@fluixi/utils 1.0.0-alpha.83 → 1.0.0-alpha.85

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.
Files changed (133) hide show
  1. package/dist/index.cjs +2858 -1
  2. package/dist/index.mjs +2838 -1
  3. package/dist/lib/array/advanced.cjs +2227 -1
  4. package/dist/lib/array/advanced.mjs +2204 -1
  5. package/dist/lib/array/array.cjs +57 -1
  6. package/dist/lib/array/array.mjs +36 -1
  7. package/dist/lib/array/index.cjs +2344 -1
  8. package/dist/lib/array/index.mjs +2322 -1
  9. package/dist/lib/array/utils.cjs +103 -1
  10. package/dist/lib/array/utils.mjs +82 -1
  11. package/dist/lib/color/color.cjs +2190 -1
  12. package/dist/lib/color/color.mjs +2167 -1
  13. package/dist/lib/color/constants.cjs +380 -1
  14. package/dist/lib/color/constants.mjs +359 -1
  15. package/dist/lib/color/conversions.cjs +629 -1
  16. package/dist/lib/color/conversions.mjs +608 -1
  17. package/dist/lib/color/helpers.cjs +2534 -1
  18. package/dist/lib/color/helpers.mjs +2511 -1
  19. package/dist/lib/color/index.cjs +2641 -1
  20. package/dist/lib/color/index.mjs +2619 -1
  21. package/dist/lib/color/types.cjs +18 -1
  22. package/dist/lib/color/utils.cjs +962 -1
  23. package/dist/lib/color/utils.mjs +939 -1
  24. package/dist/lib/compare/comparators.cjs +171 -1
  25. package/dist/lib/compare/comparators.mjs +150 -1
  26. package/dist/lib/compare/index.cjs +172 -1
  27. package/dist/lib/compare/index.mjs +152 -1
  28. package/dist/lib/crypto/hash.cjs +83 -1
  29. package/dist/lib/crypto/hash.mjs +62 -1
  30. package/dist/lib/crypto/index.cjs +85 -1
  31. package/dist/lib/crypto/index.mjs +62 -1
  32. package/dist/lib/dom/events.cjs +40 -1
  33. package/dist/lib/dom/events.mjs +19 -1
  34. package/dist/lib/dom/index.cjs +78 -1
  35. package/dist/lib/dom/index.mjs +56 -1
  36. package/dist/lib/dom/utils.cjs +57 -1
  37. package/dist/lib/dom/utils.mjs +36 -1
  38. package/dist/lib/functions/functions.cjs +366 -1
  39. package/dist/lib/functions/functions.mjs +345 -1
  40. package/dist/lib/functions/index.cjs +369 -1
  41. package/dist/lib/functions/index.mjs +347 -1
  42. package/dist/lib/functions/types.cjs +18 -1
  43. package/dist/lib/helpers.cjs +78 -1
  44. package/dist/lib/helpers.mjs +59 -1
  45. package/dist/lib/index.cjs +2857 -1
  46. package/dist/lib/index.mjs +2836 -1
  47. package/dist/lib/maths/constants.cjs +70 -1
  48. package/dist/lib/maths/constants.mjs +50 -1
  49. package/dist/lib/maths/fn/advanced.cjs +231 -1
  50. package/dist/lib/maths/fn/advanced.mjs +208 -1
  51. package/dist/lib/maths/fn/basic.cjs +212 -1
  52. package/dist/lib/maths/fn/basic.mjs +191 -1
  53. package/dist/lib/maths/fn/complex.cjs +268 -1
  54. package/dist/lib/maths/fn/complex.mjs +247 -1
  55. package/dist/lib/maths/fn/index.cjs +877 -1
  56. package/dist/lib/maths/fn/index.mjs +855 -1
  57. package/dist/lib/maths/fn/trigo.cjs +179 -1
  58. package/dist/lib/maths/fn/trigo.mjs +156 -1
  59. package/dist/lib/maths/fn/vector.cjs +728 -1
  60. package/dist/lib/maths/fn/vector.mjs +707 -1
  61. package/dist/lib/maths/formatter.cjs +61 -1
  62. package/dist/lib/maths/formatter.mjs +40 -1
  63. package/dist/lib/maths/guards.cjs +164 -1
  64. package/dist/lib/maths/guards.mjs +144 -1
  65. package/dist/lib/maths/index.cjs +1152 -1
  66. package/dist/lib/maths/index.mjs +1130 -1
  67. package/dist/lib/maths/parser.cjs +75 -1
  68. package/dist/lib/maths/parser.mjs +54 -1
  69. package/dist/lib/maths/random.cjs +49 -1
  70. package/dist/lib/maths/random.mjs +28 -1
  71. package/dist/lib/maths/types/advanced.cjs +18 -1
  72. package/dist/lib/maths/types/basic.cjs +18 -1
  73. package/dist/lib/maths/types/index.cjs +19 -1
  74. package/dist/lib/maths/types/index.mjs +1 -0
  75. package/dist/lib/maths/types/negative.cjs +18 -1
  76. package/dist/lib/maths/types/operations.cjs +18 -1
  77. package/dist/lib/object/clone.cjs +88 -1
  78. package/dist/lib/object/clone.mjs +65 -1
  79. package/dist/lib/object/diff.cjs +573 -1
  80. package/dist/lib/object/diff.mjs +550 -1
  81. package/dist/lib/object/getter-setter.cjs +2351 -1
  82. package/dist/lib/object/getter-setter.mjs +2330 -1
  83. package/dist/lib/object/index.cjs +3956 -6
  84. package/dist/lib/object/index.mjs +3936 -6
  85. package/dist/lib/object/merge.cjs +1029 -1
  86. package/dist/lib/object/merge.mjs +1006 -1
  87. package/dist/lib/object/object.cjs +280 -1
  88. package/dist/lib/object/object.mjs +257 -1
  89. package/dist/lib/object/omit.cjs +2022 -1
  90. package/dist/lib/object/omit.mjs +1999 -1
  91. package/dist/lib/object/reconcile.cjs +126 -1
  92. package/dist/lib/object/reconcile.js +1 -1
  93. package/dist/lib/object/reconcile.mjs +105 -1
  94. package/dist/lib/object/selector.cjs +303 -1
  95. package/dist/lib/object/selector.mjs +282 -1
  96. package/dist/lib/object/sort.cjs +209 -1
  97. package/dist/lib/object/sort.d.ts +1 -1
  98. package/dist/lib/object/sort.js +3 -3
  99. package/dist/lib/object/sort.mjs +186 -1
  100. package/dist/lib/object/transform.cjs +2211 -1
  101. package/dist/lib/object/transform.mjs +2190 -1
  102. package/dist/lib/object/types.cjs +18 -1
  103. package/dist/lib/object/utils.cjs +326 -6
  104. package/dist/lib/object/utils.mjs +305 -6
  105. package/dist/lib/primitive/boolean/boolean.cjs +407 -1
  106. package/dist/lib/primitive/boolean/boolean.mjs +386 -1
  107. package/dist/lib/primitive/boolean/index.cjs +382 -1
  108. package/dist/lib/primitive/boolean/index.mjs +359 -1
  109. package/dist/lib/primitive/boolean/types.cjs +18 -1
  110. package/dist/lib/primitive/date/date.cjs +1126 -1
  111. package/dist/lib/primitive/date/date.mjs +1105 -1
  112. package/dist/lib/primitive/date/index.cjs +1128 -1
  113. package/dist/lib/primitive/date/index.mjs +1105 -1
  114. package/dist/lib/primitive/date/types.cjs +18 -1
  115. package/dist/lib/primitive/index.cjs +2338 -5
  116. package/dist/lib/primitive/index.mjs +2316 -5
  117. package/dist/lib/primitive/string/index.cjs +875 -5
  118. package/dist/lib/primitive/string/index.mjs +852 -5
  119. package/dist/lib/primitive/string/parser-2.cjs +543 -8
  120. package/dist/lib/primitive/string/parser-2.mjs +522 -8
  121. package/dist/lib/primitive/string/parser.cjs +236 -3
  122. package/dist/lib/primitive/string/parser.mjs +215 -3
  123. package/dist/lib/primitive/string/string.cjs +926 -5
  124. package/dist/lib/primitive/string/string.mjs +903 -5
  125. package/dist/lib/primitive/string/types.cjs +18 -1
  126. package/dist/lib/primitive/types.cjs +18 -1
  127. package/dist/lib/url/index.cjs +327 -1
  128. package/dist/lib/url/index.mjs +304 -1
  129. package/dist/lib/url/parser.cjs +325 -1
  130. package/dist/lib/url/parser.mjs +304 -1
  131. package/dist/lib/url/types.cjs +18 -1
  132. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  133. package/package.json +5 -5
