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