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

Function extract

packages/compiler/test/i18n/extractor_merger_spec.ts:704–726  ·  view source on GitHub ↗
(
  html: string,
  implicitTags: string[] = [],
  implicitAttrs: {[k: string]: string[]} = {},
)

Source from the content-addressed store, hash-verified

702}
703
704function extract(
705 html: string,
706 implicitTags: string[] = [],
707 implicitAttrs: {[k: string]: string[]} = {},
708): [string[], string, string, string][] {
709 const result = extractMessages(
710 parseHtml(html),
711 implicitTags,
712 implicitAttrs,
713 /* preserveSignificantWhitespace */ true,
714 );
715
716 if (result.errors.length > 0) {
717 throw new Error(`unexpected errors: ${result.errors.join('\n')}`);
718 }
719
720 return result.messages.map((message) => [
721 serializeI18nNodes(message.nodes),
722 message.meaning,
723 message.description,
724 message.id,
725 ]) as [string[], string, string, string][];
726}
727
728function extractErrors(
729 html: string,

Callers 1

Calls 4

extractMessagesFunction · 0.90
mapMethod · 0.80
parseHtmlFunction · 0.70
joinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…