safe-regex-test
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/safe-regex-test package

1.0.3 • Public • Published

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

Package Sidebar

Install

npm i safe-regex-test

Weekly Downloads

26,696,791

Version

1.0.3

License

MIT

Unpacked Size

10.2 kB

Total Files

9

Last publish

Collaborators

  • ljharb