@koine/utils 2.0.0-beta.4 → 2.0.0-beta.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Defer.d.ts +0 -15
- package/Emitter.d.ts +2 -21
- package/README.md +4 -2
- package/accentSets.d.ts +1 -15
- package/addOrReplaceAtIdx.d.ts +1 -5
- package/areEqual.d.ts +2 -17
- package/arrayFilterFalsy.d.ts +1 -0
- package/arrayOfAll.d.ts +1 -28
- package/arraySum.d.ts +1 -7
- package/arrayToLookup.d.ts +1 -7
- package/arrayUniqueByProperties.d.ts +1 -0
- package/buildUrlQueryString.d.ts +2 -12
- package/capitalize.d.ts +1 -8
- package/changeCaseCamel.d.ts +2 -0
- package/changeCaseCapital.d.ts +2 -0
- package/changeCaseConstant.d.ts +2 -0
- package/changeCaseDot.d.ts +2 -0
- package/changeCaseHelpers.d.ts +19 -0
- package/changeCaseKebab.d.ts +2 -0
- package/changeCaseNone.d.ts +2 -0
- package/changeCasePascal.d.ts +2 -0
- package/changeCasePascalSnake.d.ts +2 -0
- package/changeCasePath.d.ts +2 -0
- package/changeCaseSentence.d.ts +2 -0
- package/changeCaseSnake.d.ts +2 -0
- package/changeCaseTrain.d.ts +2 -0
- package/chunkByChunks.d.ts +1 -7
- package/chunkBySize.d.ts +1 -6
- package/clamp.d.ts +1 -8
- package/clsx.d.ts +6 -9
- package/convertRange.d.ts +1 -14
- package/cookie.d.ts +1 -37
- package/createPalette.d.ts +2 -12
- package/debounce.d.ts +1 -8
- package/debouncePromise.d.ts +10 -11
- package/debounceRaf.d.ts +0 -8
- package/decode.d.ts +1 -6
- package/encode.d.ts +1 -6
- package/ensureInt.d.ts +1 -7
- package/env.d.ts +0 -0
- package/errorToString.d.ts +1 -7
- package/findDuplicatedIndexes.d.ts +1 -5
- package/forin.d.ts +1 -7
- package/gbToBytes.d.ts +1 -7
- package/getEmptyArray.d.ts +1 -9
- package/getKeys.d.ts +1 -9
- package/getMediaQueryWidthResolvers.d.ts +1 -2
- package/getMediaQueryWidthTailwindScreens.d.ts +1 -2
- package/getNonce.d.ts +1 -6
- package/getParamAmong.d.ts +1 -12
- package/getParamAsInt.d.ts +1 -12
- package/getParamAsString.d.ts +1 -11
- package/getType.d.ts +4 -17
- package/getUrlHashParams.d.ts +1 -9
- package/getUrlHashPathname.d.ts +1 -9
- package/getUrlPathnameParts.d.ts +1 -12
- package/getUrlQueryParams.d.ts +1 -14
- package/imgEmptyPixel.d.ts +1 -7
- package/index.cjs.d.ts +1 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +482 -0
- package/index.cjs.mjs +2 -0
- package/index.d.ts +24 -5
- package/index.esm.js +330 -0
- package/invariant.d.ts +1 -19
- package/isAnyObject.d.ts +2 -8
- package/isArray.d.ts +1 -7
- package/isBlob.d.ts +1 -7
- package/isBoolean.d.ts +1 -7
- package/isBrowser.d.ts +1 -6
- package/isBrowserNow.d.ts +1 -6
- package/isDate.d.ts +1 -7
- package/isEmptyArray.d.ts +1 -7
- package/isEmptyObject.d.ts +4 -8
- package/isEmptyString.d.ts +1 -7
- package/isError.d.ts +1 -7
- package/isExternalUrl.d.ts +1 -9
- package/isFile.d.ts +1 -7
- package/isFloat.d.ts +1 -7
- package/isFormData.d.ts +1 -7
- package/isFullArray.d.ts +1 -7
- package/isFullObject.d.ts +2 -8
- package/isFullString.d.ts +1 -7
- package/isFunction.d.ts +2 -8
- package/isInt.d.ts +1 -7
- package/isMap.d.ts +1 -7
- package/isNaNValue.d.ts +1 -7
- package/isNegativeNumber.d.ts +1 -7
- package/isNull.d.ts +1 -7
- package/isNullOrUndefined.d.ts +1 -7
- package/isNumber.d.ts +1 -9
- package/isNumericLiteral.d.ts +1 -0
- package/isObject.d.ts +2 -8
- package/isObjectLike.d.ts +2 -10
- package/isObjectStringKeyed.d.ts +2 -0
- package/isOneOf.d.ts +1 -5
- package/isPlainObject.d.ts +2 -8
- package/isPositiveNumber.d.ts +1 -7
- package/isPrimitive.d.ts +1 -7
- package/isPromise.d.ts +1 -7
- package/isRegExp.d.ts +1 -7
- package/isServer.d.ts +1 -6
- package/isServerNow.d.ts +1 -6
- package/isSet.d.ts +1 -7
- package/isString.d.ts +1 -7
- package/isSymbol.d.ts +1 -7
- package/isType.d.ts +2 -11
- package/isUndefined.d.ts +1 -7
- package/isWeakMap.d.ts +1 -7
- package/isWeakSet.d.ts +1 -7
- package/kbToBytes.d.ts +1 -7
- package/location.d.ts +0 -3
- package/lowercase.d.ts +1 -7
- package/mapListBy.d.ts +1 -7
- package/matchSorter.d.ts +2 -10
- package/mbToBytes.d.ts +1 -7
- package/mergeObjects.d.ts +1 -7
- package/mergeUrlQueryParams.d.ts +2 -9
- package/moveSortableArrayItemByKey.d.ts +1 -9
- package/noop.d.ts +1 -7
- package/normaliseUrl.d.ts +1 -11
- package/normaliseUrlPathname.d.ts +1 -10
- package/objectFlat.d.ts +3 -0
- package/objectFlip.d.ts +1 -0
- package/objectOmit.d.ts +1 -11
- package/objectPick.d.ts +1 -8
- package/objectSortByKeysMatching.d.ts +3 -0
- package/objectToArray.d.ts +1 -0
- package/package.json +9 -10
- package/parseCookie.d.ts +2 -11
- package/parseURL.d.ts +1 -8
- package/quaranteneProps.d.ts +2 -17
- package/randomInt.d.ts +1 -7
- package/randomKey.d.ts +1 -8
- package/readCookie.d.ts +0 -1
- package/removeAccents.d.ts +2 -6
- package/removeCookie.d.ts +1 -9
- package/removeDuplicates.d.ts +0 -0
- package/removeDuplicatesByKey.d.ts +1 -8
- package/removeDuplicatesComparing.d.ts +1 -5
- package/removeIndexesFromArray.d.ts +1 -5
- package/removeTrailingSlash.d.ts +1 -7
- package/removeUrlQueryParams.d.ts +1 -8
- package/render.d.ts +2 -41
- package/round.d.ts +2 -0
- package/roundTo.d.ts +1 -8
- package/serializeCookie.d.ts +2 -27
- package/setCookie.d.ts +1 -9
- package/shuffle.d.ts +1 -16
- package/slugify.d.ts +1 -11
- package/split.d.ts +1 -2
- package/splitReverse.d.ts +4 -0
- package/swapMap.d.ts +1 -7
- package/throttle.d.ts +1 -8
- package/titleCase.d.ts +1 -7
- package/toNumber.d.ts +1 -5
- package/toRgba.d.ts +1 -5
- package/transformToUrlPathname.d.ts +1 -11
- package/truncate.d.ts +1 -7
- package/tryUntil.d.ts +1 -8
- package/types.d.ts +1 -18
- package/typings.d.ts +31 -5
- package/uid.d.ts +1 -7
- package/updateLinkParams.d.ts +2 -10
- package/updateUrlQueryParams.d.ts +2 -9
- package/uppercase.d.ts +1 -7
- package/uuid.d.ts +1 -8
- package/uuidNumeric.d.ts +1 -6
- package/wait.d.ts +1 -7
- package/without.d.ts +0 -0
- package/Defer.js +0 -35
- package/Defer.mjs +0 -27
- package/Emitter.js +0 -53
- package/Emitter.mjs +0 -35
- package/accentSets.js +0 -133
- package/accentSets.mjs +0 -122
- package/addOrReplaceAtIdx.js +0 -40
- package/addOrReplaceAtIdx.mjs +0 -22
- package/areEqual.js +0 -75
- package/areEqual.mjs +0 -71
- package/arrayOfAll.js +0 -45
- package/arrayOfAll.mjs +0 -27
- package/arraySum.js +0 -24
- package/arraySum.mjs +0 -6
- package/arrayToLookup.js +0 -29
- package/arrayToLookup.mjs +0 -11
- package/buildUrlQueryString.js +0 -39
- package/buildUrlQueryString.mjs +0 -28
- package/capitalize.js +0 -28
- package/capitalize.mjs +0 -10
- package/changeUrlPath.d.ts +0 -10
- package/changeUrlPath.js +0 -29
- package/changeUrlPath.mjs +0 -17
- package/chunkByChunks.js +0 -52
- package/chunkByChunks.mjs +0 -34
- package/chunkBySize.js +0 -29
- package/chunkBySize.mjs +0 -11
- package/clamp.js +0 -27
- package/clamp.mjs +0 -9
- package/clsx.js +0 -59
- package/clsx.mjs +0 -46
- package/convertRange.js +0 -33
- package/convertRange.mjs +0 -15
- package/cookie.js +0 -21
- package/cookie.mjs +0 -11
- package/createPalette.js +0 -34
- package/createPalette.mjs +0 -25
- package/debounce.js +0 -39
- package/debounce.mjs +0 -21
- package/debouncePromise.js +0 -21
- package/debouncePromise.mjs +0 -8
- package/debounceRaf.js +0 -40
- package/debounceRaf.mjs +0 -22
- package/decode.js +0 -27
- package/decode.mjs +0 -9
- package/encode.js +0 -27
- package/encode.mjs +0 -9
- package/ensureInt.js +0 -24
- package/ensureInt.mjs +0 -6
- package/env.js +0 -3
- package/env.mjs +0 -2
- package/errorToString.js +0 -22
- package/errorToString.mjs +0 -7
- package/findDuplicatedIndexes.js +0 -31
- package/findDuplicatedIndexes.mjs +0 -13
- package/forin.js +0 -28
- package/forin.mjs +0 -10
- package/gbToBytes.js +0 -24
- package/gbToBytes.mjs +0 -6
- package/getEmptyArray.js +0 -29
- package/getEmptyArray.mjs +0 -16
- package/getKeys.js +0 -26
- package/getKeys.mjs +0 -8
- package/getMediaQueryWidthResolvers.js +0 -81
- package/getMediaQueryWidthResolvers.mjs +0 -63
- package/getMediaQueryWidthTailwindScreens.js +0 -51
- package/getMediaQueryWidthTailwindScreens.mjs +0 -33
- package/getNonce.js +0 -23
- package/getNonce.mjs +0 -8
- package/getParamAmong.js +0 -25
- package/getParamAmong.mjs +0 -15
- package/getParamAsInt.js +0 -28
- package/getParamAsInt.mjs +0 -18
- package/getParamAsString.js +0 -24
- package/getParamAsString.mjs +0 -13
- package/getType.js +0 -30
- package/getType.mjs +0 -17
- package/getUrlHashParams.js +0 -27
- package/getUrlHashParams.mjs +0 -14
- package/getUrlHashPathname.js +0 -29
- package/getUrlHashPathname.mjs +0 -11
- package/getUrlPathnameParts.js +0 -25
- package/getUrlPathnameParts.mjs +0 -15
- package/getUrlQueryParams.js +0 -36
- package/getUrlQueryParams.mjs +0 -27
- package/imgEmptyPixel.js +0 -24
- package/imgEmptyPixel.mjs +0 -6
- package/index.js +0 -532
- package/index.mjs +0 -132
- package/invariant.js +0 -50
- package/invariant.mjs +0 -32
- package/isAnyObject.js +0 -24
- package/isAnyObject.mjs +0 -9
- package/isArray.js +0 -24
- package/isArray.mjs +0 -9
- package/isBlob.js +0 -24
- package/isBlob.mjs +0 -9
- package/isBoolean.js +0 -24
- package/isBoolean.mjs +0 -9
- package/isBrowser.js +0 -23
- package/isBrowser.mjs +0 -5
- package/isBrowserNow.js +0 -22
- package/isBrowserNow.mjs +0 -6
- package/isDate.js +0 -24
- package/isDate.mjs +0 -9
- package/isEmptyArray.js +0 -24
- package/isEmptyArray.mjs +0 -9
- package/isEmptyObject.js +0 -24
- package/isEmptyObject.mjs +0 -9
- package/isEmptyString.js +0 -26
- package/isEmptyString.mjs +0 -8
- package/isError.js +0 -24
- package/isError.mjs +0 -9
- package/isExternalUrl.js +0 -32
- package/isExternalUrl.mjs +0 -19
- package/isFile.js +0 -24
- package/isFile.mjs +0 -9
- package/isFloat.js +0 -24
- package/isFloat.mjs +0 -9
- package/isFormData.js +0 -24
- package/isFormData.mjs +0 -9
- package/isFullArray.js +0 -24
- package/isFullArray.mjs +0 -9
- package/isFullObject.js +0 -24
- package/isFullObject.mjs +0 -9
- package/isFullString.js +0 -24
- package/isFullString.mjs +0 -9
- package/isFunction.js +0 -22
- package/isFunction.mjs +0 -8
- package/isInt.js +0 -24
- package/isInt.mjs +0 -9
- package/isMap.js +0 -24
- package/isMap.mjs +0 -9
- package/isNaNValue.js +0 -24
- package/isNaNValue.mjs +0 -9
- package/isNegativeNumber.js +0 -24
- package/isNegativeNumber.mjs +0 -9
- package/isNull.js +0 -24
- package/isNull.mjs +0 -9
- package/isNullOrUndefined.js +0 -24
- package/isNullOrUndefined.mjs +0 -9
- package/isNumber.js +0 -24
- package/isNumber.mjs +0 -11
- package/isObject.js +0 -24
- package/isObject.mjs +0 -9
- package/isObjectLike.js +0 -24
- package/isObjectLike.mjs +0 -11
- package/isOneOf.js +0 -22
- package/isOneOf.mjs +0 -4
- package/isPlainObject.js +0 -25
- package/isPlainObject.mjs +0 -10
- package/isPositiveNumber.js +0 -24
- package/isPositiveNumber.mjs +0 -9
- package/isPrimitive.js +0 -29
- package/isPrimitive.mjs +0 -14
- package/isPromise.js +0 -24
- package/isPromise.mjs +0 -9
- package/isRegExp.js +0 -24
- package/isRegExp.mjs +0 -9
- package/isServer.js +0 -23
- package/isServer.mjs +0 -7
- package/isServerNow.js +0 -22
- package/isServerNow.mjs +0 -6
- package/isSet.js +0 -24
- package/isSet.mjs +0 -9
- package/isString.js +0 -24
- package/isString.mjs +0 -9
- package/isSymbol.js +0 -24
- package/isSymbol.mjs +0 -9
- package/isType.js +0 -32
- package/isType.mjs +0 -20
- package/isUndefined.js +0 -24
- package/isUndefined.mjs +0 -9
- package/isWeakMap.js +0 -24
- package/isWeakMap.mjs +0 -9
- package/isWeakSet.js +0 -24
- package/isWeakSet.mjs +0 -9
- package/kbToBytes.js +0 -24
- package/kbToBytes.mjs +0 -6
- package/location.js +0 -6
- package/location.mjs +0 -3
- package/lowercase.js +0 -24
- package/lowercase.mjs +0 -6
- package/mapListBy.js +0 -29
- package/mapListBy.mjs +0 -11
- package/matchSorter.js +0 -373
- package/matchSorter.mjs +0 -352
- package/mbToBytes.js +0 -24
- package/mbToBytes.mjs +0 -6
- package/mergeObjects.js +0 -39
- package/mergeObjects.mjs +0 -34
- package/mergeUrlQueryParams.js +0 -32
- package/mergeUrlQueryParams.mjs +0 -18
- package/moveSortableArrayItemByKey.js +0 -35
- package/moveSortableArrayItemByKey.mjs +0 -17
- package/noop.js +0 -24
- package/noop.mjs +0 -6
- package/normaliseUrl.js +0 -24
- package/normaliseUrl.mjs +0 -13
- package/normaliseUrlPathname.js +0 -24
- package/normaliseUrlPathname.mjs +0 -12
- package/objectOmit.js +0 -35
- package/objectOmit.mjs +0 -17
- package/objectPick.js +0 -32
- package/objectPick.mjs +0 -14
- package/parseCookie.js +0 -55
- package/parseCookie.mjs +0 -44
- package/parseURL.js +0 -37
- package/parseURL.mjs +0 -19
- package/quaranteneProps.js +0 -49
- package/quaranteneProps.mjs +0 -31
- package/randomInt.js +0 -26
- package/randomInt.mjs +0 -8
- package/randomKey.js +0 -28
- package/randomKey.mjs +0 -10
- package/readCookie.js +0 -51
- package/readCookie.mjs +0 -33
- package/removeAccents.js +0 -28
- package/removeAccents.mjs +0 -12
- package/removeCookie.js +0 -28
- package/removeCookie.mjs +0 -16
- package/removeDuplicates.js +0 -13
- package/removeDuplicates.mjs +0 -12
- package/removeDuplicatesByKey.js +0 -36
- package/removeDuplicatesByKey.mjs +0 -18
- package/removeDuplicatesComparing.js +0 -25
- package/removeDuplicatesComparing.mjs +0 -9
- package/removeIndexesFromArray.js +0 -31
- package/removeIndexesFromArray.mjs +0 -13
- package/removeTrailingSlash.js +0 -26
- package/removeTrailingSlash.mjs +0 -8
- package/removeUrlQueryParams.js +0 -33
- package/removeUrlQueryParams.mjs +0 -19
- package/render.js +0 -93
- package/render.mjs +0 -110
- package/roundTo.js +0 -50
- package/roundTo.mjs +0 -32
- package/serializeCookie.js +0 -102
- package/serializeCookie.mjs +0 -98
- package/setCookie.js +0 -68
- package/setCookie.mjs +0 -55
- package/shuffle.js +0 -50
- package/shuffle.mjs +0 -32
- package/slugify.js +0 -35
- package/slugify.mjs +0 -25
- package/split.js +0 -22
- package/split.mjs +0 -4
- package/swapMap.js +0 -30
- package/swapMap.mjs +0 -12
- package/throttle.js +0 -38
- package/throttle.mjs +0 -20
- package/titleCase.js +0 -24
- package/titleCase.mjs +0 -6
- package/toNumber.js +0 -23
- package/toNumber.mjs +0 -7
- package/toRgba.js +0 -32
- package/toRgba.mjs +0 -14
- package/transformToUrlPathname.js +0 -24
- package/transformToUrlPathname.mjs +0 -13
- package/truncate.js +0 -24
- package/truncate.mjs +0 -6
- package/tryUntil.js +0 -42
- package/tryUntil.mjs +0 -24
- package/types.js +0 -5
- package/types.mjs +0 -2
- package/uid.js +0 -24
- package/uid.mjs +0 -10
- package/updateLinkParams.js +0 -26
- package/updateLinkParams.mjs +0 -13
- package/updateUrlQueryParams.js +0 -28
- package/updateUrlQueryParams.mjs +0 -14
- package/uppercase.js +0 -24
- package/uppercase.mjs +0 -6
- package/uuid.js +0 -28
- package/uuid.mjs +0 -10
- package/uuidNumeric.js +0 -23
- package/uuidNumeric.mjs +0 -5
- package/wait.js +0 -24
- package/wait.mjs +0 -6
- package/without.js +0 -55
- package/without.mjs +0 -54
package/removeTrailingSlash.d.ts
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Remove the given keys from the given URL query parameters
|
|
3
|
-
*
|
|
4
|
-
* @category location
|
|
5
|
-
* @pure
|
|
6
|
-
*/
|
|
7
|
-
export declare function removeUrlQueryParams(url: string, paramsToRemove?: string[]): string;
|
|
8
|
-
export default removeUrlQueryParams;
|
|
1
|
+
export declare let removeUrlQueryParams: (url: string, paramsToRemove?: string[]) => string;
|
package/render.d.ts
CHANGED
|
@@ -8,45 +8,6 @@ type DefinitionExtended = {
|
|
|
8
8
|
type Definitions = {
|
|
9
9
|
[key: string]: DefinitionExtended;
|
|
10
10
|
} & DefinitionExtended;
|
|
11
|
-
/**
|
|
12
|
-
* Returned render function
|
|
13
|
-
*/
|
|
14
11
|
type RenderFunction = (data: object) => string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* The data made available to the template is always on the `data` key, e.g.:
|
|
19
|
-
* `renderer({ myVal: "xx" })`
|
|
20
|
-
* ... will be accessible on
|
|
21
|
-
* `<%= data.myVal %>`
|
|
22
|
-
*
|
|
23
|
-
* The default delimiters are customised to work without conflicts with Blade and Twig:
|
|
24
|
-
* ```
|
|
25
|
-
* <% %> for evaluation
|
|
26
|
-
* <%= %> for interpolation
|
|
27
|
-
* <%? %> for conditionals
|
|
28
|
-
* <%~ %> for array iteration
|
|
29
|
-
* <%# %> for compile-time evaluation/includes and partials
|
|
30
|
-
* <%## #%> for compile-time defines
|
|
31
|
-
*
|
|
32
|
-
* Unsupported:
|
|
33
|
-
* <%! %> for interpolation with encoding
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
*
|
|
38
|
-
* ```js
|
|
39
|
-
* import { render } from "...";
|
|
40
|
-
*
|
|
41
|
-
* const data = { name: "XYZ" };
|
|
42
|
-
* const tpl = `Hello <%= data.name %>`;
|
|
43
|
-
* const renderer = render(tpl);
|
|
44
|
-
*
|
|
45
|
-
* console.log(renderer(data)); // outputs 'Hello XYZ'
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @borrows [olado/doT by Laura Doktorova](https://github.com/olado/doT)
|
|
49
|
-
* @see https://olado.github.io/doT/index.html
|
|
50
|
-
*/
|
|
51
|
-
export declare const render: (tmpl: string, def?: Definitions) => RenderFunction;
|
|
52
|
-
export default render;
|
|
12
|
+
export declare let render: (tmpl: string, def?: Definitions) => RenderFunction;
|
|
13
|
+
export {};
|
package/round.d.ts
ADDED
package/roundTo.d.ts
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Round to given number of the given number of decimals
|
|
3
|
-
*
|
|
4
|
-
* @category math
|
|
5
|
-
* @see https://stackoverflow.com/a/15762794/1938970
|
|
6
|
-
*/
|
|
7
|
-
export declare function roundTo(num: number, decimals?: number): string;
|
|
8
|
-
export default roundTo;
|
|
1
|
+
export declare let roundTo: (num: number, decimals?: number) => string;
|
package/serializeCookie.d.ts
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
import { type CookieAttributesServer } from "./cookie";
|
|
11
|
-
/**
|
|
12
|
-
* Serialize data into a cookie header.
|
|
13
|
-
*
|
|
14
|
-
* Serialize the a name value pair into a cookie string suitable for
|
|
15
|
-
* http headers. An optional attributes object specified cookie parameters.
|
|
16
|
-
*
|
|
17
|
-
* serialize('foo', 'bar', { httpOnly: true })
|
|
18
|
-
* => "foo=bar; httpOnly"
|
|
19
|
-
*
|
|
20
|
-
* @category cookie
|
|
21
|
-
*
|
|
22
|
-
* All cookie related code is inspired and adapted from:
|
|
23
|
-
* - [js-cookie](https://github.com/js-cookie/js-cookie)
|
|
24
|
-
* - [cookie](https://github.com/jshttp/cookie)
|
|
25
|
-
*/
|
|
26
|
-
export declare function serializeCookie(name: string, val: string, attributes?: CookieAttributesServer): string;
|
|
27
|
-
export default serializeCookie;
|
|
1
|
+
import type { CookieAttributesServer } from "./cookie";
|
|
2
|
+
export declare let serializeCookie: (name: string, val: string, attributes?: CookieAttributesServer) => string;
|
package/setCookie.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import { type CookieAttributesClient } from "./cookie";
|
|
2
|
-
|
|
3
|
-
* @category cookie
|
|
4
|
-
*
|
|
5
|
-
* All cookie related code is inspired and adapted from:
|
|
6
|
-
* - [js-cookie](https://github.com/js-cookie/js-cookie)
|
|
7
|
-
* - [cookie](https://github.com/jshttp/cookie)
|
|
8
|
-
*/
|
|
9
|
-
export declare function setCookie<T extends string = string>(name: string, value: string | T, attributes?: CookieAttributesClient): string | undefined;
|
|
10
|
-
export default setCookie;
|
|
2
|
+
export declare let setCookie: <T extends string = string>(name: string, value: string | T, attributes?: CookieAttributesClient) => string | undefined;
|
package/shuffle.d.ts
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Creates an array of shuffled values, using a version of the
|
|
3
|
-
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
|
|
4
|
-
*
|
|
5
|
-
* @see lodash.shuffle
|
|
6
|
-
* @since 0.1.0
|
|
7
|
-
* @category arrays
|
|
8
|
-
* @param {Array} array The array to shuffle.
|
|
9
|
-
* @returns {Array} Returns the new shuffled array.
|
|
10
|
-
* @example
|
|
11
|
-
*
|
|
12
|
-
* shuffle([1, 2, 3, 4])
|
|
13
|
-
* // => [4, 1, 3, 2]
|
|
14
|
-
*/
|
|
15
|
-
export declare function shuffle<T>(array: T[]): T[];
|
|
16
|
-
export default shuffle;
|
|
1
|
+
export declare let shuffle: <T>(array: T[]) => T[];
|
package/slugify.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Slugify a text
|
|
3
|
-
*
|
|
4
|
-
* - replaces the accented letters
|
|
5
|
-
* - replaces the punctuation with dashes
|
|
6
|
-
*
|
|
7
|
-
* @category text
|
|
8
|
-
* @see https://gist.github.com/mathewbyrne/1280286#gistcomment-3498021
|
|
9
|
-
*/
|
|
10
|
-
export declare function slugify(text: string, separator?: string): string;
|
|
11
|
-
export default slugify;
|
|
1
|
+
export declare let slugify: (text: string, separator?: string) => string;
|
package/split.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export type Split<S extends string, D extends string> = string extends S ? string[] : S extends "" ? [] : S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] : [S];
|
|
2
|
-
export declare
|
|
3
|
-
export default split;
|
|
2
|
+
export declare let split: <T extends string, D extends string>(string: T, delimiter: D) => Split<T, D>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Split } from "./split";
|
|
2
|
+
import type { Reverse } from "./types";
|
|
3
|
+
export type SplitReverse<S extends string, D extends string> = Reverse<Split<S, D>>;
|
|
4
|
+
export declare let splitReverse: <T extends string, D extends string>(string: T, delimiter: D) => Reverse<Split<T, D>>;
|
package/swapMap.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Swap object map key/value
|
|
3
|
-
*
|
|
4
|
-
* @category objects
|
|
5
|
-
*/
|
|
6
|
-
export declare function swapMap<T extends Record<string, string | number | symbol> = Record<string, string | number | symbol>>(map?: T): Record<T[keyof T], keyof T>;
|
|
7
|
-
export default swapMap;
|
|
1
|
+
export declare let swapMap: <T extends Record<string, string | number | symbol> = Record<string, string | number | symbol>>(map?: T) => Record<T[keyof T], keyof T>;
|
package/throttle.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
|
|
3
|
-
* Throttle function (e.g. for resize / scroll handlers)
|
|
4
|
-
*
|
|
5
|
-
* @category function
|
|
6
|
-
* @see https://github.com/Mobius1/Rangeable/
|
|
7
|
-
*/
|
|
8
|
-
export declare function throttle<TFn extends Function, TContext>(fn: TFn, limit: number, context?: TContext): (this: TContext, ...args: any[]) => NodeJS.Timeout | undefined;
|
|
9
|
-
export default throttle;
|
|
2
|
+
export declare let throttle: <TFn extends Function, TContext>(fn: TFn, limit: number, context?: TContext | undefined) => (this: TContext, ...args: any[]) => NodeJS.Timeout | undefined;
|
package/titleCase.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* @category typography
|
|
3
|
-
* @see https://github.com/blakeembrey/change-case/blob/master/packages/title-case/src/index.ts
|
|
4
|
-
* @author Blake Embrey (hello@blakeembrey.com)
|
|
5
|
-
*/
|
|
6
|
-
export declare const titleCase: (input?: null | string) => string;
|
|
7
|
-
export default titleCase;
|
|
1
|
+
export declare let titleCase: (input?: null | string) => string;
|
package/toNumber.d.ts
CHANGED
package/toRgba.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Transform string in a URL pathname (relative URL)
|
|
3
|
-
*
|
|
4
|
-
* - adds an initial slash
|
|
5
|
-
* - encode the string
|
|
6
|
-
* - replaces whitespaces with dashes
|
|
7
|
-
*
|
|
8
|
-
* @category location
|
|
9
|
-
*/
|
|
10
|
-
export declare function transformToUrlPathname(toPathname?: string): string;
|
|
11
|
-
export default transformToUrlPathname;
|
|
1
|
+
export declare let transformToUrlPathname: (toPathname?: string) => string;
|
package/truncate.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Truncate string
|
|
3
|
-
*
|
|
4
|
-
* @category typography
|
|
5
|
-
*/
|
|
6
|
-
export declare const truncate: (input: undefined | null | string, length: number) => string;
|
|
7
|
-
export default truncate;
|
|
1
|
+
export declare let truncate: (input: undefined | null | string, length: number) => string;
|
package/tryUntil.d.ts
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* @borrows [https://levelup.gitconnected.com/javascript-wait-until-something-happens-or-timeout-82636839ea93]
|
|
3
|
-
*
|
|
4
|
-
* @param timeout in `ms`
|
|
5
|
-
* @param interval in `ms`
|
|
6
|
-
*/
|
|
7
|
-
export declare const tryUntil: (test: () => boolean, timeout: number, interval: number, resolve: () => void, reject?: () => void) => void;
|
|
8
|
-
export default tryUntil;
|
|
1
|
+
export declare let tryUntil: (test: () => boolean, timeout: number, interval: number, resolve: () => void, reject?: () => void) => void;
|
package/types.d.ts
CHANGED
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
import type { Replace } from "type-fest";
|
|
2
|
-
/**
|
|
3
|
-
* Whatever that in javascript returns `false` when checked in an `if` condition
|
|
4
|
-
*/
|
|
5
2
|
export type AnythingFalsy = null | undefined | 0 | "";
|
|
6
|
-
/**
|
|
7
|
-
* Pick the keys of an object `T` that starts with `S`. It produces a mapped type
|
|
8
|
-
* with a subset of `T` whose keys start with `S`.
|
|
9
|
-
*/
|
|
10
3
|
export type PickStartsWith<T extends object, S extends string> = {
|
|
11
4
|
[K in keyof T as K extends `${S}${string}` ? K : never]: T[K];
|
|
12
5
|
};
|
|
13
|
-
/**
|
|
14
|
-
* Returns a union of all the keys of an object `T` which starts with `S`.
|
|
15
|
-
*/
|
|
16
6
|
export type KeysStartsWith<T extends object, S extends string> = keyof PickStartsWith<T, S>;
|
|
17
|
-
/**
|
|
18
|
-
* Pick the keys of an object `T` that starts with `S`. It produces a mapped type
|
|
19
|
-
* with a subset of `T` whose keys start with `S` *and have `S`* removed.
|
|
20
|
-
*/
|
|
21
7
|
export type PickStartsWithTails<T extends object, S extends string> = {
|
|
22
8
|
[K in keyof T as K extends `${S}${string}` ? Replace<K, S, ""> : never]: T[K];
|
|
23
9
|
};
|
|
24
|
-
/**
|
|
25
|
-
* Returns a union of all the keys of an object `T` which starts with `S`.
|
|
26
|
-
* The strings in the produced union *have `S` removed*.
|
|
27
|
-
*/
|
|
28
10
|
export type KeysTailsStartsWith<T extends object, S extends string> = keyof PickStartsWithTails<T, S>;
|
|
11
|
+
export type Reverse<Tuple> = Tuple extends [infer Head, ...infer Rest] ? [...Reverse<Rest>, Head] : [];
|
package/typings.d.ts
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* List here the global variables used by third party scripts supported within
|
|
3
|
-
* the `koine` ecosystem.
|
|
4
|
-
* variables.
|
|
3
|
+
* the `koine` ecosystem.
|
|
5
4
|
*/
|
|
6
5
|
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
//
|
|
6
|
+
// as in type-fest start
|
|
7
|
+
declare type Simplify<T> = { [KeyType in keyof T]: T[KeyType] };
|
|
8
|
+
// as in type-fest end
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Tweak a model by making some properties required (not `optional` and not `nullable`)
|
|
12
|
+
*
|
|
13
|
+
* This is useful to tweak/correct the types generated from Swagger.
|
|
14
|
+
*/
|
|
15
|
+
declare type Tweak<
|
|
16
|
+
TModel extends object,
|
|
17
|
+
TRequiredKeys extends keyof TModel | never,
|
|
18
|
+
TReplacements extends Partial<Record<keyof TModel, unknown>> | false = false,
|
|
19
|
+
> = TReplacements extends false
|
|
20
|
+
? Simplify<
|
|
21
|
+
Omit<TModel, TRequiredKeys> &
|
|
22
|
+
Required<{
|
|
23
|
+
[K in TRequiredKeys]: NonNullable<TModel[K]>;
|
|
24
|
+
}>
|
|
25
|
+
>
|
|
26
|
+
: Simplify<
|
|
27
|
+
Omit<
|
|
28
|
+
Omit<TModel, TRequiredKeys> &
|
|
29
|
+
Required<{
|
|
30
|
+
[K in TRequiredKeys]: NonNullable<TModel[K]>;
|
|
31
|
+
}>,
|
|
32
|
+
keyof TReplacements
|
|
33
|
+
> &
|
|
34
|
+
TReplacements
|
|
35
|
+
>;
|
package/uid.d.ts
CHANGED
package/updateLinkParams.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Update link `<a href="">` merging the given new query parameters.
|
|
4
|
-
* it returns the newly created `href` URL value
|
|
5
|
-
*
|
|
6
|
-
* @category location
|
|
7
|
-
* @pure
|
|
8
|
-
*/
|
|
9
|
-
export declare function updateLinkParams($anchor: HTMLAnchorElement, newParams: NonNullable<AnyQueryParams>): string;
|
|
10
|
-
export default updateLinkParams;
|
|
1
|
+
import type { AnyQueryParams } from "./location";
|
|
2
|
+
export declare let updateLinkParams: ($anchor: HTMLAnchorElement, newParams: NonNullable<AnyQueryParams>) => string;
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Update a URL string query parameters merging the given new query parameters
|
|
4
|
-
*
|
|
5
|
-
* @category location
|
|
6
|
-
* @pure
|
|
7
|
-
*/
|
|
8
|
-
export declare function updateUrlQueryParams(url: string, newParams?: NonNullable<AnyQueryParams>): string;
|
|
9
|
-
export default updateUrlQueryParams;
|
|
1
|
+
import type { AnyQueryParams } from "./location";
|
|
2
|
+
export declare let updateUrlQueryParams: (url: string, newParams?: NonNullable<AnyQueryParams>) => string;
|
package/uppercase.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Replacement for native `toUpperCase` tyescript ready (type narrowing ready)
|
|
3
|
-
*
|
|
4
|
-
* @category native
|
|
5
|
-
*/
|
|
6
|
-
export declare const uppercase: <T extends string>(str?: T | null | undefined) => Uppercase<T>;
|
|
7
|
-
export default uppercase;
|
|
1
|
+
export declare let uppercase: <T extends string>(str?: T | null | undefined) => Uppercase<T>;
|
package/uuid.d.ts
CHANGED
package/uuidNumeric.d.ts
CHANGED
package/wait.d.ts
CHANGED
package/without.d.ts
CHANGED
|
File without changes
|
package/Defer.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category async
|
|
3
|
-
*/ "use strict";
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
function _export(target, all) {
|
|
8
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: all[name]
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
_export(exports, {
|
|
14
|
-
Defer: function() {
|
|
15
|
-
return Defer;
|
|
16
|
-
},
|
|
17
|
-
default: function() {
|
|
18
|
-
return _default;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
function Defer() /* : PromiseConstructor */ {
|
|
22
|
-
// @ts-expect-error nevermind
|
|
23
|
-
const self = this || {};
|
|
24
|
-
const p = self.promise = new Promise((resolve, reject)=>{
|
|
25
|
-
self.resolve = resolve;
|
|
26
|
-
self.reject = reject;
|
|
27
|
-
});
|
|
28
|
-
self.then = p.then.bind(p);
|
|
29
|
-
self.catch = p.catch.bind(p);
|
|
30
|
-
// if (p.finally) {
|
|
31
|
-
// self.finally = p.finally.bind(p);
|
|
32
|
-
// }
|
|
33
|
-
return self;
|
|
34
|
-
}
|
|
35
|
-
const _default = Defer;
|
package/Defer.mjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @category async
|
|
3
|
-
*/ /**
|
|
4
|
-
* @category async
|
|
5
|
-
* @see https://stackoverflow.com/a/37673534/1938970
|
|
6
|
-
* @example
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* const deferred = Defer();
|
|
10
|
-
* deferred.resolve();
|
|
11
|
-
* deferred.then(handleSuccess, handleError);
|
|
12
|
-
* ```
|
|
13
|
-
*/ export function Defer() /* : PromiseConstructor */ {
|
|
14
|
-
// @ts-expect-error nevermind
|
|
15
|
-
const self = this || {};
|
|
16
|
-
const p = self.promise = new Promise((resolve, reject)=>{
|
|
17
|
-
self.resolve = resolve;
|
|
18
|
-
self.reject = reject;
|
|
19
|
-
});
|
|
20
|
-
self.then = p.then.bind(p);
|
|
21
|
-
self.catch = p.catch.bind(p);
|
|
22
|
-
// if (p.finally) {
|
|
23
|
-
// self.finally = p.finally.bind(p);
|
|
24
|
-
// }
|
|
25
|
-
return self;
|
|
26
|
-
}
|
|
27
|
-
export default Defer;
|
package/Emitter.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Emitter super simple class
|
|
3
|
-
*
|
|
4
|
-
* Events will be prefixed with the given `namespace` plus a `.` so:
|
|
5
|
-
* `{namespace}.myevent`
|
|
6
|
-
*
|
|
7
|
-
* Adapted from https://github.com/developit/mitt
|
|
8
|
-
*
|
|
9
|
-
* Regarding typescript support @see:
|
|
10
|
-
* - https://stackoverflow.com/q/53299743/1938970
|
|
11
|
-
* - https://github.com/Microsoft/TypeScript/pull/26349
|
|
12
|
-
*/ "use strict";
|
|
13
|
-
Object.defineProperty(exports, "__esModule", {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
|
16
|
-
function _export(target, all) {
|
|
17
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: all[name]
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
_export(exports, {
|
|
23
|
-
Emitter: function() {
|
|
24
|
-
return Emitter;
|
|
25
|
-
},
|
|
26
|
-
default: function() {
|
|
27
|
-
return _default;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
function Emitter(namespace) {
|
|
31
|
-
const all = new Map();
|
|
32
|
-
return {
|
|
33
|
-
/**
|
|
34
|
-
* Register an event handler for the given type.
|
|
35
|
-
*/ on (name, handler) {
|
|
36
|
-
const handlers = all.get(`${namespace}.${String(name)}`);
|
|
37
|
-
const added = handlers && handlers.push(handler);
|
|
38
|
-
if (!added) {
|
|
39
|
-
all.set(`${namespace}.${String(name)}`, [
|
|
40
|
-
handler
|
|
41
|
-
]);
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* Invoke all handlers for the given type.
|
|
46
|
-
*/ emit (name, data) {
|
|
47
|
-
(all.get(`${namespace}.${String(name)}`) || []).slice().map((handler)=>{
|
|
48
|
-
handler(data);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const _default = Emitter;
|
package/Emitter.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Emitter super simple class
|
|
3
|
-
*
|
|
4
|
-
* Events will be prefixed with the given `namespace` plus a `.` so:
|
|
5
|
-
* `{namespace}.myevent`
|
|
6
|
-
*
|
|
7
|
-
* Adapted from https://github.com/developit/mitt
|
|
8
|
-
*
|
|
9
|
-
* Regarding typescript support @see:
|
|
10
|
-
* - https://stackoverflow.com/q/53299743/1938970
|
|
11
|
-
* - https://github.com/Microsoft/TypeScript/pull/26349
|
|
12
|
-
*/ export function Emitter(namespace) {
|
|
13
|
-
const all = new Map();
|
|
14
|
-
return {
|
|
15
|
-
/**
|
|
16
|
-
* Register an event handler for the given type.
|
|
17
|
-
*/ on (name, handler) {
|
|
18
|
-
const handlers = all.get(`${namespace}.${String(name)}`);
|
|
19
|
-
const added = handlers && handlers.push(handler);
|
|
20
|
-
if (!added) {
|
|
21
|
-
all.set(`${namespace}.${String(name)}`, [
|
|
22
|
-
handler
|
|
23
|
-
]);
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
/**
|
|
27
|
-
* Invoke all handlers for the given type.
|
|
28
|
-
*/ emit (name, data) {
|
|
29
|
-
(all.get(`${namespace}.${String(name)}`) || []).slice().map((handler)=>{
|
|
30
|
-
handler(data);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export default Emitter;
|