@silen/is-url-search-params
v1.0.3
Published
Check if the parameter is urlsearchparams
Downloads
8
Maintainers
Readme
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
- type
- isArray
- isUndefined
- isNull
- isBoolean
- isBuffer
- isArrayBuffer
- isFormData
- isArrayBufferView
- isString
- isNumber
- isObject
- isPlainObject
- isDate
- isArguments
- isFile
- isBlob
- isFunction
- isSymbol
- isRegExp
- isInt8Array
- isUint8Array
- isUint8ClampedArray
- isInt16Array
- isUint16Array
- isInt32Array
- isUint32Array
- isFloat32Array
- isFloat64Array
- isError
- isPromise
- isSet
- isWeakSet
- isMap
- isWeakMap
- isStream