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

Function _humanizePlaceholders

packages/compiler/test/i18n/i18n_parser_spec.ts:386–398  ·  view source on GitHub ↗
(
  html: string,
  implicitTags: string[] = [],
  implicitAttrs: {[k: string]: string[]} = {},
  preserveSignificantWhitespace = true,
)

Source from the content-addressed store, hash-verified

384}
385
386function _humanizePlaceholders(
387 html: string,
388 implicitTags: string[] = [],
389 implicitAttrs: {[k: string]: string[]} = {},
390 preserveSignificantWhitespace = true,
391): string[] {
392 return _extractMessages(html, implicitTags, implicitAttrs, preserveSignificantWhitespace).map(
393 (msg) =>
394 Object.keys(msg.placeholders)
395 .map((name) => `${name}=${msg.placeholders[name].text}`)
396 .join(', '),
397 );
398}
399
400function _humanizePlaceholdersToMessage(
401 html: string,

Callers 1

Calls 4

_extractMessagesFunction · 0.85
mapMethod · 0.80
joinMethod · 0.65
keysMethod · 0.65

Tested by

no test coverage detected