func JsToInt16(array js.Value) []int16 {
	size := array.Get("length").Int()
	buf := array.Get("buffer")
	tmp := js.Global().Get("Uint8Array").New(buf)
	mem := make([]byte, size*2)
	js.CopyBytesToGo(mem, tmp)
	head := (*reflect.SliceHeader)(unsafe.Pointer(&mem))
	head.Cap /= 2
	head.Len /= 2
	dst := *(*[]int16)(unsafe.Pointer(head))
	runtime.KeepAlive(mem)
	return dst
}
JsToInt16 convert javascript Int16Array to Go int16.
package jsconv
import (
	"reflect"
	"runtime"
	"unsafe"
	"github.com/gowebapi/webapi/core/js"
)
func UInt8ToJs(src []uint8) js.Value {
	array := js.Global().Get("Uint8Array").New(len(src) * 1)
	js.CopyBytesToJS(array, src)
	return array
}
func JsToUInt8(array js.Value) []uint8 {
	size := array.Get("length").Int()
	mem := make([]byte, size)
	js.CopyBytesToGo(mem, array)
	head := (*reflect.SliceHeader)(unsafe.Pointer(&mem))
	dst := *(*[]uint8)(unsafe.Pointer(head))
	runtime.KeepAlive(mem)
	return dst
}
func Int8ToJs(src []int8) js.Value {
	array := js.Global().Get("Uint8Array").New(len(src) * 1)
	head := (*reflect.SliceHeader)(unsafe.Pointer(&src))
	data := *(*[]byte)(unsafe.Pointer(head))
	js.CopyBytesToJS(array, data)
	runtime.KeepAlive(src)
	buf := array.Get("buffer")
	return js.Global().Get("Int8Array").New(
		buf,
		array.Get("byteOffset"),
		array.Get("byteLength").Int()/1,
	)
}
func JsToInt8(array js.Value) []int8 {
	size := array.Get("length").Int()
	buf := array.Get("buffer")
	tmp := js.Global().Get("Uint8Array").New(buf)
	mem := make([]byte, size*1)
	js.CopyBytesToGo(mem, tmp)
	head := (*reflect.SliceHeader)(unsafe.Pointer(&mem))
	head.Cap /= 1
	head.Len /= 1
	dst := *(*[]int8)(unsafe.Pointer(head))
	runtime.KeepAlive(mem)
	return dst
}
func UInt16ToJs(src []uint16) js.Value {
	array := js.Global().Get("Uint8Array").New(len(src) * 2)
	head := (*reflect.SliceHeader)(unsafe.Pointer(&src))
	head.Len *= 2
	head.Cap *= 2
	data := *(*[]byte)(unsafe.Pointer(head))
	js.CopyBytesToJS(array, data)
	runtime.KeepAlive(src)
	buf := array.Get("buffer")
	return js.Global().Get("Uint16Array").New(
		buf,
		array.Get("byteOffset"),
		array.Get("byteLength").Int()/2,
	)
}
func JsToUInt16(array js.Value) []uint16 {
	size := array.Get("length").Int()
	buf := array.Get("buffer")
	tmp := js.Global().Get("Uint8Array").New(buf)
	mem := make([]byte, size*2)
	js.CopyBytesToGo(mem, tmp)
	head := (*reflect.SliceHeader)(unsafe.Pointer(&mem))
	head.Cap /= 2
	head.Len /= 2
	dst := *(*[]uint16)(unsafe.Pointer(head))
	runtime.KeepAlive(mem)
	return dst
}
func Int16ToJs(src []int16) js.Value {
	array := js.Global().Get("Uint8Array").New(len(src) * 2)
	head := (*reflect.SliceHeader)(unsafe.Pointer(&src))
	head.Len *= 2
	head.Cap *= 2
	data := *(*[]byte)(unsafe.Pointer(head))
	js.CopyBytesToJS(array, data)
	runtime.KeepAlive(src)
	buf := array.Get("buffer")
	return js.Global().Get("Int16Array").New(
		buf,
		array.Get("byteOffset"),
		array.Get("byteLength").Int()/2,
	)
}