@silen/is-set
v1.0.3
Published
Check if the parameter is set
Downloads
7
Readme
is-set
Determine if a value is Set
install
npm i @silen/is-set
api
declare function isSet(val: any): boolean;
usage
const { isSet } = require('@silen/is-set');
// or
import { isSet } from '@silen/is-set';
console.log(isSet(new Buffer(4)));
console.log(isSet(Buffer.alloc(4)));
console.log(isSet(undefined));
console.log(isSet(null));
console.log(isSet(''));
console.log(isSet(true));
console.log(isSet(0));
console.log(isSet(1));
console.log(isSet(1.0));
console.log(isSet('string'));
console.log(isSet({}));
console.log(isSet(function foo() {}));
console.log(isSet(Symbol()));
console.log(isSet(new Set));
console.log(isSet(new Map));
console.log(isSet(new WeakMap));
console.log(isSet(new WeakSet));
// or
console.log(window.Type.isSet(new WeakSet));
This is a demo for testing the usage of isSet
from @silen/is-set
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
- isWeakSet
- isMap
- isWeakMap
- isStream
- isURLSearchParams