Neovictorian Paisley Menswear

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

    1.0.3 • Public • Published

    is-map

    Determine if a value is Map

    install

    npm i @silen/is-map
    

    api

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

    usage

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

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

    others

    Install

    npm i @silen/is-map

    DownloadsWeekly Downloads

    5

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    8.01 kB

    Total Files

    9

    Last publish

    Collaborators

    • silentsun