@hyperframes/parsers 0.8.75 → 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
|
@@ -2084,7 +2084,16 @@ function assignStableIds(anims) {
|
|
|
2084
2084
|
return { ...anim, id };
|
|
2085
2085
|
});
|
|
2086
2086
|
}
|
|
2087
|
+
var PARSE_MEMO_ENTRIES = 4;
|
|
2088
|
+
var parseMemo = /* @__PURE__ */ new Map();
|
|
2087
2089
|
function parseGsapScriptAcorn(script) {
|
|
2090
|
+
const parsed = parseMemo.get(script) ?? parseGsapScriptAcornUncached(script);
|
|
2091
|
+
parseMemo.delete(script);
|
|
2092
|
+
parseMemo.set(script, parsed);
|
|
2093
|
+
if (parseMemo.size > PARSE_MEMO_ENTRIES) parseMemo.delete(parseMemo.keys().next().value);
|
|
2094
|
+
return structuredClone(parsed);
|
|
2095
|
+
}
|
|
2096
|
+
function parseGsapScriptAcornUncached(script) {
|
|
2088
2097
|
try {
|
|
2089
2098
|
const ast = parseProgram(script);
|
|
2090
2099
|
const scope = collectScopeBindings(ast);
|