MCPcopy Create free account
hub / github.com/angular/angular / asMessage

Function asMessage

packages/compiler/src/template/pipeline/src/ingest.ts:1308–1316  ·  view source on GitHub ↗

* Ensures that the i18nMeta, if provided, is an i18n.Message.

(i18nMeta: i18n.I18nMeta | null | undefined)

Source from the content-addressed store, hash-verified

1306 * Ensures that the i18nMeta, if provided, is an i18n.Message.
1307 */
1308function 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

Callers 5

ingestContentFunction · 0.85
ingestElementBindingsFunction · 0.85
ingestTemplateBindingsFunction · 0.85

Calls 1

ErrorInterface · 0.85

Tested by

no test coverage detected