Wondering what’s next for npm?Check out our public roadmap! »

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

    1.0.3 • Public • Published

    is-weak-set

    Determine if a value is WeakSet

    install

    npm i @silen/is-weak-set
    

    api

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

    usage

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

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

    others

    Install

    npm i @silen/is-weak-set

    DownloadsWeekly Downloads

    2

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    8.26 kB

    Total Files

    9

    Last publish

    Collaborators

    • avatar