(source: string, id: string)
| 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. |
| 87 | function 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 | |
| 93 | function resolveSnapshot(session: Composition, id: string): FlatEl | null { |
| 94 | const els = session.getElements(); |
no outgoing calls
no test coverage detected