Installation
npm install --save @types/match-it
Summary
This package contains type definitions for match-it (https://github.com/IonicaBizau/match-it#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/match-it.
index.d.ts
export = matchIt;
/**
* A safer `String.prototype.match()`/`RegExp.exec()`.
*
* @example
* import matchIt = require("match-it");
*
* const re = /(World|Mars)/;
*
* console.log(matchIt("Hello World!", re)[1]);
* // => World
*
* console.log(matchIt("Hello Mars!", re)[1]);
* // => Mars
*
* console.log(matchIt("Hello Pluto!", re)[1]);
* // => undefined
*/
declare function matchIt(input: string, re: RegExp): string[];
Additional Details
- Last updated: Tue, 07 Nov 2023 0939 GMT
- Dependencies: none
Credits
These definitions were written by BendingBender.