prc b6c02717e6 Upload complete no-internet building environment. | vor 1 Jahr | |
---|---|---|
.. | ||
.github | vor 1 Jahr | |
test | vor 1 Jahr | |
.eslintrc | vor 1 Jahr | |
CHANGELOG.md | vor 1 Jahr | |
LICENSE | vor 1 Jahr | |
README.md | vor 1 Jahr | |
index.js | vor 1 Jahr | |
package.json | vor 1 Jahr |
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