@types/safe-regex-test
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/safe-regex-test

Weekly Downloads

14,135

Version

1.0.2

License

MIT

Unpacked Size

3.56 kB

Total Files

5

Last publish

Collaborators

  • types