MCPcopy Index your code
hub / github.com/angular/angular / _parseMessageMeta

Function _parseMessageMeta

packages/compiler/src/i18n/extractor_merger.ts:682–695  ·  view source on GitHub ↗
(i18n?: string)

Source from the content-addressed store, hash-verified

680}
681
682function _parseMessageMeta(i18n?: string): {meaning: string; description: string; id: string} {
683 if (!i18n) return {meaning: '', description: '', id: ''};
684
685 const idIndex = i18n.indexOf(ID_SEPARATOR);
686 const descIndex = i18n.indexOf(MEANING_SEPARATOR);
687 const [meaningAndDesc, id] =
688 idIndex > -1 ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, ''];
689 const [meaning, description] =
690 descIndex > -1
691 ? [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)]
692 : ['', meaningAndDesc];
693
694 return {meaning, description, id: id.trim()};
695}
696
697function isTextNode(ast: html.Node[]): ast is [html.Text] {
698 return ast.length === 1 && ast[0] instanceof html.Text;

Callers 2

_addMessageMethod · 0.85
_translateAttributesMethod · 0.85

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected