MCPcopy Create free account
hub / github.com/code-pushup/cli / interpolate

Function interpolate

packages/utils/src/lib/interpolate.ts:1–9  ·  view source on GitHub ↗
(
  text: string,
  variables: Record<string, string>,
)

Source from the content-addressed store, hash-verified

1export function interpolate(
2 text: string,
3 variables: Record<string, string>,
4): string {
5 return Object.entries(variables).reduce(
6 (acc, [key, value]) => acc.replaceAll(`{${key}}`, value),
7 text,
8 );
9}

Callers 4

configFromPatternsFunction · 0.90
schemas.tsFile · 0.90
listProjectsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected