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

    1.0.3 • Public • Published

    is-object

    Determine if a value is Object

    install

    npm i @silen/is-object
    

    api

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

    usage

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

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

    others

    Install

    npm i @silen/is-object

    DownloadsWeekly Downloads

    6

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    9.91 kB

    Total Files

    9

    Last publish

    Collaborators

    • silentsun