@hyperframes/parsers 0.8.74 → 0.8.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gsapParserAcorn.js +9 -0
- package/dist/gsapParserAcorn.js.map +1 -1
- package/dist/gsapParserExports.js +9 -0
- package/dist/gsapParserExports.js.map +1 -1
- package/dist/gsapWriterAcorn.js.map +1 -1
- package/dist/hfIds.d.ts +6 -6
- package/dist/hfIds.js.map +1 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/gsapParserAcorn.js
CHANGED
|
@@ -1796,7 +1796,16 @@ function parseGsapScriptAcornForWrite(script) {
|
|
|
1796
1796
|
return null;
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
1799
|
+
var PARSE_MEMO_ENTRIES = 4;
|
|
1800
|
+
var parseMemo = /* @__PURE__ */ new Map();
|
|
1799
1801
|
function parseGsapScriptAcorn(script) {
|
|
1802
|
+
const parsed = parseMemo.get(script) ?? parseGsapScriptAcornUncached(script);
|
|
1803
|
+
parseMemo.delete(script);
|
|
1804
|
+
parseMemo.set(script, parsed);
|
|
1805
|
+
if (parseMemo.size > PARSE_MEMO_ENTRIES) parseMemo.delete(parseMemo.keys().next().value);
|
|
1806
|
+
return structuredClone(parsed);
|
|
1807
|
+
}
|
|
1808
|
+
function parseGsapScriptAcornUncached(script) {
|
|
1800
1809
|
try {
|
|
1801
1810
|
const ast = parseProgram(script);
|
|
1802
1811
|
const scope = collectScopeBindings(ast);
|