Nesting Penguins Molt

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

    1.0.0 • Public • Published

    safe-regex-test Version Badge

    dependency status dev dependency status 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

    Install

    npm i safe-regex-test

    DownloadsWeekly Downloads

    12,309,015

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    7.33 kB

    Total Files

    8

    Last publish

    Collaborators

    • ljharb