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

Function extractGsapScript

packages/sdk/src/document.ts:155–166  ·  view source on GitHub ↗
(doc: Document)

Source from the content-addressed store, hash-verified

153
154// fallow-ignore-next-line complexity
155function extractGsapScript(doc: Document): string | null {
156 // GSAP script is the first <script> tag whose text references gsap. Marker
157 // set must match studio sdkShadow.ts isGsapScriptBody so both pick the same
158 // script from a given composition.
159 for (const script of Array.from(doc.querySelectorAll("script"))) {
160 const text = script.textContent ?? "";
161 if (text.includes("gsap") || text.includes("__timelines") || text.includes("ScrollTrigger")) {
162 return text;
163 }
164 }
165 return null;
166}
167
168function extractStyles(doc: Document): string | null {
169 const styleEl = doc.querySelector("style");

Callers 2

buildAnimationIdMapFunction · 0.70
buildDocumentFunction · 0.70

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected