MCPcopy Create free account
hub / github.com/angular/dev-infra / changelogPattern

Function changelogPattern

ng-dev/release/publish/test/test-utils/test-utils.ts:143–148  ·  view source on GitHub ↗
(strings: TemplateStringsArray, ...values: any[])

Source from the content-addressed store, hash-verified

141 * 2. The `<..>` is a placeholder that will allow for arbitrary content.
142 */
143export function changelogPattern(strings: TemplateStringsArray, ...values: any[]): RegExp {
144 return new RegExp(
145 sanitizeForRegularExpression(dedent(strings, ...values).trim()).replace(/<\\.\\.>/g, '.*?'),
146 'g',
147 );
148}
149
150/** Sanitizes a given string so that it can be used as literal in a RegExp. */
151function sanitizeForRegularExpression(value: string): string {

Calls 2

dedentFunction · 0.85

Tested by

no test coverage detected