MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / placeholderValue

Function placeholderValue

packages/cli/src/commands/batchRender.ts:123–141  ·  view source on GitHub ↗
(row: Record<string, unknown>, key: string, index: number)

Source from the content-addressed store, hash-verified

121}
122
123function placeholderValue(row: Record<string, unknown>, key: string, index: number): string {
124 if (key === "index") return String(index);
125 if (!Object.hasOwn(row, key)) {
126 throw new BatchRenderInputError(
127 "Invalid output template",
128 `Missing value for placeholder {${key}} in row ${index}.`,
129 );
130 }
131
132 const value = row[key];
133 if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
134 return String(value);
135 }
136
137 throw new BatchRenderInputError(
138 "Invalid output template",
139 `Placeholder {${key}} in row ${index} must resolve to a string, number, or boolean.`,
140 );
141}
142
143export function resolveOutputTemplate(
144 template: string,

Callers 1

resolveOutputTemplateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected