(raw: string)
| 122 | } |
| 123 | |
| 124 | function parseLegacyStringLiteral(raw: string): string | null { |
| 125 | if (raw.length < 2) return null; |
| 126 | const quote = raw[0]; |
| 127 | if ((quote !== '"' && quote !== "'") || raw[raw.length - 1] !== quote) return null; |
| 128 | const body = raw.slice(1, -1); |
| 129 | if (quote === '"') { |
| 130 | try { |
| 131 | return JSON.parse(raw) as string; |
| 132 | } catch { |
| 133 | return null; |
| 134 | } |
| 135 | } |
| 136 | return body.replace(/\\'/g, "'").replace(/\\\\/g, '\\'); |
| 137 | } |
| 138 | |
| 139 | function parseLegacyPrimitive(raw: string): EditmodeTokenValue | null { |
| 140 | const text = raw.trim(); |
no outgoing calls
no test coverage detected