(doc: Document)
| 153 | |
| 154 | // fallow-ignore-next-line complexity |
| 155 | function 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 | |
| 168 | function extractStyles(doc: Document): string | null { |
| 169 | const styleEl = doc.querySelector("style"); |
no test coverage detected