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