as-typed-array

    1.0.0 • Public • Published

    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

    Keywords

    none

    Install

    npm i as-typed-array

    DownloadsWeekly Downloads

    15

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    2.9 kB

    Total Files

    6

    Last publish

    Collaborators

    • bconnorwhite