MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / resolveTargetFps

Function resolveTargetFps

packages/node/src/backend/backendSharedConfig.ts:220–239  ·  view source on GitHub ↗
(
  fpsCap: number,
  nativeConfig: Readonly<Record<string, unknown>>,
)

Source from the content-addressed store, hash-verified

218}
219
220export function resolveTargetFps(
221 fpsCap: number,
222 nativeConfig: Readonly<Record<string, unknown>>,
223): number {
224 const values = readNativeTargetFpsValues(nativeConfig);
225 if (values.camel !== null && values.snake !== null && values.camel !== values.snake) {
226 throw new ZrUiError(
227 "ZRUI_INVALID_PROPS",
228 `createNodeBackend config mismatch: nativeConfig.targetFps=${String(values.camel)} must match nativeConfig.target_fps=${String(values.snake)}.`,
229 );
230 }
231 const nativeTargetFps = values.camel ?? values.snake;
232 if (nativeTargetFps !== null && nativeTargetFps !== fpsCap) {
233 throw new ZrUiError(
234 "ZRUI_INVALID_PROPS",
235 `createNodeBackend config mismatch: fpsCap=${String(fpsCap)} must match nativeConfig.targetFps/target_fps=${String(nativeTargetFps)}. Fix: set nativeConfig.targetFps (or target_fps) to ${String(fpsCap)}, or remove the override and use fpsCap only.`,
236 );
237 }
238 return fpsCap;
239}

Callers 2

Calls 1

Tested by

no test coverage detected