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

Function countHfIdInSource

packages/studio/src/utils/sdkResolverShadow.ts:87–91  ·  view source on GitHub ↗
(source: string, id: string)

Source from the content-addressed store, hash-verified

85// Count static `data-hf-id="<id>"` occurrences (both quote styles) in source.
86// Substring split, not regex — no escaping, and the id never contains a quote.
87function countHfIdInSource(source: string, id: string): number {
88 return (
89 source.split(`data-hf-id="${id}"`).length - 1 + (source.split(`data-hf-id='${id}'`).length - 1)
90 );
91}
92
93function resolveSnapshot(session: Composition, id: string): FlatEl | null {
94 const els = session.getElements();

Callers 2

runResolverShadowFunction · 0.85
recordResolverParityFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected