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

Function asMessage

packages/compiler/src/template/pipeline/src/ingest.ts:1424–1432  ·  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

1422 * Ensures that the i18nMeta, if provided, is an i18n.Message.
1423 */
1424function 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

Callers 5

ingestContentFunction · 0.85
ingestElementBindingsFunction · 0.85
ingestTemplateBindingsFunction · 0.85

Calls 1

ErrorInterface · 0.85

Tested by

no test coverage detected