Have ideas to improve npm?Join in the discussion! »

    @silen/is-set
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    is-set

    Determine if a value is Set

    install

    npm i @silen/is-set
    

    api

    • declare function isSet(val: any): boolean;

    usage

    const { isSet } = require('@silen/is-set');
    // or
    import { isSet } from '@silen/is-set';
     
    console.log(isSet(new Buffer(4)));
    console.log(isSet(Buffer.alloc(4)));
    console.log(isSet(undefined));
    console.log(isSet(null));
    console.log(isSet(''));
    console.log(isSet(true));
    console.log(isSet(0));
    console.log(isSet(1));
    console.log(isSet(1.0));
    console.log(isSet('string'));
    console.log(isSet({}));
    console.log(isSet(function foo() {}));
    console.log(isSet(Symbol()));
    console.log(isSet(new Set));
    console.log(isSet(new Map));
    console.log(isSet(new WeakMap));
    console.log(isSet(new WeakSet));
     
    // or
    console.log(window.Type.isSet(new WeakSet));

    This is a demo for testing the usage of isSet from @silen/is-set module. You can try the others and do likewise.

    others

    Install

    npm i @silen/is-set

    DownloadsWeekly Downloads

    2

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    8.01 kB

    Total Files

    9

    Last publish

    Collaborators

    • avatar