Package Exports
- as-typed-array
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (as-typed-array) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Make any value an array, and maintain types.
Installation
yarn add as-typed-array
npm install as-typed-array
API
Usage
import asArray from "as-typed-array";
asArray(["ok"]); // ["ok"]
asArray("ok"); // ["ok"]
asArray({ ok: true }); // [{ ok: true }]
asArray(undefined); // [];
Types
import asArray from "as-typed-array";
function asArray<T>(any: (T | T[])): T[]
Dev Dependencies
- @bconnorwhite/bob: Bob is a toolkit for TypeScript projects
- jest: Delightful JavaScript Testing.