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

Function parseArgs

packages/core/scripts/debug-timeline.ts:42–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42function parseArgs() {
43 const args = process.argv.slice(2);
44 const normalizedArgs = args[0] === "--" ? args.slice(1) : args;
45 const inputPath = normalizedArgs[0];
46 let forcedFps: number | null = null;
47 let forcedMaxDuration: number | null = null;
48 for (let i = 1; i < normalizedArgs.length; i += 1) {
49 const arg = normalizedArgs[i];
50 if (arg === "--fps" && normalizedArgs[i + 1]) {
51 forcedFps = parseNum(normalizedArgs[i + 1]);
52 i += 1;
53 continue;
54 }
55 if (arg === "--max-duration" && normalizedArgs[i + 1]) {
56 forcedMaxDuration = parseNum(normalizedArgs[i + 1]);
57 i += 1;
58 }
59 }
60 return { inputPath, forcedFps, forcedMaxDuration };
61}
62
63function parseAttributes(rawAttrs: string): AttrMap {
64 const attrs: AttrMap = {};

Callers 1

mainFunction · 0.70

Calls 1

parseNumFunction · 0.70

Tested by

no test coverage detected