@silen/is-object
v1.0.3
Published
Check if the parameter is object
Downloads
3
Maintainers
Readme
is-object
Determine if a value is Object
install
npm i @silen/is-object
api
declare function isObject(val: any): boolean;
usage
const { isObject } = require('@silen/is-object');
// or
import { isObject } from '@silen/is-object';
console.log(isObject(new Buffer(4)));
console.log(isObject(Buffer.alloc(4)));
console.log(isObject(undefined));
console.log(isObject(null));
console.log(isObject(''));
console.log(isObject(true));
console.log(isObject(0));
console.log(isObject(1));
console.log(isObject(1.0));
console.log(isObject('string'));
console.log(isObject({}));
console.log(isObject(function foo() {}));
console.log(isObject(Symbol()));
console.log(isObject(new Set));
console.log(isObject(new Map));
console.log(isObject(new WeakMap));
console.log(isObject(new WeakSet));
// or
console.log(window.Type.isObject(new WeakSet));
This is a demo for testing the usage of isObject
from @silen/is-object
module. You can try the others and do likewise.
others
- type
- isArray
- isUndefined
- isNull
- isBoolean
- isBuffer
- isArrayBuffer
- isFormData
- isArrayBufferView
- isString
- isNumber
- isPlainObject
- isDate
- isArguments
- isFile
- isBlob
- isFunction
- isSymbol
- isRegExp
- isInt8Array
- isUint8Array
- isUint8ClampedArray
- isInt16Array
- isUint16Array
- isInt32Array
- isUint32Array
- isFloat32Array
- isFloat64Array
- isError
- isPromise
- isSet
- isWeakSet
- isMap
- isWeakMap
- isStream
- isURLSearchParams