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

Function parseI18nMeta

packages/compiler/src/render3/view/i18n/meta.ts:317–336  ·  view source on GitHub ↗
(meta: string = '')

Source from the content-addressed store, hash-verified

315 * @returns Object with id, meaning and description fields
316 */
317export function parseI18nMeta(meta: string = ''): I18nMeta {
318 let customId: string | undefined;
319 let meaning: string | undefined;
320 let description: string | undefined;
321
322 meta = meta.trim();
323 if (meta) {
324 const idIndex = meta.indexOf(I18N_ID_SEPARATOR);
325 const descIndex = meta.indexOf(I18N_MEANING_SEPARATOR);
326 let meaningAndDesc: string;
327 [meaningAndDesc, customId] =
328 idIndex > -1 ? [meta.slice(0, idIndex), meta.slice(idIndex + 2)] : [meta, ''];
329 [meaning, description] =
330 descIndex > -1
331 ? [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)]
332 : ['', meaningAndDesc];
333 }
334
335 return {customId, meaning, description};
336}
337
338// Converts i18n meta information for a message (id, description, meaning)
339// to a JsDoc statement formatted as expected by the Closure compiler.

Callers 2

i18n_spec.tsFile · 0.90
_parseMetadataMethod · 0.85

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…