Bakhtina Sofya b84cb877be 1st comm | 3 weeks ago | |
---|---|---|
.. | ||
.github | 3 weeks ago | |
test | 3 weeks ago | |
.eslintrc | 3 weeks ago | |
.nycrc | 3 weeks ago | |
CHANGELOG.md | 3 weeks ago | |
LICENSE | 3 weeks ago | |
README.md | 3 weeks ago | |
index.js | 3 weeks ago | |
package.json | 3 weeks ago |
Give a regex, get a robust predicate function that tests it against a string. This will work even if RegExp.prototype
is altered later.
npm install --save safe-regex-test
var regexTester = require('safe-regex-test');
var assert = require('assert');
var tester = regexTester('a');
assert.ok(tester('a'));
assert.notOk(tester('b'));
Simply clone the repo, npm install
, and run npm test