(value: string)
| 199 | |
| 200 | /** Escapes a string and wraps it in single quotes for use in JS code. */ |
| 201 | export function singleQuote(value: string): string { |
| 202 | const inner = JSON.stringify(value) |
| 203 | .slice(1, -1) |
| 204 | .replace(/\\"/g, '"') |
| 205 | .replace(/'/g, String.raw`\'`); |
| 206 | return `'${inner}'`; |
| 207 | } |
no outgoing calls
no test coverage detected