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