infracloud/scripts/node_modules/safe-regex-test
2026-02-28 09:07:22 -03:00
..
.github docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00
test docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00
.eslintrc docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00
.nycrc docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00
CHANGELOG.md docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00
index.d.ts docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00
index.js docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00
LICENSE docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00
package.json docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00
README.md docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00
tsconfig.json docs: update infrastructure docs, connections and services inventory 2026-02-28 09:07:22 -03:00

safe-regex-test Version Badge

github actions coverage License Downloads

npm badge

Give a regex, get a robust predicate function that tests it against a string. This will work even if RegExp.prototype is altered later.

Getting started

npm install --save safe-regex-test

Usage/Examples

var regexTester = require('safe-regex-test');
var assert = require('assert');

var tester = regexTester('a');
assert.ok(tester('a'));
assert.notOk(tester('b'));

Tests

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