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