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