@koine/utils 2.0.0-beta.10 → 2.0.0-beta.12
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/Emitter.d.ts +3 -1
- package/Emitter.mjs +3 -1
- package/accentSets.d.ts +3 -2
- package/accentSets.mjs +3 -2
- package/addOrReplaceAtIdx.d.ts +4 -0
- package/addOrReplaceAtIdx.mjs +4 -0
- package/areEqual.d.ts +1 -1
- package/areEqual.mjs +1 -1
- package/arrayOfAll.d.ts +1 -2
- package/arrayOfAll.mjs +1 -2
- package/arraySum.d.ts +2 -1
- package/arraySum.mjs +2 -1
- package/capitalize.d.ts +2 -1
- package/capitalize.mjs +2 -1
- package/chunkByChunks.d.ts +1 -1
- package/chunkByChunks.mjs +1 -1
- package/clsx.d.ts +2 -1
- package/clsx.mjs +2 -1
- package/convertRange.d.ts +3 -1
- package/convertRange.mjs +3 -1
- package/cookie.d.ts +13 -1
- package/cookie.mjs +5 -1
- package/createPalette.d.ts +3 -1
- package/createPalette.mjs +3 -1
- package/debouncePromise.d.ts +10 -2
- package/debouncePromise.mjs +6 -2
- package/debounceRaf.d.ts +1 -1
- package/debounceRaf.mjs +1 -1
- package/errorToString.d.ts +2 -1
- package/errorToString.mjs +2 -1
- package/forin.d.ts +2 -1
- package/forin.mjs +2 -1
- package/getEmptyArray.d.ts +0 -1
- package/getEmptyArray.mjs +0 -1
- package/getKeys.d.ts +2 -1
- package/getKeys.mjs +2 -1
- package/getMediaQueryWidthResolvers.d.ts +6 -0
- package/getMediaQueryWidthResolvers.mjs +5 -1
- package/getMediaQueryWidthTailwindScreens.d.ts +4 -0
- package/getMediaQueryWidthTailwindScreens.mjs +4 -1
- package/getParamAmong.d.ts +3 -2
- package/getParamAmong.mjs +3 -2
- package/getParamAsInt.d.ts +2 -2
- package/getParamAsInt.mjs +2 -2
- package/getParamAsString.d.ts +1 -1
- package/getParamAsString.mjs +1 -1
- package/getType.d.ts +0 -3
- package/getType.mjs +0 -3
- package/getUrlQueryParams.d.ts +3 -4
- package/getUrlQueryParams.mjs +3 -4
- package/index.d.ts +4 -1
- package/matchSorter.mjs +2 -2
- package/mergeObjects.d.ts +1 -1
- package/mergeObjects.mjs +1 -1
- package/mergeUrlQueryParams.d.ts +0 -1
- package/mergeUrlQueryParams.mjs +0 -1
- package/moveSortableArrayItemByKey.d.ts +1 -1
- package/moveSortableArrayItemByKey.mjs +1 -1
- package/objectOmit.d.ts +1 -1
- package/objectOmit.mjs +1 -1
- package/objectPick.d.ts +1 -1
- package/objectPick.mjs +1 -1
- package/package.json +2 -2
- package/quaranteneProps.d.ts +1 -1
- package/quaranteneProps.mjs +1 -1
- package/readCookie.d.ts +5 -0
- package/removeCookie.d.ts +0 -4
- package/removeCookie.mjs +0 -4
- package/removeUrlQueryParams.d.ts +0 -1
- package/removeUrlQueryParams.mjs +0 -1
- package/render.d.ts +2 -1
- package/render.mjs +2 -1
- package/serializeCookie.d.ts +1 -5
- package/serializeCookie.mjs +1 -5
- package/setCookie.d.ts +0 -4
- package/setCookie.mjs +0 -4
- package/shuffle.d.ts +7 -6
- package/shuffle.mjs +7 -6
- package/slugify.d.ts +2 -1
- package/slugify.mjs +2 -1
- package/split.d.ts +4 -0
- package/split.mjs +4 -1
- package/swapMap.d.ts +1 -1
- package/swapMap.mjs +1 -1
- package/throttle.d.ts +1 -1
- package/throttle.mjs +1 -1
- package/titleCase.d.ts +4 -3
- package/titleCase.mjs +4 -3
- package/truncate.d.ts +1 -1
- package/truncate.mjs +1 -1
- package/tryUntil.d.ts +4 -1
- package/tryUntil.mjs +4 -1
- package/typings.d.ts +1 -6
- package/updateUrlQueryParams.d.ts +0 -1
- package/updateUrlQueryParams.mjs +0 -1
- package/uppercase.d.ts +1 -0
- package/uppercase.mjs +1 -0
- package/Defer.js +0 -35
- package/Emitter.js +0 -53
- package/accentSets.js +0 -133
- package/addOrReplaceAtIdx.js +0 -40
- package/areEqual.js +0 -75
- package/arrayOfAll.js +0 -45
- package/arraySum.js +0 -24
- package/arrayToLookup.js +0 -29
- package/buildUrlQueryString.js +0 -39
- package/capitalize.js +0 -28
- package/changeUrlPath.js +0 -29
- package/chunkByChunks.js +0 -52
- package/chunkBySize.js +0 -29
- package/clamp.js +0 -27
- package/clsx.js +0 -60
- package/convertRange.js +0 -33
- package/cookie.js +0 -21
- package/createPalette.js +0 -39
- package/debounce.js +0 -39
- package/debouncePromise.js +0 -87
- package/debounceRaf.js +0 -40
- package/decode.js +0 -27
- package/encode.js +0 -27
- package/ensureInt.js +0 -24
- package/env.js +0 -3
- package/errorToString.js +0 -22
- package/findDuplicatedIndexes.js +0 -31
- package/forin.js +0 -28
- package/gbToBytes.js +0 -24
- package/getEmptyArray.js +0 -29
- package/getKeys.js +0 -26
- package/getMediaQueryWidthResolvers.js +0 -81
- package/getMediaQueryWidthTailwindScreens.js +0 -51
- package/getNonce.js +0 -23
- package/getParamAmong.js +0 -25
- package/getParamAsInt.js +0 -28
- package/getParamAsString.js +0 -24
- package/getType.js +0 -30
- package/getUrlHashParams.js +0 -27
- package/getUrlHashPathname.js +0 -29
- package/getUrlPathnameParts.js +0 -25
- package/getUrlQueryParams.js +0 -36
- package/imgEmptyPixel.js +0 -24
- package/index.js +0 -532
- package/invariant.js +0 -50
- package/isAnyObject.js +0 -24
- package/isArray.js +0 -24
- package/isBlob.js +0 -24
- package/isBoolean.js +0 -24
- package/isBrowser.js +0 -23
- package/isBrowserNow.js +0 -22
- package/isDate.js +0 -24
- package/isEmptyArray.js +0 -24
- package/isEmptyObject.js +0 -24
- package/isEmptyString.js +0 -26
- package/isError.js +0 -24
- package/isExternalUrl.js +0 -32
- package/isFile.js +0 -24
- package/isFloat.js +0 -24
- package/isFormData.js +0 -24
- package/isFullArray.js +0 -24
- package/isFullObject.js +0 -24
- package/isFullString.js +0 -24
- package/isFunction.js +0 -22
- package/isInt.js +0 -24
- package/isMap.js +0 -24
- package/isNaNValue.js +0 -24
- package/isNegativeNumber.js +0 -24
- package/isNull.js +0 -24
- package/isNullOrUndefined.js +0 -24
- package/isNumber.js +0 -24
- package/isObject.js +0 -24
- package/isObjectLike.js +0 -24
- package/isOneOf.js +0 -22
- package/isPlainObject.js +0 -25
- package/isPositiveNumber.js +0 -24
- package/isPrimitive.js +0 -29
- package/isPromise.js +0 -24
- package/isRegExp.js +0 -24
- package/isServer.js +0 -23
- package/isServerNow.js +0 -22
- package/isSet.js +0 -24
- package/isString.js +0 -24
- package/isSymbol.js +0 -24
- package/isType.js +0 -32
- package/isUndefined.js +0 -24
- package/isWeakMap.js +0 -24
- package/isWeakSet.js +0 -24
- package/kbToBytes.js +0 -24
- package/location.js +0 -6
- package/lowercase.js +0 -24
- package/mapListBy.js +0 -29
- package/matchSorter.js +0 -373
- package/mbToBytes.js +0 -24
- package/mergeObjects.js +0 -39
- package/mergeUrlQueryParams.js +0 -32
- package/moveSortableArrayItemByKey.js +0 -35
- package/noop.js +0 -24
- package/normaliseUrl.js +0 -24
- package/normaliseUrlPathname.js +0 -24
- package/objectOmit.js +0 -35
- package/objectPick.js +0 -32
- package/parseCookie.js +0 -55
- package/parseURL.js +0 -37
- package/quaranteneProps.js +0 -49
- package/randomInt.js +0 -26
- package/randomKey.js +0 -28
- package/readCookie.js +0 -51
- package/removeAccents.js +0 -28
- package/removeCookie.js +0 -28
- package/removeDuplicates.js +0 -13
- package/removeDuplicatesByKey.js +0 -36
- package/removeDuplicatesComparing.js +0 -25
- package/removeIndexesFromArray.js +0 -31
- package/removeTrailingSlash.js +0 -26
- package/removeUrlQueryParams.js +0 -33
- package/render.js +0 -93
- package/roundTo.js +0 -50
- package/serializeCookie.js +0 -102
- package/setCookie.js +0 -68
- package/shuffle.js +0 -50
- package/slugify.js +0 -35
- package/split.js +0 -22
- package/swapMap.js +0 -30
- package/throttle.js +0 -38
- package/titleCase.js +0 -24
- package/toNumber.js +0 -23
- package/toRgba.js +0 -32
- package/transformToUrlPathname.js +0 -24
- package/truncate.js +0 -24
- package/tryUntil.js +0 -42
- package/types.js +0 -5
- package/uid.js +0 -24
- package/updateLinkParams.js +0 -26
- package/updateUrlQueryParams.js +0 -28
- package/uppercase.js +0 -24
- package/uuid.js +0 -28
- package/uuidNumeric.js +0 -23
- package/wait.js +0 -24
- package/without.js +0 -55
package/accentSets.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* First value is the `to`, second is `from`, from *which* chars do we translates *to*
|
|
3
|
-
*
|
|
4
|
-
* @category text
|
|
5
|
-
*/ "use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
function _export(target, all) {
|
|
10
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: all[name]
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
_export(exports, {
|
|
16
|
-
accentsSets: function() {
|
|
17
|
-
return accentsSets;
|
|
18
|
-
},
|
|
19
|
-
default: function() {
|
|
20
|
-
return _default;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const accentsSets = [
|
|
24
|
-
[
|
|
25
|
-
"a",
|
|
26
|
-
"ÀÁÂÃÅÆĀĂĄẠẢẤẦẨẪẬẮẰẲẴẶ"
|
|
27
|
-
],
|
|
28
|
-
[
|
|
29
|
-
"ae",
|
|
30
|
-
"Ä"
|
|
31
|
-
],
|
|
32
|
-
[
|
|
33
|
-
"c",
|
|
34
|
-
"ÇĆĈČ"
|
|
35
|
-
],
|
|
36
|
-
[
|
|
37
|
-
"d",
|
|
38
|
-
"ÐĎĐÞ"
|
|
39
|
-
],
|
|
40
|
-
[
|
|
41
|
-
"e",
|
|
42
|
-
"ÈÉÊËĒĔĖĘĚẸẺẼẾỀỂỄỆ"
|
|
43
|
-
],
|
|
44
|
-
[
|
|
45
|
-
"g",
|
|
46
|
-
"ĜĞĢǴ"
|
|
47
|
-
],
|
|
48
|
-
[
|
|
49
|
-
"h",
|
|
50
|
-
"ĤḦ"
|
|
51
|
-
],
|
|
52
|
-
[
|
|
53
|
-
"i",
|
|
54
|
-
"ÌÍÎÏĨĪĮİỈỊ"
|
|
55
|
-
],
|
|
56
|
-
[
|
|
57
|
-
"j",
|
|
58
|
-
"Ĵ"
|
|
59
|
-
],
|
|
60
|
-
[
|
|
61
|
-
"ij",
|
|
62
|
-
"IJ"
|
|
63
|
-
],
|
|
64
|
-
[
|
|
65
|
-
"k",
|
|
66
|
-
"Ķ"
|
|
67
|
-
],
|
|
68
|
-
[
|
|
69
|
-
"l",
|
|
70
|
-
"ĹĻĽŁ"
|
|
71
|
-
],
|
|
72
|
-
[
|
|
73
|
-
"m",
|
|
74
|
-
"Ḿ"
|
|
75
|
-
],
|
|
76
|
-
[
|
|
77
|
-
"n",
|
|
78
|
-
"ÑŃŅŇ"
|
|
79
|
-
],
|
|
80
|
-
[
|
|
81
|
-
"o",
|
|
82
|
-
"ÒÓÔÕØŌŎŐỌỎỐỒỔỖỘỚỜỞỠỢǪǬƠ"
|
|
83
|
-
],
|
|
84
|
-
[
|
|
85
|
-
"oe",
|
|
86
|
-
"΅"
|
|
87
|
-
],
|
|
88
|
-
[
|
|
89
|
-
"p",
|
|
90
|
-
"ṕ"
|
|
91
|
-
],
|
|
92
|
-
[
|
|
93
|
-
"r",
|
|
94
|
-
"ŔŖŘ"
|
|
95
|
-
],
|
|
96
|
-
[
|
|
97
|
-
"s",
|
|
98
|
-
"ŚŜŞŠ"
|
|
99
|
-
],
|
|
100
|
-
[
|
|
101
|
-
"ss",
|
|
102
|
-
"ß"
|
|
103
|
-
],
|
|
104
|
-
[
|
|
105
|
-
"t",
|
|
106
|
-
"ŢŤ"
|
|
107
|
-
],
|
|
108
|
-
[
|
|
109
|
-
"u",
|
|
110
|
-
"ÙÚÛŨŪŬŮŰŲỤỦỨỪỬỮỰƯ"
|
|
111
|
-
],
|
|
112
|
-
[
|
|
113
|
-
"ue",
|
|
114
|
-
"Ü"
|
|
115
|
-
],
|
|
116
|
-
[
|
|
117
|
-
"w",
|
|
118
|
-
"ẂŴẀẄ"
|
|
119
|
-
],
|
|
120
|
-
[
|
|
121
|
-
"x",
|
|
122
|
-
"ẍ"
|
|
123
|
-
],
|
|
124
|
-
[
|
|
125
|
-
"y",
|
|
126
|
-
"ÝŶŸỲỴỶỸ"
|
|
127
|
-
],
|
|
128
|
-
[
|
|
129
|
-
"z",
|
|
130
|
-
"ŹŻŽ"
|
|
131
|
-
]
|
|
132
|
-
];
|
|
133
|
-
const _default = accentsSets;
|
package/addOrReplaceAtIdx.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category array
|
|
3
|
-
*/ "use strict";
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
function _export(target, all) {
|
|
8
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: all[name]
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
_export(exports, {
|
|
14
|
-
addOrReplaceAtIdx: function() {
|
|
15
|
-
return addOrReplaceAtIdx;
|
|
16
|
-
},
|
|
17
|
-
default: function() {
|
|
18
|
-
return _default;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
function addOrReplaceAtIdx(list, newItem, newIdx) {
|
|
22
|
-
if (list.length === 0) {
|
|
23
|
-
return [
|
|
24
|
-
newItem
|
|
25
|
-
];
|
|
26
|
-
}
|
|
27
|
-
if (typeof newIdx === "undefined" || list.length - 1 < newIdx) {
|
|
28
|
-
return [
|
|
29
|
-
...list,
|
|
30
|
-
newItem
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
return list.map((item, idx)=>{
|
|
34
|
-
if (idx === newIdx) {
|
|
35
|
-
return newItem;
|
|
36
|
-
}
|
|
37
|
-
return item;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
const _default = addOrReplaceAtIdx;
|
package/areEqual.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
areEqual: function() {
|
|
13
|
-
return areEqual;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _isArray = require("./isArray");
|
|
20
|
-
const _isObject = require("./isObject");
|
|
21
|
-
function areEqualArrays(a, b) {
|
|
22
|
-
if (!b) return false;
|
|
23
|
-
if (a.length !== b.length) return false;
|
|
24
|
-
for(let i = 0; i < a.length; i++){
|
|
25
|
-
const aValue = a[i];
|
|
26
|
-
const bValue = b[i];
|
|
27
|
-
if (!areEqual(aValue, bValue)) return false;
|
|
28
|
-
}
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
function areEqualObjects(a, b) {
|
|
32
|
-
if (!b) return false;
|
|
33
|
-
const aKeys = Object.keys(a);
|
|
34
|
-
const bKeys = Object.keys(b);
|
|
35
|
-
if (aKeys.length !== bKeys.length) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
for (const _key of aKeys){
|
|
39
|
-
const key = _key;
|
|
40
|
-
const aValue = a[key];
|
|
41
|
-
const bValue = b[key];
|
|
42
|
-
if (!areEqual(aValue, bValue)) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
function areEqual(a, b) {
|
|
49
|
-
if (!a && !b) {
|
|
50
|
-
// console.log(`areEqual took ${performance.now() - t0} ms`);
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
// const t0 = performance.now();
|
|
54
|
-
if (!b && a !== b) {
|
|
55
|
-
// console.log(`areEqual took ${performance.now() - t0} ms`);
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
const areObjects = (0, _isObject.isObject)(a) && (0, _isObject.isObject)(b);
|
|
59
|
-
if (areObjects && !areEqualObjects(a, b)) {
|
|
60
|
-
// console.log(`areEqual took ${performance.now() - t0} ms`);
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
const areArrays = (0, _isArray.isArray)(a) && (0, _isArray.isArray)(b);
|
|
64
|
-
if (areArrays && !areEqualArrays(a, b)) {
|
|
65
|
-
// console.log(`areEqual took ${performance.now() - t0} ms`);
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
if (!areObjects && !areArrays && a !== b) {
|
|
69
|
-
// console.log(`areEqual took ${performance.now() - t0} ms`);
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
// console.log(`areEqual took ${performance.now() - t0} ms`);
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
const _default = areEqual;
|
package/arrayOfAll.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensure an array contains all desired values
|
|
3
|
-
*
|
|
4
|
-
* @category array
|
|
5
|
-
* @borrows [SO comment by `CertainPerformance`](https://stackoverflow.com/a/60132060/1938970)
|
|
6
|
-
*
|
|
7
|
-
* @usage
|
|
8
|
-
*
|
|
9
|
-
* ```
|
|
10
|
-
* type Fruit = "pear" | "apple" | "orange";
|
|
11
|
-
*
|
|
12
|
-
* const arrayOfAllFruits = arrayOfAll<Fruit>();
|
|
13
|
-
*
|
|
14
|
-
* const allFruits = arrayOfAllFruits([
|
|
15
|
-
* "pear",
|
|
16
|
-
* "apple",
|
|
17
|
-
* "orange"
|
|
18
|
-
* ]); // ts compiler ok
|
|
19
|
-
*
|
|
20
|
-
* const allFruits = arrayOfAllFruits([
|
|
21
|
-
* "pear",
|
|
22
|
-
* "apple",
|
|
23
|
-
* ]); // ts compiler fails
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
*/ "use strict";
|
|
27
|
-
Object.defineProperty(exports, "__esModule", {
|
|
28
|
-
value: true
|
|
29
|
-
});
|
|
30
|
-
function _export(target, all) {
|
|
31
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: all[name]
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
_export(exports, {
|
|
37
|
-
arrayOfAll: function() {
|
|
38
|
-
return arrayOfAll;
|
|
39
|
-
},
|
|
40
|
-
default: function() {
|
|
41
|
-
return _default;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const arrayOfAll = ()=>(array)=>array;
|
|
45
|
-
const _default = arrayOfAll;
|
package/arraySum.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sum array of numbers
|
|
3
|
-
*
|
|
4
|
-
* @category array | math
|
|
5
|
-
*/ "use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
function _export(target, all) {
|
|
10
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: all[name]
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
_export(exports, {
|
|
16
|
-
arraySum: function() {
|
|
17
|
-
return arraySum;
|
|
18
|
-
},
|
|
19
|
-
default: function() {
|
|
20
|
-
return _default;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const arraySum = (numbers)=>numbers.reduce((sum, current)=>sum + current, 0);
|
|
24
|
-
const _default = arraySum;
|
package/arrayToLookup.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps a simple flat array to a lookup dictionary object
|
|
3
|
-
*
|
|
4
|
-
* @category array
|
|
5
|
-
*/ "use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
function _export(target, all) {
|
|
10
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: all[name]
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
_export(exports, {
|
|
16
|
-
arrayToLookup: function() {
|
|
17
|
-
return arrayToLookup;
|
|
18
|
-
},
|
|
19
|
-
default: function() {
|
|
20
|
-
return _default;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
function arrayToLookup(array = []) {
|
|
24
|
-
return array.reduce((obj, item)=>{
|
|
25
|
-
obj[item] = 1;
|
|
26
|
-
return obj;
|
|
27
|
-
}, {});
|
|
28
|
-
}
|
|
29
|
-
const _default = arrayToLookup;
|
package/buildUrlQueryString.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
buildUrlQueryString: function() {
|
|
13
|
-
return buildUrlQueryString;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _isArray = /*#__PURE__*/ _interop_require_default._(require("./isArray"));
|
|
21
|
-
const _isNull = /*#__PURE__*/ _interop_require_default._(require("./isNull"));
|
|
22
|
-
const _isUndefined = /*#__PURE__*/ _interop_require_default._(require("./isUndefined"));
|
|
23
|
-
function buildUrlQueryString(params) {
|
|
24
|
-
let output = "";
|
|
25
|
-
if (!params) return output;
|
|
26
|
-
for(const key in params){
|
|
27
|
-
const value = params[key];
|
|
28
|
-
if ((0, _isArray.default)(value)) {
|
|
29
|
-
for(let i = 0; i < value.length; i++){
|
|
30
|
-
output += `${key}=${encodeURIComponent(value[i] + "")}&`;
|
|
31
|
-
}
|
|
32
|
-
} else if (!(0, _isNull.default)(value) && !(0, _isUndefined.default)(value)) {
|
|
33
|
-
output += `${key}=${encodeURIComponent(value + "")}&`;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
// removes the last &
|
|
37
|
-
return output ? `?${output.replace(/&+$/, "")}` : "";
|
|
38
|
-
}
|
|
39
|
-
const _default = buildUrlQueryString;
|
package/capitalize.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Capitalize first letter of the given string.
|
|
3
|
-
*
|
|
4
|
-
* @category text
|
|
5
|
-
* @see https://stackoverflow.com/a/11409944/1938970
|
|
6
|
-
*/ "use strict";
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
function _export(target, all) {
|
|
11
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: all[name]
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
_export(exports, {
|
|
17
|
-
capitalize: function() {
|
|
18
|
-
return capitalize;
|
|
19
|
-
},
|
|
20
|
-
default: function() {
|
|
21
|
-
return _default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
function capitalize(string) {
|
|
25
|
-
const ensuredString = string || "";
|
|
26
|
-
return ensuredString.charAt(0).toUpperCase() + ensuredString.slice(1);
|
|
27
|
-
}
|
|
28
|
-
const _default = capitalize;
|
package/changeUrlPath.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
changeUrlPath: function() {
|
|
13
|
-
return changeUrlPath;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _isBrowser = /*#__PURE__*/ _interop_require_default._(require("./isBrowser"));
|
|
21
|
-
const _normaliseUrlPathname = /*#__PURE__*/ _interop_require_default._(require("./normaliseUrlPathname"));
|
|
22
|
-
function changeUrlPath(pathname, state, replace) {
|
|
23
|
-
const path = (0, _normaliseUrlPathname.default)(`/${pathname}/`);
|
|
24
|
-
if (_isBrowser.default) {
|
|
25
|
-
history[replace ? "replaceState" : "pushState"](state, "", path);
|
|
26
|
-
}
|
|
27
|
-
return path;
|
|
28
|
-
}
|
|
29
|
-
const _default = changeUrlPath;
|
package/chunkByChunks.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TODO: untested
|
|
3
|
-
* @category array
|
|
4
|
-
* @see https://stackoverflow.com/a/8189268/1938970
|
|
5
|
-
*/ "use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
function _export(target, all) {
|
|
10
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: all[name]
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
_export(exports, {
|
|
16
|
-
chunkByChunks: function() {
|
|
17
|
-
return chunkByChunks;
|
|
18
|
-
},
|
|
19
|
-
default: function() {
|
|
20
|
-
return _default;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
function chunkByChunks(arr, nrOfChunks, balanced) {
|
|
24
|
-
if (nrOfChunks < 2) return [
|
|
25
|
-
arr
|
|
26
|
-
];
|
|
27
|
-
const len = arr.length;
|
|
28
|
-
const output = [];
|
|
29
|
-
let i = 0;
|
|
30
|
-
let size;
|
|
31
|
-
if (len % nrOfChunks === 0) {
|
|
32
|
-
size = Math.floor(len / nrOfChunks);
|
|
33
|
-
while(i < len){
|
|
34
|
-
output.push(arr.slice(i, i += size));
|
|
35
|
-
}
|
|
36
|
-
} else if (balanced) {
|
|
37
|
-
while(i < len){
|
|
38
|
-
size = Math.ceil((len - i) / nrOfChunks--);
|
|
39
|
-
output.push(arr.slice(i, i += size));
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
nrOfChunks--;
|
|
43
|
-
size = Math.floor(len / nrOfChunks);
|
|
44
|
-
if (len % size === 0) size--;
|
|
45
|
-
while(i < size * nrOfChunks){
|
|
46
|
-
output.push(arr.slice(i, i += size));
|
|
47
|
-
}
|
|
48
|
-
output.push(arr.slice(size * nrOfChunks));
|
|
49
|
-
}
|
|
50
|
-
return output;
|
|
51
|
-
}
|
|
52
|
-
const _default = chunkByChunks;
|
package/chunkBySize.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category array
|
|
3
|
-
* @see https://stackoverflow.com/a/40682136/1938970
|
|
4
|
-
*/ "use strict";
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
function _export(target, all) {
|
|
9
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: all[name]
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
_export(exports, {
|
|
15
|
-
chunkBySize: function() {
|
|
16
|
-
return chunkBySize;
|
|
17
|
-
},
|
|
18
|
-
default: function() {
|
|
19
|
-
return _default;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
function chunkBySize(arr, size) {
|
|
23
|
-
const output = [];
|
|
24
|
-
for(let i = 0; i < arr.length; i += size){
|
|
25
|
-
output.push(arr.slice(i, i + size));
|
|
26
|
-
}
|
|
27
|
-
return output;
|
|
28
|
-
}
|
|
29
|
-
const _default = chunkBySize;
|
package/clamp.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a number whose value is limited to the given range.
|
|
3
|
-
*
|
|
4
|
-
* @category math
|
|
5
|
-
* @see https://stackoverflow.com/a/11409944/1938970
|
|
6
|
-
*/ "use strict";
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
function _export(target, all) {
|
|
11
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: all[name]
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
_export(exports, {
|
|
17
|
-
clamp: function() {
|
|
18
|
-
return clamp;
|
|
19
|
-
},
|
|
20
|
-
default: function() {
|
|
21
|
-
return _default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
function clamp(num, min, max) {
|
|
25
|
-
return Math.min(Math.max(num, min), max);
|
|
26
|
-
}
|
|
27
|
-
const _default = clamp;
|
package/clsx.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// import type { ClassValue } from "clsx";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
function _export(target, all) {
|
|
7
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: all[name]
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
_export(exports, {
|
|
13
|
-
clsx: function() {
|
|
14
|
-
return clsx;
|
|
15
|
-
},
|
|
16
|
-
default: function() {
|
|
17
|
-
return _default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
// import _clsx from "clsx";
|
|
21
|
-
// export const clsx = _clsx;
|
|
22
|
-
function toVal(mix) {
|
|
23
|
-
let k, y, str = "";
|
|
24
|
-
if (typeof mix === "string" || typeof mix === "number") {
|
|
25
|
-
str += mix;
|
|
26
|
-
} else if (typeof mix === "object") {
|
|
27
|
-
if (Array.isArray(mix)) {
|
|
28
|
-
for(k = 0; k < mix.length; k++){
|
|
29
|
-
if (mix[k]) {
|
|
30
|
-
if (y = toVal(mix[k])) {
|
|
31
|
-
str && (str += " ");
|
|
32
|
-
str += y;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
for(k in mix){
|
|
38
|
-
if (mix[k]) {
|
|
39
|
-
str && (str += " ");
|
|
40
|
-
str += k;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return str;
|
|
46
|
-
}
|
|
47
|
-
const clsx = function() {
|
|
48
|
-
let i = 0, tmp, x, str = "";
|
|
49
|
-
while(i < arguments.length){
|
|
50
|
-
// eslint-disable-next-line prefer-rest-params
|
|
51
|
-
if (tmp = arguments[i++]) {
|
|
52
|
-
if (x = toVal(tmp)) {
|
|
53
|
-
str && (str += " ");
|
|
54
|
-
str += x;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return str;
|
|
59
|
-
};
|
|
60
|
-
const _default = clsx;
|
package/convertRange.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert range of a number
|
|
3
|
-
*
|
|
4
|
-
* e.g. converting number 5 in a scale/range from 0 10 to a scale/range from 50
|
|
5
|
-
* to 100 would return 75
|
|
6
|
-
* ```
|
|
7
|
-
* convertRange(5, [0, 10], [50, 100]);
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
* @category math
|
|
11
|
-
* @see https://stackoverflow.com/a/14224813
|
|
12
|
-
*/ "use strict";
|
|
13
|
-
Object.defineProperty(exports, "__esModule", {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
|
16
|
-
function _export(target, all) {
|
|
17
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: all[name]
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
_export(exports, {
|
|
23
|
-
convertRange: function() {
|
|
24
|
-
return convertRange;
|
|
25
|
-
},
|
|
26
|
-
default: function() {
|
|
27
|
-
return _default;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
function convertRange(num, r1, r2) {
|
|
31
|
-
return (num - r1[0]) * (r2[1] - r2[0]) / (r1[1] - r1[0]) + r2[0];
|
|
32
|
-
}
|
|
33
|
-
const _default = convertRange;
|
package/cookie.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
* @category cookie
|
|
5
|
-
*
|
|
6
|
-
* All cookie related code is inspired and adapted from:
|
|
7
|
-
* - [js-cookie](https://github.com/js-cookie/js-cookie)
|
|
8
|
-
* - [cookie](https://github.com/jshttp/cookie)
|
|
9
|
-
*/ "use strict";
|
|
10
|
-
Object.defineProperty(exports, "__esModule", {
|
|
11
|
-
value: true
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "defaultAttributesClient", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function() {
|
|
16
|
-
return defaultAttributesClient;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const defaultAttributesClient = {
|
|
20
|
-
path: "/"
|
|
21
|
-
};
|