
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@types/balanced-match
Advanced tools
npm install --save @types/balanced-match
This package contains type definitions for balanced-match (https://github.com/juliangruber/balanced-match).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/balanced-match.
// Type definitions for balanced-match 1.0
// Project: https://github.com/juliangruber/balanced-match
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface Output {
/**
* The index of the first match of a
*/
start: number;
/**
* The index of the matching b
*/
end: number;
/**
* The preamble, a and b not included
*/
pre: string;
/**
* The match, a and b not included
*/
body: string;
/**
* The postscript, a and b not included
*/
post: string;
}
/**
*
* 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', '}']`
*/
declare function balanced(a: string | RegExp, b: string | RegExp, str: string): Output | undefined;
declare namespace balanced {
/**
* For the first non-nested matching pair of `a` and `b` in `str`,
* return an array with indexes: `[ <a index>, <b index> ]`.
*/
function range(a: string | RegExp, b: string | RegExp, str: string): [number, number] | undefined;
}
export = balanced;
These definitions were written by Piotr Błażejewicz.
FAQs
TypeScript definitions for balanced-match
The npm package @types/balanced-match receives a total of 29,580 weekly downloads. As such, @types/balanced-match popularity was classified as popular.
We found that @types/balanced-match demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.