North Pittsburgh Meatpackers

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

    1.0.3 • Public • Published

    is-date

    Determine if a value is Date

    install

    npm i @silen/is-date
    

    api

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

    usage

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

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

    others

    Install

    npm i @silen/is-date

    DownloadsWeekly Downloads

    5

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    8.07 kB

    Total Files

    9

    Last publish

    Collaborators

    • silentsun