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