• Creates a case parameter for a typedarray.

    You can't put typedarrays in case parameters directly so instead of

    u.combine('data', [
    new Uint8Array([1, 2, 3]),
    new Float32Array([4, 5, 6]),
    ])

    You can use

    u.combine('data', [
    typedArrayParam('Uint8Array' [1, 2, 3]),
    typedArrayParam('Float32Array' [4, 5, 6]),
    ])

    and then convert the params to typedarrays eg.

     .fn(t => {
    const data = t.params.data.map(v => typedArrayFromParam(v));
    })

    Type Parameters

    • K extends keyof TypedArrayMap

    Parameters

    • type: K
    • data: number[]

    Returns TypedArrayParam<K>

Generated using TypeDoc