@tamagui/simple-hash 3.0.6 → 3.0.8
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.
|
@@ -25,7 +25,7 @@ __export(index_exports, { simpleHash: () => simpleHash });
|
|
|
25
25
|
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
var cache = /* @__PURE__ */ new Map();
|
|
27
27
|
var cacheSize = 0;
|
|
28
|
-
var simpleHash = function(strIn) {
|
|
28
|
+
var simpleHash = function simpleHash2(strIn) {
|
|
29
29
|
var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
|
|
30
30
|
var cacheKey = `${hashMin}:${strIn}`;
|
|
31
31
|
if (cache.has(cacheKey)) {
|
|
@@ -63,7 +63,7 @@ var simpleHash = function(strIn) {
|
|
|
63
63
|
cacheSize++;
|
|
64
64
|
return res;
|
|
65
65
|
};
|
|
66
|
-
var hashChar = function(hash, c) {
|
|
66
|
+
var hashChar = function hashChar2(hash, c) {
|
|
67
67
|
return Math.imul(31, hash) + c.charCodeAt(0) | 0;
|
|
68
68
|
};
|
|
69
69
|
function isValidCSSCharCode(code) {
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(index_exports, { simpleHash: () => simpleHash });
|
|
|
25
25
|
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
var cache = /* @__PURE__ */ new Map();
|
|
27
27
|
var cacheSize = 0;
|
|
28
|
-
var simpleHash = function(strIn) {
|
|
28
|
+
var simpleHash = function simpleHash2(strIn) {
|
|
29
29
|
var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
|
|
30
30
|
var cacheKey = `${hashMin}:${strIn}`;
|
|
31
31
|
if (cache.has(cacheKey)) {
|
|
@@ -63,7 +63,7 @@ var simpleHash = function(strIn) {
|
|
|
63
63
|
cacheSize++;
|
|
64
64
|
return res;
|
|
65
65
|
};
|
|
66
|
-
var hashChar = function(hash, c) {
|
|
66
|
+
var hashChar = function hashChar2(hash, c) {
|
|
67
67
|
return Math.imul(31, hash) + c.charCodeAt(0) | 0;
|
|
68
68
|
};
|
|
69
69
|
function isValidCSSCharCode(code) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n simpleHash: () => simpleHash\n});\nmodule.exports = __toCommonJS(index_exports);\nvar cache = /* @__PURE__ */ new Map();\nvar cacheSize = 0;\nvar simpleHash = function(strIn) {\n var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;\n var cacheKey = `${hashMin}:${strIn}`;\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey);\n }\n var str = strIn;\n if (str[0] === \"v\" && str.startsWith(\"var(\")) {\n str = str.slice(6, str.length - 1);\n }\n var hash = 0;\n var valids = \"\";\n var added = 0;\n var len = str.length;\n for (var i = 0; i < len; i++) {\n if (hashMin !== \"strict\" && added <= hashMin) {\n var char = str.charCodeAt(i);\n if (char === 46) {\n valids += \"--\";\n continue;\n }\n if (isValidCSSCharCode(char)) {\n added++;\n valids += str[i];\n continue;\n }\n }\n hash = hashChar(hash, str[i]);\n }\n var res = valids + (hash ? Math.abs(hash) : \"\");\n if (cacheSize > 1e4) {\n cache.clear();\n cacheSize = 0;\n }\n cache.set(cacheKey, res);\n cacheSize++;\n return res;\n};\nvar hashChar = function(hash, c) {\n return Math.imul(31, hash) + c.charCodeAt(0) | 0;\n};\nfunction isValidCSSCharCode(code) {\n return (\n // A-Z\n code >= 65 && code <= 90 || // a-z\n code >= 97 && code <= 122 || // _\n code === 95 || // -\n code === 45 || // 0-9\n code >= 48 && code <= 57\n );\n}\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe,EACtB,kBAAkB,WACpB,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,IAAI,wBAAwB,IAAI,IAAI;AACpC,IAAI,YAAY;AAChB,IAAI,aAAa,SAAS,OAAO;
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n simpleHash: () => simpleHash\n});\nmodule.exports = __toCommonJS(index_exports);\nvar cache = /* @__PURE__ */ new Map();\nvar cacheSize = 0;\nvar simpleHash = function simpleHash2(strIn) {\n var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;\n var cacheKey = `${hashMin}:${strIn}`;\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey);\n }\n var str = strIn;\n if (str[0] === \"v\" && str.startsWith(\"var(\")) {\n str = str.slice(6, str.length - 1);\n }\n var hash = 0;\n var valids = \"\";\n var added = 0;\n var len = str.length;\n for (var i = 0; i < len; i++) {\n if (hashMin !== \"strict\" && added <= hashMin) {\n var char = str.charCodeAt(i);\n if (char === 46) {\n valids += \"--\";\n continue;\n }\n if (isValidCSSCharCode(char)) {\n added++;\n valids += str[i];\n continue;\n }\n }\n hash = hashChar(hash, str[i]);\n }\n var res = valids + (hash ? Math.abs(hash) : \"\");\n if (cacheSize > 1e4) {\n cache.clear();\n cacheSize = 0;\n }\n cache.set(cacheKey, res);\n cacheSize++;\n return res;\n};\nvar hashChar = function hashChar2(hash, c) {\n return Math.imul(31, hash) + c.charCodeAt(0) | 0;\n};\nfunction isValidCSSCharCode(code) {\n return (\n // A-Z\n code >= 65 && code <= 90 || // a-z\n code >= 97 && code <= 122 || // _\n code === 95 || // -\n code === 45 || // 0-9\n code >= 48 && code <= 57\n );\n}\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe,EACtB,kBAAkB,WACpB,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,IAAI,wBAAwB,IAAI,IAAI;AACpC,IAAI,YAAY;AAChB,IAAI,aAAa,SAAS,YAAY,OAAO;CAC3C,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC/E,IAAI,WAAW,GAAG,QAAQ,GAAG;CAC7B,IAAI,MAAM,IAAI,QAAQ,GAAG;EACvB,OAAO,MAAM,IAAI,QAAQ;CAC3B;CACA,IAAI,MAAM;CACV,IAAI,IAAI,OAAO,OAAO,IAAI,WAAW,MAAM,GAAG;EAC5C,MAAM,IAAI,MAAM,GAAG,IAAI,SAAS,CAAC;CACnC;CACA,IAAI,OAAO;CACX,IAAI,SAAS;CACb,IAAI,QAAQ;CACZ,IAAI,MAAM,IAAI;CACd,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,KAAK;EAC5B,IAAI,YAAY,YAAY,SAAS,SAAS;GAC5C,IAAI,OAAO,IAAI,WAAW,CAAC;GAC3B,IAAI,SAAS,IAAI;IACf,UAAU;IACV;GACF;GACA,IAAI,mBAAmB,IAAI,GAAG;IAC5B;IACA,UAAU,IAAI;IACd;GACF;EACF;EACA,OAAO,SAAS,MAAM,IAAI,EAAE;CAC9B;CACA,IAAI,MAAM,UAAU,OAAO,KAAK,IAAI,IAAI,IAAI;CAC5C,IAAI,YAAY,KAAK;EACnB,MAAM,MAAM;EACZ,YAAY;CACd;CACA,MAAM,IAAI,UAAU,GAAG;CACvB;CACA,OAAO;AACT;AACA,IAAI,WAAW,SAAS,UAAU,MAAM,GAAG;CACzC,OAAO,KAAK,KAAK,IAAI,IAAI,IAAI,EAAE,WAAW,CAAC,IAAI;AACjD;AACA,SAAS,mBAAmB,MAAM;CAChC,OAEE,QAAQ,MAAM,QAAQ,MACtB,QAAQ,MAAM,QAAQ,OACtB,SAAS,MACT,SAAS,MACT,QAAQ,MAAM,QAAQ;AAE1B"}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var cache = /* @__PURE__ */ new Map();
|
|
2
2
|
var cacheSize = 0;
|
|
3
|
-
var simpleHash = function(strIn) {
|
|
3
|
+
var simpleHash = function simpleHash2(strIn) {
|
|
4
4
|
var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
|
|
5
5
|
var cacheKey = `${hashMin}:${strIn}`;
|
|
6
6
|
if (cache.has(cacheKey)) {
|
|
@@ -38,7 +38,7 @@ var simpleHash = function(strIn) {
|
|
|
38
38
|
cacheSize++;
|
|
39
39
|
return res;
|
|
40
40
|
};
|
|
41
|
-
var hashChar = function(hash, c) {
|
|
41
|
+
var hashChar = function hashChar2(hash, c) {
|
|
42
42
|
return Math.imul(31, hash) + c.charCodeAt(0) | 0;
|
|
43
43
|
};
|
|
44
44
|
function isValidCSSCharCode(code) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["var cache = /* @__PURE__ */ new Map();\nvar cacheSize = 0;\nvar simpleHash = function(strIn) {\n var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;\n var cacheKey = `${hashMin}:${strIn}`;\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey);\n }\n var str = strIn;\n if (str[0] === \"v\" && str.startsWith(\"var(\")) {\n str = str.slice(6, str.length - 1);\n }\n var hash = 0;\n var valids = \"\";\n var added = 0;\n var len = str.length;\n for (var i = 0; i < len; i++) {\n if (hashMin !== \"strict\" && added <= hashMin) {\n var char = str.charCodeAt(i);\n if (char === 46) {\n valids += \"--\";\n continue;\n }\n if (isValidCSSCharCode(char)) {\n added++;\n valids += str[i];\n continue;\n }\n }\n hash = hashChar(hash, str[i]);\n }\n var res = valids + (hash ? Math.abs(hash) : \"\");\n if (cacheSize > 1e4) {\n cache.clear();\n cacheSize = 0;\n }\n cache.set(cacheKey, res);\n cacheSize++;\n return res;\n};\nvar hashChar = function(hash, c) {\n return Math.imul(31, hash) + c.charCodeAt(0) | 0;\n};\nfunction isValidCSSCharCode(code) {\n return (\n // A-Z\n code >= 65 && code <= 90 || // a-z\n code >= 97 && code <= 122 || // _\n code === 95 || // -\n code === 45 || // 0-9\n code >= 48 && code <= 57\n );\n}\nexport {\n simpleHash\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";AAAA,IAAI,wBAAwB,IAAI,IAAI;AACpC,IAAI,YAAY;AAChB,IAAI,aAAa,SAAS,OAAO;
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["var cache = /* @__PURE__ */ new Map();\nvar cacheSize = 0;\nvar simpleHash = function simpleHash2(strIn) {\n var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;\n var cacheKey = `${hashMin}:${strIn}`;\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey);\n }\n var str = strIn;\n if (str[0] === \"v\" && str.startsWith(\"var(\")) {\n str = str.slice(6, str.length - 1);\n }\n var hash = 0;\n var valids = \"\";\n var added = 0;\n var len = str.length;\n for (var i = 0; i < len; i++) {\n if (hashMin !== \"strict\" && added <= hashMin) {\n var char = str.charCodeAt(i);\n if (char === 46) {\n valids += \"--\";\n continue;\n }\n if (isValidCSSCharCode(char)) {\n added++;\n valids += str[i];\n continue;\n }\n }\n hash = hashChar(hash, str[i]);\n }\n var res = valids + (hash ? Math.abs(hash) : \"\");\n if (cacheSize > 1e4) {\n cache.clear();\n cacheSize = 0;\n }\n cache.set(cacheKey, res);\n cacheSize++;\n return res;\n};\nvar hashChar = function hashChar2(hash, c) {\n return Math.imul(31, hash) + c.charCodeAt(0) | 0;\n};\nfunction isValidCSSCharCode(code) {\n return (\n // A-Z\n code >= 65 && code <= 90 || // a-z\n code >= 97 && code <= 122 || // _\n code === 95 || // -\n code === 45 || // 0-9\n code >= 48 && code <= 57\n );\n}\nexport {\n simpleHash\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";AAAA,IAAI,wBAAwB,IAAI,IAAI;AACpC,IAAI,YAAY;AAChB,IAAI,aAAa,SAAS,YAAY,OAAO;CAC3C,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC/E,IAAI,WAAW,GAAG,QAAQ,GAAG;CAC7B,IAAI,MAAM,IAAI,QAAQ,GAAG;EACvB,OAAO,MAAM,IAAI,QAAQ;CAC3B;CACA,IAAI,MAAM;CACV,IAAI,IAAI,OAAO,OAAO,IAAI,WAAW,MAAM,GAAG;EAC5C,MAAM,IAAI,MAAM,GAAG,IAAI,SAAS,CAAC;CACnC;CACA,IAAI,OAAO;CACX,IAAI,SAAS;CACb,IAAI,QAAQ;CACZ,IAAI,MAAM,IAAI;CACd,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,KAAK;EAC5B,IAAI,YAAY,YAAY,SAAS,SAAS;GAC5C,IAAI,OAAO,IAAI,WAAW,CAAC;GAC3B,IAAI,SAAS,IAAI;IACf,UAAU;IACV;GACF;GACA,IAAI,mBAAmB,IAAI,GAAG;IAC5B;IACA,UAAU,IAAI;IACd;GACF;EACF;EACA,OAAO,SAAS,MAAM,IAAI,EAAE;CAC9B;CACA,IAAI,MAAM,UAAU,OAAO,KAAK,IAAI,IAAI,IAAI;CAC5C,IAAI,YAAY,KAAK;EACnB,MAAM,MAAM;EACZ,YAAY;CACd;CACA,MAAM,IAAI,UAAU,GAAG;CACvB;CACA,OAAO;AACT;AACA,IAAI,WAAW,SAAS,UAAU,MAAM,GAAG;CACzC,OAAO,KAAK,KAAK,IAAI,IAAI,IAAI,EAAE,WAAW,CAAC,IAAI;AACjD;AACA,SAAS,mBAAmB,MAAM;CAChC,OAEE,QAAQ,MAAM,QAAQ,MACtB,QAAQ,MAAM,QAAQ,OACtB,SAAS,MACT,SAAS,MACT,QAAQ,MAAM,QAAQ;AAE1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/simple-hash",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"clean:build": "tamagui-build clean:build"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@tamagui/build": "3.0.
|
|
37
|
+
"@tamagui/build": "3.0.8"
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
|
41
41
|
"url": "git+https://github.com/tamagui/tamagui.git",
|
|
42
42
|
"directory": "code/core/simple-hash"
|
|
43
43
|
},
|
|
44
|
-
"releaseSourceCommit": "
|
|
44
|
+
"releaseSourceCommit": "b723356193510591d9ad15877b8937e8e6a31910"
|
|
45
45
|
}
|