Installation
npm install --save @types/safe-regex-test
Summary
This package contains type definitions for safe-regex-test (https://github.com/ljharb/safe-regex-test#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/safe-regex-test.
index.d.ts
export = makeRegexTester;
/**
* Give a regex, get a robust predicate function that tests it against a string.
* This will work even if `RegExp.prototype` is altered later.
*
* @example
* import regexTester = require('safe-regex-test');
* import * as assert from 'node:assert';
*
* const tester = regexTester(/a/);
* assert.ok(tester('a') === true);
* assert.ok(tester('b') === false);
*/
declare function makeRegexTester(regex: RegExp): (s: string) => boolean;
Additional Details
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: none
Credits
These definitions were written by BendingBender.