MCPcopy Create free account
hub / github.com/bytebase/bytebase / interpolate

Function interpolate

frontend/src/react/components/BannersWrapper.test.tsx:47–53  ·  view source on GitHub ↗
(key: string, values?: Record<string, unknown>)

Source from the content-addressed store, hash-verified

45};
46
47function interpolate(key: string, values?: Record<string, unknown>) {
48 let result = translations[key] ?? key;
49 for (const [name, value] of Object.entries(values ?? {})) {
50 result = result.replaceAll(`{{${name}}}`, String(value));
51 }
52 return result;
53}
54
55vi.mock("react-i18next", () => ({
56 useTranslation: () => ({

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected