Package Exports
- @silen/is-reg-exp
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@silen/is-reg-exp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
is-reg-exp
Determine if a value is RegExp
install
npm i @silen/is-reg-exp
api
declare function isRegExp(val: any): boolean;
usage
const { isRegExp } = require('@silen/is-reg-exp');
// or
import { isRegExp } from '@silen/is-reg-exp';
console.log(isRegExp(new Buffer(4)));
console.log(isRegExp(Buffer.alloc(4)));
console.log(isRegExp(undefined));
console.log(isRegExp(null));
console.log(isRegExp(''));
console.log(isRegExp(true));
console.log(isRegExp(0));
console.log(isRegExp(1));
console.log(isRegExp(1.0));
console.log(isRegExp('string'));
console.log(isRegExp({}));
console.log(isRegExp(function foo() {}));
console.log(isRegExp(Symbol()));
console.log(isRegExp(new Set));
console.log(isRegExp(new Map));
console.log(isRegExp(new WeakMap));
console.log(isRegExp(new WeakSet));
// or
console.log(window.Type.isRegExp(new WeakSet));
This is a demo for testing the usage of isRegExp
from @silen/is-reg-exp
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
- isInt8Array
- isUint8Array
- isUint8ClampedArray
- isInt16Array
- isUint16Array
- isInt32Array
- isUint32Array
- isFloat32Array
- isFloat64Array
- isError
- isPromise
- isSet
- isWeakSet
- isMap
- isWeakMap
- isStream
- isURLSearchParams