@koine/utils 2.0.0-beta.4 → 2.0.0-beta.42
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/Defer.d.ts +0 -15
- package/Emitter.d.ts +2 -21
- package/README.md +4 -2
- package/accentSets.d.ts +1 -15
- package/addOrReplaceAtIdx.d.ts +1 -5
- package/areEqual.d.ts +2 -17
- package/arrayFilterFalsy.d.ts +1 -0
- package/arrayOfAll.d.ts +1 -28
- package/arraySum.d.ts +1 -7
- package/arrayToLookup.d.ts +1 -7
- package/arrayUniqueByProperties.d.ts +1 -0
- package/buildUrlQueryString.d.ts +2 -12
- package/capitalize.d.ts +1 -8
- package/changeCaseCamel.d.ts +2 -0
- package/changeCaseCapital.d.ts +2 -0
- package/changeCaseConstant.d.ts +2 -0
- package/changeCaseDot.d.ts +2 -0
- package/changeCaseHelpers.d.ts +19 -0
- package/changeCaseKebab.d.ts +2 -0
- package/changeCaseNone.d.ts +2 -0
- package/changeCasePascal.d.ts +2 -0
- package/changeCasePascalSnake.d.ts +2 -0
- package/changeCasePath.d.ts +2 -0
- package/changeCaseSentence.d.ts +2 -0
- package/changeCaseSnake.d.ts +2 -0
- package/changeCaseTrain.d.ts +2 -0
- package/chunkByChunks.d.ts +1 -7
- package/chunkBySize.d.ts +1 -6
- package/clamp.d.ts +1 -8
- package/clsx.d.ts +6 -9
- package/convertRange.d.ts +1 -14
- package/cookie.d.ts +1 -37
- package/createPalette.d.ts +2 -12
- package/debounce.d.ts +1 -8
- package/debouncePromise.d.ts +10 -11
- package/debounceRaf.d.ts +0 -8
- package/decode.d.ts +1 -6
- package/encode.d.ts +1 -6
- package/ensureInt.d.ts +1 -7
- package/env.d.ts +0 -0
- package/errorToString.d.ts +1 -7
- package/findDuplicatedIndexes.d.ts +1 -5
- package/forin.d.ts +1 -7
- package/gbToBytes.d.ts +1 -7
- package/getEmptyArray.d.ts +1 -9
- package/getKeys.d.ts +1 -9
- package/getMediaQueryWidthResolvers.d.ts +1 -2
- package/getMediaQueryWidthTailwindScreens.d.ts +1 -2
- package/getNonce.d.ts +1 -6
- package/getParamAmong.d.ts +1 -12
- package/getParamAsInt.d.ts +1 -12
- package/getParamAsString.d.ts +1 -11
- package/getType.d.ts +4 -17
- package/getUrlHashParams.d.ts +1 -9
- package/getUrlHashPathname.d.ts +1 -9
- package/getUrlPathnameParts.d.ts +1 -12
- package/getUrlQueryParams.d.ts +1 -14
- package/imgEmptyPixel.d.ts +1 -7
- package/index.cjs.d.ts +1 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +482 -0
- package/index.cjs.mjs +2 -0
- package/index.d.ts +24 -5
- package/index.esm.js +330 -0
- package/invariant.d.ts +1 -19
- package/isAnyObject.d.ts +2 -8
- package/isArray.d.ts +1 -7
- package/isBlob.d.ts +1 -7
- package/isBoolean.d.ts +1 -7
- package/isBrowser.d.ts +1 -6
- package/isBrowserNow.d.ts +1 -6
- package/isDate.d.ts +1 -7
- package/isEmptyArray.d.ts +1 -7
- package/isEmptyObject.d.ts +4 -8
- package/isEmptyString.d.ts +1 -7
- package/isError.d.ts +1 -7
- package/isExternalUrl.d.ts +1 -9
- package/isFile.d.ts +1 -7
- package/isFloat.d.ts +1 -7
- package/isFormData.d.ts +1 -7
- package/isFullArray.d.ts +1 -7
- package/isFullObject.d.ts +2 -8
- package/isFullString.d.ts +1 -7
- package/isFunction.d.ts +2 -8
- package/isInt.d.ts +1 -7
- package/isMap.d.ts +1 -7
- package/isNaNValue.d.ts +1 -7
- package/isNegativeNumber.d.ts +1 -7
- package/isNull.d.ts +1 -7
- package/isNullOrUndefined.d.ts +1 -7
- package/isNumber.d.ts +1 -9
- package/isNumericLiteral.d.ts +1 -0
- package/isObject.d.ts +2 -8
- package/isObjectLike.d.ts +2 -10
- package/isObjectStringKeyed.d.ts +2 -0
- package/isOneOf.d.ts +1 -5
- package/isPlainObject.d.ts +2 -8
- package/isPositiveNumber.d.ts +1 -7
- package/isPrimitive.d.ts +1 -7
- package/isPromise.d.ts +1 -7
- package/isRegExp.d.ts +1 -7
- package/isServer.d.ts +1 -6
- package/isServerNow.d.ts +1 -6
- package/isSet.d.ts +1 -7
- package/isString.d.ts +1 -7
- package/isSymbol.d.ts +1 -7
- package/isType.d.ts +2 -11
- package/isUndefined.d.ts +1 -7
- package/isWeakMap.d.ts +1 -7
- package/isWeakSet.d.ts +1 -7
- package/kbToBytes.d.ts +1 -7
- package/location.d.ts +0 -3
- package/lowercase.d.ts +1 -7
- package/mapListBy.d.ts +1 -7
- package/matchSorter.d.ts +2 -10
- package/mbToBytes.d.ts +1 -7
- package/mergeObjects.d.ts +1 -7
- package/mergeUrlQueryParams.d.ts +2 -9
- package/moveSortableArrayItemByKey.d.ts +1 -9
- package/noop.d.ts +1 -7
- package/normaliseUrl.d.ts +1 -11
- package/normaliseUrlPathname.d.ts +1 -10
- package/objectFlat.d.ts +3 -0
- package/objectFlip.d.ts +1 -0
- package/objectOmit.d.ts +1 -11
- package/objectPick.d.ts +1 -8
- package/objectSortByKeysMatching.d.ts +3 -0
- package/objectToArray.d.ts +1 -0
- package/package.json +9 -10
- package/parseCookie.d.ts +2 -11
- package/parseURL.d.ts +1 -8
- package/quaranteneProps.d.ts +2 -17
- package/randomInt.d.ts +1 -7
- package/randomKey.d.ts +1 -8
- package/readCookie.d.ts +0 -1
- package/removeAccents.d.ts +2 -6
- package/removeCookie.d.ts +1 -9
- package/removeDuplicates.d.ts +0 -0
- package/removeDuplicatesByKey.d.ts +1 -8
- package/removeDuplicatesComparing.d.ts +1 -5
- package/removeIndexesFromArray.d.ts +1 -5
- package/removeTrailingSlash.d.ts +1 -7
- package/removeUrlQueryParams.d.ts +1 -8
- package/render.d.ts +2 -41
- package/round.d.ts +2 -0
- package/roundTo.d.ts +1 -8
- package/serializeCookie.d.ts +2 -27
- package/setCookie.d.ts +1 -9
- package/shuffle.d.ts +1 -16
- package/slugify.d.ts +1 -11
- package/split.d.ts +1 -2
- package/splitReverse.d.ts +4 -0
- package/swapMap.d.ts +1 -7
- package/throttle.d.ts +1 -8
- package/titleCase.d.ts +1 -7
- package/toNumber.d.ts +1 -5
- package/toRgba.d.ts +1 -5
- package/transformToUrlPathname.d.ts +1 -11
- package/truncate.d.ts +1 -7
- package/tryUntil.d.ts +1 -8
- package/types.d.ts +1 -18
- package/typings.d.ts +31 -5
- package/uid.d.ts +1 -7
- package/updateLinkParams.d.ts +2 -10
- package/updateUrlQueryParams.d.ts +2 -9
- package/uppercase.d.ts +1 -7
- package/uuid.d.ts +1 -8
- package/uuidNumeric.d.ts +1 -6
- package/wait.d.ts +1 -7
- package/without.d.ts +0 -0
- package/Defer.js +0 -35
- package/Defer.mjs +0 -27
- package/Emitter.js +0 -53
- package/Emitter.mjs +0 -35
- package/accentSets.js +0 -133
- package/accentSets.mjs +0 -122
- package/addOrReplaceAtIdx.js +0 -40
- package/addOrReplaceAtIdx.mjs +0 -22
- package/areEqual.js +0 -75
- package/areEqual.mjs +0 -71
- package/arrayOfAll.js +0 -45
- package/arrayOfAll.mjs +0 -27
- package/arraySum.js +0 -24
- package/arraySum.mjs +0 -6
- package/arrayToLookup.js +0 -29
- package/arrayToLookup.mjs +0 -11
- package/buildUrlQueryString.js +0 -39
- package/buildUrlQueryString.mjs +0 -28
- package/capitalize.js +0 -28
- package/capitalize.mjs +0 -10
- package/changeUrlPath.d.ts +0 -10
- package/changeUrlPath.js +0 -29
- package/changeUrlPath.mjs +0 -17
- package/chunkByChunks.js +0 -52
- package/chunkByChunks.mjs +0 -34
- package/chunkBySize.js +0 -29
- package/chunkBySize.mjs +0 -11
- package/clamp.js +0 -27
- package/clamp.mjs +0 -9
- package/clsx.js +0 -59
- package/clsx.mjs +0 -46
- package/convertRange.js +0 -33
- package/convertRange.mjs +0 -15
- package/cookie.js +0 -21
- package/cookie.mjs +0 -11
- package/createPalette.js +0 -34
- package/createPalette.mjs +0 -25
- package/debounce.js +0 -39
- package/debounce.mjs +0 -21
- package/debouncePromise.js +0 -21
- package/debouncePromise.mjs +0 -8
- package/debounceRaf.js +0 -40
- package/debounceRaf.mjs +0 -22
- package/decode.js +0 -27
- package/decode.mjs +0 -9
- package/encode.js +0 -27
- package/encode.mjs +0 -9
- package/ensureInt.js +0 -24
- package/ensureInt.mjs +0 -6
- package/env.js +0 -3
- package/env.mjs +0 -2
- package/errorToString.js +0 -22
- package/errorToString.mjs +0 -7
- package/findDuplicatedIndexes.js +0 -31
- package/findDuplicatedIndexes.mjs +0 -13
- package/forin.js +0 -28
- package/forin.mjs +0 -10
- package/gbToBytes.js +0 -24
- package/gbToBytes.mjs +0 -6
- package/getEmptyArray.js +0 -29
- package/getEmptyArray.mjs +0 -16
- package/getKeys.js +0 -26
- package/getKeys.mjs +0 -8
- package/getMediaQueryWidthResolvers.js +0 -81
- package/getMediaQueryWidthResolvers.mjs +0 -63
- package/getMediaQueryWidthTailwindScreens.js +0 -51
- package/getMediaQueryWidthTailwindScreens.mjs +0 -33
- package/getNonce.js +0 -23
- package/getNonce.mjs +0 -8
- package/getParamAmong.js +0 -25
- package/getParamAmong.mjs +0 -15
- package/getParamAsInt.js +0 -28
- package/getParamAsInt.mjs +0 -18
- package/getParamAsString.js +0 -24
- package/getParamAsString.mjs +0 -13
- package/getType.js +0 -30
- package/getType.mjs +0 -17
- package/getUrlHashParams.js +0 -27
- package/getUrlHashParams.mjs +0 -14
- package/getUrlHashPathname.js +0 -29
- package/getUrlHashPathname.mjs +0 -11
- package/getUrlPathnameParts.js +0 -25
- package/getUrlPathnameParts.mjs +0 -15
- package/getUrlQueryParams.js +0 -36
- package/getUrlQueryParams.mjs +0 -27
- package/imgEmptyPixel.js +0 -24
- package/imgEmptyPixel.mjs +0 -6
- package/index.js +0 -532
- package/index.mjs +0 -132
- package/invariant.js +0 -50
- package/invariant.mjs +0 -32
- package/isAnyObject.js +0 -24
- package/isAnyObject.mjs +0 -9
- package/isArray.js +0 -24
- package/isArray.mjs +0 -9
- package/isBlob.js +0 -24
- package/isBlob.mjs +0 -9
- package/isBoolean.js +0 -24
- package/isBoolean.mjs +0 -9
- package/isBrowser.js +0 -23
- package/isBrowser.mjs +0 -5
- package/isBrowserNow.js +0 -22
- package/isBrowserNow.mjs +0 -6
- package/isDate.js +0 -24
- package/isDate.mjs +0 -9
- package/isEmptyArray.js +0 -24
- package/isEmptyArray.mjs +0 -9
- package/isEmptyObject.js +0 -24
- package/isEmptyObject.mjs +0 -9
- package/isEmptyString.js +0 -26
- package/isEmptyString.mjs +0 -8
- package/isError.js +0 -24
- package/isError.mjs +0 -9
- package/isExternalUrl.js +0 -32
- package/isExternalUrl.mjs +0 -19
- package/isFile.js +0 -24
- package/isFile.mjs +0 -9
- package/isFloat.js +0 -24
- package/isFloat.mjs +0 -9
- package/isFormData.js +0 -24
- package/isFormData.mjs +0 -9
- package/isFullArray.js +0 -24
- package/isFullArray.mjs +0 -9
- package/isFullObject.js +0 -24
- package/isFullObject.mjs +0 -9
- package/isFullString.js +0 -24
- package/isFullString.mjs +0 -9
- package/isFunction.js +0 -22
- package/isFunction.mjs +0 -8
- package/isInt.js +0 -24
- package/isInt.mjs +0 -9
- package/isMap.js +0 -24
- package/isMap.mjs +0 -9
- package/isNaNValue.js +0 -24
- package/isNaNValue.mjs +0 -9
- package/isNegativeNumber.js +0 -24
- package/isNegativeNumber.mjs +0 -9
- package/isNull.js +0 -24
- package/isNull.mjs +0 -9
- package/isNullOrUndefined.js +0 -24
- package/isNullOrUndefined.mjs +0 -9
- package/isNumber.js +0 -24
- package/isNumber.mjs +0 -11
- package/isObject.js +0 -24
- package/isObject.mjs +0 -9
- package/isObjectLike.js +0 -24
- package/isObjectLike.mjs +0 -11
- package/isOneOf.js +0 -22
- package/isOneOf.mjs +0 -4
- package/isPlainObject.js +0 -25
- package/isPlainObject.mjs +0 -10
- package/isPositiveNumber.js +0 -24
- package/isPositiveNumber.mjs +0 -9
- package/isPrimitive.js +0 -29
- package/isPrimitive.mjs +0 -14
- package/isPromise.js +0 -24
- package/isPromise.mjs +0 -9
- package/isRegExp.js +0 -24
- package/isRegExp.mjs +0 -9
- package/isServer.js +0 -23
- package/isServer.mjs +0 -7
- package/isServerNow.js +0 -22
- package/isServerNow.mjs +0 -6
- package/isSet.js +0 -24
- package/isSet.mjs +0 -9
- package/isString.js +0 -24
- package/isString.mjs +0 -9
- package/isSymbol.js +0 -24
- package/isSymbol.mjs +0 -9
- package/isType.js +0 -32
- package/isType.mjs +0 -20
- package/isUndefined.js +0 -24
- package/isUndefined.mjs +0 -9
- package/isWeakMap.js +0 -24
- package/isWeakMap.mjs +0 -9
- package/isWeakSet.js +0 -24
- package/isWeakSet.mjs +0 -9
- package/kbToBytes.js +0 -24
- package/kbToBytes.mjs +0 -6
- package/location.js +0 -6
- package/location.mjs +0 -3
- package/lowercase.js +0 -24
- package/lowercase.mjs +0 -6
- package/mapListBy.js +0 -29
- package/mapListBy.mjs +0 -11
- package/matchSorter.js +0 -373
- package/matchSorter.mjs +0 -352
- package/mbToBytes.js +0 -24
- package/mbToBytes.mjs +0 -6
- package/mergeObjects.js +0 -39
- package/mergeObjects.mjs +0 -34
- package/mergeUrlQueryParams.js +0 -32
- package/mergeUrlQueryParams.mjs +0 -18
- package/moveSortableArrayItemByKey.js +0 -35
- package/moveSortableArrayItemByKey.mjs +0 -17
- package/noop.js +0 -24
- package/noop.mjs +0 -6
- package/normaliseUrl.js +0 -24
- package/normaliseUrl.mjs +0 -13
- package/normaliseUrlPathname.js +0 -24
- package/normaliseUrlPathname.mjs +0 -12
- package/objectOmit.js +0 -35
- package/objectOmit.mjs +0 -17
- package/objectPick.js +0 -32
- package/objectPick.mjs +0 -14
- package/parseCookie.js +0 -55
- package/parseCookie.mjs +0 -44
- package/parseURL.js +0 -37
- package/parseURL.mjs +0 -19
- package/quaranteneProps.js +0 -49
- package/quaranteneProps.mjs +0 -31
- package/randomInt.js +0 -26
- package/randomInt.mjs +0 -8
- package/randomKey.js +0 -28
- package/randomKey.mjs +0 -10
- package/readCookie.js +0 -51
- package/readCookie.mjs +0 -33
- package/removeAccents.js +0 -28
- package/removeAccents.mjs +0 -12
- package/removeCookie.js +0 -28
- package/removeCookie.mjs +0 -16
- package/removeDuplicates.js +0 -13
- package/removeDuplicates.mjs +0 -12
- package/removeDuplicatesByKey.js +0 -36
- package/removeDuplicatesByKey.mjs +0 -18
- package/removeDuplicatesComparing.js +0 -25
- package/removeDuplicatesComparing.mjs +0 -9
- package/removeIndexesFromArray.js +0 -31
- package/removeIndexesFromArray.mjs +0 -13
- package/removeTrailingSlash.js +0 -26
- package/removeTrailingSlash.mjs +0 -8
- package/removeUrlQueryParams.js +0 -33
- package/removeUrlQueryParams.mjs +0 -19
- package/render.js +0 -93
- package/render.mjs +0 -110
- package/roundTo.js +0 -50
- package/roundTo.mjs +0 -32
- package/serializeCookie.js +0 -102
- package/serializeCookie.mjs +0 -98
- package/setCookie.js +0 -68
- package/setCookie.mjs +0 -55
- package/shuffle.js +0 -50
- package/shuffle.mjs +0 -32
- package/slugify.js +0 -35
- package/slugify.mjs +0 -25
- package/split.js +0 -22
- package/split.mjs +0 -4
- package/swapMap.js +0 -30
- package/swapMap.mjs +0 -12
- package/throttle.js +0 -38
- package/throttle.mjs +0 -20
- package/titleCase.js +0 -24
- package/titleCase.mjs +0 -6
- package/toNumber.js +0 -23
- package/toNumber.mjs +0 -7
- package/toRgba.js +0 -32
- package/toRgba.mjs +0 -14
- package/transformToUrlPathname.js +0 -24
- package/transformToUrlPathname.mjs +0 -13
- package/truncate.js +0 -24
- package/truncate.mjs +0 -6
- package/tryUntil.js +0 -42
- package/tryUntil.mjs +0 -24
- package/types.js +0 -5
- package/types.mjs +0 -2
- package/uid.js +0 -24
- package/uid.mjs +0 -10
- package/updateLinkParams.js +0 -26
- package/updateLinkParams.mjs +0 -13
- package/updateUrlQueryParams.js +0 -28
- package/updateUrlQueryParams.mjs +0 -14
- package/uppercase.js +0 -24
- package/uppercase.mjs +0 -6
- package/uuid.js +0 -28
- package/uuid.mjs +0 -10
- package/uuidNumeric.js +0 -23
- package/uuidNumeric.mjs +0 -5
- package/wait.js +0 -24
- package/wait.mjs +0 -6
- package/without.js +0 -55
- package/without.mjs +0 -54
package/isFullString.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Returns whether the payload is a string, BUT returns false for ''
|
|
3
|
-
*
|
|
4
|
-
* @category is
|
|
5
|
-
*/
|
|
6
|
-
export declare function isFullString(payload: any): payload is string;
|
|
7
|
-
export default isFullString;
|
|
1
|
+
export declare let isFullString: (payload: any) => payload is string;
|
package/isFunction.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Returns whether the payload is a function (regular or async)
|
|
4
|
-
*
|
|
5
|
-
* @category is
|
|
6
|
-
*/
|
|
7
|
-
export declare function isFunction(payload: any): payload is AnyFunction;
|
|
8
|
-
export default isFunction;
|
|
1
|
+
import type { AnyFunction } from "./getType";
|
|
2
|
+
export declare let isFunction: (payload: any) => payload is AnyFunction;
|
package/isInt.d.ts
CHANGED
package/isMap.d.ts
CHANGED
package/isNaNValue.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)
|
|
3
|
-
*
|
|
4
|
-
* @category is
|
|
5
|
-
*/
|
|
6
|
-
export declare function isNaNValue(payload: any): payload is typeof NaN;
|
|
7
|
-
export default isNaNValue;
|
|
1
|
+
export declare let isNaNValue: (payload: any) => payload is number;
|
package/isNegativeNumber.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Returns whether the payload is a negative number (but not 0)
|
|
3
|
-
*
|
|
4
|
-
* @category is
|
|
5
|
-
*/
|
|
6
|
-
export declare function isNegativeNumber(payload: any): payload is number;
|
|
7
|
-
export default isNegativeNumber;
|
|
1
|
+
export declare let isNegativeNumber: (payload: any) => payload is number;
|
package/isNull.d.ts
CHANGED
package/isNullOrUndefined.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Returns true whether the payload is null or undefined
|
|
3
|
-
*
|
|
4
|
-
* @category is
|
|
5
|
-
*/
|
|
6
|
-
export declare const isNullOrUndefined: import("./getType").TypeGuard<any, null | undefined>;
|
|
7
|
-
export default isNullOrUndefined;
|
|
1
|
+
export declare let isNullOrUndefined: import("./getType").TypeGuard<any, null | undefined>;
|
package/isNumber.d.ts
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Returns whether the payload is a number (but not NaN)
|
|
3
|
-
*
|
|
4
|
-
* This will return `false` for `NaN`!!
|
|
5
|
-
*
|
|
6
|
-
* @category is
|
|
7
|
-
*/
|
|
8
|
-
export declare function isNumber(payload: any): payload is number;
|
|
9
|
-
export default isNumber;
|
|
1
|
+
export declare let isNumber: (payload: any) => payload is number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare let isNumericLiteral: (payload: string) => payload is `${number}`;
|
package/isObject.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
|
|
4
|
-
*
|
|
5
|
-
* @category is
|
|
6
|
-
*/
|
|
7
|
-
export declare function isObject(payload: any): payload is PlainObject;
|
|
8
|
-
export default isObject;
|
|
1
|
+
import type { PlainObject } from "./getType";
|
|
2
|
+
export declare let isObject: (payload: any) => payload is PlainObject;
|
package/isObjectLike.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Returns whether the payload is an object like a type passed in < >
|
|
4
|
-
*
|
|
5
|
-
* Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.
|
|
6
|
-
*
|
|
7
|
-
* @category is
|
|
8
|
-
*/
|
|
9
|
-
export declare function isObjectLike<T extends PlainObject>(payload: any): payload is T;
|
|
10
|
-
export default isObjectLike;
|
|
1
|
+
import type { PlainObject } from "./getType";
|
|
2
|
+
export declare let isObjectLike: <T extends PlainObject>(payload: any) => payload is T;
|
package/isOneOf.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
* @category is
|
|
4
|
-
*/
|
|
1
|
+
import type { TypeGuard } from "./getType";
|
|
5
2
|
export declare function isOneOf<A, B extends A, C extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>): TypeGuard<A, B | C>;
|
|
6
3
|
export declare function isOneOf<A, B extends A, C extends A, D extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>, c: TypeGuard<A, D>): TypeGuard<A, B | C | D>;
|
|
7
4
|
export declare function isOneOf<A, B extends A, C extends A, D extends A, E extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>, c: TypeGuard<A, D>, d: TypeGuard<A, E>): TypeGuard<A, B | C | D | E>;
|
|
8
5
|
export declare function isOneOf<A, B extends A, C extends A, D extends A, E extends A, F extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>, c: TypeGuard<A, D>, d: TypeGuard<A, E>, e: TypeGuard<A, F>): TypeGuard<A, B | C | D | E | F>;
|
|
9
|
-
export default isOneOf;
|
package/isPlainObject.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
|
|
4
|
-
*
|
|
5
|
-
* @category is
|
|
6
|
-
*/
|
|
7
|
-
export declare function isPlainObject(payload: any): payload is PlainObject;
|
|
8
|
-
export default isPlainObject;
|
|
1
|
+
import type { PlainObject } from "./getType";
|
|
2
|
+
export declare let isPlainObject: <TReturn = PlainObject>(payload: any) => payload is TReturn;
|
package/isPositiveNumber.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Returns whether the payload is a positive number (but not 0)
|
|
3
|
-
*
|
|
4
|
-
* @category is
|
|
5
|
-
*/
|
|
6
|
-
export declare function isPositiveNumber(payload: any): payload is number;
|
|
7
|
-
export default isPositiveNumber;
|
|
1
|
+
export declare let isPositiveNumber: (payload: any) => payload is number;
|
package/isPrimitive.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
|
|
3
|
-
*
|
|
4
|
-
* @category is
|
|
5
|
-
*/
|
|
6
|
-
export declare function isPrimitive(payload: any): payload is boolean | null | undefined | number | string | symbol;
|
|
7
|
-
export default isPrimitive;
|
|
1
|
+
export declare let isPrimitive: (payload: any) => payload is string | number | boolean | symbol | null | undefined;
|
package/isPromise.d.ts
CHANGED
package/isRegExp.d.ts
CHANGED
package/isServer.d.ts
CHANGED
package/isServerNow.d.ts
CHANGED
package/isSet.d.ts
CHANGED
package/isString.d.ts
CHANGED
package/isSymbol.d.ts
CHANGED
package/isType.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Does a generic check to check that the given payload is of a given type.
|
|
4
|
-
* In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);
|
|
5
|
-
* It will, however, differentiate between object and null
|
|
6
|
-
*
|
|
7
|
-
* @category is
|
|
8
|
-
* @throws {TypeError} Will throw type error if type is an invalid type
|
|
9
|
-
*/
|
|
10
|
-
export declare function isType<T extends AnyFunction | AnyClass>(payload: any, type: T): payload is T;
|
|
11
|
-
export default isType;
|
|
1
|
+
import type { AnyClass, AnyFunction } from "./getType";
|
|
2
|
+
export declare let isType: <T extends AnyFunction | AnyClass>(payload: any, type: T) => payload is T;
|
package/isUndefined.d.ts
CHANGED
package/isWeakMap.d.ts
CHANGED
package/isWeakSet.d.ts
CHANGED
package/kbToBytes.d.ts
CHANGED
package/location.d.ts
CHANGED
package/lowercase.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Replacement for native `toLowercase` tyescript ready (type narrowing ready)
|
|
3
|
-
*
|
|
4
|
-
* @category native
|
|
5
|
-
*/
|
|
6
|
-
export declare const lowercase: <T extends string>(str?: T | null | undefined) => Lowercase<T>;
|
|
7
|
-
export default lowercase;
|
|
1
|
+
export declare let lowercase: <T extends string>(str?: T | null | undefined) => Lowercase<T>;
|
package/mapListBy.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Maps an array of objects into a map keyed with the given key
|
|
3
|
-
*
|
|
4
|
-
* @category array
|
|
5
|
-
*/
|
|
6
|
-
export declare function mapListBy<T extends Record<string | number | symbol, any>>(array?: T[], key?: keyof T): Record<T[keyof T], T>;
|
|
7
|
-
export default mapListBy;
|
|
1
|
+
export declare let mapListBy: <T extends Record<string | number | symbol, any>>(array?: T[], key?: keyof T) => Record<T[keyof T], T>;
|
package/matchSorter.d.ts
CHANGED
|
@@ -47,15 +47,7 @@ declare const RANKING_ACRONYM = 2;
|
|
|
47
47
|
declare const RANKING_MATCHES = 1;
|
|
48
48
|
declare const RANKING_NO_MATCH = 0;
|
|
49
49
|
type Ranking = typeof RANKING_CASE_SENSITIVE_EQUAL | typeof RANKING_EQUAL | typeof RANKING_STARTS_WITH | typeof RANKING_WORD_STARTS_WITH | typeof RANKING_CONTAINS | typeof RANKING_ACRONYM | typeof RANKING_MATCHES | typeof RANKING_NO_MATCH;
|
|
50
|
-
declare
|
|
51
|
-
|
|
52
|
-
* Takes an array of items and a value and returns a new array with the items that match the given value
|
|
53
|
-
* @param {Array} items - the items to sort
|
|
54
|
-
* @param {String} value - the value to use for ranking
|
|
55
|
-
* @param {Object} options - Some options to configure the sorter
|
|
56
|
-
* @return {Array} - the new sorted array
|
|
57
|
-
*/
|
|
58
|
-
declare function matchSorter<ItemType = string>(items: ReadonlyArray<ItemType>, value: string, options?: MatchSorterOptions<ItemType>): Array<ItemType>;
|
|
50
|
+
declare let defaultBaseSortFn: BaseSorter<unknown>;
|
|
51
|
+
declare let matchSorter: <ItemType = string>(items: readonly ItemType[], value: string, options?: MatchSorterOptions<ItemType>) => ItemType[];
|
|
59
52
|
export { matchSorter, defaultBaseSortFn };
|
|
60
53
|
export type { MatchSorterOptions, KeyAttributesOptions, KeyOption, KeyAttributes, RankingInfo, ValueGetterKey, };
|
|
61
|
-
export default matchSorter;
|
package/mbToBytes.d.ts
CHANGED
package/mergeObjects.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Merge two or more objects together. It mutates the target object.
|
|
3
|
-
*
|
|
4
|
-
* @category objects
|
|
5
|
-
* @see https://stackoverflow.com/a/46973278/1938970
|
|
6
|
-
*/
|
|
7
|
-
export declare const mergeObjects: <T extends object = object>(target: T, ...sources: Partial<T>[]) => T;
|
|
1
|
+
export declare let mergeObjects: <T extends object = object>(target: T, ...sources: Partial<T>[]) => T;
|
package/mergeUrlQueryParams.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Merge query parameters objects, it *mutates* the first given object argument
|
|
4
|
-
*
|
|
5
|
-
* @category location
|
|
6
|
-
* @pure
|
|
7
|
-
*/
|
|
8
|
-
export declare function mergeUrlQueryParams<T extends AnyQueryParams>(oldParams?: NonNullable<AnyQueryParams>, newParams?: NonNullable<AnyQueryParams>): T;
|
|
9
|
-
export default mergeUrlQueryParams;
|
|
1
|
+
import type { AnyQueryParams } from "./location";
|
|
2
|
+
export declare let mergeUrlQueryParams: <T extends AnyQueryParams>(oldParams?: NonNullable<AnyQueryParams>, newParams?: NonNullable<AnyQueryParams>) => T;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Move item from one place to another in a sortable array of objects, re-ordering
|
|
3
|
-
* the array accrodingly (no swapping of position).
|
|
4
|
-
* This is useful for drag and drop functionalities
|
|
5
|
-
*
|
|
6
|
-
* @category arrays, dnd
|
|
7
|
-
*/
|
|
8
|
-
export declare function moveSortableArrayItemByKey<T, K extends keyof T>(items: T[], key: K, fromItem: Pick<T, K>, toItem: Pick<T, K>): T[];
|
|
9
|
-
export default moveSortableArrayItemByKey;
|
|
1
|
+
export declare let moveSortableArrayItemByKey: <T, K extends keyof T>(items: T[], key: K, fromItem: Pick<T, K>, toItem: Pick<T, K>) => T[];
|
package/noop.d.ts
CHANGED
package/normaliseUrl.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Normalise URL, it works both for absolute and relative URLs
|
|
3
|
-
*
|
|
4
|
-
* - replaces too many consecutive slashes (except `http{s}://`)
|
|
5
|
-
* - removes the trailing slash
|
|
6
|
-
*
|
|
7
|
-
* @category location
|
|
8
|
-
* @see https://stackoverflow.com/a/40649435/1938970
|
|
9
|
-
*/
|
|
10
|
-
export declare function normaliseUrl(absoluteUrl?: string): string;
|
|
11
|
-
export default normaliseUrl;
|
|
1
|
+
export declare let normaliseUrl: (absoluteUrl?: string) => string;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Normalise URL pathname (relative URL)
|
|
3
|
-
*
|
|
4
|
-
* - replaces too many consecutive slashes
|
|
5
|
-
* - removes the trailing slash
|
|
6
|
-
*
|
|
7
|
-
* @category location
|
|
8
|
-
*/
|
|
9
|
-
export declare function normaliseUrlPathname(pathname?: string): string;
|
|
10
|
-
export default normaliseUrlPathname;
|
|
1
|
+
export declare let normaliseUrlPathname: (pathname?: string) => string;
|
package/objectFlat.d.ts
ADDED
package/objectFlip.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare let objectFlip: <T extends PropertyKey, U extends PropertyKey>(input: Record<T, U>, keyTransformer?: ((key: string) => T) | undefined) => Record<U, T>;
|
package/objectOmit.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Omit object properties by removing the given keys, it returns a
|
|
3
|
-
* new object.
|
|
4
|
-
*
|
|
5
|
-
* NOTE: most of the time using a normal [destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) is enough,
|
|
6
|
-
* use this utility only when it makes sense.
|
|
7
|
-
*
|
|
8
|
-
* @category objects
|
|
9
|
-
*/
|
|
10
|
-
export declare function objectOmit<T extends object, Keys extends (keyof T)[]>(object: T, keys: Keys): Omit<T, Keys[number]>;
|
|
11
|
-
export default objectOmit;
|
|
1
|
+
export declare let objectOmit: <T extends object, Keys extends (keyof T)[]>(object: T, keys: Keys) => Omit<T, Keys[number]>;
|
package/objectPick.d.ts
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Pick object properties by selecting only the given keys, it returns a
|
|
3
|
-
* new object.
|
|
4
|
-
*
|
|
5
|
-
* @category objects
|
|
6
|
-
*/
|
|
7
|
-
export declare function objectPick<T extends object, Keys extends (keyof T)[]>(object: T, keys: Keys): Pick<T, Keys[number]>;
|
|
8
|
-
export default objectPick;
|
|
1
|
+
export declare let objectPick: <T extends object, Keys extends (keyof T)[]>(object: T, keys: Keys) => Pick<T, Keys[number]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare let objectToArray: <T extends object, R>(obj: T, iterator: (key: keyof T, index: number) => R) => R[];
|
package/package.json
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
"name": "@koine/utils",
|
|
3
3
|
"sideEffects": false,
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"
|
|
6
|
-
"ts-debounce": "^4.0.0",
|
|
7
|
-
"type-fest": "^3.12.0"
|
|
5
|
+
"type-fest": "^4.9.0"
|
|
8
6
|
},
|
|
9
|
-
"module": "./index.mjs",
|
|
10
|
-
"main": "./index.js",
|
|
11
7
|
"exports": {
|
|
8
|
+
"./package.json": "./package.json",
|
|
12
9
|
".": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
10
|
+
"module": "./index.esm.js",
|
|
11
|
+
"import": "./index.cjs.mjs",
|
|
12
|
+
"default": "./index.cjs.js"
|
|
15
13
|
}
|
|
16
14
|
},
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
15
|
+
"module": "./index.esm.js",
|
|
16
|
+
"main": "./index.cjs.js",
|
|
17
|
+
"version": "2.0.0-beta.42"
|
|
18
|
+
}
|
package/parseCookie.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Parse a cookie header.
|
|
4
|
-
*
|
|
5
|
-
* Parse the given cookie header string into an object
|
|
6
|
-
* The object has the various cookies as keys(names) => values
|
|
7
|
-
*
|
|
8
|
-
* @category cookie
|
|
9
|
-
*/
|
|
10
|
-
export declare function parseCookie<T extends Record<string, unknown> = Record<string, string>>(str: string, attributes?: CookieAttributesServer): T;
|
|
11
|
-
export default parseCookie;
|
|
1
|
+
import type { CookieAttributesServer } from "./cookie";
|
|
2
|
+
export declare let parseCookie: <T extends Record<string, unknown> = Record<string, string>>(str: string, attributes?: CookieAttributesServer) => T;
|
package/parseURL.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Solution without DOM or specific env native methods
|
|
3
|
-
*
|
|
4
|
-
* @category location
|
|
5
|
-
* @see https://stackoverflow.com/a/21553982/1938970
|
|
6
|
-
*/
|
|
7
|
-
export declare function parseURL(url: string): {
|
|
1
|
+
export declare let parseURL: (url: string) => {
|
|
8
2
|
href: string;
|
|
9
3
|
protocol: string;
|
|
10
4
|
host: string;
|
|
@@ -14,4 +8,3 @@ export declare function parseURL(url: string): {
|
|
|
14
8
|
search: string;
|
|
15
9
|
hash: string;
|
|
16
10
|
} | null;
|
|
17
|
-
export default parseURL;
|
package/quaranteneProps.d.ts
CHANGED
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
* @category impl
|
|
3
|
-
* @usage
|
|
4
|
-
*
|
|
5
|
-
* ```ts
|
|
6
|
-
* const { _: { onKeyDown }, myOwnProp, ...rest } = quaranteneProps([
|
|
7
|
-
* "onPointerLeave",
|
|
8
|
-
* "onPointerMove",
|
|
9
|
-
* "onClick",
|
|
10
|
-
* "onPointerDown",
|
|
11
|
-
* "onPointerUp",
|
|
12
|
-
* "onKeyDown",
|
|
13
|
-
* ]);
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare function quaranteneProps<TProps extends Record<never, never>, TSupectPropsKeys extends QuaranteneProps<TProps>>(props: TProps, propsKeysToQuarantene: TSupectPropsKeys): Omit<TProps, TSupectPropsKeys[number]> & {
|
|
1
|
+
export declare let quaranteneProps: <TProps extends Record<never, never>, TSupectPropsKeys extends QuaranteneProps<TProps>>(props: TProps, propsKeysToQuarantene: TSupectPropsKeys) => Omit<TProps, TSupectPropsKeys[number]> & {
|
|
17
2
|
_: Pick<TProps, TSupectPropsKeys[number]>;
|
|
18
3
|
};
|
|
19
|
-
export default quaranteneProps;
|
|
20
4
|
type QuaranteneProps<TProps extends Record<never, never>> = readonly (keyof {
|
|
21
5
|
[K in keyof TProps]?: TProps[K];
|
|
22
6
|
})[];
|
|
7
|
+
export {};
|
package/randomInt.d.ts
CHANGED
package/randomKey.d.ts
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Get random key from given object
|
|
3
|
-
*
|
|
4
|
-
* @category misc
|
|
5
|
-
* @see https://stackoverflow.com/a/15106541/1938970
|
|
6
|
-
*/
|
|
7
|
-
export declare function randomKey<T extends Record<string | number, unknown>>(obj: T): keyof T;
|
|
8
|
-
export default randomKey;
|
|
1
|
+
export declare let randomKey: <T extends Record<string | number, unknown>>(obj: T) => keyof T;
|
package/readCookie.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export declare function readCookie<T extends Record<string, unknown> = Record<string, string>>(name?: null): T;
|
|
2
2
|
export declare function readCookie<T extends Record<string, unknown> = Record<string, string>, N extends keyof T = keyof T>(name: N): T[N];
|
|
3
|
-
export default readCookie;
|
package/removeAccents.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* @category text
|
|
4
|
-
*/
|
|
5
|
-
export declare function removeAccents(text?: string, sets?: AccentsSet[]): string;
|
|
6
|
-
export default removeAccents;
|
|
1
|
+
import type { AccentsSet } from "./accentSets";
|
|
2
|
+
export declare let removeAccents: (text?: string, sets?: AccentsSet[]) => string;
|
package/removeCookie.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import { type CookieAttributesClient } from "./cookie";
|
|
2
|
-
|
|
3
|
-
* @category cookie
|
|
4
|
-
*
|
|
5
|
-
* All cookie related code is inspired and adapted from:
|
|
6
|
-
* - [js-cookie](https://github.com/js-cookie/js-cookie)
|
|
7
|
-
* - [cookie](https://github.com/jshttp/cookie)
|
|
8
|
-
*/
|
|
9
|
-
export declare function removeCookie(name: string, attributes?: CookieAttributesClient): void;
|
|
10
|
-
export default removeCookie;
|
|
2
|
+
export declare let removeCookie: (name: string, attributes?: CookieAttributesClient) => void;
|
package/removeDuplicates.d.ts
CHANGED
|
File without changes
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Remove duplicated array objects, equality is determined by a strict (`===`)
|
|
3
|
-
* comparison of each object's given key
|
|
4
|
-
*
|
|
5
|
-
* @category array
|
|
6
|
-
*/
|
|
7
|
-
export declare function removeDuplicatesByKey<T extends Record<string | number | symbol, any>>(array: T[] | undefined, key: keyof T): T[];
|
|
8
|
-
export default removeDuplicatesByKey;
|
|
1
|
+
export declare let removeDuplicatesByKey: <T extends Record<string | number | symbol, any>>(array: T[] | undefined, key: keyof T) => T[];
|