(text: string)
| 116 | |
| 117 | /** A `$localize` tagged template's default text: `` $localize`:kebab-case@@routes.about:about` `` is `about`. */ |
| 118 | export function localizeDefault(text: string): string | null { |
| 119 | const m = /^\$localize\s*`((?:[^`\\$]|\\.)*)`$/.exec(text.trim()); |
| 120 | if (!m) return null; |
| 121 | const body = m[1]!; |
| 122 | // `:meaning|description@@id:text` — the metadata block is the leading `:…:`. |
| 123 | const meta = /^:[^:]*:/.exec(body); |
| 124 | return meta ? body.slice(meta[0].length) : body; |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * A string written statically: a literal, a `$localize` default, or `+` |
no test coverage detected