@tamagui/core 1.112.8 → 1.112.9

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/native.js CHANGED
@@ -1027,9 +1027,10 @@ var require_index_native2 = __commonJS({
1027
1027
  }
1028
1028
  });
1029
1029
  module2.exports = __toCommonJS2(src_exports2);
1030
- var cache2 = /* @__PURE__ */ new Map(), simpleHash = function(str) {
1030
+ var cache2 = /* @__PURE__ */ new Map(), cacheSize = 0, simpleHash = function(strIn) {
1031
1031
  var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
1032
- if (cache2.has(str)) return cache2.get(str);
1032
+ if (cache2.has(strIn)) return cache2.get(strIn);
1033
+ var str = strIn;
1033
1034
  str[0] === "v" && str.startsWith("var(") && (str = str.slice(6, str.length - 1));
1034
1035
  for (var hash = 0, valids = "", added = 0, len = str.length, i = 0; i < len; i++) {
1035
1036
  if (hashMin !== "strict" && added <= hashMin) {
@@ -1046,7 +1047,7 @@ var require_index_native2 = __commonJS({
1046
1047
  hash = hashChar(hash, str[i]);
1047
1048
  }
1048
1049
  var res = valids + (hash ? Math.abs(hash) : "");
1049
- return cache2.size > 1e4 && cache2.clear(), cache2.set(str, res), res;
1050
+ return cacheSize > 1e4 && (cache2.clear(), cacheSize = 0), cache2.set(strIn, res), cacheSize++, res;
1050
1051
  }, hashChar = function(hash, c) {
1051
1052
  return Math.imul(31, hash) + c.charCodeAt(0) | 0;
1052
1053
  };