• Version 1.0.2
  • Published
  • 5.85 kB
  • No dependencies
  • MIT license


npm i @types/balanced-match
yarn add @types/balanced-match
pnpm add @types/balanced-match


TypeScript definitions for balanced-match



function balanced

balanced: typeof balanced;
  • For the first non-nested matching pair of a and b in str, return an object with those keys: start the index of the first match of end the index of the matching b pre the preamble, a and b not included body the match, a and b not included post the postscript, a and b not included If there's no match, undefined will be returned. If the str contains more a than b / there are unmatched pairs, the first match that was closed will be used. For example, {{a} will match ['{', 'a', ''] and {a}} will match ['', 'a', '}']

function range

range: (a: string | RegExp, b: string | RegExp, str: string) => Output | void;
  • For the first non-nested matching pair of a and b in str, return an array with indexes: [ <a index>, <b index> ].

Package Files (1)

Dependencies (0)

No dependencies.

Dev Dependencies (0)

No dev dependencies.

Peer Dependencies (0)

No peer dependencies.


To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/balanced-match.

  • Markdown
  • HTML
    <a href="https://www.jsdocs.io/package/@types/balanced-match"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>