* Ensures that the i18nMeta, if provided, is an i18n.Message.
(i18nMeta: i18n.I18nMeta | null | undefined)
| 1422 | * Ensures that the i18nMeta, if provided, is an i18n.Message. |
| 1423 | */ |
| 1424 | function asMessage(i18nMeta: i18n.I18nMeta | null | undefined): i18n.Message | null { |
| 1425 | if (i18nMeta == null) { |
| 1426 | return null; |
| 1427 | } |
| 1428 | if (!(i18nMeta instanceof i18n.Message)) { |
| 1429 | throw Error(`Expected i18n meta to be a Message, but got: ${i18nMeta.constructor.name}`); |
| 1430 | } |
| 1431 | return i18nMeta; |
| 1432 | } |
| 1433 | |
| 1434 | /** |
| 1435 | * Process all of the bindings on an element in the template AST and convert them to their IR |
no test coverage detected