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

Function checkOutputCollisions

packages/cli/src/commands/batchRender.ts:173–192  ·  view source on GitHub ↗
(rows: readonly PreparedBatchRow[], manifestPath: string)

Source from the content-addressed store, hash-verified

171}
172
173function checkOutputCollisions(rows: readonly PreparedBatchRow[], manifestPath: string): void {
174 const seen = new Map<string, number>();
175 for (const row of rows) {
176 const previous = seen.get(row.outputPath);
177 if (previous !== undefined) {
178 throw new BatchRenderInputError(
179 "Batch output collision",
180 `Rows ${previous} and ${row.index} both resolve to ${row.outputPath}.`,
181 "Use placeholders such as {index} or a unique row key in --output.",
182 );
183 }
184 if (row.outputPath === manifestPath) {
185 throw new BatchRenderInputError(
186 "Batch output collision",
187 `Row ${row.index} resolves to the manifest path: ${manifestPath}.`,
188 );
189 }
190 seen.set(row.outputPath, row.index);
191 }
192}
193
194function validateBatchVariables(
195 rows: readonly Record<string, unknown>[],

Callers 1

prepareBatchRenderFunction · 0.85

Calls 2

getMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected