@koine/utils 2.0.0-beta.13 → 2.0.0-beta.15
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 +11 -0
- package/Emitter.d.ts +0 -20
- package/Emitter.js +20 -0
- package/accentSets.d.ts +0 -14
- package/accentSets.js +30 -0
- package/addOrReplaceAtIdx.d.ts +0 -7
- package/addOrReplaceAtIdx.js +16 -0
- package/areEqual.d.ts +0 -15
- package/areEqual.js +55 -0
- package/arrayOfAll.d.ts +0 -25
- package/arrayOfAll.js +6 -0
- package/arraySum.d.ts +0 -6
- package/arraySum.js +4 -0
- package/arrayToLookup.d.ts +0 -5
- package/arrayToLookup.js +8 -0
- package/buildUrlQueryString.d.ts +1 -10
- package/buildUrlQueryString.js +21 -0
- package/capitalize.d.ts +0 -7
- package/capitalize.js +6 -0
- package/changeUrlPath.d.ts +0 -8
- package/changeUrlPath.js +10 -0
- package/chunkByChunks.d.ts +0 -5
- package/chunkByChunks.js +32 -0
- package/chunkBySize.d.ts +0 -4
- package/chunkBySize.js +8 -0
- package/cjs/Defer.d.ts +6 -0
- package/cjs/Defer.js +15 -0
- package/cjs/Emitter.d.ts +7 -0
- package/cjs/Emitter.js +24 -0
- package/cjs/accentSets.d.ts +3 -0
- package/cjs/accentSets.js +33 -0
- package/cjs/addOrReplaceAtIdx.d.ts +2 -0
- package/cjs/addOrReplaceAtIdx.js +20 -0
- package/cjs/areEqual.d.ts +4 -0
- package/cjs/areEqual.js +59 -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/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/cjs/chunkByChunks.js +36 -0
- 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/cjs/clsx.js +44 -0
- 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/cjs/debounce.js +26 -0
- 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/cjs/getMediaQueryWidthResolvers.js +44 -0
- package/cjs/getMediaQueryWidthTailwindScreens.d.ts +5 -0
- package/cjs/getMediaQueryWidthTailwindScreens.js +31 -0
- 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} +9 -7
- package/cjs/index.js +265 -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/cjs/matchSorter.js +259 -0
- 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/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/package.json +6 -0
- package/cjs/parseCookie.d.ts +3 -0
- package/cjs/parseCookie.js +38 -0
- package/cjs/parseURL.d.ts +11 -0
- package/cjs/parseURL.js +18 -0
- 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/cjs/readCookie.js +38 -0
- package/cjs/removeAccents.d.ts +3 -0
- package/cjs/removeAccents.js +16 -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/cjs/removeDuplicatesByKey.js +18 -0
- 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/cjs/render.js +123 -0
- package/cjs/roundTo.d.ts +2 -0
- package/cjs/roundTo.js +16 -0
- package/cjs/serializeCookie.d.ts +3 -0
- package/cjs/serializeCookie.js +74 -0
- package/cjs/setCookie.d.ts +3 -0
- package/cjs/setCookie.js +47 -0
- 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 +8 -0
- package/cjs/swapMap.d.ts +2 -0
- package/cjs/swapMap.js +13 -0
- package/cjs/throttle.d.ts +2 -0
- package/cjs/throttle.js +24 -0
- 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/cjs/uuid.js +11 -0
- 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 +4 -0
- package/clsx.d.ts +0 -7
- package/clsx.js +40 -0
- package/convertRange.d.ts +0 -14
- package/convertRange.js +4 -0
- package/cookie.d.ts +0 -48
- package/cookie.js +1 -0
- package/createPalette.d.ts +0 -12
- package/createPalette.js +12 -0
- package/debounce.d.ts +0 -6
- package/debounce.js +22 -0
- package/debouncePromise.d.ts +0 -18
- package/debouncePromise.js +65 -0
- package/debounceRaf.d.ts +0 -7
- package/debounceRaf.js +17 -0
- package/decode.d.ts +0 -4
- package/decode.js +6 -0
- package/encode.d.ts +0 -4
- package/encode.js +6 -0
- package/ensureInt.d.ts +0 -5
- package/ensureInt.js +4 -0
- package/env.js +1 -0
- package/errorToString.d.ts +0 -6
- package/errorToString.js +5 -0
- package/findDuplicatedIndexes.d.ts +0 -3
- package/findDuplicatedIndexes.js +11 -0
- package/forin.d.ts +0 -6
- package/forin.js +6 -0
- package/gbToBytes.d.ts +0 -5
- package/gbToBytes.js +2 -0
- package/getEmptyArray.d.ts +0 -6
- package/getEmptyArray.js +8 -0
- package/getKeys.d.ts +0 -8
- package/getKeys.js +2 -0
- package/getMediaQueryWidthResolvers.d.ts +0 -6
- package/getMediaQueryWidthResolvers.js +40 -0
- package/getMediaQueryWidthTailwindScreens.d.ts +1 -5
- package/getMediaQueryWidthTailwindScreens.js +27 -0
- package/getNonce.d.ts +0 -4
- package/getNonce.js +5 -0
- package/getParamAmong.d.ts +0 -11
- package/getParamAmong.js +7 -0
- package/getParamAsInt.d.ts +0 -10
- package/getParamAsInt.js +10 -0
- package/getParamAsString.d.ts +0 -9
- package/getParamAsString.js +5 -0
- package/getType.d.ts +0 -12
- package/getType.js +4 -0
- package/getUrlHashParams.d.ts +1 -7
- package/getUrlHashParams.js +10 -0
- package/getUrlHashPathname.d.ts +0 -7
- package/getUrlHashPathname.js +6 -0
- package/getUrlPathnameParts.d.ts +0 -10
- package/getUrlPathnameParts.js +10 -0
- package/getUrlQueryParams.d.ts +1 -11
- package/getUrlQueryParams.js +25 -0
- package/imgEmptyPixel.d.ts +0 -5
- package/imgEmptyPixel.js +2 -0
- package/index.d.ts +133 -136
- package/index.js +130 -0
- package/invariant.d.ts +0 -17
- package/invariant.js +17 -0
- package/isAnyObject.d.ts +1 -6
- package/isAnyObject.js +5 -0
- package/isArray.d.ts +0 -5
- package/isArray.js +5 -0
- package/isBlob.d.ts +0 -5
- package/isBlob.js +5 -0
- package/isBoolean.d.ts +0 -5
- package/isBoolean.js +5 -0
- package/isBrowser.d.ts +0 -4
- package/isBrowser.js +2 -0
- package/isBrowserNow.d.ts +0 -4
- package/isBrowserNow.js +3 -0
- package/isDate.d.ts +0 -5
- package/isDate.js +5 -0
- package/isEmptyArray.d.ts +0 -5
- package/isEmptyArray.js +5 -0
- package/isEmptyObject.d.ts +0 -5
- package/isEmptyObject.js +5 -0
- package/isEmptyString.d.ts +0 -5
- package/isEmptyString.js +4 -0
- package/isError.d.ts +0 -5
- package/isError.js +5 -0
- package/isExternalUrl.d.ts +0 -7
- package/isExternalUrl.js +12 -0
- package/isFile.d.ts +0 -5
- package/isFile.js +5 -0
- package/isFloat.d.ts +0 -5
- package/isFloat.js +5 -0
- package/isFormData.d.ts +0 -5
- package/isFormData.js +5 -0
- package/isFullArray.d.ts +0 -5
- package/isFullArray.js +5 -0
- package/isFullObject.d.ts +1 -6
- package/isFullObject.js +5 -0
- package/isFullString.d.ts +0 -5
- package/isFullString.js +5 -0
- package/isFunction.d.ts +1 -6
- package/isFunction.js +4 -0
- package/isInt.d.ts +0 -5
- package/isInt.js +5 -0
- package/isMap.d.ts +0 -5
- package/isMap.js +5 -0
- package/isNaNValue.d.ts +0 -5
- package/isNaNValue.js +5 -0
- package/isNegativeNumber.d.ts +0 -5
- package/isNegativeNumber.js +5 -0
- package/isNull.d.ts +0 -5
- package/isNull.js +5 -0
- package/isNullOrUndefined.d.ts +0 -5
- package/isNullOrUndefined.js +5 -0
- package/isNumber.d.ts +0 -7
- package/isNumber.js +5 -0
- package/isObject.d.ts +1 -6
- package/isObject.js +5 -0
- package/isObjectLike.d.ts +1 -8
- package/isObjectLike.js +5 -0
- package/isOneOf.d.ts +1 -4
- package/isOneOf.js +10 -0
- package/isPlainObject.d.ts +1 -6
- package/isPlainObject.js +8 -0
- package/isPositiveNumber.d.ts +0 -5
- package/isPositiveNumber.js +5 -0
- package/isPrimitive.d.ts +0 -5
- package/isPrimitive.js +15 -0
- package/isPromise.d.ts +0 -5
- package/isPromise.js +5 -0
- package/isRegExp.d.ts +0 -5
- package/isRegExp.js +5 -0
- package/isServer.d.ts +0 -4
- package/isServer.js +3 -0
- package/isServerNow.d.ts +0 -4
- package/isServerNow.js +3 -0
- package/isSet.d.ts +0 -5
- package/isSet.js +5 -0
- package/isString.d.ts +0 -5
- package/isString.js +5 -0
- package/isSymbol.d.ts +0 -5
- package/isSymbol.js +5 -0
- package/isType.d.ts +1 -9
- package/isType.js +13 -0
- package/isUndefined.d.ts +0 -5
- package/isUndefined.js +5 -0
- package/isWeakMap.d.ts +0 -5
- package/isWeakMap.js +5 -0
- package/isWeakSet.d.ts +0 -5
- package/isWeakSet.js +5 -0
- package/kbToBytes.d.ts +0 -5
- package/kbToBytes.js +2 -0
- package/location.d.ts +0 -3
- package/location.js +1 -0
- package/lowercase.d.ts +0 -5
- package/lowercase.js +4 -0
- package/mapListBy.d.ts +0 -5
- package/mapListBy.js +9 -0
- package/matchSorter.d.ts +0 -7
- package/matchSorter.js +255 -0
- package/mbToBytes.d.ts +0 -5
- package/mbToBytes.js +2 -0
- package/mergeObjects.d.ts +0 -6
- package/mergeObjects.js +33 -0
- package/mergeUrlQueryParams.d.ts +1 -6
- package/mergeUrlQueryParams.js +16 -0
- package/moveSortableArrayItemByKey.d.ts +0 -7
- package/moveSortableArrayItemByKey.js +10 -0
- package/noop.d.ts +0 -5
- package/noop.js +2 -0
- package/normaliseUrl.d.ts +0 -9
- package/normaliseUrl.js +6 -0
- package/normaliseUrlPathname.d.ts +0 -8
- package/normaliseUrlPathname.js +6 -0
- package/objectOmit.d.ts +0 -9
- package/objectOmit.js +10 -0
- package/objectPick.d.ts +0 -6
- package/objectPick.js +9 -0
- package/package.json +568 -6
- package/parseCookie.d.ts +1 -9
- package/parseCookie.js +34 -0
- package/parseURL.d.ts +0 -6
- package/parseURL.js +14 -0
- package/quaranteneProps.d.ts +0 -15
- package/quaranteneProps.js +16 -0
- package/randomInt.d.ts +0 -5
- package/randomInt.js +4 -0
- package/randomKey.d.ts +0 -6
- package/randomKey.js +5 -0
- package/readCookie.d.ts +0 -5
- package/{readCookie.mjs → readCookie.js} +8 -7
- package/removeAccents.d.ts +1 -4
- package/removeAccents.js +12 -0
- package/removeCookie.d.ts +1 -4
- package/removeCookie.js +8 -0
- package/removeDuplicates.js +1 -0
- package/removeDuplicatesByKey.d.ts +0 -6
- package/removeDuplicatesByKey.js +14 -0
- package/removeDuplicatesComparing.d.ts +0 -3
- package/removeDuplicatesComparing.js +7 -0
- package/removeIndexesFromArray.d.ts +0 -3
- package/removeIndexesFromArray.js +10 -0
- package/removeTrailingSlash.d.ts +0 -5
- package/removeTrailingSlash.js +5 -0
- package/removeUrlQueryParams.d.ts +0 -5
- package/removeUrlQueryParams.js +15 -0
- package/render.d.ts +0 -40
- package/render.js +119 -0
- package/roundTo.d.ts +0 -6
- package/roundTo.js +12 -0
- package/serializeCookie.d.ts +1 -21
- package/{serializeCookie.mjs → serializeCookie.js} +9 -33
- package/setCookie.d.ts +1 -4
- package/setCookie.js +43 -0
- package/shuffle.d.ts +0 -15
- package/shuffle.js +18 -0
- package/slugify.d.ts +0 -10
- package/slugify.js +14 -0
- package/split.d.ts +0 -4
- package/split.js +4 -0
- package/swapMap.d.ts +0 -5
- package/swapMap.js +9 -0
- package/throttle.d.ts +0 -7
- package/throttle.js +20 -0
- package/titleCase.d.ts +0 -6
- package/titleCase.js +6 -0
- package/toNumber.d.ts +0 -3
- package/toNumber.js +5 -0
- package/toRgba.d.ts +0 -3
- package/toRgba.js +9 -0
- package/transformToUrlPathname.d.ts +0 -9
- package/transformToUrlPathname.js +7 -0
- package/truncate.d.ts +0 -5
- package/truncate.js +8 -0
- package/tryUntil.d.ts +0 -9
- package/tryUntil.js +15 -0
- package/types.d.ts +0 -18
- package/types.js +1 -0
- package/uid.d.ts +0 -5
- package/uid.js +7 -0
- package/updateLinkParams.d.ts +1 -8
- package/updateLinkParams.js +7 -0
- package/updateUrlQueryParams.d.ts +1 -6
- package/updateUrlQueryParams.js +12 -0
- package/uppercase.d.ts +0 -6
- package/uppercase.js +4 -0
- package/uuid.d.ts +0 -6
- package/uuid.js +7 -0
- package/uuidNumeric.d.ts +0 -4
- package/uuidNumeric.js +2 -0
- package/wait.d.ts +0 -5
- package/wait.js +4 -0
- package/without.js +1 -0
- package/Defer.mjs +0 -27
- package/Emitter.mjs +0 -37
- package/README.md +0 -47
- package/accentSets.mjs +0 -123
- package/addOrReplaceAtIdx.mjs +0 -26
- package/areEqual.mjs +0 -71
- package/arrayOfAll.mjs +0 -26
- package/arraySum.mjs +0 -7
- package/arrayToLookup.mjs +0 -11
- package/buildUrlQueryString.mjs +0 -28
- package/capitalize.mjs +0 -11
- package/changeUrlPath.mjs +0 -17
- package/chunkByChunks.mjs +0 -34
- package/chunkBySize.mjs +0 -11
- package/clamp.mjs +0 -9
- package/clsx.mjs +0 -48
- package/convertRange.mjs +0 -17
- package/cookie.mjs +0 -15
- package/createPalette.mjs +0 -32
- package/debounce.mjs +0 -21
- package/debouncePromise.mjs +0 -79
- package/debounceRaf.mjs +0 -22
- package/decode.mjs +0 -9
- package/encode.mjs +0 -9
- package/ensureInt.mjs +0 -6
- package/env.mjs +0 -2
- package/errorToString.mjs +0 -8
- package/findDuplicatedIndexes.mjs +0 -13
- package/forin.mjs +0 -11
- package/gbToBytes.mjs +0 -6
- package/getEmptyArray.mjs +0 -15
- package/getKeys.mjs +0 -9
- package/getMediaQueryWidthResolvers.mjs +0 -67
- package/getMediaQueryWidthTailwindScreens.mjs +0 -36
- package/getNonce.mjs +0 -8
- package/getParamAmong.mjs +0 -16
- package/getParamAsInt.mjs +0 -18
- package/getParamAsString.mjs +0 -13
- package/getType.mjs +0 -14
- package/getUrlHashParams.mjs +0 -14
- package/getUrlHashPathname.mjs +0 -11
- package/getUrlPathnameParts.mjs +0 -15
- package/getUrlQueryParams.mjs +0 -26
- package/imgEmptyPixel.mjs +0 -6
- package/invariant.mjs +0 -32
- package/isAnyObject.mjs +0 -9
- package/isArray.mjs +0 -9
- package/isBlob.mjs +0 -9
- package/isBoolean.mjs +0 -9
- package/isBrowser.mjs +0 -5
- package/isBrowserNow.mjs +0 -6
- package/isDate.mjs +0 -9
- package/isEmptyArray.mjs +0 -9
- package/isEmptyObject.mjs +0 -9
- package/isEmptyString.mjs +0 -8
- package/isError.mjs +0 -9
- package/isExternalUrl.mjs +0 -19
- package/isFile.mjs +0 -9
- package/isFloat.mjs +0 -9
- package/isFormData.mjs +0 -9
- package/isFullArray.mjs +0 -9
- package/isFullObject.mjs +0 -9
- package/isFullString.mjs +0 -9
- package/isFunction.mjs +0 -8
- package/isInt.mjs +0 -9
- package/isMap.mjs +0 -9
- package/isNaNValue.mjs +0 -9
- package/isNegativeNumber.mjs +0 -9
- package/isNull.mjs +0 -9
- package/isNullOrUndefined.mjs +0 -9
- package/isNumber.mjs +0 -11
- package/isObject.mjs +0 -9
- package/isObjectLike.mjs +0 -11
- package/isOneOf.mjs +0 -4
- package/isPlainObject.mjs +0 -10
- package/isPositiveNumber.mjs +0 -9
- package/isPrimitive.mjs +0 -14
- package/isPromise.mjs +0 -9
- package/isRegExp.mjs +0 -9
- package/isServer.mjs +0 -7
- package/isServerNow.mjs +0 -6
- package/isSet.mjs +0 -9
- package/isString.mjs +0 -9
- package/isSymbol.mjs +0 -9
- package/isType.mjs +0 -20
- package/isUndefined.mjs +0 -9
- package/isWeakMap.mjs +0 -9
- package/isWeakSet.mjs +0 -9
- package/kbToBytes.mjs +0 -6
- package/location.mjs +0 -3
- package/lowercase.mjs +0 -6
- package/mapListBy.mjs +0 -11
- package/matchSorter.mjs +0 -352
- package/mbToBytes.mjs +0 -6
- package/mergeObjects.mjs +0 -34
- package/mergeUrlQueryParams.mjs +0 -17
- package/moveSortableArrayItemByKey.mjs +0 -17
- package/noop.mjs +0 -6
- package/normaliseUrl.mjs +0 -13
- package/normaliseUrlPathname.mjs +0 -12
- package/objectOmit.mjs +0 -17
- package/objectPick.mjs +0 -14
- package/parseCookie.mjs +0 -44
- package/parseURL.mjs +0 -19
- package/quaranteneProps.mjs +0 -31
- package/randomInt.mjs +0 -8
- package/randomKey.mjs +0 -10
- package/removeAccents.mjs +0 -12
- package/removeCookie.mjs +0 -12
- package/removeDuplicates.mjs +0 -12
- package/removeDuplicatesByKey.mjs +0 -18
- package/removeDuplicatesComparing.mjs +0 -9
- package/removeIndexesFromArray.mjs +0 -13
- package/removeTrailingSlash.mjs +0 -8
- package/removeUrlQueryParams.mjs +0 -18
- package/render.mjs +0 -111
- package/roundTo.mjs +0 -32
- package/setCookie.mjs +0 -51
- package/shuffle.mjs +0 -33
- package/slugify.mjs +0 -26
- package/split.mjs +0 -7
- package/swapMap.mjs +0 -12
- package/throttle.mjs +0 -20
- package/titleCase.mjs +0 -7
- package/toNumber.mjs +0 -7
- package/toRgba.mjs +0 -14
- package/transformToUrlPathname.mjs +0 -13
- package/truncate.mjs +0 -6
- package/tryUntil.mjs +0 -27
- package/types.mjs +0 -2
- package/uid.mjs +0 -10
- package/updateLinkParams.mjs +0 -13
- package/updateUrlQueryParams.mjs +0 -13
- package/uppercase.mjs +0 -7
- package/uuid.mjs +0 -10
- package/uuidNumeric.mjs +0 -5
- package/wait.mjs +0 -6
- package/without.mjs +0 -54
package/arraySum.mjs
DELETED
package/arrayToLookup.mjs
DELETED
package/buildUrlQueryString.mjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import isArray from "./isArray";
|
|
2
|
-
import isNull from "./isNull";
|
|
3
|
-
import isUndefined from "./isUndefined";
|
|
4
|
-
/**
|
|
5
|
-
* Get clean query string for URL
|
|
6
|
-
*
|
|
7
|
-
* It returns the query string **with** the initial `?`
|
|
8
|
-
*
|
|
9
|
-
* TODO: at some point replace with `URLSearchParams`, @see [caniuse](https://caniuse.com/?search=URLSearchParams)
|
|
10
|
-
*
|
|
11
|
-
* @category location
|
|
12
|
-
*/ export function buildUrlQueryString(params) {
|
|
13
|
-
let output = "";
|
|
14
|
-
if (!params) return output;
|
|
15
|
-
for(const key in params){
|
|
16
|
-
const value = params[key];
|
|
17
|
-
if (isArray(value)) {
|
|
18
|
-
for(let i = 0; i < value.length; i++){
|
|
19
|
-
output += `${key}=${encodeURIComponent(value[i] + "")}&`;
|
|
20
|
-
}
|
|
21
|
-
} else if (!isNull(value) && !isUndefined(value)) {
|
|
22
|
-
output += `${key}=${encodeURIComponent(value + "")}&`;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
// removes the last &
|
|
26
|
-
return output ? `?${output.replace(/&+$/, "")}` : "";
|
|
27
|
-
}
|
|
28
|
-
export default buildUrlQueryString;
|
package/capitalize.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Capitalize first letter of the given string.
|
|
3
|
-
*
|
|
4
|
-
* @category text
|
|
5
|
-
* @resources
|
|
6
|
-
* - https://stackoverflow.com/a/11409944/1938970
|
|
7
|
-
*/ export function capitalize(string) {
|
|
8
|
-
const ensuredString = string || "";
|
|
9
|
-
return ensuredString.charAt(0).toUpperCase() + ensuredString.slice(1);
|
|
10
|
-
}
|
|
11
|
-
export default capitalize;
|
package/changeUrlPath.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import isBrowser from "./isBrowser";
|
|
2
|
-
import normaliseUrlPathname from "./normaliseUrlPathname";
|
|
3
|
-
/**
|
|
4
|
-
* Change URL path, ensures initial and ending slashes and normalise eventual
|
|
5
|
-
* consecutive slashes, it uses `history`.
|
|
6
|
-
*
|
|
7
|
-
* @category location
|
|
8
|
-
* @param replace Replace URL instead of pushing it in the history stack. By default it pushes it.
|
|
9
|
-
* @returns {string} The new cleaned pathname
|
|
10
|
-
*/ export function changeUrlPath(pathname, state, replace) {
|
|
11
|
-
const path = normaliseUrlPathname(`/${pathname}/`);
|
|
12
|
-
if (isBrowser) {
|
|
13
|
-
history[replace ? "replaceState" : "pushState"](state, "", path);
|
|
14
|
-
}
|
|
15
|
-
return path;
|
|
16
|
-
}
|
|
17
|
-
export default changeUrlPath;
|
package/chunkByChunks.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category array
|
|
3
|
-
* @see https://stackoverflow.com/a/8189268/1938970
|
|
4
|
-
* @experimental TODO: untested
|
|
5
|
-
*/ export function chunkByChunks(arr, nrOfChunks, balanced) {
|
|
6
|
-
if (nrOfChunks < 2) return [
|
|
7
|
-
arr
|
|
8
|
-
];
|
|
9
|
-
const len = arr.length;
|
|
10
|
-
const output = [];
|
|
11
|
-
let i = 0;
|
|
12
|
-
let size;
|
|
13
|
-
if (len % nrOfChunks === 0) {
|
|
14
|
-
size = Math.floor(len / nrOfChunks);
|
|
15
|
-
while(i < len){
|
|
16
|
-
output.push(arr.slice(i, i += size));
|
|
17
|
-
}
|
|
18
|
-
} else if (balanced) {
|
|
19
|
-
while(i < len){
|
|
20
|
-
size = Math.ceil((len - i) / nrOfChunks--);
|
|
21
|
-
output.push(arr.slice(i, i += size));
|
|
22
|
-
}
|
|
23
|
-
} else {
|
|
24
|
-
nrOfChunks--;
|
|
25
|
-
size = Math.floor(len / nrOfChunks);
|
|
26
|
-
if (len % size === 0) size--;
|
|
27
|
-
while(i < size * nrOfChunks){
|
|
28
|
-
output.push(arr.slice(i, i += size));
|
|
29
|
-
}
|
|
30
|
-
output.push(arr.slice(size * nrOfChunks));
|
|
31
|
-
}
|
|
32
|
-
return output;
|
|
33
|
-
}
|
|
34
|
-
export default chunkByChunks;
|
package/chunkBySize.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category array
|
|
3
|
-
* @see https://stackoverflow.com/a/40682136/1938970
|
|
4
|
-
*/ export function chunkBySize(arr, size) {
|
|
5
|
-
const output = [];
|
|
6
|
-
for(let i = 0; i < arr.length; i += size){
|
|
7
|
-
output.push(arr.slice(i, i + size));
|
|
8
|
-
}
|
|
9
|
-
return output;
|
|
10
|
-
}
|
|
11
|
-
export default chunkBySize;
|
package/clamp.mjs
DELETED
package/clsx.mjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// import type { ClassValue } from "clsx";
|
|
2
|
-
// import _clsx from "clsx";
|
|
3
|
-
// export const clsx = _clsx;
|
|
4
|
-
function toVal(mix) {
|
|
5
|
-
let k, y, str = "";
|
|
6
|
-
if (typeof mix === "string" || typeof mix === "number") {
|
|
7
|
-
str += mix;
|
|
8
|
-
} else if (typeof mix === "object") {
|
|
9
|
-
if (Array.isArray(mix)) {
|
|
10
|
-
for(k = 0; k < mix.length; k++){
|
|
11
|
-
if (mix[k]) {
|
|
12
|
-
if (y = toVal(mix[k])) {
|
|
13
|
-
str && (str += " ");
|
|
14
|
-
str += y;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
} else {
|
|
19
|
-
for(k in mix){
|
|
20
|
-
if (mix[k]) {
|
|
21
|
-
str && (str += " ");
|
|
22
|
-
str += k;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return str;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Class names utility
|
|
31
|
-
*
|
|
32
|
-
* @category impl
|
|
33
|
-
* @borrows [lukeed/clsx](https://github.com/lukeed/clsx)
|
|
34
|
-
* @license MIT Luke Edwards https://github.com/lukeed/clsx/blob/master/license
|
|
35
|
-
*/ export const clsx = function() {
|
|
36
|
-
let i = 0, tmp, x, str = "";
|
|
37
|
-
while(i < arguments.length){
|
|
38
|
-
// eslint-disable-next-line prefer-rest-params
|
|
39
|
-
if (tmp = arguments[i++]) {
|
|
40
|
-
if (x = toVal(tmp)) {
|
|
41
|
-
str && (str += " ");
|
|
42
|
-
str += x;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return str;
|
|
47
|
-
};
|
|
48
|
-
export default clsx;
|
package/convertRange.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert range of a number
|
|
3
|
-
*
|
|
4
|
-
* e.g. converting number 5 in a scale/range from 0 10 to a scale/range from 50
|
|
5
|
-
* to 100 would return 75
|
|
6
|
-
* @example
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* convertRange(5, [0, 10], [50, 100]);
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
* @category math
|
|
13
|
-
* @see https://stackoverflow.com/a/14224813
|
|
14
|
-
*/ export function convertRange(num, r1, r2) {
|
|
15
|
-
return (num - r1[0]) * (r2[1] - r2[0]) / (r1[1] - r1[0]) + r2[0];
|
|
16
|
-
}
|
|
17
|
-
export default convertRange;
|
package/cookie.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module
|
|
3
|
-
*
|
|
4
|
-
* @category cookie
|
|
5
|
-
*
|
|
6
|
-
* All cookie related code is inspired and adapted from:
|
|
7
|
-
* - [js-cookie](https://github.com/js-cookie/js-cookie)
|
|
8
|
-
* - [cookie](https://github.com/jshttp/cookie)
|
|
9
|
-
*/ /**
|
|
10
|
-
* @category cookie
|
|
11
|
-
*/ /**
|
|
12
|
-
* @category cookie
|
|
13
|
-
*/ export const defaultAttributesClient = {
|
|
14
|
-
path: "/"
|
|
15
|
-
};
|
package/createPalette.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create palette, this is primarily thought to improve the reuse of a palette
|
|
3
|
-
* definition between TailwindCSS and straight ES imports
|
|
4
|
-
*
|
|
5
|
-
* @category colors
|
|
6
|
-
* @category tailwind
|
|
7
|
-
* @category responsive
|
|
8
|
-
*
|
|
9
|
-
* @returns An array with: 1) A flat palette map 2) A TailwindCSS ready palette
|
|
10
|
-
* object 3) A flat array of colors (no special sorting, same order as the `shades`
|
|
11
|
-
* given as argument)
|
|
12
|
-
*/ export const createPalette = (name, shades)=>{
|
|
13
|
-
const map = shades.reduce((map, def)=>{
|
|
14
|
-
map[def[0]] = def[1];
|
|
15
|
-
return map;
|
|
16
|
-
}, {});
|
|
17
|
-
// NOTE: the following breaks typedoc, with `any` it compiles
|
|
18
|
-
// const map = shades.reduce((map, def) => {
|
|
19
|
-
// map[def[0]] = def[1] as TColor;
|
|
20
|
-
// return map;
|
|
21
|
-
// }, {} as { [s: string]: TColor });
|
|
22
|
-
const tailwindPalette = shades.reduce((map, def)=>{
|
|
23
|
-
map[`${name}-${def[0]}`] = def[1];
|
|
24
|
-
return map;
|
|
25
|
-
}, {});
|
|
26
|
-
return [
|
|
27
|
-
map,
|
|
28
|
-
tailwindPalette,
|
|
29
|
-
Object.values(map)
|
|
30
|
-
];
|
|
31
|
-
};
|
|
32
|
-
export default createPalette;
|
package/debounce.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debounce function (with `setTimeout`)
|
|
3
|
-
*
|
|
4
|
-
* @category function
|
|
5
|
-
* @borrows [davidwalsh/debounce](https://davidwalsh.name/javascript-debounce-function)
|
|
6
|
-
*/ export function debounce(fn, wait, immediate) {
|
|
7
|
-
let timeout;
|
|
8
|
-
return function(...args) {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
10
|
-
const context = this;
|
|
11
|
-
const later = function() {
|
|
12
|
-
timeout = null;
|
|
13
|
-
if (!immediate) fn.apply(context, args);
|
|
14
|
-
};
|
|
15
|
-
const callNow = immediate && !timeout;
|
|
16
|
-
if (timeout) clearTimeout(timeout);
|
|
17
|
-
timeout = setTimeout(later, wait);
|
|
18
|
-
if (callNow) fn.apply(context, args);
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export default debounce;
|
package/debouncePromise.mjs
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// import { debounce as tsDebounce } from "ts-debounce";
|
|
2
|
-
// export { type Options as DebounceOptions } from "ts-debounce";
|
|
3
|
-
// export { type DebouncedFunction } from "ts-debounce";
|
|
4
|
-
// /**
|
|
5
|
-
// * Debounce function (with `Promise`)
|
|
6
|
-
// *
|
|
7
|
-
// * @category function
|
|
8
|
-
// * @borrows [chodorowicz/ts-debounce](https://github.com/chodorowicz/ts-debounce)
|
|
9
|
-
// */
|
|
10
|
-
// export const debouncePromise = tsDebounce;
|
|
11
|
-
// export default debouncePromise;
|
|
12
|
-
/**
|
|
13
|
-
* Copy pasted from [chodorowicz/ts-debounce](https://github.com/chodorowicz/ts-debounce/blob/master/src/index.ts)
|
|
14
|
-
*
|
|
15
|
-
* @module
|
|
16
|
-
*/ /**
|
|
17
|
-
* @categroy functionn
|
|
18
|
-
*/ /**
|
|
19
|
-
* Debounce function (with `Promise`)
|
|
20
|
-
*
|
|
21
|
-
* @category function
|
|
22
|
-
* @borrows [chodorowicz/ts-debounce](https://github.com/chodorowicz/ts-debounce)
|
|
23
|
-
* @license MIT: Jakub Chodorowicz
|
|
24
|
-
*/ export function debouncePromise(func, waitMilliseconds = 50, options = {}) {
|
|
25
|
-
let timeoutId;
|
|
26
|
-
const isImmediate = options.isImmediate ?? false;
|
|
27
|
-
const callback = options.callback ?? false;
|
|
28
|
-
const maxWait = options.maxWait;
|
|
29
|
-
let lastInvokeTime = Date.now();
|
|
30
|
-
let promises = [];
|
|
31
|
-
function nextInvokeTimeout() {
|
|
32
|
-
if (maxWait !== undefined) {
|
|
33
|
-
const timeSinceLastInvocation = Date.now() - lastInvokeTime;
|
|
34
|
-
if (timeSinceLastInvocation + waitMilliseconds >= maxWait) {
|
|
35
|
-
return maxWait - timeSinceLastInvocation;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return waitMilliseconds;
|
|
39
|
-
}
|
|
40
|
-
const debouncedFunction = function(...args) {
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
42
|
-
const context = this;
|
|
43
|
-
return new Promise((resolve, reject)=>{
|
|
44
|
-
const invokeFunction = function() {
|
|
45
|
-
timeoutId = undefined;
|
|
46
|
-
lastInvokeTime = Date.now();
|
|
47
|
-
if (!isImmediate) {
|
|
48
|
-
const result = func.apply(context, args);
|
|
49
|
-
callback && callback(result);
|
|
50
|
-
promises.forEach(({ resolve })=>resolve(result));
|
|
51
|
-
promises = [];
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const shouldCallNow = isImmediate && timeoutId === undefined;
|
|
55
|
-
if (timeoutId !== undefined) {
|
|
56
|
-
clearTimeout(timeoutId);
|
|
57
|
-
}
|
|
58
|
-
timeoutId = setTimeout(invokeFunction, nextInvokeTimeout());
|
|
59
|
-
if (shouldCallNow) {
|
|
60
|
-
const result = func.apply(context, args);
|
|
61
|
-
callback && callback(result);
|
|
62
|
-
return resolve(result);
|
|
63
|
-
}
|
|
64
|
-
promises.push({
|
|
65
|
-
resolve,
|
|
66
|
-
reject
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
debouncedFunction.cancel = function(reason) {
|
|
71
|
-
if (timeoutId !== undefined) {
|
|
72
|
-
clearTimeout(timeoutId);
|
|
73
|
-
}
|
|
74
|
-
promises.forEach(({ reject })=>reject(reason));
|
|
75
|
-
promises = [];
|
|
76
|
-
};
|
|
77
|
-
return debouncedFunction;
|
|
78
|
-
}
|
|
79
|
-
export default debouncePromise;
|
package/debounceRaf.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debounce function (with `requestAnimationFrame`)
|
|
3
|
-
*
|
|
4
|
-
* @category function
|
|
5
|
-
* @borrows [vanillajstoolkit/debounce](https://vanillajstoolkit.com/helpers/debounce/)
|
|
6
|
-
* @license (c) 2021 Chris Ferdinandi, MIT License, https://gomakethings.com
|
|
7
|
-
*/ export function debounceRaf(fn) {
|
|
8
|
-
let timeout;
|
|
9
|
-
return function(...args) {
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
11
|
-
const context = this;
|
|
12
|
-
// If there's a timer, cancel it
|
|
13
|
-
if (timeout) {
|
|
14
|
-
window.cancelAnimationFrame(timeout);
|
|
15
|
-
}
|
|
16
|
-
// Setup the new requestAnimationFrame()
|
|
17
|
-
timeout = window.requestAnimationFrame(function() {
|
|
18
|
-
fn.apply(context, args);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export default debounceRaf;
|
package/decode.mjs
DELETED
package/encode.mjs
DELETED
package/ensureInt.mjs
DELETED
package/env.mjs
DELETED
package/errorToString.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import isString from "./isString";
|
|
2
|
-
/**
|
|
3
|
-
* Ensure to transform a JavaScript `Error` into a string (uses its `message`)
|
|
4
|
-
*
|
|
5
|
-
* @category error
|
|
6
|
-
* @category cast
|
|
7
|
-
*/ export const errorToString = (e)=>e instanceof Error ? e.message : isString(e) ? e : "";
|
|
8
|
-
export default errorToString;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category array
|
|
3
|
-
*/ export function findDuplicatedIndexes(arr) {
|
|
4
|
-
const indexes = {};
|
|
5
|
-
for(let i = 0; i < arr.length; i++){
|
|
6
|
-
const idxInArray = arr.indexOf(arr[i]);
|
|
7
|
-
if (idxInArray !== i && idxInArray !== -1) {
|
|
8
|
-
indexes[i] = true;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return indexes;
|
|
12
|
-
}
|
|
13
|
-
export default findDuplicatedIndexes;
|
package/forin.mjs
DELETED
package/gbToBytes.mjs
DELETED
package/getEmptyArray.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import isNumber from "./isNumber";
|
|
2
|
-
/**
|
|
3
|
-
* Returns an array of undefined values of the desired length, useful to build
|
|
4
|
-
* skeleton UIs.
|
|
5
|
-
*
|
|
6
|
-
* @category array
|
|
7
|
-
*/ export function getEmptyArray(length) {
|
|
8
|
-
if (!isNumber(length)) {
|
|
9
|
-
length = parseInt(length, 10);
|
|
10
|
-
}
|
|
11
|
-
return Array.from({
|
|
12
|
-
length
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
export default getEmptyArray;
|
package/getKeys.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type safe replacement for `Object.keys(myObject)` to iterate over a record
|
|
3
|
-
* without loosing the key's types in simple `string`s.
|
|
4
|
-
*
|
|
5
|
-
* @category native
|
|
6
|
-
* @category object
|
|
7
|
-
* @see https://stackoverflow.com/a/59459000/1938970
|
|
8
|
-
*/ export const getKeys = Object.keys;
|
|
9
|
-
export default getKeys;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category responsive
|
|
3
|
-
*/ /**
|
|
4
|
-
* @category responsive
|
|
5
|
-
*/ export function getMediaQueryWidthResolvers(customBreakpoints) {
|
|
6
|
-
const breakpoints = {
|
|
7
|
-
xs: 0,
|
|
8
|
-
...customBreakpoints
|
|
9
|
-
};
|
|
10
|
-
const sortedBreakpointsNames = Object.keys(breakpoints).map((key)=>{
|
|
11
|
-
const br = key;
|
|
12
|
-
return [
|
|
13
|
-
br,
|
|
14
|
-
breakpoints[br]
|
|
15
|
-
];
|
|
16
|
-
}).sort((a, b)=>a[1] - b[1]).map((item)=>item[0]);
|
|
17
|
-
const getNextBreakpoint = (breakpoint)=>{
|
|
18
|
-
const index = sortedBreakpointsNames.indexOf(breakpoint);
|
|
19
|
-
return sortedBreakpointsNames[index + 1];
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* It behaves the same as `(min-width: ${value}px)`
|
|
23
|
-
* where value is the given breakpoint value.
|
|
24
|
-
* For ease of use this can be used both as a function `min("md")` and as an
|
|
25
|
-
* object literal `min.md`.
|
|
26
|
-
*/ const min = (br)=>`(min-width: ${breakpoints[br]}px)`;
|
|
27
|
-
/**
|
|
28
|
-
* It behaves the same as `(max-width: ${value}px)`
|
|
29
|
-
* where value is the given breakpoint value.
|
|
30
|
-
* For ease of use this can be used both as a function `max("md")` and as an
|
|
31
|
-
* object literal `max.md`.
|
|
32
|
-
*/ const max = (br)=>`(max-width: ${breakpoints[br] - 0.02}px)`;
|
|
33
|
-
/**
|
|
34
|
-
* It behaves the same as `min`
|
|
35
|
-
* @inheritdoc {max}
|
|
36
|
-
*/ const up = min;
|
|
37
|
-
/**
|
|
38
|
-
* It behaves similarly to `max` but you will use the "next" breakpoint,
|
|
39
|
-
* specifying CSS that will apply from the given breakpoint and down.
|
|
40
|
-
*/ const down = (br)=>{
|
|
41
|
-
const brNext = getNextBreakpoint(br);
|
|
42
|
-
// TODO: if br does not exists otherwise throw Error
|
|
43
|
-
return brNext && `(max-width: ${breakpoints[brNext] - 0.02}px)`;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Media query between the two given breakpoints
|
|
47
|
-
*/ const between = (br1, br2)=>{
|
|
48
|
-
br2 = br2 || getNextBreakpoint(br1);
|
|
49
|
-
return br2 ? `(min-width: ${breakpoints[br1]}px) and (max-width: ${breakpoints[br2] - 0.02}px)` : min(br1);
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Media query to apply from the given breakpoint until the next, just for its
|
|
53
|
-
* full range
|
|
54
|
-
*/ const only = (br)=>{
|
|
55
|
-
const brNext = getNextBreakpoint(br);
|
|
56
|
-
return brNext ? between(br, brNext) : min(br);
|
|
57
|
-
};
|
|
58
|
-
return {
|
|
59
|
-
max,
|
|
60
|
-
min,
|
|
61
|
-
down,
|
|
62
|
-
up,
|
|
63
|
-
between,
|
|
64
|
-
only
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export default getMediaQueryWidthResolvers;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { getMediaQueryWidthResolvers } from "./getMediaQueryWidthResolvers";
|
|
2
|
-
/**
|
|
3
|
-
* @category responsive
|
|
4
|
-
* @category tailwind
|
|
5
|
-
*/ export function getMediaQueryWidthTailwindScreens(breakpoints) {
|
|
6
|
-
const mqWidthResolvers = getMediaQueryWidthResolvers(breakpoints);
|
|
7
|
-
// Object.keys(breakpoints).reduce((screens, br) => {
|
|
8
|
-
const screens = Object.keys(breakpoints).reduce((output, br, idx)=>{
|
|
9
|
-
const brNext = Object.keys(breakpoints)[idx + 1];
|
|
10
|
-
for(const resolverName in mqWidthResolvers){
|
|
11
|
-
// this line is just for typescript..
|
|
12
|
-
const resolver = resolverName;
|
|
13
|
-
const resolverFn = mqWidthResolvers[resolver];
|
|
14
|
-
const raw = resolverFn(br);
|
|
15
|
-
if (raw) {
|
|
16
|
-
if (resolverName === "min") {
|
|
17
|
-
output[`@${br}`] = {
|
|
18
|
-
raw
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
if (resolverName === "between") {
|
|
22
|
-
if (brNext) output[`@${resolverName}-${br}_${brNext}`] = {
|
|
23
|
-
raw
|
|
24
|
-
};
|
|
25
|
-
} else {
|
|
26
|
-
output[`@${resolverName}-${br}`] = {
|
|
27
|
-
raw
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return output;
|
|
33
|
-
}, {});
|
|
34
|
-
return screens;
|
|
35
|
-
}
|
|
36
|
-
export default getMediaQueryWidthTailwindScreens;
|
package/getNonce.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { isUndefined } from "./isUndefined";
|
|
2
|
-
/**
|
|
3
|
-
* @category security
|
|
4
|
-
* @see https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/nonce.ts
|
|
5
|
-
*/ export function getNonce() {
|
|
6
|
-
return isUndefined(__webpack_nonce__) ? null : __webpack_nonce__;
|
|
7
|
-
}
|
|
8
|
-
export default getNonce;
|
package/getParamAmong.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import getParamAsString from "./getParamAsString";
|
|
2
|
-
/**
|
|
3
|
-
* Get query parameter as `string` treating the `ParsedUrlQuery` result of
|
|
4
|
-
* [`querystring`](https://nodejs.org/api/querystring.html) (used in next.js
|
|
5
|
-
* router and elsewhere)
|
|
6
|
-
*
|
|
7
|
-
* @category location
|
|
8
|
-
*
|
|
9
|
-
* @param raw The _raw_ query parameter
|
|
10
|
-
* @param allowedValues The list of values (as strings) that the parameter can
|
|
11
|
-
* have, if not one of them `null` is returned
|
|
12
|
-
*/ export function getParamAmong(raw, allowedValues = []) {
|
|
13
|
-
const string = getParamAsString(raw);
|
|
14
|
-
return allowedValues.includes(string) ? string : null;
|
|
15
|
-
}
|
|
16
|
-
export default getParamAmong;
|
package/getParamAsInt.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import getParamAsString from "./getParamAsString";
|
|
2
|
-
/**
|
|
3
|
-
* Get query parameter as `int`eger treating the `ParsedUrlQuery` result of
|
|
4
|
-
* [`querystring`](https://nodejs.org/api/querystring.html) (used in next.js
|
|
5
|
-
* router and elsewhere)
|
|
6
|
-
*
|
|
7
|
-
* @category location
|
|
8
|
-
*
|
|
9
|
-
* @param raw The _raw_ query parameter
|
|
10
|
-
* @param fallback Fallback number, we return `null` if not provided
|
|
11
|
-
*/ export function getParamAsInt(raw, fallback = null) {
|
|
12
|
-
const string = getParamAsString(raw);
|
|
13
|
-
if (string) {
|
|
14
|
-
return parseInt(string, 10);
|
|
15
|
-
}
|
|
16
|
-
return fallback;
|
|
17
|
-
}
|
|
18
|
-
export default getParamAsInt;
|
package/getParamAsString.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import isArray from "./isArray";
|
|
2
|
-
/**
|
|
3
|
-
* Get query parameter as `string` treating the `ParsedUrlQuery` result of
|
|
4
|
-
* [`querystring`](https://nodejs.org/api/querystring.html) (used in next.js
|
|
5
|
-
* router and elsewhere)
|
|
6
|
-
*
|
|
7
|
-
* @category location
|
|
8
|
-
*
|
|
9
|
-
* @param raw The _raw_ query parameter
|
|
10
|
-
*/ export function getParamAsString(raw) {
|
|
11
|
-
return (isArray(raw) ? raw[0] : raw) || "";
|
|
12
|
-
}
|
|
13
|
-
export default getParamAsString;
|
package/getType.mjs
DELETED
|
@@ -1,14 +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
|
-
*/ /**
|
|
10
|
-
* Returns the object type of the given payload
|
|
11
|
-
*/ export function getType(payload) {
|
|
12
|
-
return Object.prototype.toString.call(payload).slice(8, -1);
|
|
13
|
-
}
|
|
14
|
-
export default getType;
|