* 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)
| 1218 | * @returns the string in the "canonical" representation without escaped quotes. |
| 1219 | */ |
| 1220 | function unescapeQuotes(str: string, isQuoted: boolean): string { |
| 1221 | return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, '$1'); |
| 1222 | } |
| 1223 | |
| 1224 | /** |
| 1225 | * Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors` |
no test coverage detected
searching dependent graphs…