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

Function setGsapScript

packages/sdk/src/engine/model.ts:327–342  ·  view source on GitHub ↗
(document: Document, newScript: string)

Source from the content-addressed store, hash-verified

325}
326
327export function setGsapScript(document: Document, newScript: string): void {
328 const existing = findGsapScriptElement(document);
329 if (!newScript) {
330 existing?.remove();
331 return;
332 }
333 let el = existing;
334 if (!el) {
335 el = document.createElement("script") as unknown as Element;
336 const head =
337 (document.querySelector("head") as unknown as Element | null) ??
338 (document.body as unknown as Element);
339 (head as any).appendChild(el);
340 }
341 el.textContent = newScript;
342}
343
344// ─── Sibling index ────────────────────────────────────────────────────────────
345

Callers 15

applyOneFunction · 0.85
handleSetTimingFunction · 0.85
handleRemoveElementFunction · 0.85
handleAddWithKeyframesFunction · 0.85
handleAddGsapTweenFunction · 0.85
handleSetGsapTweenFunction · 0.85
handleRemoveGsapPropertyFunction · 0.85
handleRemoveGsapTweenFunction · 0.85
handleRemoveAllKeyframesFunction · 0.85
handleConvertToKeyframesFunction · 0.85

Calls 2

findGsapScriptElementFunction · 0.85
querySelectorMethod · 0.65

Tested by

no test coverage detected