Bakhtina Sofya b84cb877be 1st comm | hace 2 semanas | |
---|---|---|
.. | ||
.github | hace 2 semanas | |
test | hace 2 semanas | |
.eslintrc | hace 2 semanas | |
.nycrc | hace 2 semanas | |
CHANGELOG.md | hace 2 semanas | |
LICENSE | hace 2 semanas | |
README.md | hace 2 semanas | |
index.js | hace 2 semanas | |
package.json | hace 2 semanas |
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