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

Function extractWindowNumber

packages/core/scripts/debug-timeline.ts:97–103  ·  view source on GitHub ↗
(html: string, key: string)

Source from the content-addressed store, hash-verified

95}
96
97function extractWindowNumber(html: string, key: string): number | null {
98 const escapedKey = key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
99 const regex = new RegExp(`${escapedKey}\\s*=\\s*([0-9]+(?:\\.[0-9]+)?)`, "i");
100 const match = html.match(regex);
101 if (!match) return null;
102 return parseNum(match[1]);
103}
104
105function normalizeDurationSeconds(
106 rawDuration: number | null,

Callers 1

mainFunction · 0.85

Calls 1

parseNumFunction · 0.70

Tested by

no test coverage detected