JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 53962954
  • Score
    100M100P100Q230342F
  • License MIT

Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag

Package Exports

  • is-regex

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 (is-regex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-regex Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value a JS regex? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

Example

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(isRegex([]));
assert.notOk(isRegex({}));

assert.ok(isRegex(/a/g));
assert.ok(isRegex(new RegExp('a', 'g')));

Tests

Simply clone the repo, npm install, and run npm test