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

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

    1.0.3 • Public • Published

    is-url-search-params

    Determine if a value is UrlSearchParams

    install

    npm i @silen/is-url-search-params
    

    api

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

    usage

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

    This is a demo for testing the usage of isURLSearchParams from @silen/is-url-search-params module. You can try the others and do likewise.

    others

    Install

    npm i @silen/is-url-search-params

    DownloadsWeekly Downloads

    1

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    8.72 kB

    Total Files

    9

    Last publish

    Collaborators

    • avatar