* Length-preserving copy of `content` with string-literal and comment * interiors blanked out, so delimiter scans cannot be tripped by braces or * quotes inside them. Indices into the result line up with indices into * `content`.
(content: string)
| 591 | * `content`. |
| 592 | */ |
| 593 | function blankStringsAndComments(content: string): string { |
| 594 | return content.replace( |
| 595 | /(['"`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\/[^\n]*|\/\*[\s\S]*?\*\//g, |
| 596 | (match) => match[0] + match.slice(1, -1).replace(/[^\n]/g, ' ') + match[match.length - 1] |
| 597 | ) |
| 598 | } |
| 599 | |
| 600 | /** |
| 601 | * Extract the OAuth service id from the block's `oauth-input` credential |
no test coverage detected