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

Function unescapeQuotes

packages/compiler/src/shadow_css.ts:1252–1254  ·  view source on GitHub ↗

* Unescape all quotes present in a string, but only if the string was actually already * quoted. * * This generates a "canonical" representation of strings which can be used to match strings * which would otherwise only differ because of differently escaped quotes. * * For example it converts

(str: string, isQuoted: boolean)

Source from the content-addressed store, hash-verified

1250 * @returns the string in the "canonical" representation without escaped quotes.
1251 */
1252function unescapeQuotes(str: string, isQuoted: boolean): string {
1253 return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, '$1');
1254}
1255
1256/**
1257 * Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors`

Callers 2

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected