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