max_liu b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
..
.github b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
test b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
.eslintrc b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
.nycrc b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
CHANGELOG.md b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
LICENSE b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
README.md b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
index.d.ts b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
index.js b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
package.json b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전
tsconfig.json b7ab7c8514 chore: 更新node_modules依赖文件 2 주 전

README.md

safe-regex-test Version Badge

github actions coverage License Downloads

npm badge

Give a regex, get a robust predicate function that tests it against a string. This will work even if RegExp.prototype is altered later.

Getting started

npm install --save safe-regex-test

Usage/Examples

var regexTester = require('safe-regex-test');
var assert = require('assert');

var tester = regexTester('a');
assert.ok(tester('a'));
assert.notOk(tester('b'));

Tests

Simply clone the repo, npm install, and run npm test