Socket
Socket
Sign inDemoInstall

@tamagui/simple-hash

Package Overview
Dependencies
Maintainers
1
Versions
946
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tamagui/simple-hash - npm Package Compare versions

Comparing version 1.113.1 to 1.113.2

66

dist/esm/index.native.js

@@ -1,43 +0,39 @@

var cache = /* @__PURE__ */new Map(),
cacheSize = 0,
simpleHash = function (strIn) {
var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
if (cache.has(strIn)) return cache.get(strIn);
var str = strIn;
str[0] === "v" && str.startsWith("var(") && (str = str.slice(6, str.length - 1));
for (var hash = 0, valids = "", added = 0, len = str.length, i = 0; i < len; i++) {
if (hashMin !== "strict" && added <= hashMin) {
var char = str.charCodeAt(i);
if (char === 46) {
valids += "--";
continue;
}
if (isValidCSSCharCode(char)) {
added++, valids += str[i];
continue;
}
var cache = /* @__PURE__ */ new Map(), cacheSize = 0, simpleHash = function(strIn) {
var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
if (cache.has(strIn))
return cache.get(strIn);
var str = strIn;
str[0] === "v" && str.startsWith("var(") && (str = str.slice(6, str.length - 1));
for (var hash = 0, valids = "", added = 0, len = str.length, i = 0; i < len; i++) {
if (hashMin !== "strict" && added <= hashMin) {
var char = str.charCodeAt(i);
if (char === 46) {
valids += "--";
continue;
}
hash = hashChar(hash, str[i]);
if (isValidCSSCharCode(char)) {
added++, valids += str[i];
continue;
}
}
var res = valids + (hash ? Math.abs(hash) : "");
return cacheSize > 1e4 && (cache.clear(), cacheSize = 0), cache.set(strIn, res), cacheSize++, res;
},
hashChar = function (hash, c) {
return Math.imul(31, hash) + c.charCodeAt(0) | 0;
};
hash = hashChar(hash, str[i]);
}
var res = valids + (hash ? Math.abs(hash) : "");
return cacheSize > 1e4 && (cache.clear(), cacheSize = 0), cache.set(strIn, res), cacheSize++, res;
}, hashChar = function(hash, c) {
return Math.imul(31, hash) + c.charCodeAt(0) | 0;
};
function isValidCSSCharCode(code) {
return (
// A-Z
code >= 65 && code <= 90 ||
// a-z
code >= 97 && code <= 122 ||
// _
code === 95 ||
// -
code === 45 ||
// 0-9
code >= 65 && code <= 90 || // a-z
code >= 97 && code <= 122 || // _
code === 95 || // -
code === 45 || // 0-9
code >= 48 && code <= 57
);
}
export { simpleHash };
//# sourceMappingURL=index.native.js.map
export {
simpleHash
};
//# sourceMappingURL=index.js.map
{
"name": "@tamagui/simple-hash",
"version": "1.113.1",
"version": "1.113.2",
"sideEffects": false,

@@ -32,3 +32,3 @@ "types": "./types/index.d.ts",

"devDependencies": {
"@tamagui/build": "1.113.1"
"@tamagui/build": "1.113.2"
},

@@ -35,0 +35,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc