// StringifyFrame is only available with GopherJS. func StringifyFrame(object *js.Object) *js.Object { if _, ok := object.Interface().(string); ok { return object } jsView := js.Global.Get("Uint8Array").New(object) goBytes := jsView.Interface().([]uint8) goString := string(goBytes) return js.Global.Get("String").New(goString) }
func StringSlice(o *js.Object) []string { if o == nil { return nil } d := o.Interface().([]interface{}) ret := make([]string, len(d)) for i, e := range d { ret[i] = e.(string) } return ret }
func Float64Slice(o *js.Object) []float64 { if o == nil { return nil } d := o.Interface().([]interface{}) ret := make([]float64, len(d)) for i, e := range d { ret[i] = e.(float64) } return ret }
func IntSlice(o *js.Object) []int { if o == nil { return nil } d := o.Interface().([]interface{}) ret := make([]int, len(d)) for i, e := range d { ret[i] = int(e.(float64)) } return ret }