@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/getParamAsString.js
DELETED
|
@@ -1,24 +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
|
-
getParamAsString: function() {
|
|
13
|
-
return getParamAsString;
|
|
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
|
-
function getParamAsString(raw) {
|
|
22
|
-
return ((0, _isArray.default)(raw) ? raw[0] : raw) || "";
|
|
23
|
-
}
|
|
24
|
-
const _default = getParamAsString;
|
package/getType.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
* Same as [is-what](https://github.com/mesqueeb/is-what) plus:
|
|
5
|
-
*
|
|
6
|
-
* - `isFormData`
|
|
7
|
-
* - `isInt`
|
|
8
|
-
* - `isFloat`
|
|
9
|
-
*/ "use strict";
|
|
10
|
-
Object.defineProperty(exports, "__esModule", {
|
|
11
|
-
value: true
|
|
12
|
-
});
|
|
13
|
-
function _export(target, all) {
|
|
14
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: all[name]
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
_export(exports, {
|
|
20
|
-
getType: function() {
|
|
21
|
-
return getType;
|
|
22
|
-
},
|
|
23
|
-
default: function() {
|
|
24
|
-
return _default;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
function getType(payload) {
|
|
28
|
-
return Object.prototype.toString.call(payload).slice(8, -1);
|
|
29
|
-
}
|
|
30
|
-
const _default = getType;
|
package/getUrlHashParams.js
DELETED
|
@@ -1,27 +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
|
-
getUrlHashParams: function() {
|
|
13
|
-
return getUrlHashParams;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function getUrlHashParams(hash = "") {
|
|
20
|
-
hash = hash || location.hash;
|
|
21
|
-
const hashParts = hash.split("?");
|
|
22
|
-
if (hashParts.length >= 1) {
|
|
23
|
-
return Object.fromEntries(new URLSearchParams(hashParts[1]));
|
|
24
|
-
}
|
|
25
|
-
return {};
|
|
26
|
-
}
|
|
27
|
-
const _default = getUrlHashParams;
|
package/getUrlHashPathname.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* It returns the "pathname" cleaned up from the `#` and the initial slashes
|
|
3
|
-
* extracting it from the given `hash` string or, if not provided, failling
|
|
4
|
-
* back reading the `location.hash`
|
|
5
|
-
*
|
|
6
|
-
* @category location
|
|
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
|
-
getUrlHashPathname: function() {
|
|
19
|
-
return getUrlHashPathname;
|
|
20
|
-
},
|
|
21
|
-
default: function() {
|
|
22
|
-
return _default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
function getUrlHashPathname(hash = "") {
|
|
26
|
-
hash = hash || location.hash;
|
|
27
|
-
return hash.split("?")[0].replace(/^#\//, "");
|
|
28
|
-
}
|
|
29
|
-
const _default = getUrlHashPathname;
|
package/getUrlPathnameParts.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
|
-
getUrlPathnameParts: function() {
|
|
13
|
-
return getUrlPathnameParts;
|
|
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
|
-
function getUrlPathnameParts(pathname = "") {
|
|
22
|
-
pathname = pathname || _isBrowser.default ? location.pathname : "";
|
|
23
|
-
return pathname.replace(/^\//, "").split("/").filter((part)=>part);
|
|
24
|
-
}
|
|
25
|
-
const _default = getUrlPathnameParts;
|
package/getUrlQueryParams.js
DELETED
|
@@ -1,36 +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
|
-
getUrlQueryParams: function() {
|
|
13
|
-
return getUrlQueryParams;
|
|
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
|
-
function getUrlQueryParams(url) {
|
|
22
|
-
let params = {};
|
|
23
|
-
const search = url ? url.split("?")?.[1] : _isBrowser.default ? location.search.substring(1) : "";
|
|
24
|
-
if (!search) {
|
|
25
|
-
return {};
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
// @see https://stackoverflow.com/a/8649003/1938970
|
|
29
|
-
const paramsAsObj = `{"${search.replace(/&/g, '","').replace(/=/g, '":"')}"}`;
|
|
30
|
-
params = JSON.parse(paramsAsObj, (key, value)=>key === "" ? value : decodeURIComponent(value));
|
|
31
|
-
} catch (e) {
|
|
32
|
-
// do nothing or warn on process.env["NODE_ENV"] !== "production"
|
|
33
|
-
}
|
|
34
|
-
return params;
|
|
35
|
-
}
|
|
36
|
-
const _default = getUrlQueryParams;
|
package/imgEmptyPixel.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Empty img pixel as a string to inline
|
|
3
|
-
*
|
|
4
|
-
* @category img
|
|
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
|
-
imgEmptyPixel: function() {
|
|
17
|
-
return imgEmptyPixel;
|
|
18
|
-
},
|
|
19
|
-
default: function() {
|
|
20
|
-
return _default;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const imgEmptyPixel = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";
|
|
24
|
-
const _default = imgEmptyPixel;
|