@fluixi/utils 1.0.0-alpha.82 → 1.0.0-alpha.84
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/index.cjs +2858 -1
- package/dist/index.mjs +2838 -1
- package/dist/lib/array/advanced.cjs +2227 -1
- package/dist/lib/array/advanced.mjs +2204 -1
- package/dist/lib/array/array.cjs +57 -1
- package/dist/lib/array/array.mjs +36 -1
- package/dist/lib/array/index.cjs +2344 -1
- package/dist/lib/array/index.mjs +2322 -1
- package/dist/lib/array/utils.cjs +103 -1
- package/dist/lib/array/utils.mjs +82 -1
- package/dist/lib/color/color.cjs +2190 -1
- package/dist/lib/color/color.mjs +2167 -1
- package/dist/lib/color/constants.cjs +380 -1
- package/dist/lib/color/constants.mjs +359 -1
- package/dist/lib/color/conversions.cjs +629 -1
- package/dist/lib/color/conversions.mjs +608 -1
- package/dist/lib/color/helpers.cjs +2534 -1
- package/dist/lib/color/helpers.mjs +2511 -1
- package/dist/lib/color/index.cjs +2641 -1
- package/dist/lib/color/index.mjs +2619 -1
- package/dist/lib/color/types.cjs +18 -1
- package/dist/lib/color/utils.cjs +962 -1
- package/dist/lib/color/utils.mjs +939 -1
- package/dist/lib/compare/comparators.cjs +171 -1
- package/dist/lib/compare/comparators.mjs +150 -1
- package/dist/lib/compare/index.cjs +172 -1
- package/dist/lib/compare/index.mjs +152 -1
- package/dist/lib/crypto/hash.cjs +83 -1
- package/dist/lib/crypto/hash.mjs +62 -1
- package/dist/lib/crypto/index.cjs +85 -1
- package/dist/lib/crypto/index.mjs +62 -1
- package/dist/lib/dom/events.cjs +40 -1
- package/dist/lib/dom/events.mjs +19 -1
- package/dist/lib/dom/index.cjs +78 -1
- package/dist/lib/dom/index.mjs +56 -1
- package/dist/lib/dom/utils.cjs +57 -1
- package/dist/lib/dom/utils.mjs +36 -1
- package/dist/lib/functions/functions.cjs +366 -1
- package/dist/lib/functions/functions.mjs +345 -1
- package/dist/lib/functions/index.cjs +369 -1
- package/dist/lib/functions/index.mjs +347 -1
- package/dist/lib/functions/types.cjs +18 -1
- package/dist/lib/helpers.cjs +78 -1
- package/dist/lib/helpers.mjs +59 -1
- package/dist/lib/index.cjs +2857 -1
- package/dist/lib/index.mjs +2836 -1
- package/dist/lib/maths/constants.cjs +70 -1
- package/dist/lib/maths/constants.mjs +50 -1
- package/dist/lib/maths/fn/advanced.cjs +231 -1
- package/dist/lib/maths/fn/advanced.mjs +208 -1
- package/dist/lib/maths/fn/basic.cjs +212 -1
- package/dist/lib/maths/fn/basic.mjs +191 -1
- package/dist/lib/maths/fn/complex.cjs +268 -1
- package/dist/lib/maths/fn/complex.mjs +247 -1
- package/dist/lib/maths/fn/index.cjs +877 -1
- package/dist/lib/maths/fn/index.mjs +855 -1
- package/dist/lib/maths/fn/trigo.cjs +179 -1
- package/dist/lib/maths/fn/trigo.mjs +156 -1
- package/dist/lib/maths/fn/vector.cjs +728 -1
- package/dist/lib/maths/fn/vector.mjs +707 -1
- package/dist/lib/maths/formatter.cjs +61 -1
- package/dist/lib/maths/formatter.mjs +40 -1
- package/dist/lib/maths/guards.cjs +164 -1
- package/dist/lib/maths/guards.mjs +144 -1
- package/dist/lib/maths/index.cjs +1152 -1
- package/dist/lib/maths/index.mjs +1130 -1
- package/dist/lib/maths/parser.cjs +75 -1
- package/dist/lib/maths/parser.mjs +54 -1
- package/dist/lib/maths/random.cjs +49 -1
- package/dist/lib/maths/random.mjs +28 -1
- package/dist/lib/maths/types/advanced.cjs +18 -1
- package/dist/lib/maths/types/basic.cjs +18 -1
- package/dist/lib/maths/types/index.cjs +19 -1
- package/dist/lib/maths/types/index.mjs +1 -0
- package/dist/lib/maths/types/negative.cjs +18 -1
- package/dist/lib/maths/types/operations.cjs +18 -1
- package/dist/lib/object/clone.cjs +88 -1
- package/dist/lib/object/clone.mjs +65 -1
- package/dist/lib/object/diff.cjs +573 -1
- package/dist/lib/object/diff.mjs +550 -1
- package/dist/lib/object/getter-setter.cjs +2351 -1
- package/dist/lib/object/getter-setter.mjs +2330 -1
- package/dist/lib/object/index.cjs +3956 -6
- package/dist/lib/object/index.mjs +3936 -6
- package/dist/lib/object/merge.cjs +1029 -1
- package/dist/lib/object/merge.mjs +1006 -1
- package/dist/lib/object/object.cjs +280 -1
- package/dist/lib/object/object.mjs +257 -1
- package/dist/lib/object/omit.cjs +2022 -1
- package/dist/lib/object/omit.mjs +1999 -1
- package/dist/lib/object/reconcile.cjs +126 -1
- package/dist/lib/object/reconcile.mjs +105 -1
- package/dist/lib/object/selector.cjs +303 -1
- package/dist/lib/object/selector.mjs +282 -1
- package/dist/lib/object/sort.cjs +209 -1
- package/dist/lib/object/sort.mjs +186 -1
- package/dist/lib/object/transform.cjs +2211 -1
- package/dist/lib/object/transform.mjs +2190 -1
- package/dist/lib/object/types.cjs +18 -1
- package/dist/lib/object/utils.cjs +326 -6
- package/dist/lib/object/utils.mjs +305 -6
- package/dist/lib/primitive/boolean/boolean.cjs +407 -1
- package/dist/lib/primitive/boolean/boolean.mjs +386 -1
- package/dist/lib/primitive/boolean/index.cjs +382 -1
- package/dist/lib/primitive/boolean/index.mjs +359 -1
- package/dist/lib/primitive/boolean/types.cjs +18 -1
- package/dist/lib/primitive/date/date.cjs +1126 -1
- package/dist/lib/primitive/date/date.mjs +1105 -1
- package/dist/lib/primitive/date/index.cjs +1128 -1
- package/dist/lib/primitive/date/index.mjs +1105 -1
- package/dist/lib/primitive/date/types.cjs +18 -1
- package/dist/lib/primitive/index.cjs +2338 -5
- package/dist/lib/primitive/index.mjs +2316 -5
- package/dist/lib/primitive/string/index.cjs +875 -5
- package/dist/lib/primitive/string/index.mjs +852 -5
- package/dist/lib/primitive/string/parser-2.cjs +543 -8
- package/dist/lib/primitive/string/parser-2.mjs +522 -8
- package/dist/lib/primitive/string/parser.cjs +236 -3
- package/dist/lib/primitive/string/parser.mjs +215 -3
- package/dist/lib/primitive/string/string.cjs +926 -5
- package/dist/lib/primitive/string/string.mjs +903 -5
- package/dist/lib/primitive/string/types.cjs +18 -1
- package/dist/lib/primitive/types.cjs +18 -1
- package/dist/lib/url/index.cjs +327 -1
- package/dist/lib/url/index.mjs +304 -1
- package/dist/lib/url/parser.cjs +325 -1
- package/dist/lib/url/parser.mjs +304 -1
- package/dist/lib/url/types.cjs +18 -1
- package/package.json +5 -5
package/dist/lib/crypto/hash.cjs
CHANGED
|
@@ -1 +1,83 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
+
};
|
package/dist/lib/crypto/hash.mjs
CHANGED
|
@@ -1 +1,62 @@
|
|
|
1
|
-
|
|
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";
|
|
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
|
-
|
|
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
|
+
};
|
package/dist/lib/dom/events.cjs
CHANGED
|
@@ -1 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
+
}
|
package/dist/lib/dom/events.mjs
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
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
|
+
};
|
package/dist/lib/dom/index.cjs
CHANGED
|
@@ -1 +1,78 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @fluixi/utils v1.0.0-alpha.84 | (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
|
+
};
|
package/dist/lib/dom/index.mjs
CHANGED
|
@@ -1 +1,56 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @fluixi/utils v1.0.0-alpha.84 | (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
|
+
};
|
package/dist/lib/dom/utils.cjs
CHANGED
|
@@ -1 +1,57 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
+
};
|
package/dist/lib/dom/utils.mjs
CHANGED
|
@@ -1 +1,36 @@
|
|
|
1
|
-
|
|
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
|
+
};
|