* 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)
| 1278 | * @returns the string in the "canonical" representation without escaped quotes. |
| 1279 | */ |
| 1280 | function unescapeQuotes(str: string, isQuoted: boolean): string { |
| 1281 | return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, '$1'); |
| 1282 | } |
| 1283 | |
| 1284 | /** |
| 1285 | * Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors` |
no test coverage detected