@koine/utils 2.0.0-beta.2 → 2.0.0-beta.21
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 -14
- package/Defer.js +2 -21
- package/Emitter.d.ts +0 -18
- package/Emitter.js +2 -24
- package/accentSets.d.ts +0 -13
- package/accentSets.js +2 -13
- package/addOrReplaceAtIdx.d.ts +0 -3
- package/addOrReplaceAtIdx.js +4 -11
- package/areEqual.d.ts +0 -15
- package/areEqual.js +24 -39
- package/arrayOfAll.d.ts +0 -26
- package/arrayOfAll.js +2 -32
- package/arraySum.d.ts +0 -5
- package/arraySum.js +2 -11
- package/arrayToLookup.d.ts +0 -5
- package/arrayToLookup.js +2 -11
- package/arrayUniqueByProperties.d.ts +2 -0
- package/arrayUniqueByProperties.js +8 -0
- package/buildUrlQueryString.d.ts +1 -10
- package/buildUrlQueryString.js +7 -22
- package/capitalize.d.ts +0 -6
- package/capitalize.js +2 -12
- package/changeUrlPath.d.ts +0 -8
- package/changeUrlPath.js +6 -19
- package/chunkByChunks.d.ts +0 -5
- package/chunkByChunks.js +2 -11
- package/chunkBySize.d.ts +0 -4
- package/chunkBySize.js +2 -10
- package/cjs/Defer.d.ts +6 -0
- package/cjs/Defer.js +15 -0
- package/cjs/Emitter.d.ts +7 -0
- package/{Emitter.mjs → cjs/Emitter.js} +6 -20
- package/cjs/accentSets.d.ts +3 -0
- package/{accentSets.mjs → cjs/accentSets.js} +5 -10
- package/cjs/addOrReplaceAtIdx.d.ts +2 -0
- package/cjs/addOrReplaceAtIdx.js +20 -0
- package/cjs/areEqual.d.ts +4 -0
- package/cjs/areEqual.js +70 -0
- package/cjs/arrayOfAll.d.ts +2 -0
- package/cjs/arrayOfAll.js +10 -0
- package/cjs/arraySum.d.ts +2 -0
- package/cjs/arraySum.js +8 -0
- package/cjs/arrayToLookup.d.ts +2 -0
- package/cjs/arrayToLookup.js +12 -0
- package/cjs/arrayUniqueByProperties.d.ts +2 -0
- package/cjs/arrayUniqueByProperties.js +12 -0
- package/cjs/buildUrlQueryString.d.ts +3 -0
- package/cjs/buildUrlQueryString.js +25 -0
- package/cjs/capitalize.d.ts +2 -0
- package/cjs/capitalize.js +10 -0
- package/cjs/changeUrlPath.d.ts +2 -0
- package/cjs/changeUrlPath.js +14 -0
- package/cjs/chunkByChunks.d.ts +2 -0
- package/{chunkByChunks.mjs → cjs/chunkByChunks.js} +6 -7
- package/cjs/chunkBySize.d.ts +2 -0
- package/cjs/chunkBySize.js +12 -0
- package/cjs/clamp.d.ts +2 -0
- package/cjs/clamp.js +8 -0
- package/cjs/clsx.d.ts +6 -0
- package/{clsx.mjs → cjs/clsx.js} +6 -11
- package/cjs/convertRange.d.ts +2 -0
- package/cjs/convertRange.js +8 -0
- package/cjs/cookie.d.ts +18 -0
- package/cjs/cookie.js +4 -0
- package/cjs/createPalette.d.ts +10 -0
- package/cjs/createPalette.js +16 -0
- package/cjs/debounce.d.ts +2 -0
- package/{debounce.mjs → cjs/debounce.js} +6 -9
- package/cjs/debouncePromise.d.ts +11 -0
- package/cjs/debouncePromise.js +69 -0
- package/cjs/debounceRaf.d.ts +2 -0
- package/cjs/debounceRaf.js +21 -0
- package/cjs/decode.d.ts +2 -0
- package/cjs/decode.js +10 -0
- package/cjs/encode.d.ts +2 -0
- package/cjs/encode.js +10 -0
- package/cjs/ensureInt.d.ts +2 -0
- package/cjs/ensureInt.js +8 -0
- package/cjs/env.d.ts +0 -0
- package/cjs/env.js +1 -0
- package/cjs/errorToString.d.ts +2 -0
- package/cjs/errorToString.js +9 -0
- package/cjs/findDuplicatedIndexes.d.ts +2 -0
- package/cjs/findDuplicatedIndexes.js +15 -0
- package/cjs/forin.d.ts +2 -0
- package/cjs/forin.js +10 -0
- package/cjs/gbToBytes.d.ts +2 -0
- package/cjs/gbToBytes.js +6 -0
- package/cjs/getEmptyArray.d.ts +2 -0
- package/cjs/getEmptyArray.js +12 -0
- package/cjs/getKeys.d.ts +2 -0
- package/cjs/getKeys.js +5 -0
- package/cjs/getMediaQueryWidthResolvers.d.ts +10 -0
- package/{getMediaQueryWidthResolvers.mjs → cjs/getMediaQueryWidthResolvers.js} +8 -32
- package/cjs/getMediaQueryWidthTailwindScreens.d.ts +5 -0
- package/{getMediaQueryWidthTailwindScreens.mjs → cjs/getMediaQueryWidthTailwindScreens.js} +8 -6
- package/cjs/getNonce.d.ts +2 -0
- package/cjs/getNonce.js +9 -0
- package/cjs/getParamAmong.d.ts +2 -0
- package/cjs/getParamAmong.js +11 -0
- package/cjs/getParamAsInt.d.ts +2 -0
- package/cjs/getParamAsInt.js +14 -0
- package/cjs/getParamAsString.d.ts +2 -0
- package/cjs/getParamAsString.js +9 -0
- package/cjs/getType.d.ts +7 -0
- package/cjs/getType.js +8 -0
- package/cjs/getUrlHashParams.d.ts +3 -0
- package/cjs/getUrlHashParams.js +14 -0
- package/cjs/getUrlHashPathname.d.ts +2 -0
- package/cjs/getUrlHashPathname.js +10 -0
- package/cjs/getUrlPathnameParts.d.ts +2 -0
- package/cjs/getUrlPathnameParts.js +14 -0
- package/cjs/getUrlQueryParams.d.ts +3 -0
- package/cjs/getUrlQueryParams.js +29 -0
- package/cjs/imgEmptyPixel.d.ts +2 -0
- package/cjs/imgEmptyPixel.js +5 -0
- package/{index.mjs → cjs/index.d.ts} +15 -8
- package/cjs/index.js +275 -0
- package/cjs/invariant.d.ts +2 -0
- package/cjs/invariant.js +21 -0
- package/cjs/isAnyObject.d.ts +3 -0
- package/cjs/isAnyObject.js +9 -0
- package/cjs/isArray.d.ts +2 -0
- package/cjs/isArray.js +9 -0
- package/cjs/isBlob.d.ts +2 -0
- package/cjs/isBlob.js +9 -0
- package/cjs/isBoolean.d.ts +2 -0
- package/cjs/isBoolean.js +9 -0
- package/cjs/isBrowser.d.ts +2 -0
- package/cjs/isBrowser.js +5 -0
- package/cjs/isBrowserNow.d.ts +2 -0
- package/cjs/isBrowserNow.js +7 -0
- package/cjs/isDate.d.ts +2 -0
- package/cjs/isDate.js +9 -0
- package/cjs/isEmptyArray.d.ts +2 -0
- package/cjs/isEmptyArray.js +9 -0
- package/cjs/isEmptyObject.d.ts +4 -0
- package/cjs/isEmptyObject.js +9 -0
- package/cjs/isEmptyString.d.ts +2 -0
- package/cjs/isEmptyString.js +8 -0
- package/cjs/isError.d.ts +2 -0
- package/cjs/isError.js +9 -0
- package/cjs/isExternalUrl.d.ts +2 -0
- package/cjs/isExternalUrl.js +16 -0
- package/cjs/isFile.d.ts +2 -0
- package/cjs/isFile.js +9 -0
- package/cjs/isFloat.d.ts +2 -0
- package/cjs/isFloat.js +9 -0
- package/cjs/isFormData.d.ts +2 -0
- package/cjs/isFormData.js +9 -0
- package/cjs/isFullArray.d.ts +2 -0
- package/cjs/isFullArray.js +9 -0
- package/cjs/isFullObject.d.ts +3 -0
- package/cjs/isFullObject.js +9 -0
- package/cjs/isFullString.d.ts +2 -0
- package/cjs/isFullString.js +9 -0
- package/cjs/isFunction.d.ts +3 -0
- package/cjs/isFunction.js +8 -0
- package/cjs/isInt.d.ts +2 -0
- package/cjs/isInt.js +9 -0
- package/cjs/isMap.d.ts +2 -0
- package/cjs/isMap.js +9 -0
- package/cjs/isNaNValue.d.ts +2 -0
- package/cjs/isNaNValue.js +9 -0
- package/cjs/isNegativeNumber.d.ts +2 -0
- package/cjs/isNegativeNumber.js +9 -0
- package/cjs/isNull.d.ts +2 -0
- package/cjs/isNull.js +9 -0
- package/cjs/isNullOrUndefined.d.ts +2 -0
- package/cjs/isNullOrUndefined.js +8 -0
- package/cjs/isNumber.d.ts +2 -0
- package/cjs/isNumber.js +9 -0
- package/cjs/isObject.d.ts +3 -0
- package/cjs/isObject.js +9 -0
- package/cjs/isObjectLike.d.ts +3 -0
- package/cjs/isObjectLike.js +9 -0
- package/cjs/isOneOf.d.ts +6 -0
- package/cjs/isOneOf.js +14 -0
- package/cjs/isPlainObject.d.ts +3 -0
- package/cjs/isPlainObject.js +12 -0
- package/cjs/isPositiveNumber.d.ts +2 -0
- package/cjs/isPositiveNumber.js +9 -0
- package/cjs/isPrimitive.d.ts +2 -0
- package/cjs/isPrimitive.js +19 -0
- package/cjs/isPromise.d.ts +2 -0
- package/cjs/isPromise.js +9 -0
- package/cjs/isRegExp.d.ts +2 -0
- package/cjs/isRegExp.js +9 -0
- package/cjs/isServer.d.ts +2 -0
- package/cjs/isServer.js +6 -0
- package/cjs/isServerNow.d.ts +2 -0
- package/cjs/isServerNow.js +7 -0
- package/cjs/isSet.d.ts +2 -0
- package/cjs/isSet.js +9 -0
- package/cjs/isString.d.ts +2 -0
- package/cjs/isString.js +9 -0
- package/cjs/isSymbol.d.ts +2 -0
- package/cjs/isSymbol.js +9 -0
- package/cjs/isType.d.ts +3 -0
- package/cjs/isType.js +17 -0
- package/cjs/isUndefined.d.ts +2 -0
- package/cjs/isUndefined.js +9 -0
- package/cjs/isWeakMap.d.ts +2 -0
- package/cjs/isWeakMap.js +9 -0
- package/cjs/isWeakSet.d.ts +2 -0
- package/cjs/isWeakSet.js +9 -0
- package/cjs/kbToBytes.d.ts +2 -0
- package/cjs/kbToBytes.js +6 -0
- package/cjs/location.d.ts +1 -0
- package/cjs/location.js +2 -0
- package/cjs/lowercase.d.ts +2 -0
- package/cjs/lowercase.js +8 -0
- package/cjs/mapListBy.d.ts +2 -0
- package/cjs/mapListBy.js +13 -0
- package/cjs/matchSorter.d.ts +54 -0
- package/{matchSorter.mjs → cjs/matchSorter.js} +13 -124
- package/cjs/mbToBytes.d.ts +2 -0
- package/cjs/mbToBytes.js +6 -0
- package/cjs/mergeObjects.d.ts +1 -0
- package/cjs/mergeObjects.js +37 -0
- package/cjs/mergeUrlQueryParams.d.ts +3 -0
- package/cjs/mergeUrlQueryParams.js +20 -0
- package/cjs/moveSortableArrayItemByKey.d.ts +2 -0
- package/cjs/moveSortableArrayItemByKey.js +14 -0
- package/cjs/noop.d.ts +2 -0
- package/cjs/noop.js +6 -0
- package/cjs/normaliseUrl.d.ts +2 -0
- package/cjs/normaliseUrl.js +10 -0
- package/cjs/normaliseUrlPathname.d.ts +2 -0
- package/cjs/normaliseUrlPathname.js +10 -0
- package/cjs/objectFlip.d.ts +2 -0
- package/cjs/objectFlip.js +15 -0
- package/cjs/objectOmit.d.ts +2 -0
- package/cjs/objectOmit.js +14 -0
- package/cjs/objectPick.d.ts +2 -0
- package/cjs/objectPick.js +13 -0
- package/cjs/objectToArray.d.ts +2 -0
- package/cjs/objectToArray.js +8 -0
- package/cjs/package.json +6 -0
- package/cjs/parseCookie.d.ts +3 -0
- package/{parseCookie.mjs → cjs/parseCookie.js} +6 -16
- package/cjs/parseURL.d.ts +11 -0
- package/{parseURL.mjs → cjs/parseURL.js} +6 -8
- package/cjs/quaranteneProps.d.ts +7 -0
- package/cjs/quaranteneProps.js +20 -0
- package/cjs/randomInt.d.ts +2 -0
- package/cjs/randomInt.js +8 -0
- package/cjs/randomKey.d.ts +2 -0
- package/cjs/randomKey.js +9 -0
- package/cjs/readCookie.d.ts +3 -0
- package/{readCookie.mjs → cjs/readCookie.js} +8 -4
- package/cjs/removeAccents.d.ts +3 -0
- package/cjs/removeAccents.js +17 -0
- package/cjs/removeCookie.d.ts +3 -0
- package/cjs/removeCookie.js +12 -0
- package/cjs/removeDuplicates.d.ts +0 -0
- package/cjs/removeDuplicates.js +1 -0
- package/cjs/removeDuplicatesByKey.d.ts +2 -0
- package/{removeDuplicatesByKey.mjs → cjs/removeDuplicatesByKey.js} +6 -8
- package/cjs/removeDuplicatesComparing.d.ts +2 -0
- package/cjs/removeDuplicatesComparing.js +11 -0
- package/cjs/removeIndexesFromArray.d.ts +2 -0
- package/cjs/removeIndexesFromArray.js +14 -0
- package/cjs/removeTrailingSlash.d.ts +2 -0
- package/cjs/removeTrailingSlash.js +9 -0
- package/cjs/removeUrlQueryParams.d.ts +2 -0
- package/cjs/removeUrlQueryParams.js +19 -0
- package/cjs/render.d.ts +13 -0
- package/{render.mjs → cjs/render.js} +8 -50
- package/cjs/round.d.ts +3 -0
- package/cjs/round.js +10 -0
- package/cjs/roundTo.d.ts +2 -0
- package/cjs/roundTo.js +16 -0
- package/cjs/serializeCookie.d.ts +3 -0
- package/{serializeCookie.mjs → cjs/serializeCookie.js} +11 -41
- package/cjs/setCookie.d.ts +3 -0
- package/{setCookie.mjs → cjs/setCookie.js} +15 -26
- package/cjs/shuffle.d.ts +2 -0
- package/cjs/shuffle.js +22 -0
- package/cjs/slugify.d.ts +2 -0
- package/cjs/slugify.js +18 -0
- package/cjs/split.d.ts +3 -0
- package/cjs/split.js +6 -0
- package/cjs/swapMap.d.ts +2 -0
- package/cjs/swapMap.js +13 -0
- package/cjs/throttle.d.ts +2 -0
- package/{throttle.mjs → cjs/throttle.js} +8 -10
- package/cjs/titleCase.d.ts +2 -0
- package/cjs/titleCase.js +10 -0
- package/cjs/toNumber.d.ts +2 -0
- package/cjs/toNumber.js +9 -0
- package/cjs/toRgba.d.ts +2 -0
- package/cjs/toRgba.js +13 -0
- package/cjs/transformToUrlPathname.d.ts +2 -0
- package/cjs/transformToUrlPathname.js +11 -0
- package/cjs/truncate.d.ts +2 -0
- package/cjs/truncate.js +12 -0
- package/cjs/tryUntil.d.ts +2 -0
- package/cjs/tryUntil.js +19 -0
- package/cjs/types.d.ts +10 -0
- package/cjs/types.js +2 -0
- package/cjs/uid.d.ts +2 -0
- package/cjs/uid.js +11 -0
- package/cjs/updateLinkParams.d.ts +3 -0
- package/cjs/updateLinkParams.js +11 -0
- package/cjs/updateUrlQueryParams.d.ts +3 -0
- package/cjs/updateUrlQueryParams.js +16 -0
- package/cjs/uppercase.d.ts +2 -0
- package/cjs/uppercase.js +8 -0
- package/cjs/uuid.d.ts +2 -0
- package/{uuid.mjs → cjs/uuid.js} +6 -8
- package/cjs/uuidNumeric.d.ts +2 -0
- package/cjs/uuidNumeric.js +6 -0
- package/cjs/wait.d.ts +2 -0
- package/cjs/wait.js +8 -0
- package/cjs/without.d.ts +0 -0
- package/cjs/without.js +1 -0
- package/clamp.d.ts +0 -6
- package/clamp.js +2 -12
- package/clsx.d.ts +4 -7
- package/clsx.js +2 -15
- package/convertRange.d.ts +0 -12
- package/convertRange.js +2 -18
- package/cookie.d.ts +0 -36
- package/cookie.js +1 -13
- package/createPalette.d.ts +0 -10
- package/createPalette.js +2 -16
- package/debounce.d.ts +0 -6
- package/debounce.js +2 -13
- package/debouncePromise.d.ts +10 -10
- package/debouncePromise.js +65 -12
- package/debounceRaf.d.ts +0 -7
- package/debounceRaf.js +2 -16
- package/decode.d.ts +0 -4
- package/decode.js +2 -10
- package/encode.d.ts +0 -4
- package/encode.js +2 -10
- package/ensureInt.d.ts +0 -5
- package/ensureInt.js +2 -11
- package/env.d.ts +0 -0
- package/env.js +0 -2
- package/errorToString.d.ts +0 -5
- package/errorToString.js +4 -14
- package/findDuplicatedIndexes.d.ts +0 -3
- package/findDuplicatedIndexes.js +2 -9
- package/forin.d.ts +0 -5
- package/forin.js +2 -11
- package/gbToBytes.d.ts +0 -5
- package/gbToBytes.js +2 -11
- package/getEmptyArray.d.ts +0 -7
- package/getEmptyArray.js +4 -16
- package/getKeys.d.ts +0 -7
- package/getKeys.js +2 -12
- package/getMediaQueryWidthResolvers.d.ts +0 -0
- package/getMediaQueryWidthResolvers.js +4 -36
- package/getMediaQueryWidthTailwindScreens.d.ts +1 -1
- package/getMediaQueryWidthTailwindScreens.js +4 -10
- package/getNonce.d.ts +0 -4
- package/getNonce.js +4 -12
- package/getParamAmong.d.ts +0 -10
- package/getParamAmong.js +4 -19
- package/getParamAsInt.d.ts +0 -10
- package/getParamAsInt.js +4 -19
- package/getParamAsString.d.ts +0 -9
- package/getParamAsString.js +4 -18
- package/getType.d.ts +0 -15
- package/getType.js +2 -21
- package/getUrlHashParams.d.ts +1 -7
- package/getUrlHashParams.js +2 -12
- package/getUrlHashPathname.d.ts +0 -7
- package/getUrlHashPathname.js +2 -13
- package/getUrlPathnameParts.d.ts +0 -10
- package/getUrlPathnameParts.js +4 -19
- package/getUrlQueryParams.d.ts +1 -12
- package/getUrlQueryParams.js +4 -22
- package/imgEmptyPixel.d.ts +0 -5
- package/imgEmptyPixel.js +2 -10
- package/index.d.ts +139 -134
- package/index.js +135 -267
- package/invariant.d.ts +0 -17
- package/invariant.js +3 -24
- package/isAnyObject.d.ts +1 -6
- package/isAnyObject.js +4 -14
- package/isArray.d.ts +0 -5
- package/isArray.js +4 -14
- package/isBlob.d.ts +0 -5
- package/isBlob.js +4 -14
- package/isBoolean.d.ts +0 -5
- package/isBoolean.js +4 -14
- package/isBrowser.d.ts +0 -4
- package/isBrowser.js +2 -9
- package/isBrowserNow.d.ts +0 -4
- package/isBrowserNow.js +3 -12
- package/isDate.d.ts +0 -5
- package/isDate.js +4 -14
- package/isEmptyArray.d.ts +0 -5
- package/isEmptyArray.js +4 -14
- package/isEmptyObject.d.ts +0 -5
- package/isEmptyObject.js +4 -14
- package/isEmptyString.d.ts +0 -5
- package/isEmptyString.js +2 -11
- package/isError.d.ts +0 -5
- package/isError.js +4 -14
- package/isExternalUrl.d.ts +0 -7
- package/isExternalUrl.js +4 -18
- package/isFile.d.ts +0 -5
- package/isFile.js +4 -14
- package/isFloat.d.ts +0 -5
- package/isFloat.js +4 -14
- package/isFormData.d.ts +0 -5
- package/isFormData.js +4 -14
- package/isFullArray.d.ts +0 -5
- package/isFullArray.js +4 -14
- package/isFullObject.d.ts +1 -6
- package/isFullObject.js +4 -14
- package/isFullString.d.ts +0 -5
- package/isFullString.js +4 -14
- package/isFunction.d.ts +1 -6
- package/isFunction.js +2 -11
- package/isInt.d.ts +0 -5
- package/isInt.js +4 -14
- package/isMap.d.ts +0 -5
- package/isMap.js +4 -14
- package/isNaNValue.d.ts +0 -5
- package/isNaNValue.js +4 -14
- package/isNegativeNumber.d.ts +0 -5
- package/isNegativeNumber.js +4 -14
- package/isNull.d.ts +0 -5
- package/isNull.js +4 -14
- package/isNullOrUndefined.d.ts +0 -5
- package/isNullOrUndefined.js +5 -14
- package/isNumber.d.ts +0 -7
- package/isNumber.js +4 -16
- package/isObject.d.ts +1 -6
- package/isObject.js +4 -14
- package/isObjectLike.d.ts +1 -8
- package/isObjectLike.js +4 -16
- package/isOneOf.d.ts +1 -4
- package/isOneOf.js +2 -6
- package/isPlainObject.d.ts +1 -6
- package/isPlainObject.js +4 -14
- package/isPositiveNumber.d.ts +0 -5
- package/isPositiveNumber.js +4 -14
- package/isPrimitive.d.ts +0 -5
- package/isPrimitive.js +14 -24
- package/isPromise.d.ts +0 -5
- package/isPromise.js +4 -14
- package/isRegExp.d.ts +0 -5
- package/isRegExp.js +4 -14
- package/isServer.d.ts +0 -4
- package/isServer.js +3 -12
- package/isServerNow.d.ts +0 -4
- package/isServerNow.js +3 -12
- package/isSet.d.ts +0 -5
- package/isSet.js +4 -14
- package/isString.d.ts +0 -5
- package/isString.js +4 -14
- package/isSymbol.d.ts +0 -5
- package/isSymbol.js +4 -14
- package/isType.d.ts +1 -9
- package/isType.js +4 -18
- package/isUndefined.d.ts +0 -5
- package/isUndefined.js +4 -14
- package/isWeakMap.d.ts +0 -5
- package/isWeakMap.js +4 -14
- package/isWeakSet.d.ts +0 -5
- package/isWeakSet.js +4 -14
- package/kbToBytes.d.ts +0 -5
- package/kbToBytes.js +2 -11
- package/location.d.ts +0 -3
- package/location.js +1 -2
- package/lowercase.d.ts +0 -5
- package/lowercase.js +2 -11
- package/mapListBy.d.ts +0 -5
- package/mapListBy.js +2 -11
- package/matchSorter.d.ts +0 -7
- package/matchSorter.js +9 -128
- package/mbToBytes.d.ts +0 -5
- package/mbToBytes.js +2 -11
- package/mergeObjects.d.ts +1 -7
- package/mergeObjects.js +11 -19
- package/mergeUrlQueryParams.d.ts +1 -7
- package/mergeUrlQueryParams.js +4 -15
- package/moveSortableArrayItemByKey.d.ts +0 -7
- package/moveSortableArrayItemByKey.js +5 -16
- package/noop.d.ts +0 -5
- package/noop.js +2 -11
- package/normaliseUrl.d.ts +0 -9
- package/normaliseUrl.js +4 -18
- package/normaliseUrlPathname.d.ts +0 -8
- package/normaliseUrlPathname.js +4 -17
- package/objectFlip.d.ts +2 -0
- package/objectFlip.js +11 -0
- package/objectOmit.d.ts +0 -9
- package/objectOmit.js +2 -15
- package/objectPick.d.ts +0 -6
- package/objectPick.js +2 -12
- package/objectToArray.d.ts +2 -0
- package/objectToArray.js +4 -0
- package/package.json +583 -11
- package/parseCookie.d.ts +1 -9
- package/parseCookie.js +2 -20
- package/parseURL.d.ts +0 -6
- package/parseURL.js +2 -12
- package/quaranteneProps.d.ts +0 -15
- package/quaranteneProps.js +2 -23
- package/randomInt.d.ts +0 -5
- package/randomInt.js +2 -11
- package/randomKey.d.ts +0 -6
- package/randomKey.js +2 -12
- package/readCookie.d.ts +0 -0
- package/readCookie.js +4 -8
- package/removeAccents.d.ts +1 -4
- package/removeAccents.js +6 -12
- package/removeCookie.d.ts +1 -8
- package/removeCookie.js +6 -17
- package/removeDuplicates.d.ts +0 -0
- package/removeDuplicates.js +0 -12
- package/removeDuplicatesByKey.d.ts +0 -6
- package/removeDuplicatesByKey.js +2 -12
- package/removeDuplicatesComparing.d.ts +0 -3
- package/removeDuplicatesComparing.js +6 -13
- package/removeIndexesFromArray.d.ts +0 -3
- package/removeIndexesFromArray.js +2 -10
- package/removeTrailingSlash.d.ts +0 -5
- package/removeTrailingSlash.js +2 -11
- package/removeUrlQueryParams.d.ts +0 -6
- package/removeUrlQueryParams.js +6 -17
- package/render.d.ts +0 -39
- package/render.js +4 -54
- package/round.d.ts +3 -0
- package/round.js +6 -0
- package/roundTo.d.ts +0 -6
- package/roundTo.js +3 -29
- package/serializeCookie.d.ts +1 -25
- package/serializeCookie.js +7 -45
- package/setCookie.d.ts +1 -8
- package/setCookie.js +11 -30
- package/shuffle.d.ts +0 -14
- package/shuffle.js +4 -22
- package/slugify.d.ts +0 -9
- package/slugify.js +11 -24
- package/split.d.ts +1 -1
- package/split.js +2 -8
- package/swapMap.d.ts +0 -5
- package/swapMap.js +2 -11
- package/throttle.d.ts +0 -6
- package/throttle.js +4 -14
- package/titleCase.d.ts +0 -5
- package/titleCase.js +2 -11
- package/toNumber.d.ts +0 -3
- package/toNumber.js +4 -11
- package/toRgba.d.ts +0 -3
- package/toRgba.js +2 -13
- package/transformToUrlPathname.d.ts +0 -9
- package/transformToUrlPathname.js +4 -18
- package/truncate.d.ts +0 -5
- package/truncate.js +2 -11
- package/tryUntil.d.ts +0 -6
- package/tryUntil.js +2 -18
- package/types.d.ts +0 -18
- package/types.js +1 -2
- package/typings.d.ts +1 -6
- package/uid.d.ts +0 -5
- package/uid.js +2 -11
- package/updateLinkParams.d.ts +1 -8
- package/updateLinkParams.js +4 -16
- package/updateUrlQueryParams.d.ts +1 -7
- package/updateUrlQueryParams.js +7 -18
- package/uppercase.d.ts +0 -5
- package/uppercase.js +2 -11
- package/uuid.d.ts +0 -6
- package/uuid.js +2 -12
- package/uuidNumeric.d.ts +0 -4
- package/uuidNumeric.js +2 -10
- package/wait.d.ts +0 -5
- package/wait.js +2 -11
- package/without.d.ts +0 -0
- package/without.js +0 -55
- package/Defer.mjs +0 -26
- package/README.md +0 -42
- package/addOrReplaceAtIdx.mjs +0 -19
- package/areEqual.mjs +0 -77
- package/arrayOfAll.mjs +0 -32
- package/arraySum.mjs +0 -9
- package/arrayToLookup.mjs +0 -13
- package/buildUrlQueryString.mjs +0 -31
- package/capitalize.mjs +0 -12
- package/changeUrlPath.mjs +0 -18
- package/chunkBySize.mjs +0 -12
- package/clamp.mjs +0 -10
- package/convertRange.mjs +0 -16
- package/cookie.mjs +0 -10
- package/createPalette.mjs +0 -22
- package/debouncePromise.mjs +0 -9
- package/debounceRaf.mjs +0 -27
- package/decode.mjs +0 -10
- package/encode.mjs +0 -10
- package/ensureInt.mjs +0 -9
- package/env.mjs +0 -3
- package/errorToString.mjs +0 -10
- package/findDuplicatedIndexes.mjs +0 -14
- package/forin.mjs +0 -11
- package/gbToBytes.mjs +0 -7
- package/getEmptyArray.mjs +0 -15
- package/getKeys.mjs +0 -9
- package/getNonce.mjs +0 -9
- package/getParamAmong.mjs +0 -17
- package/getParamAsInt.mjs +0 -20
- package/getParamAsString.mjs +0 -14
- package/getType.mjs +0 -19
- package/getUrlHashParams.mjs +0 -16
- package/getUrlHashPathname.mjs +0 -13
- package/getUrlPathnameParts.mjs +0 -20
- package/getUrlQueryParams.mjs +0 -38
- package/imgEmptyPixel.mjs +0 -7
- package/invariant.mjs +0 -34
- package/isAnyObject.mjs +0 -10
- package/isArray.mjs +0 -10
- package/isBlob.mjs +0 -10
- package/isBoolean.mjs +0 -10
- package/isBrowser.mjs +0 -6
- package/isBrowserNow.mjs +0 -7
- package/isDate.mjs +0 -10
- package/isEmptyArray.mjs +0 -10
- package/isEmptyObject.mjs +0 -10
- package/isEmptyString.mjs +0 -9
- package/isError.mjs +0 -10
- package/isExternalUrl.mjs +0 -21
- package/isFile.mjs +0 -10
- package/isFloat.mjs +0 -10
- package/isFormData.mjs +0 -10
- package/isFullArray.mjs +0 -10
- package/isFullObject.mjs +0 -10
- package/isFullString.mjs +0 -10
- package/isFunction.mjs +0 -9
- package/isInt.mjs +0 -10
- package/isMap.mjs +0 -10
- package/isNaNValue.mjs +0 -10
- package/isNegativeNumber.mjs +0 -10
- package/isNull.mjs +0 -10
- package/isNullOrUndefined.mjs +0 -10
- package/isNumber.mjs +0 -12
- package/isObject.mjs +0 -10
- package/isObjectLike.mjs +0 -12
- package/isOneOf.mjs +0 -10
- package/isPlainObject.mjs +0 -13
- package/isPositiveNumber.mjs +0 -10
- package/isPrimitive.mjs +0 -20
- package/isPromise.mjs +0 -10
- package/isRegExp.mjs +0 -10
- package/isServer.mjs +0 -8
- package/isServerNow.mjs +0 -7
- package/isSet.mjs +0 -10
- package/isString.mjs +0 -10
- package/isSymbol.mjs +0 -10
- package/isType.mjs +0 -22
- package/isUndefined.mjs +0 -10
- package/isWeakMap.mjs +0 -10
- package/isWeakSet.mjs +0 -10
- package/kbToBytes.mjs +0 -7
- package/location.mjs +0 -1
- package/lowercase.mjs +0 -9
- package/mapListBy.mjs +0 -14
- package/mbToBytes.mjs +0 -7
- package/mergeObjects.mjs +0 -37
- package/mergeUrlQueryParams.mjs +0 -22
- package/moveSortableArrayItemByKey.mjs +0 -17
- package/noop.mjs +0 -7
- package/normaliseUrl.mjs +0 -15
- package/normaliseUrlPathname.mjs +0 -14
- package/objectOmit.mjs +0 -19
- package/objectPick.mjs +0 -15
- package/quaranteneProps.mjs +0 -33
- package/randomInt.mjs +0 -9
- package/randomKey.mjs +0 -11
- package/removeAccents.mjs +0 -15
- package/removeCookie.mjs +0 -15
- package/removeDuplicates.mjs +0 -13
- package/removeDuplicatesComparing.mjs +0 -10
- package/removeIndexesFromArray.mjs +0 -14
- package/removeTrailingSlash.mjs +0 -10
- package/removeUrlQueryParams.mjs +0 -21
- package/roundTo.mjs +0 -34
- package/shuffle.mjs +0 -32
- package/slugify.mjs +0 -23
- package/split.mjs +0 -4
- package/swapMap.mjs +0 -14
- package/titleCase.mjs +0 -11
- package/toNumber.mjs +0 -8
- package/toRgba.mjs +0 -16
- package/transformToUrlPathname.mjs +0 -16
- package/truncate.mjs +0 -13
- package/tryUntil.mjs +0 -27
- package/types.mjs +0 -1
- package/uid.mjs +0 -12
- package/updateLinkParams.mjs +0 -14
- package/updateUrlQueryParams.mjs +0 -18
- package/uppercase.mjs +0 -9
- package/uuidNumeric.mjs +0 -6
- package/wait.mjs +0 -9
- package/without.mjs +0 -56
package/mapListBy.d.ts
CHANGED
package/mapListBy.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapListBy = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Maps an array of objects into a map keyed with the given key
|
|
6
|
-
*
|
|
7
|
-
* @category array
|
|
8
|
-
*/
|
|
9
|
-
function mapListBy(array, key) {
|
|
1
|
+
export function mapListBy(array, key) {
|
|
10
2
|
if (array === void 0) { array = []; }
|
|
11
3
|
if (key === void 0) { key = ""; }
|
|
12
4
|
return array.reduce(function (obj, item) {
|
|
@@ -14,5 +6,4 @@ function mapListBy(array, key) {
|
|
|
14
6
|
return obj;
|
|
15
7
|
}, {});
|
|
16
8
|
}
|
|
17
|
-
|
|
18
|
-
exports.default = mapListBy;
|
|
9
|
+
export default mapListBy;
|
package/matchSorter.d.ts
CHANGED
|
@@ -48,13 +48,6 @@ 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
50
|
declare const defaultBaseSortFn: BaseSorter<unknown>;
|
|
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
51
|
declare function matchSorter<ItemType = string>(items: ReadonlyArray<ItemType>, value: string, options?: MatchSorterOptions<ItemType>): Array<ItemType>;
|
|
59
52
|
export { matchSorter, defaultBaseSortFn };
|
|
60
53
|
export type { MatchSorterOptions, KeyAttributesOptions, KeyOption, KeyAttributes, RankingInfo, ValueGetterKey, };
|
package/matchSorter.js
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.defaultBaseSortFn = exports.matchSorter = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
/**
|
|
6
|
-
* @file
|
|
7
|
-
*
|
|
8
|
-
* Slightly adapted from Kent C. Dodd's [match-sorter](https://github.com/kentcdodds/match-sorter)
|
|
9
|
-
* differences are:
|
|
10
|
-
* - less exports
|
|
11
|
-
* - smaller output
|
|
12
|
-
* - no external deps
|
|
13
|
-
*
|
|
14
|
-
* TODO: turn objects into arrays for smaller output?
|
|
15
|
-
*
|
|
16
|
-
* @name match-sorter
|
|
17
|
-
* @license MIT license.
|
|
18
|
-
* @copyright (c) 2020 Kent C. Dodds
|
|
19
|
-
* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
|
|
20
|
-
*/
|
|
21
|
-
var removeAccents_1 = tslib_1.__importDefault(require("./removeAccents"));
|
|
1
|
+
import { __assign, __read, __spreadArray } from "tslib";
|
|
2
|
+
import removeAccents from "./removeAccents.js";
|
|
22
3
|
var RANKING_CASE_SENSITIVE_EQUAL = 7;
|
|
23
4
|
var RANKING_EQUAL = 6;
|
|
24
5
|
var RANKING_STARTS_WITH = 5;
|
|
@@ -30,14 +11,6 @@ var RANKING_NO_MATCH = 0;
|
|
|
30
11
|
var defaultBaseSortFn = function (a, b) {
|
|
31
12
|
return String(a.rankedValue).localeCompare(String(b.rankedValue));
|
|
32
13
|
};
|
|
33
|
-
exports.defaultBaseSortFn = defaultBaseSortFn;
|
|
34
|
-
/**
|
|
35
|
-
* Takes an array of items and a value and returns a new array with the items that match the given value
|
|
36
|
-
* @param {Array} items - the items to sort
|
|
37
|
-
* @param {String} value - the value to use for ranking
|
|
38
|
-
* @param {Object} options - Some options to configure the sorter
|
|
39
|
-
* @return {Array} - the new sorted array
|
|
40
|
-
*/
|
|
41
14
|
function matchSorter(items, value, options) {
|
|
42
15
|
if (options === void 0) { options = {}; }
|
|
43
16
|
var keys = options.keys, _a = options.threshold, threshold = _a === void 0 ? RANKING_MATCHES : _a, _b = options.baseSort, baseSort = _b === void 0 ? defaultBaseSortFn : _b, _c = options.sorter, sorter = _c === void 0 ? function (matchedItems) {
|
|
@@ -52,26 +25,15 @@ function matchSorter(items, value, options) {
|
|
|
52
25
|
var rankingInfo = getHighestRanking(item, keys, value, options);
|
|
53
26
|
var rank = rankingInfo.rank, _a = rankingInfo.keyThreshold, keyThreshold = _a === void 0 ? threshold : _a;
|
|
54
27
|
if (rank >= keyThreshold) {
|
|
55
|
-
matches.push(
|
|
28
|
+
matches.push(__assign(__assign({}, rankingInfo), { item: item, index: index }));
|
|
56
29
|
}
|
|
57
30
|
return matches;
|
|
58
31
|
}
|
|
59
32
|
}
|
|
60
|
-
exports.matchSorter = matchSorter;
|
|
61
|
-
/**
|
|
62
|
-
* Gets the highest ranking for value for the given item based on its values for the given keys
|
|
63
|
-
* @param {*} item - the item to rank
|
|
64
|
-
* @param {Array} keys - the keys to get values from the item for the ranking
|
|
65
|
-
* @param {String} value - the value to rank against
|
|
66
|
-
* @param {Object} options - options to control the ranking
|
|
67
|
-
* @return {{rank: Number, keyIndex: Number, keyThreshold: Number}} - the highest ranking
|
|
68
|
-
*/
|
|
69
33
|
function getHighestRanking(item, keys, value, options) {
|
|
70
34
|
if (!keys) {
|
|
71
|
-
// if keys is not specified, then we assume the item given is ready to be matched
|
|
72
35
|
var stringItem = item;
|
|
73
36
|
return {
|
|
74
|
-
// ends up being duplicate of 'item' in matches but consistent
|
|
75
37
|
rankedValue: stringItem,
|
|
76
38
|
rank: getMatchRanking(stringItem, value, options),
|
|
77
39
|
keyIndex: -1,
|
|
@@ -105,63 +67,37 @@ function getHighestRanking(item, keys, value, options) {
|
|
|
105
67
|
keyThreshold: options.threshold,
|
|
106
68
|
});
|
|
107
69
|
}
|
|
108
|
-
/**
|
|
109
|
-
* Gives a rankings score based on how well the two strings match.
|
|
110
|
-
* @param {String} testString - the string to test against
|
|
111
|
-
* @param {String} stringToRank - the string to rank
|
|
112
|
-
* @param {Object} options - options for the match (like keepDiacritics for comparison)
|
|
113
|
-
* @returns {Number} the ranking for how well stringToRank matches testString
|
|
114
|
-
*/
|
|
115
70
|
function getMatchRanking(testString, stringToRank, options) {
|
|
116
71
|
testString = prepareValueForComparison(testString, options);
|
|
117
72
|
stringToRank = prepareValueForComparison(stringToRank, options);
|
|
118
|
-
// too long
|
|
119
73
|
if (stringToRank.length > testString.length) {
|
|
120
74
|
return RANKING_NO_MATCH;
|
|
121
75
|
}
|
|
122
|
-
// case sensitive equals
|
|
123
76
|
if (testString === stringToRank) {
|
|
124
77
|
return RANKING_CASE_SENSITIVE_EQUAL;
|
|
125
78
|
}
|
|
126
|
-
// Lower casing before further comparison
|
|
127
79
|
testString = testString.toLowerCase();
|
|
128
80
|
stringToRank = stringToRank.toLowerCase();
|
|
129
|
-
// case insensitive equals
|
|
130
81
|
if (testString === stringToRank) {
|
|
131
82
|
return RANKING_EQUAL;
|
|
132
83
|
}
|
|
133
|
-
// starts with
|
|
134
84
|
if (testString.startsWith(stringToRank)) {
|
|
135
85
|
return RANKING_STARTS_WITH;
|
|
136
86
|
}
|
|
137
|
-
// word starts with
|
|
138
87
|
if (testString.includes(" ".concat(stringToRank))) {
|
|
139
88
|
return RANKING_WORD_STARTS_WITH;
|
|
140
89
|
}
|
|
141
|
-
// contains
|
|
142
90
|
if (testString.includes(stringToRank)) {
|
|
143
91
|
return RANKING_CONTAINS;
|
|
144
92
|
}
|
|
145
93
|
else if (stringToRank.length === 1) {
|
|
146
|
-
// If the only character in the given stringToRank
|
|
147
|
-
// isn't even contained in the testString, then
|
|
148
|
-
// it's definitely not a match.
|
|
149
94
|
return RANKING_NO_MATCH;
|
|
150
95
|
}
|
|
151
|
-
// acronym
|
|
152
96
|
if (getAcronym(testString).includes(stringToRank)) {
|
|
153
97
|
return RANKING_ACRONYM;
|
|
154
98
|
}
|
|
155
|
-
// will return a number between RANKING_MATCHES and
|
|
156
|
-
// RANKING_MATCHES + 1 depending on how close of a match it is.
|
|
157
99
|
return getClosenessRanking(testString, stringToRank);
|
|
158
100
|
}
|
|
159
|
-
/**
|
|
160
|
-
* Generates an acronym for a string.
|
|
161
|
-
*
|
|
162
|
-
* @param {String} string the string for which to produce the acronym
|
|
163
|
-
* @returns {String} the acronym
|
|
164
|
-
*/
|
|
165
101
|
function getAcronym(string) {
|
|
166
102
|
var acronym = "";
|
|
167
103
|
var wordsInString = string.split(" ");
|
|
@@ -173,16 +109,6 @@ function getAcronym(string) {
|
|
|
173
109
|
});
|
|
174
110
|
return acronym;
|
|
175
111
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Returns a score based on how spread apart the
|
|
178
|
-
* characters from the stringToRank are within the testString.
|
|
179
|
-
* A number close to RANKING_MATCHES represents a loose match. A number close
|
|
180
|
-
* to RANKING_MATCHES + 1 represents a tighter match.
|
|
181
|
-
* @param {String} testString - the string to test against
|
|
182
|
-
* @param {String} stringToRank - the string to rank
|
|
183
|
-
* @returns {Number} the number between RANKING_MATCHES and
|
|
184
|
-
* RANKING_MATCHES + 1 for how well stringToRank matches testString
|
|
185
|
-
*/
|
|
186
112
|
function getClosenessRanking(testString, stringToRank) {
|
|
187
113
|
var matchingInOrderCharCount = 0;
|
|
188
114
|
var charNumber = 0;
|
|
@@ -218,12 +144,6 @@ function getClosenessRanking(testString, stringToRank) {
|
|
|
218
144
|
var spread = charNumber - firstIndex;
|
|
219
145
|
return getRanking(spread);
|
|
220
146
|
}
|
|
221
|
-
/**
|
|
222
|
-
* Sorts items that have a rank, index, and keyIndex
|
|
223
|
-
* @param {Object} a - the first item to sort
|
|
224
|
-
* @param {Object} b - the second item to sort
|
|
225
|
-
* @return {Number} -1 if a should come first, 1 if b should come first, 0 if equal
|
|
226
|
-
*/
|
|
227
147
|
function sortRankedValues(a, b, baseSort) {
|
|
228
148
|
var aFirst = -1;
|
|
229
149
|
var bFirst = 1;
|
|
@@ -232,7 +152,6 @@ function sortRankedValues(a, b, baseSort) {
|
|
|
232
152
|
var same = aRank === bRank;
|
|
233
153
|
if (same) {
|
|
234
154
|
if (aKeyIndex === bKeyIndex) {
|
|
235
|
-
// use the base sort function as a tie-breaker
|
|
236
155
|
return baseSort(a, b);
|
|
237
156
|
}
|
|
238
157
|
else {
|
|
@@ -243,28 +162,14 @@ function sortRankedValues(a, b, baseSort) {
|
|
|
243
162
|
return aRank > bRank ? aFirst : bFirst;
|
|
244
163
|
}
|
|
245
164
|
}
|
|
246
|
-
/**
|
|
247
|
-
* Prepares value for comparison by stringifying it, removing diacritics (if specified)
|
|
248
|
-
* @param {String} value - the value to clean
|
|
249
|
-
* @param {Object} options - {keepDiacritics: whether to remove diacritics}
|
|
250
|
-
* @return {String} the prepared value
|
|
251
|
-
*/
|
|
252
165
|
function prepareValueForComparison(value, _a) {
|
|
253
166
|
var keepDiacritics = _a.keepDiacritics;
|
|
254
|
-
|
|
255
|
-
// so part of preparing the value for comparison is ensure that it is a string
|
|
256
|
-
value = "".concat(value); // toString
|
|
167
|
+
value = "".concat(value);
|
|
257
168
|
if (!keepDiacritics) {
|
|
258
|
-
value = (
|
|
169
|
+
value = removeAccents(value);
|
|
259
170
|
}
|
|
260
171
|
return value;
|
|
261
172
|
}
|
|
262
|
-
/**
|
|
263
|
-
* Gets value for key in item at arbitrarily nested keypath
|
|
264
|
-
* @param {Object} item - the item
|
|
265
|
-
* @param {Object|Function} key - the potentially nested keypath or property callback
|
|
266
|
-
* @return {Array} - an array containing the value(s) at the nested keypath
|
|
267
|
-
*/
|
|
268
173
|
function getItemValues(item, key) {
|
|
269
174
|
if (typeof key === "object") {
|
|
270
175
|
key = key.key;
|
|
@@ -280,13 +185,11 @@ function getItemValues(item, key) {
|
|
|
280
185
|
value = item[key];
|
|
281
186
|
}
|
|
282
187
|
else if (key.includes(".")) {
|
|
283
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
284
188
|
return getNestedValues(key, item);
|
|
285
189
|
}
|
|
286
190
|
else {
|
|
287
191
|
value = null;
|
|
288
192
|
}
|
|
289
|
-
// because `value` can also be undefined
|
|
290
193
|
if (value == null) {
|
|
291
194
|
return [];
|
|
292
195
|
}
|
|
@@ -295,13 +198,6 @@ function getItemValues(item, key) {
|
|
|
295
198
|
}
|
|
296
199
|
return [String(value)];
|
|
297
200
|
}
|
|
298
|
-
/**
|
|
299
|
-
* Given path: "foo.bar.baz"
|
|
300
|
-
* And item: {foo: {bar: {baz: 'buzz'}}}
|
|
301
|
-
* -> 'buzz'
|
|
302
|
-
* @param path a dot-separated set of keys
|
|
303
|
-
* @param item the item to get the value from
|
|
304
|
-
*/
|
|
305
201
|
function getNestedValues(path, item) {
|
|
306
202
|
var keys = path.split(".");
|
|
307
203
|
var values = [item];
|
|
@@ -319,28 +215,17 @@ function getNestedValues(path, item) {
|
|
|
319
215
|
}
|
|
320
216
|
}
|
|
321
217
|
else if (nestedKey === "*") {
|
|
322
|
-
// ensure that values is an array
|
|
323
218
|
nestedValues = nestedValues.concat(nestedItem);
|
|
324
219
|
}
|
|
325
220
|
}
|
|
326
221
|
values = nestedValues;
|
|
327
222
|
}
|
|
328
223
|
if (Array.isArray(values[0])) {
|
|
329
|
-
// keep allowing the implicit wildcard for an array of strings at the end of
|
|
330
|
-
// the path; don't use `.flat()` because that's not available in node.js v10
|
|
331
224
|
var result = [];
|
|
332
|
-
return result.concat.apply(result, values);
|
|
225
|
+
return result.concat.apply(result, __spreadArray([], __read(values), false));
|
|
333
226
|
}
|
|
334
|
-
// Based on our logic it should be an array of strings by now...
|
|
335
|
-
// assuming the user's path terminated in strings
|
|
336
227
|
return values;
|
|
337
228
|
}
|
|
338
|
-
/**
|
|
339
|
-
* Gets all the values for the given keys in the given item and returns an array of those values
|
|
340
|
-
* @param item - the item from which the values will be retrieved
|
|
341
|
-
* @param keys - the keys to use to retrieve the values
|
|
342
|
-
* @return objects with {itemValue, attributes}
|
|
343
|
-
*/
|
|
344
229
|
function getAllValuesToRank(item, keys) {
|
|
345
230
|
var allValues = [];
|
|
346
231
|
for (var j = 0, J = keys.length; j < J; j++) {
|
|
@@ -360,15 +245,11 @@ var defaultKeyAttributes = {
|
|
|
360
245
|
maxRanking: Infinity,
|
|
361
246
|
minRanking: -Infinity,
|
|
362
247
|
};
|
|
363
|
-
/**
|
|
364
|
-
* Gets all the attributes for the given key
|
|
365
|
-
* @param key - the key from which the attributes will be retrieved
|
|
366
|
-
* @return object containing the key's attributes
|
|
367
|
-
*/
|
|
368
248
|
function getKeyAttributes(key) {
|
|
369
249
|
if (typeof key === "string") {
|
|
370
250
|
return defaultKeyAttributes;
|
|
371
251
|
}
|
|
372
|
-
return
|
|
252
|
+
return __assign(__assign({}, defaultKeyAttributes), key);
|
|
373
253
|
}
|
|
374
|
-
|
|
254
|
+
export { matchSorter, defaultBaseSortFn };
|
|
255
|
+
export default matchSorter;
|
package/mbToBytes.d.ts
CHANGED
package/mbToBytes.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.mbToBytes = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Megabytes to bytes
|
|
6
|
-
*
|
|
7
|
-
* @category format
|
|
8
|
-
*/
|
|
9
|
-
var mbToBytes = function (bytes) { return bytes * 1000 * 1000; };
|
|
10
|
-
exports.mbToBytes = mbToBytes;
|
|
11
|
-
exports.default = exports.mbToBytes;
|
|
1
|
+
export var mbToBytes = function (bytes) { return bytes * 1000 * 1000; };
|
|
2
|
+
export default mbToBytes;
|
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: T[]) => T;
|
|
1
|
+
export declare const mergeObjects: <T extends object = object>(target: T, ...sources: Partial<T>[]) => T;
|
package/mergeObjects.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
var isObject_1 = require("./isObject");
|
|
6
|
-
/**
|
|
7
|
-
* Merge two or more objects together. It mutates the target object.
|
|
8
|
-
*
|
|
9
|
-
* @category objects
|
|
10
|
-
* @see https://stackoverflow.com/a/46973278/1938970
|
|
11
|
-
*/
|
|
12
|
-
var mergeObjects = function (target) {
|
|
1
|
+
import { __read, __spreadArray } from "tslib";
|
|
2
|
+
import { isObject } from "./isObject.js";
|
|
3
|
+
import { isUndefined } from "./isUndefined.js";
|
|
4
|
+
export var mergeObjects = function (target) {
|
|
13
5
|
var sources = [];
|
|
14
6
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
15
7
|
sources[_i - 1] = arguments[_i];
|
|
@@ -21,21 +13,21 @@ var mergeObjects = function (target) {
|
|
|
21
13
|
if (source === undefined) {
|
|
22
14
|
return target;
|
|
23
15
|
}
|
|
24
|
-
if (
|
|
16
|
+
if (isObject(target) && isObject(source)) {
|
|
25
17
|
Object.keys(source).forEach(function (_key) {
|
|
26
18
|
var key = _key;
|
|
27
|
-
if (
|
|
19
|
+
if (isObject(source[key])) {
|
|
28
20
|
if (!target[key]) {
|
|
29
|
-
// @ts-expect-error FIXME: ...
|
|
30
21
|
target[key] = {};
|
|
31
22
|
}
|
|
32
|
-
|
|
23
|
+
mergeObjects(target[key], source[key]);
|
|
33
24
|
}
|
|
34
25
|
else {
|
|
35
|
-
|
|
26
|
+
if (!isUndefined(source[key])) {
|
|
27
|
+
target[key] = source[key];
|
|
28
|
+
}
|
|
36
29
|
}
|
|
37
30
|
});
|
|
38
31
|
}
|
|
39
|
-
return
|
|
32
|
+
return mergeObjects.apply(void 0, __spreadArray([target], __read(sources), false));
|
|
40
33
|
};
|
|
41
|
-
exports.mergeObjects = mergeObjects;
|
package/mergeUrlQueryParams.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { type AnyQueryParams } from "./location";
|
|
2
|
-
/**
|
|
3
|
-
* Merge query parameters objects, it *mutates* the first given object argument
|
|
4
|
-
*
|
|
5
|
-
* @category location
|
|
6
|
-
* @pure
|
|
7
|
-
*/
|
|
1
|
+
import { type AnyQueryParams } from "./location.js";
|
|
8
2
|
export declare function mergeUrlQueryParams<T extends AnyQueryParams>(oldParams?: NonNullable<AnyQueryParams>, newParams?: NonNullable<AnyQueryParams>): T;
|
|
9
3
|
export default mergeUrlQueryParams;
|
package/mergeUrlQueryParams.js
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.mergeUrlQueryParams = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var isNull_1 = tslib_1.__importDefault(require("./isNull"));
|
|
6
|
-
/**
|
|
7
|
-
* Merge query parameters objects, it *mutates* the first given object argument
|
|
8
|
-
*
|
|
9
|
-
* @category location
|
|
10
|
-
* @pure
|
|
11
|
-
*/
|
|
12
|
-
function mergeUrlQueryParams(oldParams, newParams) {
|
|
1
|
+
import isNull from "./isNull.js";
|
|
2
|
+
export function mergeUrlQueryParams(oldParams, newParams) {
|
|
13
3
|
if (oldParams === void 0) { oldParams = {}; }
|
|
14
4
|
if (newParams === void 0) { newParams = {}; }
|
|
15
5
|
for (var key in newParams) {
|
|
16
6
|
var value = newParams[key];
|
|
17
|
-
if (oldParams[key] && (
|
|
7
|
+
if (oldParams[key] && isNull(value)) {
|
|
18
8
|
delete oldParams[key];
|
|
19
9
|
}
|
|
20
10
|
else {
|
|
@@ -23,5 +13,4 @@ function mergeUrlQueryParams(oldParams, newParams) {
|
|
|
23
13
|
}
|
|
24
14
|
return oldParams;
|
|
25
15
|
}
|
|
26
|
-
|
|
27
|
-
exports.default = mergeUrlQueryParams;
|
|
16
|
+
export default mergeUrlQueryParams;
|
|
@@ -1,9 +1,2 @@
|
|
|
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
1
|
export declare function moveSortableArrayItemByKey<T, K extends keyof T>(items: T[], key: K, fromItem: Pick<T, K>, toItem: Pick<T, K>): T[];
|
|
9
2
|
export default moveSortableArrayItemByKey;
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.moveSortableArrayItemByKey = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
/**
|
|
6
|
-
* Move item from one place to another in a sortable array of objects, re-ordering
|
|
7
|
-
* the array accrodingly (no swapping of position).
|
|
8
|
-
* This is useful for drag and drop functionalities
|
|
9
|
-
*
|
|
10
|
-
* @category arrays, dnd
|
|
11
|
-
*/
|
|
12
|
-
function moveSortableArrayItemByKey(items, key, fromItem, toItem) {
|
|
1
|
+
import { __read, __spreadArray } from "tslib";
|
|
2
|
+
export function moveSortableArrayItemByKey(items, key, fromItem, toItem) {
|
|
13
3
|
var itemsKeys = items.map(function (item) { return item[key]; });
|
|
14
4
|
var idxFrom = itemsKeys.indexOf(fromItem[key]);
|
|
15
5
|
var idxTo = itemsKeys.indexOf(toItem[key]);
|
|
16
|
-
var
|
|
6
|
+
var _a = __read(items.splice(idxFrom, 1), 1), item = _a[0];
|
|
17
7
|
items.splice(idxTo, 0, item);
|
|
18
|
-
return
|
|
8
|
+
return __spreadArray([], __read(items), false);
|
|
19
9
|
}
|
|
20
|
-
|
|
21
|
-
exports.default = moveSortableArrayItemByKey;
|
|
10
|
+
export default moveSortableArrayItemByKey;
|
package/noop.d.ts
CHANGED
package/noop.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.noop = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* No operation function
|
|
6
|
-
*
|
|
7
|
-
* @category native
|
|
8
|
-
*/
|
|
9
|
-
var noop = function () { return void 0; };
|
|
10
|
-
exports.noop = noop;
|
|
11
|
-
exports.default = exports.noop;
|
|
1
|
+
export var noop = function () { return void 0; };
|
|
2
|
+
export default noop;
|
package/normaliseUrl.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
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
1
|
export declare function normaliseUrl(absoluteUrl?: string): string;
|
|
11
2
|
export default normaliseUrl;
|
package/normaliseUrl.js
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.normaliseUrl = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var removeTrailingSlash_1 = tslib_1.__importDefault(require("./removeTrailingSlash"));
|
|
6
|
-
/**
|
|
7
|
-
* Normalise URL, it works both for absolute and relative URLs
|
|
8
|
-
*
|
|
9
|
-
* - replaces too many consecutive slashes (except `http{s}://`)
|
|
10
|
-
* - removes the trailing slash
|
|
11
|
-
*
|
|
12
|
-
* @category location
|
|
13
|
-
* @see https://stackoverflow.com/a/40649435/1938970
|
|
14
|
-
*/
|
|
15
|
-
function normaliseUrl(absoluteUrl) {
|
|
1
|
+
import removeTralingSlash from "./removeTrailingSlash.js";
|
|
2
|
+
export function normaliseUrl(absoluteUrl) {
|
|
16
3
|
if (absoluteUrl === void 0) { absoluteUrl = ""; }
|
|
17
|
-
return (
|
|
4
|
+
return removeTralingSlash(absoluteUrl.replace(/(:\/\/)|(\/)+/g, "$1$2"));
|
|
18
5
|
}
|
|
19
|
-
|
|
20
|
-
exports.default = normaliseUrl;
|
|
6
|
+
export default normaliseUrl;
|
|
@@ -1,10 +1,2 @@
|
|
|
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
1
|
export declare function normaliseUrlPathname(pathname?: string): string;
|
|
10
2
|
export default normaliseUrlPathname;
|
package/normaliseUrlPathname.js
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.normaliseUrlPathname = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var removeTrailingSlash_1 = tslib_1.__importDefault(require("./removeTrailingSlash"));
|
|
6
|
-
/**
|
|
7
|
-
* Normalise URL pathname (relative URL)
|
|
8
|
-
*
|
|
9
|
-
* - replaces too many consecutive slashes
|
|
10
|
-
* - removes the trailing slash
|
|
11
|
-
*
|
|
12
|
-
* @category location
|
|
13
|
-
*/
|
|
14
|
-
function normaliseUrlPathname(pathname) {
|
|
1
|
+
import removeTralingSlash from "./removeTrailingSlash.js";
|
|
2
|
+
export function normaliseUrlPathname(pathname) {
|
|
15
3
|
if (pathname === void 0) { pathname = ""; }
|
|
16
|
-
return (
|
|
4
|
+
return removeTralingSlash(pathname.replace(/\/+/g, "/"));
|
|
17
5
|
}
|
|
18
|
-
|
|
19
|
-
exports.default = normaliseUrlPathname;
|
|
6
|
+
export default normaliseUrlPathname;
|
package/objectFlip.d.ts
ADDED
package/objectFlip.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
2
|
+
export function objectFlip(input, keyTransformer) {
|
|
3
|
+
return Object.fromEntries(Object.entries(input).map(function (_a) {
|
|
4
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
5
|
+
return [
|
|
6
|
+
value,
|
|
7
|
+
keyTransformer ? keyTransformer(key) : key,
|
|
8
|
+
];
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
export default objectFlip;
|
package/objectOmit.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
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
1
|
export declare function objectOmit<T extends object, Keys extends (keyof T)[]>(object: T, keys: Keys): Omit<T, Keys[number]>;
|
|
11
2
|
export default objectOmit;
|
package/objectOmit.js
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectOmit = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Omit object properties by removing the given keys, it returns a
|
|
6
|
-
* new object.
|
|
7
|
-
*
|
|
8
|
-
* 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,
|
|
9
|
-
* use this utility only when it makes sense.
|
|
10
|
-
*
|
|
11
|
-
* @category objects
|
|
12
|
-
*/
|
|
13
|
-
function objectOmit(object, keys) {
|
|
1
|
+
export function objectOmit(object, keys) {
|
|
14
2
|
return Object.keys(object).reduce(function (output, key) {
|
|
15
3
|
if (!keys.includes(key)) {
|
|
16
4
|
output[key] =
|
|
@@ -19,5 +7,4 @@ function objectOmit(object, keys) {
|
|
|
19
7
|
return output;
|
|
20
8
|
}, {});
|
|
21
9
|
}
|
|
22
|
-
|
|
23
|
-
exports.default = objectOmit;
|
|
10
|
+
export default objectOmit;
|
package/objectPick.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pick object properties by selecting only the given keys, it returns a
|
|
3
|
-
* new object.
|
|
4
|
-
*
|
|
5
|
-
* @category objects
|
|
6
|
-
*/
|
|
7
1
|
export declare function objectPick<T extends object, Keys extends (keyof T)[]>(object: T, keys: Keys): Pick<T, Keys[number]>;
|
|
8
2
|
export default objectPick;
|