Gogs df670eaa27 first commit il y a 3 semaines
..
.github df670eaa27 first commit il y a 3 semaines
test df670eaa27 first commit il y a 3 semaines
.eslintrc df670eaa27 first commit il y a 3 semaines
.nycrc df670eaa27 first commit il y a 3 semaines
CHANGELOG.md df670eaa27 first commit il y a 3 semaines
LICENSE df670eaa27 first commit il y a 3 semaines
README.md df670eaa27 first commit il y a 3 semaines
index.d.ts df670eaa27 first commit il y a 3 semaines
index.js df670eaa27 first commit il y a 3 semaines
package.json df670eaa27 first commit il y a 3 semaines
tsconfig.json df670eaa27 first commit il y a 3 semaines

README.md

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