@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.
@@ -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);