zlwu dd667101ef first commit 1 سال پیش
..
.github dd667101ef first commit 1 سال پیش
test dd667101ef first commit 1 سال پیش
.eslintrc dd667101ef first commit 1 سال پیش
.nycrc dd667101ef first commit 1 سال پیش
CHANGELOG.md dd667101ef first commit 1 سال پیش
LICENSE dd667101ef first commit 1 سال پیش
README.md dd667101ef first commit 1 سال پیش
index.d.ts dd667101ef first commit 1 سال پیش
index.js dd667101ef first commit 1 سال پیش
package.json dd667101ef first commit 1 سال پیش
tsconfig.json dd667101ef first commit 1 سال پیش

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