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

    1.0.3 • Public • Published

    is-function

    Determine if a value is Function

    install

    npm i @silen/is-function
    

    api

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

    usage

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

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

    others

    Install

    npm i @silen/is-function

    DownloadsWeekly Downloads

    5

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    8.3 kB

    Total Files

    9

    Last publish

    Collaborators

    • silentsun