* Ensures that the i18nMeta, if provided, is an i18n.Message.
(i18nMeta: i18n.I18nMeta | null | undefined)
| 1306 | * Ensures that the i18nMeta, if provided, is an i18n.Message. |
| 1307 | */ |
| 1308 | function asMessage(i18nMeta: i18n.I18nMeta | null | undefined): i18n.Message | null { |
| 1309 | if (i18nMeta == null) { |
| 1310 | return null; |
| 1311 | } |
| 1312 | if (!(i18nMeta instanceof i18n.Message)) { |
| 1313 | throw Error(`Expected i18n meta to be a Message, but got: ${i18nMeta.constructor.name}`); |
| 1314 | } |
| 1315 | return i18nMeta; |
| 1316 | } |
| 1317 | |
| 1318 | /** |
| 1319 | * Process all of the bindings on an element in the template AST and convert them to their IR |
no test coverage detected