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

Function parseRenderOverrides

packages/producer/src/server.ts:164–176  ·  view source on GitHub ↗

* Parse the lenient form of the variable + resolution overrides used by * `parseRenderOptions`. Invalid shapes coerce to `undefined` here; * `validateRenderOverrides` separately rejects explicitly-supplied bad values * with a 400 so they aren't silently ignored.

(body: Record<string, unknown>)

Source from the content-addressed store, hash-verified

162 * with a 400 so they aren't silently ignored.
163 */
164function parseRenderOverrides(body: Record<string, unknown>): {
165 variables?: Record<string, unknown>;
166 outputResolution?: CanvasResolution;
167} {
168 // Only forward a plain JSON object. Arrays / primitives / null → undefined.
169 const variables = isPlainObject(body.variables) ? body.variables : undefined;
170 // Accept canonical presets and aliases ("4k", "landscape-4k", …).
171 const outputResolution =
172 typeof body.outputResolution === "string"
173 ? normalizeResolutionFlag(body.outputResolution)
174 : undefined;
175 return { variables, outputResolution };
176}
177
178/**
179 * Build the `createRenderJob` config from a prepared render input. Shared by

Callers 1

parseRenderOptionsFunction · 0.85

Calls 2

normalizeResolutionFlagFunction · 0.85
isPlainObjectFunction · 0.70

Tested by

no test coverage detected