package
Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag
npm install is-regexGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 13 packages.
247.4 kB
Includes dependencies.
4 direct dependencies.
Is this value a JS regex? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
var isRegex = require('is-regex');
var assert = require('assert');
assert.notOk(isRegex(undefined));
assert.notOk(isRegex(null));
assert.notOk(isRegex(false));
assert.notOk(isRegex(true));
assert.notOk(isRegex(42));
assert.notOk(isRegex('foo'));
assert.notOk(isRegex(function () {}));
assert.notOk(
Simply clone the repo, npm install, and run npm test