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

Function parseGifLoopArg

packages/cli/src/utils/renderArgs.ts:232–246  ·  view source on GitHub ↗
(raw: string | undefined)

Source from the content-addressed store, hash-verified

230 * caller can apply the format-dependent default (0 = infinite for gif).
231 */
232export function parseGifLoopArg(raw: string | undefined): GifLoopParseResult {
233 if (raw === undefined) return { ok: true, value: undefined };
234 const trimmed = raw.trim();
235 if (trimmed.length === 0) {
236 return { ok: false, message: "GIF loop count must not be empty." };
237 }
238 const parsed = Number(trimmed);
239 if (!Number.isInteger(parsed) || parsed < 0 || parsed > 65_535) {
240 return {
241 ok: false,
242 message: `Got "${raw}". GIF loop count must be an integer between 0 and 65535.`,
243 };
244 }
245 return { ok: true, value: parsed };
246}

Callers 2

renderArgs.test.tsFile · 0.85
runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected