MCPcopy Create free account
hub / github.com/angular/angular / looseMatch

Function looseMatch

packages/compiler-cli/test/ngtsc/debug_transform_spec.ts:41–49  ·  view source on GitHub ↗

* Creates a regex that matches the expected shape of the `debugName` while * tolerating differences in output between ngtsc and ngp.

(expected: string)

Source from the content-addressed store, hash-verified

39 * tolerating differences in output between ngtsc and ngp.
40 */
41function looseMatch(expected: string): RegExp {
42 const pattern = expected
43 .replace(/[.*+?^${}()|[\]\\/]/g, '\\$&')
44 .replace(/\\\/\\\* @ts-ignore \\\*\\\/ /g, '(?:\\/\\* @ts-ignore \\*\\/ )?')
45 .replace(/\\\(\s*/g, '\\(\\s*')
46 .replace(/\s*\\\)/g, '\\s*\\)')
47 .replace(/,?\s*\\\}/g, ',?\\s*\\}');
48 return new RegExp(pattern);
49}
50
51runInEachFileSystem(() => {
52 describe('Debug Info Typescript tranformation', () => {

Callers 1

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected