2.0.0 • Published 1 year ago

typed-array-interleave v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

typed-array-interleave

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Interleave n typed arrays.

paypal coinbase twitter

Installation

npm install typed-array-interleave

Usage

import typedArrayInterleave from "typed-array-interleave";
typedArrayInterleave(
  Uint8Array,
  [3, 2],
  Uint8Array.of(1, 2, 3, 4, 5, 6),
  Uint8Array.of(7, 8, 9, 10)
);
//=> Uint8Array [1, 2, 3, 7, 8, 4, 5, 6, 9, 10]

API

typedArrayInterleave

typedArrayInterleave(ResultConstructor, elements, ...arrays) ⇒ TypedArray

Interleave n typed arrays

Kind: Exported function

ParamTypeDescription
ResultConstructorTypedArrayReturned typed array constructor
elementsArrayNumber of elements to group for each typed array
...arraysTypedArrayArrays to interleave

License

MIT. See license file.