Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

as-typed-array

npm typescript GitHub stars Twitter Follow

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 DependenciesDavid


License license

MIT

About

Make any value an array, and maintain types

Resources

Packages

No packages published