@@ -1 +1,83 @@
1
- "use strict";var h=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var w=(n,t)=>{for(var e in t)h(n,e,{get:t[e],enumerable:!0})},A=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of y(t))!p.call(n,a)&&a!==e&&h(n,a,{get:()=>t[a],enumerable:!(r=g(t,a))||r.enumerable});return n};var u=n=>A(h({},"__esModule",{value:!0}),n);var l={};w(l,{compareWithHash:()=>f,createHash:()=>x,hash:()=>i,hashStringPromise:()=>H,string_hash:()=>S});module.exports=u(l);var x=async(n,t="SHA-1")=>{if(typeof window>"u")return null;let{subtle:e}=window.globalThis.crypto,r=await e.generateKey({name:"HMAC",hash:t,length:256},!0,["sign","verify"]),o=new TextEncoder().encode(n),c=await e.sign({name:"HMAC"},r,o);return[...new Uint8Array(c)].map(d=>d.toString(16).padStart(2,"0")).join("")},i=async(n,t="SHA-256")=>{let r=new TextEncoder().encode(n),a=await crypto.subtle.digest(t,r);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("")},f=async(n,t,e="SHA-256")=>{let r=await i(n,e),a=await i(t,e);return r===a};async function H(n,t="SHA-256"){let r=new TextEncoder().encode(n),a=await crypto.subtle.digest(t,r);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("")}var S=n=>{let t=0;for(let e=0;e<n.length;e++){let r=n.charCodeAt(e);t=(t<<5)-t+r,t=t&t}return t.toString(16)};
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/crypto/hash.ts
21
+ var hash_exports = {};
22
+ __export(hash_exports, {
23
+ compareWithHash: () => compareWithHash,
24
+ createHash: () => createHash,
25
+ hash: () => hash,
26
+ hashStringPromise: () => hashStringPromise,
27
+ string_hash: () => string_hash
28
+ });
29
+ module.exports = __toCommonJS(hash_exports);
30
+ var createHash = async (value, algorithm = "SHA-1") => {
31
+ if (typeof window === "undefined") return null;
32
+ const { subtle } = window.globalThis.crypto;
33
+ const key = await subtle.generateKey(
34
+ {
35
+ name: "HMAC",
36
+ hash: algorithm,
37
+ length: 256
38
+ },
39
+ true,
40
+ ["sign", "verify"]
41
+ );
42
+ const enc = new TextEncoder();
43
+ const message = enc.encode(value);
44
+ const digest = await subtle.sign(
45
+ {
46
+ name: "HMAC"
47
+ },
48
+ key,
49
+ message
50
+ );
51
+ const hex = [...new Uint8Array(digest)].map((x) => x.toString(16).padStart(2, "0")).join("");
52
+ return hex;
53
+ };
54
+ var hash = async (value, algorithm = "SHA-256") => {
55
+ const encoder = new TextEncoder();
56
+ const data = encoder.encode(value);
57
+ const hashBuffer = await crypto.subtle.digest(algorithm, data);
58
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
59
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
60
+ return hashHex;
61
+ };
62
+ var compareWithHash = async (value1, value2, algorithm = "SHA-256") => {
63
+ const hash1 = await hash(value1, algorithm);
64
+ const hash2 = await hash(value2, algorithm);
65
+ return hash1 === hash2;
66
+ };
67
+ async function hashStringPromise(value, algorithm = "SHA-256") {
68
+ const encoder = new TextEncoder();
69
+ const data = encoder.encode(value);
70
+ const hashBuffer = await crypto.subtle.digest(algorithm, data);
71
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
72
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
73
+ return hashHex;
74
+ }
75
+ var string_hash = (str) => {
76
+ let hash2 = 0;
77
+ for (let i = 0; i < str.length; i++) {
78
+ const char = str.charCodeAt(i);
79
+ hash2 = (hash2 << 5) - hash2 + char;
80
+ hash2 = hash2 & hash2;
81
+ }
82
+ return hash2.toString(16);
83
+ };
@@ -1 +1,62 @@
1
- var d=async(e,t="SHA-1")=>{if(typeof window>"u")return null;let{subtle:n}=window.globalThis.crypto,r=await n.generateKey({name:"HMAC",hash:t,length:256},!0,["sign","verify"]),o=new TextEncoder().encode(e),c=await n.sign({name:"HMAC"},r,o);return[...new Uint8Array(c)].map(i=>i.toString(16).padStart(2,"0")).join("")},h=async(e,t="SHA-256")=>{let r=new TextEncoder().encode(e),a=await crypto.subtle.digest(t,r);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("")},g=async(e,t,n="SHA-256")=>{let r=await h(e,n),a=await h(t,n);return r===a};async function y(e,t="SHA-256"){let r=new TextEncoder().encode(e),a=await crypto.subtle.digest(t,r);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("")}var p=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return t.toString(16)};export{g as compareWithHash,d as createHash,h as hash,y as hashStringPromise,p as string_hash};
1
+ // src/lib/crypto/hash.ts
2
+ var createHash = async (value, algorithm = "SHA-1") => {
3
+ if (typeof window === "undefined") return null;
4
+ const { subtle } = window.globalThis.crypto;
5
+ const key = await subtle.generateKey(
6
+ {
7
+ name: "HMAC",
8
+ hash: algorithm,
9
+ length: 256
10
+ },
11
+ true,
12
+ ["sign", "verify"]
13
+ );
14
+ const enc = new TextEncoder();
15
+ const message = enc.encode(value);
16
+ const digest = await subtle.sign(
17
+ {
18
+ name: "HMAC"
19
+ },
20
+ key,
21
+ message
22
+ );
23
+ const hex = [...new Uint8Array(digest)].map((x) => x.toString(16).padStart(2, "0")).join("");
24
+ return hex;
25
+ };
26
+ var hash = async (value, algorithm = "SHA-256") => {
27
+ const encoder = new TextEncoder();
28
+ const data = encoder.encode(value);
29
+ const hashBuffer = await crypto.subtle.digest(algorithm, data);
30
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
31
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
32
+ return hashHex;
33
+ };
34
+ var compareWithHash = async (value1, value2, algorithm = "SHA-256") => {
35
+ const hash1 = await hash(value1, algorithm);
36
+ const hash2 = await hash(value2, algorithm);
37
+ return hash1 === hash2;
38
+ };
39
+ async function hashStringPromise(value, algorithm = "SHA-256") {
40
+ const encoder = new TextEncoder();
41
+ const data = encoder.encode(value);
42
+ const hashBuffer = await crypto.subtle.digest(algorithm, data);
43
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
44
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
45
+ return hashHex;
46
+ }
47
+ var string_hash = (str) => {
48
+ let hash2 = 0;
49
+ for (let i = 0; i < str.length; i++) {
50
+ const char = str.charCodeAt(i);
51
+ hash2 = (hash2 << 5) - hash2 + char;
52
+ hash2 = hash2 & hash2;
53
+ }
54
+ return hash2.toString(16);
55
+ };
56
+ export {
57
+ compareWithHash,
58
+ createHash,
59
+ hash,
60
+ hashStringPromise,
61
+ string_hash
62
+ };
@@ -1 +1,85 @@
1
- "use strict";var h=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var w=(n,t)=>{for(var e in t)h(n,e,{get:t[e],enumerable:!0})},A=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of y(t))!p.call(n,a)&&a!==e&&h(n,a,{get:()=>t[a],enumerable:!(r=g(t,a))||r.enumerable});return n};var u=n=>A(h({},"__esModule",{value:!0}),n);var l={};w(l,{compareWithHash:()=>f,createHash:()=>x,hash:()=>i,hashStringPromise:()=>H,string_hash:()=>S});module.exports=u(l);var x=async(n,t="SHA-1")=>{if(typeof window>"u")return null;let{subtle:e}=window.globalThis.crypto,r=await e.generateKey({name:"HMAC",hash:t,length:256},!0,["sign","verify"]),o=new TextEncoder().encode(n),c=await e.sign({name:"HMAC"},r,o);return[...new Uint8Array(c)].map(d=>d.toString(16).padStart(2,"0")).join("")},i=async(n,t="SHA-256")=>{let r=new TextEncoder().encode(n),a=await crypto.subtle.digest(t,r);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("")},f=async(n,t,e="SHA-256")=>{let r=await i(n,e),a=await i(t,e);return r===a};async function H(n,t="SHA-256"){let r=new TextEncoder().encode(n),a=await crypto.subtle.digest(t,r);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("")}var S=n=>{let t=0;for(let e=0;e<n.length;e++){let r=n.charCodeAt(e);t=(t<<5)-t+r,t=t&t}return t.toString(16)};
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/crypto/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ compareWithHash: () => compareWithHash,
24
+ createHash: () => createHash,
25
+ hash: () => hash,
26
+ hashStringPromise: () => hashStringPromise,
27
+ string_hash: () => string_hash
28
+ });
29
+ module.exports = __toCommonJS(index_exports);
30
+
31
+ // src/lib/crypto/hash.ts
32
+ var createHash = async (value, algorithm = "SHA-1") => {
33
+ if (typeof window === "undefined") return null;
34
+ const { subtle } = window.globalThis.crypto;
35
+ const key = await subtle.generateKey(
36
+ {
37
+ name: "HMAC",
38
+ hash: algorithm,
39
+ length: 256
40
+ },
41
+ true,
42
+ ["sign", "verify"]
43
+ );
44
+ const enc = new TextEncoder();
45
+ const message = enc.encode(value);
46
+ const digest = await subtle.sign(
47
+ {
48
+ name: "HMAC"
49
+ },
50
+ key,
51
+ message
52
+ );
53
+ const hex = [...new Uint8Array(digest)].map((x) => x.toString(16).padStart(2, "0")).join("");
54
+ return hex;
55
+ };
56
+ var hash = async (value, algorithm = "SHA-256") => {
57
+ const encoder = new TextEncoder();
58
+ const data = encoder.encode(value);
59
+ const hashBuffer = await crypto.subtle.digest(algorithm, data);
60
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
61
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
62
+ return hashHex;
63
+ };
64
+ var compareWithHash = async (value1, value2, algorithm = "SHA-256") => {
65
+ const hash1 = await hash(value1, algorithm);
66
+ const hash2 = await hash(value2, algorithm);
67
+ return hash1 === hash2;
68
+ };
69
+ async function hashStringPromise(value, algorithm = "SHA-256") {
70
+ const encoder = new TextEncoder();
71
+ const data = encoder.encode(value);
72
+ const hashBuffer = await crypto.subtle.digest(algorithm, data);
73
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
74
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
75
+ return hashHex;
76
+ }
77
+ var string_hash = (str) => {
78
+ let hash2 = 0;
79
+ for (let i = 0; i < str.length; i++) {
80
+ const char = str.charCodeAt(i);
81
+ hash2 = (hash2 << 5) - hash2 + char;
82
+ hash2 = hash2 & hash2;
83
+ }
84
+ return hash2.toString(16);
85
+ };
@@ -1 +1,62 @@
1
- var d=async(e,t="SHA-1")=>{if(typeof window>"u")return null;let{subtle:n}=window.globalThis.crypto,r=await n.generateKey({name:"HMAC",hash:t,length:256},!0,["sign","verify"]),o=new TextEncoder().encode(e),c=await n.sign({name:"HMAC"},r,o);return[...new Uint8Array(c)].map(i=>i.toString(16).padStart(2,"0")).join("")},h=async(e,t="SHA-256")=>{let r=new TextEncoder().encode(e),a=await crypto.subtle.digest(t,r);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("")},g=async(e,t,n="SHA-256")=>{let r=await h(e,n),a=await h(t,n);return r===a};async function y(e,t="SHA-256"){let r=new TextEncoder().encode(e),a=await crypto.subtle.digest(t,r);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("")}var p=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return t.toString(16)};export{g as compareWithHash,d as createHash,h as hash,y as hashStringPromise,p as string_hash};
1
+ // src/lib/crypto/hash.ts
2
+ var createHash = async (value, algorithm = "SHA-1") => {
3
+ if (typeof window === "undefined") return null;
4
+ const { subtle } = window.globalThis.crypto;
5
+ const key = await subtle.generateKey(
6
+ {
7
+ name: "HMAC",
8
+ hash: algorithm,
9
+ length: 256
10
+ },
11
+ true,
12
+ ["sign", "verify"]
13
+ );
14
+ const enc = new TextEncoder();
15
+ const message = enc.encode(value);
16
+ const digest = await subtle.sign(
17
+ {
18
+ name: "HMAC"
19
+ },
20
+ key,
21
+ message
22
+ );
23
+ const hex = [...new Uint8Array(digest)].map((x) => x.toString(16).padStart(2, "0")).join("");
24
+ return hex;
25
+ };
26
+ var hash = async (value, algorithm = "SHA-256") => {
27
+ const encoder = new TextEncoder();
28
+ const data = encoder.encode(value);
29
+ const hashBuffer = await crypto.subtle.digest(algorithm, data);
30
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
31
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
32
+ return hashHex;
33
+ };
34
+ var compareWithHash = async (value1, value2, algorithm = "SHA-256") => {
35
+ const hash1 = await hash(value1, algorithm);
36
+ const hash2 = await hash(value2, algorithm);
37
+ return hash1 === hash2;
38
+ };
39
+ async function hashStringPromise(value, algorithm = "SHA-256") {
40
+ const encoder = new TextEncoder();
41
+ const data = encoder.encode(value);
42
+ const hashBuffer = await crypto.subtle.digest(algorithm, data);
43
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
44
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
45
+ return hashHex;
46
+ }
47
+ var string_hash = (str) => {
48
+ let hash2 = 0;
49
+ for (let i = 0; i < str.length; i++) {
50
+ const char = str.charCodeAt(i);
51
+ hash2 = (hash2 << 5) - hash2 + char;
52
+ hash2 = hash2 & hash2;
53
+ }
54
+ return hash2.toString(16);
55
+ };
56
+ export {
57
+ compareWithHash,
58
+ createHash,
59
+ hash,
60
+ hashStringPromise,
61
+ string_hash
62
+ };
@@ -1 +1,40 @@
1
- "use strict";var r=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var E=(e,n)=>{for(var o in n)r(e,o,{get:n[o],enumerable:!0})},d=(e,n,o,v)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of s(n))!a.call(e,t)&&t!==o&&r(e,t,{get:()=>n[t],enumerable:!(v=i(n,t))||v.enumerable});return e};var u=e=>d(r({},"__esModule",{value:!0}),e);var c={};E(c,{isAddRemoveListenerTarget:()=>p,isDOMEventTarget:()=>y,isNodeEventEmitter:()=>f,isOnOffTarget:()=>g});module.exports=u(c);function y(e){return e&&typeof e.addEventListener=="function"}function f(e){return e&&typeof e.addEventListener=="function"&&typeof e.removeEventListener=="function"}function g(e){return e&&typeof e.on=="function"&&typeof e.off=="function"}function p(e){return e&&typeof e.addListener=="function"&&typeof e.removeListener=="function"}
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/dom/events.ts
21
+ var events_exports = {};
22
+ __export(events_exports, {
23
+ isAddRemoveListenerTarget: () => isAddRemoveListenerTarget,
24
+ isDOMEventTarget: () => isDOMEventTarget,
25
+ isNodeEventEmitter: () => isNodeEventEmitter,
26
+ isOnOffTarget: () => isOnOffTarget
27
+ });
28
+ module.exports = __toCommonJS(events_exports);
29
+ function isDOMEventTarget(target) {
30
+ return target && typeof target.addEventListener === "function";
31
+ }
32
+ function isNodeEventEmitter(target) {
33
+ return target && typeof target.addEventListener === "function" && typeof target.removeEventListener === "function";
34
+ }
35
+ function isOnOffTarget(target) {
36
+ return target && typeof target.on === "function" && typeof target.off === "function";
37
+ }
38
+ function isAddRemoveListenerTarget(target) {
39
+ return target && typeof target.addListener === "function" && typeof target.removeListener === "function";
40
+ }
@@ -1 +1,19 @@
1
- function n(e){return e&&typeof e.addEventListener=="function"}function t(e){return e&&typeof e.addEventListener=="function"&&typeof e.removeEventListener=="function"}function o(e){return e&&typeof e.on=="function"&&typeof e.off=="function"}function r(e){return e&&typeof e.addListener=="function"&&typeof e.removeListener=="function"}export{r as isAddRemoveListenerTarget,n as isDOMEventTarget,t as isNodeEventEmitter,o as isOnOffTarget};
1
+ // src/lib/dom/events.ts
2
+ function isDOMEventTarget(target) {
3
+ return target && typeof target.addEventListener === "function";
4
+ }
5
+ function isNodeEventEmitter(target) {
6
+ return target && typeof target.addEventListener === "function" && typeof target.removeEventListener === "function";
7
+ }
8
+ function isOnOffTarget(target) {
9
+ return target && typeof target.on === "function" && typeof target.off === "function";
10
+ }
11
+ function isAddRemoveListenerTarget(target) {
12
+ return target && typeof target.addListener === "function" && typeof target.removeListener === "function";
13
+ }
14
+ export {
15
+ isAddRemoveListenerTarget,
16
+ isDOMEventTarget,
17
+ isNodeEventEmitter,
18
+ isOnOffTarget
19
+ };
@@ -1 +1,78 @@
1
- "use strict";var i=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var E=(e,n)=>{for(var r in n)i(e,r,{get:n[r],enumerable:!0})},f=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of d(n))!u.call(e,o)&&o!==r&&i(e,o,{get:()=>n[o],enumerable:!(t=v(n,o))||t.enumerable});return e};var p=e=>f(i({},"__esModule",{value:!0}),e);var M={};E(M,{aenu:()=>L,btoa:()=>x,isAddRemoveListenerTarget:()=>y,isDOMEventTarget:()=>g,isNodeEventEmitter:()=>c,isOnOffTarget:()=>l,uena:()=>b,updateQueryStringParameter:()=>h,windowObject:()=>m});module.exports=p(M);function g(e){return e&&typeof e.addEventListener=="function"}function c(e){return e&&typeof e.addEventListener=="function"&&typeof e.removeEventListener=="function"}function l(e){return e&&typeof e.on=="function"&&typeof e.off=="function"}function y(e){return e&&typeof e.addListener=="function"&&typeof e.removeListener=="function"}function m(){return typeof globalThis=="object"?globalThis:typeof window=="object"?window:typeof self=="object"?self:typeof global=="object"?global:null}function x(e){return Buffer.from(e).toString("base64")}function b(e){return Buffer.from(e).toString("base64")}function L(e){return decodeURIComponent(Buffer.from(e,"base64").toString("utf-8"))}var h=(e,n,r)=>{let t=r,o=new RegExp("([?&])"+n+"=.*?(&|$)","i"),s=e.includes("?")?"&":"?";n==="country"&&(t=JSON.parse(t).alpha_2),n==="phone"&&(t=t.trim().replace(/\s/g,""));let a=e.match(o);return typeof a<"u"&&a!==null?e.replace(o,"$1"+n+"="+t+"$2"):e+s+n+"="+t};
1
+ /*! @fluixi/utils v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/lib/dom/index.ts
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ aenu: () => aenu,
25
+ btoa: () => btoa,
26
+ isAddRemoveListenerTarget: () => isAddRemoveListenerTarget,
27
+ isDOMEventTarget: () => isDOMEventTarget,
28
+ isNodeEventEmitter: () => isNodeEventEmitter,
29
+ isOnOffTarget: () => isOnOffTarget,
30
+ uena: () => uena,
31
+ updateQueryStringParameter: () => updateQueryStringParameter,
32
+ windowObject: () => windowObject
33
+ });
34
+ module.exports = __toCommonJS(index_exports);
35
+
36
+ // src/lib/dom/events.ts
37
+ function isDOMEventTarget(target) {
38
+ return target && typeof target.addEventListener === "function";
39
+ }
40
+ function isNodeEventEmitter(target) {
41
+ return target && typeof target.addEventListener === "function" && typeof target.removeEventListener === "function";
42
+ }
43
+ function isOnOffTarget(target) {
44
+ return target && typeof target.on === "function" && typeof target.off === "function";
45
+ }
46
+ function isAddRemoveListenerTarget(target) {
47
+ return target && typeof target.addListener === "function" && typeof target.removeListener === "function";
48
+ }
49
+
50
+ // src/lib/dom/utils.ts
51
+ function windowObject() {
52
+ return typeof globalThis === "object" ? globalThis : typeof window === "object" ? window : typeof self === "object" ? self : typeof global === "object" ? global : null;
53
+ }
54
+ function btoa(chn) {
55
+ return Buffer.from(chn).toString("base64");
56
+ }
57
+ function uena(chn) {
58
+ return Buffer.from(chn).toString("base64");
59
+ }
60
+ function aenu(chn) {
61
+ return decodeURIComponent(Buffer.from(chn, "base64").toString("utf-8"));
62
+ }
63
+ var updateQueryStringParameter = (uri, key, val) => {
64
+ let value = val;
65
+ const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
66
+ const separator = uri.includes("?") ? "&" : "?";
67
+ if (key === "country") {
68
+ value = JSON.parse(value).alpha_2;
69
+ }
70
+ if (key === "phone") {
71
+ value = value.trim().replace(/\s/g, "");
72
+ }
73
+ const match = uri.match(re);
74
+ if (typeof match !== "undefined" && match !== null) {
75
+ return uri.replace(re, "$1" + key + "=" + value + "$2");
76
+ }
77
+ return uri + separator + key + "=" + value;
78
+ };
@@ -1 +1,56 @@
1
- function s(e){return e&&typeof e.addEventListener=="function"}function v(e){return e&&typeof e.addEventListener=="function"&&typeof e.removeEventListener=="function"}function d(e){return e&&typeof e.on=="function"&&typeof e.off=="function"}function u(e){return e&&typeof e.addListener=="function"&&typeof e.removeListener=="function"}function f(){return typeof globalThis=="object"?globalThis:typeof window=="object"?window:typeof self=="object"?self:typeof global=="object"?global:null}function p(e){return Buffer.from(e).toString("base64")}function g(e){return Buffer.from(e).toString("base64")}function c(e){return decodeURIComponent(Buffer.from(e,"base64").toString("utf-8"))}var l=(e,t,i)=>{let n=i,o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=e.includes("?")?"&":"?";t==="country"&&(n=JSON.parse(n).alpha_2),t==="phone"&&(n=n.trim().replace(/\s/g,""));let r=e.match(o);return typeof r<"u"&&r!==null?e.replace(o,"$1"+t+"="+n+"$2"):e+a+t+"="+n};export{c as aenu,p as btoa,u as isAddRemoveListenerTarget,s as isDOMEventTarget,v as isNodeEventEmitter,d as isOnOffTarget,g as uena,l as updateQueryStringParameter,f as windowObject};
1
+ /*! @fluixi/utils v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
2
+
3
+ // src/lib/dom/events.ts
4
+ function isDOMEventTarget(target) {
5
+ return target && typeof target.addEventListener === "function";
6
+ }
7
+ function isNodeEventEmitter(target) {
8
+ return target && typeof target.addEventListener === "function" && typeof target.removeEventListener === "function";
9
+ }
10
+ function isOnOffTarget(target) {
11
+ return target && typeof target.on === "function" && typeof target.off === "function";
12
+ }
13
+ function isAddRemoveListenerTarget(target) {
14
+ return target && typeof target.addListener === "function" && typeof target.removeListener === "function";
15
+ }
16
+
17
+ // src/lib/dom/utils.ts
18
+ function windowObject() {
19
+ return typeof globalThis === "object" ? globalThis : typeof window === "object" ? window : typeof self === "object" ? self : typeof global === "object" ? global : null;
20
+ }
21
+ function btoa(chn) {
22
+ return Buffer.from(chn).toString("base64");
23
+ }
24
+ function uena(chn) {
25
+ return Buffer.from(chn).toString("base64");
26
+ }
27
+ function aenu(chn) {
28
+ return decodeURIComponent(Buffer.from(chn, "base64").toString("utf-8"));
29
+ }
30
+ var updateQueryStringParameter = (uri, key, val) => {
31
+ let value = val;
32
+ const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
33
+ const separator = uri.includes("?") ? "&" : "?";
34
+ if (key === "country") {
35
+ value = JSON.parse(value).alpha_2;
36
+ }
37
+ if (key === "phone") {
38
+ value = value.trim().replace(/\s/g, "");
39
+ }
40
+ const match = uri.match(re);
41
+ if (typeof match !== "undefined" && match !== null) {
42
+ return uri.replace(re, "$1" + key + "=" + value + "$2");
43
+ }
44
+ return uri + separator + key + "=" + value;
45
+ };
46
+ export {
47
+ aenu,
48
+ btoa,
49
+ isAddRemoveListenerTarget,
50
+ isDOMEventTarget,
51
+ isNodeEventEmitter,
52
+ isOnOffTarget,
53
+ uena,
54
+ updateQueryStringParameter,
55
+ windowObject
56
+ };
@@ -1 +1,57 @@
1
- "use strict";var a=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var s=(t,e)=>{for(var o in e)a(t,o,{get:e[o],enumerable:!0})},p=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of u(e))!c.call(t,r)&&r!==o&&a(t,r,{get:()=>e[r],enumerable:!(n=i(e,r))||n.enumerable});return t};var g=t=>p(a({},"__esModule",{value:!0}),t);var x={};s(x,{aenu:()=>h,btoa:()=>d,uena:()=>m,updateQueryStringParameter:()=>w,windowObject:()=>b});module.exports=g(x);function b(){return typeof globalThis=="object"?globalThis:typeof window=="object"?window:typeof self=="object"?self:typeof global=="object"?global:null}function d(t){return Buffer.from(t).toString("base64")}function m(t){return Buffer.from(t).toString("base64")}function h(t){return decodeURIComponent(Buffer.from(t,"base64").toString("utf-8"))}var w=(t,e,o)=>{let n=o,r=new RegExp("([?&])"+e+"=.*?(&|$)","i"),l=t.includes("?")?"&":"?";e==="country"&&(n=JSON.parse(n).alpha_2),e==="phone"&&(n=n.trim().replace(/\s/g,""));let f=t.match(r);return typeof f<"u"&&f!==null?t.replace(r,"$1"+e+"="+n+"$2"):t+l+e+"="+n};
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/dom/utils.ts
21
+ var utils_exports = {};
22
+ __export(utils_exports, {
23
+ aenu: () => aenu,
24
+ btoa: () => btoa,
25
+ uena: () => uena,
26
+ updateQueryStringParameter: () => updateQueryStringParameter,
27
+ windowObject: () => windowObject
28
+ });
29
+ module.exports = __toCommonJS(utils_exports);
30
+ function windowObject() {
31
+ return typeof globalThis === "object" ? globalThis : typeof window === "object" ? window : typeof self === "object" ? self : typeof global === "object" ? global : null;
32
+ }
33
+ function btoa(chn) {
34
+ return Buffer.from(chn).toString("base64");
35
+ }
36
+ function uena(chn) {
37
+ return Buffer.from(chn).toString("base64");
38
+ }
39
+ function aenu(chn) {
40
+ return decodeURIComponent(Buffer.from(chn, "base64").toString("utf-8"));
41
+ }
42
+ var updateQueryStringParameter = (uri, key, val) => {
43
+ let value = val;
44
+ const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
45
+ const separator = uri.includes("?") ? "&" : "?";
46
+ if (key === "country") {
47
+ value = JSON.parse(value).alpha_2;
48
+ }
49
+ if (key === "phone") {
50
+ value = value.trim().replace(/\s/g, "");
51
+ }
52
+ const match = uri.match(re);
53
+ if (typeof match !== "undefined" && match !== null) {
54
+ return uri.replace(re, "$1" + key + "=" + value + "$2");
55
+ }
56
+ return uri + separator + key + "=" + value;
57
+ };
@@ -1 +1,36 @@
1
- function l(){return typeof globalThis=="object"?globalThis:typeof window=="object"?window:typeof self=="object"?self:typeof global=="object"?global:null}function i(t){return Buffer.from(t).toString("base64")}function u(t){return Buffer.from(t).toString("base64")}function c(t){return decodeURIComponent(Buffer.from(t,"base64").toString("utf-8"))}var s=(t,n,a)=>{let e=a,r=new RegExp("([?&])"+n+"=.*?(&|$)","i"),f=t.includes("?")?"&":"?";n==="country"&&(e=JSON.parse(e).alpha_2),n==="phone"&&(e=e.trim().replace(/\s/g,""));let o=t.match(r);return typeof o<"u"&&o!==null?t.replace(r,"$1"+n+"="+e+"$2"):t+f+n+"="+e};export{c as aenu,i as btoa,u as uena,s as updateQueryStringParameter,l as windowObject};
1
+ // src/lib/dom/utils.ts
2
+ function windowObject() {
3
+ return typeof globalThis === "object" ? globalThis : typeof window === "object" ? window : typeof self === "object" ? self : typeof global === "object" ? global : null;
4
+ }
5
+ function btoa(chn) {
6
+ return Buffer.from(chn).toString("base64");
7
+ }
8
+ function uena(chn) {
9
+ return Buffer.from(chn).toString("base64");
10
+ }
11
+ function aenu(chn) {
12
+ return decodeURIComponent(Buffer.from(chn, "base64").toString("utf-8"));
13
+ }
14
+ var updateQueryStringParameter = (uri, key, val) => {
15
+ let value = val;
16
+ const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
17
+ const separator = uri.includes("?") ? "&" : "?";
18
+ if (key === "country") {
19
+ value = JSON.parse(value).alpha_2;
20
+ }
21
+ if (key === "phone") {
22
+ value = value.trim().replace(/\s/g, "");
23
+ }
24
+ const match = uri.match(re);
25
+ if (typeof match !== "undefined" && match !== null) {
26
+ return uri.replace(re, "$1" + key + "=" + value + "$2");
27
+ }
28
+ return uri + separator + key + "=" + value;
29
+ };
30
+ export {
31
+ aenu,
32
+ btoa,
33
+ uena,
34
+ updateQueryStringParameter,
35
+ windowObject
36
+ };