Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tamagui/simple-hash

Package Overview
Dependencies
Maintainers
1
Versions
963
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.111.8 to 1.111.9

61

dist/esm/index.native.js

@@ -1,37 +0,40 @@

var cache = /* @__PURE__ */ new Map(), simpleHash = function(str) {
var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
if (cache.has(str))
return cache.get(str);
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;
var cache = /* @__PURE__ */new Map(),
simpleHash = function (str) {
var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
if (cache.has(str)) return cache.get(str);
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;
}
}
if (isValidCSSCharCode(char)) {
added++, valids += str[i];
continue;
}
hash = hashChar(hash, str[i]);
}
hash = hashChar(hash, str[i]);
}
var res = valids + (hash ? Math.abs(hash) : "");
return cache.size > 1e4 && cache.clear(), cache.set(str, res), res;
}, hashChar = function(hash, c) {
return Math.imul(31, hash) + c.charCodeAt(0) | 0;
};
var res = valids + (hash ? Math.abs(hash) : "");
return cache.size > 1e4 && cache.clear(), cache.set(str, res), 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.js.map
export { simpleHash };
//# sourceMappingURL=index.native.js.map
{
"name": "@tamagui/simple-hash",
"version": "1.111.8",
"version": "1.111.9",
"sideEffects": false,

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

".": {
"react-native-import": "./dist/esm/index.native.mjs",
"react-native-import": "./dist/esm/index.native.js",
"react-native": "./dist/cjs/index.native.js",

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

"devDependencies": {
"@tamagui/build": "1.111.8"
"@tamagui/build": "1.111.9"
},

@@ -36,0 +36,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