MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / localizeDefault

Function localizeDefault

src/resolution/frameworks/angular-router.ts:120–127  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

118
119/** A `$localize` tagged template's default text: `` $localize`:kebab-case@@routes.about:about` `` is `about`. */
120export function localizeDefault(text: string): string | null {
121 const m = /^\$localize\s*`((?:[^`\\$]|\\.)*)`$/.exec(text.trim());
122 if (!m) return null;
123 const body = m[1]!;
124 // `:meaning|description@@id:text` — the metadata block is the leading `:…:`.
125 const meta = /^:[^:]*:/.exec(body);
126 return meta ? body.slice(meta[0].length) : body;
127}
128
129/**
130 * A string written statically: a literal, a `$localize` default, or `+`

Callers 2

staticStringFunction · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected