@koine/utils 2.0.0-beta.10 → 2.0.0-beta.11
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/createPalette.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
|
-
createPalette: function() {
|
|
13
|
-
return createPalette;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const createPalette = (name, shades)=>{
|
|
20
|
-
const map = shades.reduce((map, def)=>{
|
|
21
|
-
map[def[0]] = def[1];
|
|
22
|
-
return map;
|
|
23
|
-
}, {});
|
|
24
|
-
// NOTE: the following breaks typedoc, with `any` it compiles
|
|
25
|
-
// const map = shades.reduce((map, def) => {
|
|
26
|
-
// map[def[0]] = def[1] as TColor;
|
|
27
|
-
// return map;
|
|
28
|
-
// }, {} as { [s: string]: TColor });
|
|
29
|
-
const tailwindPalette = shades.reduce((map, def)=>{
|
|
30
|
-
map[`${name}-${def[0]}`] = def[1];
|
|
31
|
-
return map;
|
|
32
|
-
}, {});
|
|
33
|
-
return [
|
|
34
|
-
map,
|
|
35
|
-
tailwindPalette,
|
|
36
|
-
Object.values(map)
|
|
37
|
-
];
|
|
38
|
-
};
|
|
39
|
-
const _default = createPalette;
|
package/debounce.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debounce function (with `setTimeout`)
|
|
3
|
-
*
|
|
4
|
-
* @category function
|
|
5
|
-
* @borrows [davidwalsh/debounce](https://davidwalsh.name/javascript-debounce-function)
|
|
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
|
-
debounce: function() {
|
|
18
|
-
return debounce;
|
|
19
|
-
},
|
|
20
|
-
default: function() {
|
|
21
|
-
return _default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
function debounce(fn, wait, immediate) {
|
|
25
|
-
let timeout;
|
|
26
|
-
return function(...args) {
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
28
|
-
const context = this;
|
|
29
|
-
const later = function() {
|
|
30
|
-
timeout = null;
|
|
31
|
-
if (!immediate) fn.apply(context, args);
|
|
32
|
-
};
|
|
33
|
-
const callNow = immediate && !timeout;
|
|
34
|
-
if (timeout) clearTimeout(timeout);
|
|
35
|
-
timeout = setTimeout(later, wait);
|
|
36
|
-
if (callNow) fn.apply(context, args);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
const _default = debounce;
|
package/debouncePromise.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// import { debounce as tsDebounce } from "ts-debounce";
|
|
2
|
-
// export { type Options as DebounceOptions } from "ts-debounce";
|
|
3
|
-
// export { type DebouncedFunction } from "ts-debounce";
|
|
4
|
-
// /**
|
|
5
|
-
// * Debounce function (with `Promise`)
|
|
6
|
-
// *
|
|
7
|
-
// * @category function
|
|
8
|
-
// * @borrows [chodorowicz/ts-debounce](https://github.com/chodorowicz/ts-debounce)
|
|
9
|
-
// */
|
|
10
|
-
// export const debouncePromise = tsDebounce;
|
|
11
|
-
// export default debouncePromise;
|
|
12
|
-
/**
|
|
13
|
-
* @file Copy pasted from https://github.com/chodorowicz/ts-debounce/blob/master/src/index.ts
|
|
14
|
-
*/ "use strict";
|
|
15
|
-
Object.defineProperty(exports, "__esModule", {
|
|
16
|
-
value: true
|
|
17
|
-
});
|
|
18
|
-
function _export(target, all) {
|
|
19
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: all[name]
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
_export(exports, {
|
|
25
|
-
debouncePromise: function() {
|
|
26
|
-
return debouncePromise;
|
|
27
|
-
},
|
|
28
|
-
default: function() {
|
|
29
|
-
return _default;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
function debouncePromise(func, waitMilliseconds = 50, options = {}) {
|
|
33
|
-
let timeoutId;
|
|
34
|
-
const isImmediate = options.isImmediate ?? false;
|
|
35
|
-
const callback = options.callback ?? false;
|
|
36
|
-
const maxWait = options.maxWait;
|
|
37
|
-
let lastInvokeTime = Date.now();
|
|
38
|
-
let promises = [];
|
|
39
|
-
function nextInvokeTimeout() {
|
|
40
|
-
if (maxWait !== undefined) {
|
|
41
|
-
const timeSinceLastInvocation = Date.now() - lastInvokeTime;
|
|
42
|
-
if (timeSinceLastInvocation + waitMilliseconds >= maxWait) {
|
|
43
|
-
return maxWait - timeSinceLastInvocation;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return waitMilliseconds;
|
|
47
|
-
}
|
|
48
|
-
const debouncedFunction = function(...args) {
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
50
|
-
const context = this;
|
|
51
|
-
return new Promise((resolve, reject)=>{
|
|
52
|
-
const invokeFunction = function() {
|
|
53
|
-
timeoutId = undefined;
|
|
54
|
-
lastInvokeTime = Date.now();
|
|
55
|
-
if (!isImmediate) {
|
|
56
|
-
const result = func.apply(context, args);
|
|
57
|
-
callback && callback(result);
|
|
58
|
-
promises.forEach(({ resolve })=>resolve(result));
|
|
59
|
-
promises = [];
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const shouldCallNow = isImmediate && timeoutId === undefined;
|
|
63
|
-
if (timeoutId !== undefined) {
|
|
64
|
-
clearTimeout(timeoutId);
|
|
65
|
-
}
|
|
66
|
-
timeoutId = setTimeout(invokeFunction, nextInvokeTimeout());
|
|
67
|
-
if (shouldCallNow) {
|
|
68
|
-
const result = func.apply(context, args);
|
|
69
|
-
callback && callback(result);
|
|
70
|
-
return resolve(result);
|
|
71
|
-
}
|
|
72
|
-
promises.push({
|
|
73
|
-
resolve,
|
|
74
|
-
reject
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
debouncedFunction.cancel = function(reason) {
|
|
79
|
-
if (timeoutId !== undefined) {
|
|
80
|
-
clearTimeout(timeoutId);
|
|
81
|
-
}
|
|
82
|
-
promises.forEach(({ reject })=>reject(reason));
|
|
83
|
-
promises = [];
|
|
84
|
-
};
|
|
85
|
-
return debouncedFunction;
|
|
86
|
-
}
|
|
87
|
-
const _default = debouncePromise;
|
package/debounceRaf.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debounce function (with `requestAnimationFrame`)
|
|
3
|
-
*
|
|
4
|
-
* (c) 2021 Chris Ferdinandi, MIT License, https://gomakethings.com
|
|
5
|
-
* @category function
|
|
6
|
-
* @borrows [vanillajstoolkit/debounce](https://vanillajstoolkit.com/helpers/debounce/)
|
|
7
|
-
*/ "use strict";
|
|
8
|
-
Object.defineProperty(exports, "__esModule", {
|
|
9
|
-
value: true
|
|
10
|
-
});
|
|
11
|
-
function _export(target, all) {
|
|
12
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: all[name]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
_export(exports, {
|
|
18
|
-
debounceRaf: function() {
|
|
19
|
-
return debounceRaf;
|
|
20
|
-
},
|
|
21
|
-
default: function() {
|
|
22
|
-
return _default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
function debounceRaf(fn) {
|
|
26
|
-
let timeout;
|
|
27
|
-
return function(...args) {
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
29
|
-
const context = this;
|
|
30
|
-
// If there's a timer, cancel it
|
|
31
|
-
if (timeout) {
|
|
32
|
-
window.cancelAnimationFrame(timeout);
|
|
33
|
-
}
|
|
34
|
-
// Setup the new requestAnimationFrame()
|
|
35
|
-
timeout = window.requestAnimationFrame(function() {
|
|
36
|
-
fn.apply(context, args);
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
const _default = debounceRaf;
|
package/decode.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category security
|
|
3
|
-
* @see https://stackoverflow.com/a/22405578/9122820
|
|
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
|
-
decode: function() {
|
|
16
|
-
return decode;
|
|
17
|
-
},
|
|
18
|
-
default: function() {
|
|
19
|
-
return _default;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
function decode(str) {
|
|
23
|
-
return str.replace(/.{3}/g, function(c) {
|
|
24
|
-
return String.fromCharCode(parseInt(c, 10));
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
const _default = decode;
|
package/encode.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category security
|
|
3
|
-
* @see https://stackoverflow.com/a/22405578/9122820
|
|
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
|
-
encode: function() {
|
|
16
|
-
return encode;
|
|
17
|
-
},
|
|
18
|
-
default: function() {
|
|
19
|
-
return _default;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
function encode(str) {
|
|
23
|
-
return str.replace(/./g, function(c) {
|
|
24
|
-
return ("00" + c.charCodeAt(0)).slice(-3);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
const _default = encode;
|
package/ensureInt.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensure input to be an integer
|
|
3
|
-
*
|
|
4
|
-
* @category cast
|
|
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
|
-
ensureInt: function() {
|
|
17
|
-
return ensureInt;
|
|
18
|
-
},
|
|
19
|
-
default: function() {
|
|
20
|
-
return _default;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const ensureInt = (input)=>typeof input === "string" ? parseInt(input, 10) : Math.round(input);
|
|
24
|
-
const _default = ensureInt;
|
package/env.js
DELETED
package/errorToString.js
DELETED
|
@@ -1,22 +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
|
-
errorToString: function() {
|
|
13
|
-
return errorToString;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _isString = /*#__PURE__*/ _interop_require_default._(require("./isString"));
|
|
21
|
-
const errorToString = (e)=>e instanceof Error ? e.message : (0, _isString.default)(e) ? e : "";
|
|
22
|
-
const _default = errorToString;
|
package/findDuplicatedIndexes.js
DELETED
|
@@ -1,31 +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
|
-
findDuplicatedIndexes: function() {
|
|
15
|
-
return findDuplicatedIndexes;
|
|
16
|
-
},
|
|
17
|
-
default: function() {
|
|
18
|
-
return _default;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
function findDuplicatedIndexes(arr) {
|
|
22
|
-
const indexes = {};
|
|
23
|
-
for(let i = 0; i < arr.length; i++){
|
|
24
|
-
const idxInArray = arr.indexOf(arr[i]);
|
|
25
|
-
if (idxInArray !== i && idxInArray !== -1) {
|
|
26
|
-
indexes[i] = true;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return indexes;
|
|
30
|
-
}
|
|
31
|
-
const _default = findDuplicatedIndexes;
|
package/forin.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* To easily get typed native `for in`
|
|
3
|
-
*
|
|
4
|
-
* @category objects
|
|
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
|
-
forin: function() {
|
|
17
|
-
return forin;
|
|
18
|
-
},
|
|
19
|
-
default: function() {
|
|
20
|
-
return _default;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
function forin(object, cb) {
|
|
24
|
-
for(const key in object){
|
|
25
|
-
cb(key, object[key]);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const _default = forin;
|
package/gbToBytes.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gigabytes to bytes
|
|
3
|
-
*
|
|
4
|
-
* @category format
|
|
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
|
-
gbToBytes: function() {
|
|
17
|
-
return gbToBytes;
|
|
18
|
-
},
|
|
19
|
-
default: function() {
|
|
20
|
-
return _default;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const gbToBytes = (bytes)=>bytes * 1000 * 1000 * 1000;
|
|
24
|
-
const _default = gbToBytes;
|
package/getEmptyArray.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
|
-
getEmptyArray: function() {
|
|
13
|
-
return getEmptyArray /* <T extends undefined | null = undefined> */ ;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _isNumber = /*#__PURE__*/ _interop_require_default._(require("./isNumber"));
|
|
21
|
-
function getEmptyArray(length) {
|
|
22
|
-
if (!(0, _isNumber.default)(length)) {
|
|
23
|
-
length = parseInt(length, 10);
|
|
24
|
-
}
|
|
25
|
-
return Array.from({
|
|
26
|
-
length
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
const _default = getEmptyArray;
|
package/getKeys.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type safe replacement for `Object.keys(myObject)` to iterate over a record
|
|
3
|
-
* without loosing the key's types in simple `string`s.
|
|
4
|
-
*
|
|
5
|
-
* @category objects
|
|
6
|
-
* @see https://stackoverflow.com/a/59459000/1938970
|
|
7
|
-
*/ "use strict";
|
|
8
|
-
Object.defineProperty(exports, "__esModule", {
|
|
9
|
-
value: true
|
|
10
|
-
});
|
|
11
|
-
function _export(target, all) {
|
|
12
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: all[name]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
_export(exports, {
|
|
18
|
-
getKeys: function() {
|
|
19
|
-
return getKeys;
|
|
20
|
-
},
|
|
21
|
-
default: function() {
|
|
22
|
-
return _default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const getKeys = Object.keys;
|
|
26
|
-
const _default = getKeys;
|
|
@@ -1,81 +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
|
-
getMediaQueryWidthResolvers: function() {
|
|
13
|
-
return getMediaQueryWidthResolvers;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function getMediaQueryWidthResolvers(customBreakpoints) {
|
|
20
|
-
const breakpoints = {
|
|
21
|
-
xs: 0,
|
|
22
|
-
...customBreakpoints
|
|
23
|
-
};
|
|
24
|
-
const sortedBreakpointsNames = Object.keys(breakpoints).map((key)=>{
|
|
25
|
-
const br = key;
|
|
26
|
-
return [
|
|
27
|
-
br,
|
|
28
|
-
breakpoints[br]
|
|
29
|
-
];
|
|
30
|
-
}).sort((a, b)=>a[1] - b[1]).map((item)=>item[0]);
|
|
31
|
-
const getNextBreakpoint = (breakpoint)=>{
|
|
32
|
-
const index = sortedBreakpointsNames.indexOf(breakpoint);
|
|
33
|
-
return sortedBreakpointsNames[index + 1];
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* It behaves the same as `(min-width: ${value}px)`
|
|
37
|
-
* where value is the given breakpoint value.
|
|
38
|
-
* For ease of use this can be used both as a function `min("md")` and as an
|
|
39
|
-
* object literal `min.md`.
|
|
40
|
-
*/ const min = (br)=>`(min-width: ${breakpoints[br]}px)`;
|
|
41
|
-
/**
|
|
42
|
-
* It behaves the same as `(max-width: ${value}px)`
|
|
43
|
-
* where value is the given breakpoint value.
|
|
44
|
-
* For ease of use this can be used both as a function `max("md")` and as an
|
|
45
|
-
* object literal `max.md`.
|
|
46
|
-
*/ const max = (br)=>`(max-width: ${breakpoints[br] - 0.02}px)`;
|
|
47
|
-
/**
|
|
48
|
-
* It behaves the same as `min`
|
|
49
|
-
* @inheritdoc {max}
|
|
50
|
-
*/ const up = min;
|
|
51
|
-
/**
|
|
52
|
-
* It behaves similarly to `max` but you will use the "next" breakpoint,
|
|
53
|
-
* specifying CSS that will apply from the given breakpoint and down.
|
|
54
|
-
*/ const down = (br)=>{
|
|
55
|
-
const brNext = getNextBreakpoint(br);
|
|
56
|
-
// TODO: if br does not exists otherwise throw Error
|
|
57
|
-
return brNext && `(max-width: ${breakpoints[brNext] - 0.02}px)`;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Media query between the two given breakpoints
|
|
61
|
-
*/ const between = (br1, br2)=>{
|
|
62
|
-
br2 = br2 || getNextBreakpoint(br1);
|
|
63
|
-
return br2 ? `(min-width: ${breakpoints[br1]}px) and (max-width: ${breakpoints[br2] - 0.02}px)` : min(br1);
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Media query to apply from the given breakpoint until the next, just for its
|
|
67
|
-
* full range
|
|
68
|
-
*/ const only = (br)=>{
|
|
69
|
-
const brNext = getNextBreakpoint(br);
|
|
70
|
-
return brNext ? between(br, brNext) : min(br);
|
|
71
|
-
};
|
|
72
|
-
return {
|
|
73
|
-
max,
|
|
74
|
-
min,
|
|
75
|
-
down,
|
|
76
|
-
up,
|
|
77
|
-
between,
|
|
78
|
-
only
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
const _default = getMediaQueryWidthResolvers;
|
|
@@ -1,51 +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
|
-
getMediaQueryWidthTailwindScreens: function() {
|
|
13
|
-
return getMediaQueryWidthTailwindScreens;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _getMediaQueryWidthResolvers = require("./getMediaQueryWidthResolvers");
|
|
20
|
-
function getMediaQueryWidthTailwindScreens(breakpoints) {
|
|
21
|
-
const mqWidthResolvers = (0, _getMediaQueryWidthResolvers.getMediaQueryWidthResolvers)(breakpoints);
|
|
22
|
-
// Object.keys(breakpoints).reduce((screens, br) => {
|
|
23
|
-
const screens = Object.keys(breakpoints).reduce((output, br, idx)=>{
|
|
24
|
-
const brNext = Object.keys(breakpoints)[idx + 1];
|
|
25
|
-
for(const resolverName in mqWidthResolvers){
|
|
26
|
-
// this line is just for typescript..
|
|
27
|
-
const resolver = resolverName;
|
|
28
|
-
const resolverFn = mqWidthResolvers[resolver];
|
|
29
|
-
const raw = resolverFn(br);
|
|
30
|
-
if (raw) {
|
|
31
|
-
if (resolverName === "min") {
|
|
32
|
-
output[`@${br}`] = {
|
|
33
|
-
raw
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
if (resolverName === "between") {
|
|
37
|
-
if (brNext) output[`@${resolverName}-${br}_${brNext}`] = {
|
|
38
|
-
raw
|
|
39
|
-
};
|
|
40
|
-
} else {
|
|
41
|
-
output[`@${resolverName}-${br}`] = {
|
|
42
|
-
raw
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return output;
|
|
48
|
-
}, {});
|
|
49
|
-
return screens;
|
|
50
|
-
}
|
|
51
|
-
const _default = getMediaQueryWidthTailwindScreens;
|
package/getNonce.js
DELETED
|
@@ -1,23 +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
|
-
getNonce: function() {
|
|
13
|
-
return getNonce;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _isUndefined = require("./isUndefined");
|
|
20
|
-
function getNonce() {
|
|
21
|
-
return (0, _isUndefined.isUndefined)(__webpack_nonce__) ? null : __webpack_nonce__;
|
|
22
|
-
}
|
|
23
|
-
const _default = getNonce;
|
package/getParamAmong.js
DELETED
|
@@ -1,25 +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
|
-
getParamAmong: function() {
|
|
13
|
-
return getParamAmong;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _getParamAsString = /*#__PURE__*/ _interop_require_default._(require("./getParamAsString"));
|
|
21
|
-
function getParamAmong(raw, allowedValues = []) {
|
|
22
|
-
const string = (0, _getParamAsString.default)(raw);
|
|
23
|
-
return allowedValues.includes(string) ? string : null;
|
|
24
|
-
}
|
|
25
|
-
const _default = getParamAmong;
|
package/getParamAsInt.js
DELETED
|
@@ -1,28 +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
|
-
getParamAsInt: function() {
|
|
13
|
-
return getParamAsInt;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _getParamAsString = /*#__PURE__*/ _interop_require_default._(require("./getParamAsString"));
|
|
21
|
-
function getParamAsInt(raw, fallback = null) {
|
|
22
|
-
const string = (0, _getParamAsString.default)(raw);
|
|
23
|
-
if (string) {
|
|
24
|
-
return parseInt(string, 10);
|
|
25
|
-
}
|
|
26
|
-
return fallback;
|
|
27
|
-
}
|
|
28
|
-
const _default = getParamAsInt;
|