@zelgadis87/utils-core 4.4.0 → 4.4.2
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/dist/Logger.d.ts +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/lazy/Lazy.d.ts +2 -1
- package/dist/lazy/LazyAsync.d.ts +2 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/arrays.d.ts +10 -1
- package/dist/utils/functions.d.ts +4 -1
- package/esbuild/index.cjs +167 -7
- package/esbuild/index.mjs +161 -6
- package/package.json +1 -1
- package/src/Logger.ts +4 -2
- package/src/index.ts +1 -1
- package/src/lazy/Lazy.ts +3 -1
- package/src/lazy/LazyAsync.ts +3 -1
- package/src/utils/arrays.ts +24 -3
- package/src/utils/functions.ts +10 -2
- package/dist/utils/functions/bindThis.d.ts +0 -1
- package/src/utils/functions/bindThis.ts +0 -4
package/dist/Logger.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
declare const LEVELS: readonly ["log", "debug", "info", "warn", "error"];
|
|
2
2
|
type TLogLevel = keyof Console & typeof LEVELS[number];
|
|
3
|
-
type TLoggerOpts = {
|
|
3
|
+
export type TLoggerOpts = {
|
|
4
4
|
console: Console;
|
|
5
5
|
enabled: boolean;
|
|
6
6
|
minLevel: Uppercase<TLogLevel>;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export declare class Logger {
|
|
9
9
|
readonly name: string;
|
|
10
10
|
private enabled;
|
|
11
11
|
private console;
|
|
@@ -18,4 +18,4 @@ export default class Logger {
|
|
|
18
18
|
get error(): (...args: any[]) => void;
|
|
19
19
|
private logWrap;
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export default Logger;
|
package/dist/index.d.ts
CHANGED
package/dist/lazy/Lazy.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* The initialization of the value is done once and only if required (lazy initialization).
|
|
4
4
|
* @author gtomberli
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare class Lazy<T> {
|
|
7
7
|
private _value;
|
|
8
8
|
private _initialized;
|
|
9
9
|
private _generator;
|
|
@@ -19,3 +19,4 @@ export default class Lazy<T> {
|
|
|
19
19
|
apply(fnPresent: (t: T) => void, fnEmpty: () => void): void;
|
|
20
20
|
static of<T>(generator: () => T): Lazy<T>;
|
|
21
21
|
}
|
|
22
|
+
export default Lazy;
|
package/dist/lazy/LazyAsync.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare class LazyAsync<T> {
|
|
2
2
|
private _promise;
|
|
3
3
|
private _pending;
|
|
4
4
|
private _resolvedValue;
|
|
@@ -21,3 +21,4 @@ export default class LazyAsync<T> {
|
|
|
21
21
|
getOrThrow(errorMessage?: "Value not initialized"): Promise<T> | never;
|
|
22
22
|
static of<T>(generator: () => Promise<T>): LazyAsync<T>;
|
|
23
23
|
}
|
|
24
|
+
export default LazyAsync;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/small-date@2.0.1/node_modules/small-date/index.d.ts","../src/utils/functions/bindthis.ts","../src/utils/functions/constant.ts","../src/sorting/types.ts","../src/sorting/comparisonchain.ts","../src/sorting/sorter.ts","../src/sorting/index.ts","../src/utils/nulls.ts","../src/utils/arrays/groupby.ts","../src/utils/arrays/indexby.ts","../src/utils/arrays/statistics.ts","../src/utils/arrays/uniqby.ts","../src/utils/arrays.ts","../src/utils/booleans.ts","../src/utils/empties.ts","../src/utils/errors/withtrycatch.ts","../src/utils/errors.ts","../src/utils/json.ts","../src/utils/numbers/round.ts","../src/utils/numbers.ts","../src/utils/primitives.ts","../src/time/timeunit.ts","../src/time/timebase.ts","../src/time/timeduration.ts","../src/utils/promises.ts","../src/utils/random.ts","../src/utils/records/entries.ts","../src/utils/records.ts","../src/utils/strings/stringparts.ts","../src/utils/strings.ts","../src/utils/index.ts","../src/utils/functions/iff.ts","../src/utils/functions.ts","../src/async/deferred.ts","../src/time/types.ts","../src/time/timeinstantbuilder.ts","../src/time/timeinstant.ts","../src/logger.ts","../src/optional.ts","../src/async/cancelabledeferred.ts","../src/time/timefrequency.ts","../src/async/ratethrottler.ts","../src/async/semaphore.ts","../src/async/index.ts","../src/lazy/lazy.ts","../src/lazy/lazyasync.ts","../src/lazy/index.ts","../src/time/randomtimeduration.ts","../src/time/timerange.ts","../src/time/index.ts","../src/upgrade/errors.ts","../src/upgrade/types.ts","../src/upgrade/gettransitionspath.ts","../src/upgrade/dataupgrader.ts","../src/upgrade/index.ts","../src/index.ts"],"fileIdsList":[[92],[91],[92,98,100,101],[92,99,114],[92,114],[65,89,96,97,102,105,108,113],[103,104],[89],[66],[89,95],[66,91],[61,62,89],[62,63,64],[80,82,93,95,99,106,107],[80,82,84],[80],[65,80,81,89,92,95],[82,89],[59,65,80,81,82,92,93,94],[66,91,93,95],[95,108],[89,109,110,111],[89,110],[110,112],[65,66,67,68,69,70,91],[71],[74],[75,91],[60,61,90],[66,71,72,73,75,76,78,79,83,84,86,88,91],[75],[77,91],[82,91],[85],[66,71,87],[66,71,88]],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","impliedFormat":1},{"version":"9e8ca8ed051c2697578c023d9c29d6df689a083561feba5c14aedee895853999","affectsGlobalScope":true,"impliedFormat":1},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"45d8ccb3dfd57355eb29749919142d4321a0aa4df6acdfc54e30433d7176600a","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1a94697425a99354df73d9c8291e2ecd4dddd370aed4023c2d6dee6cccb32666","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3f9fc0ec0b96a9e642f11eda09c0be83a61c7b336977f8b9fdb1e9788e925fe","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true,"impliedFormat":1},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true,"impliedFormat":1},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true,"impliedFormat":1},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true,"impliedFormat":1},{"version":"15c1c3d7b2e46e0025417ed6d5f03f419e57e6751f87925ca19dc88297053fe6","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"c77f0c58173b1b3364632db5ee4455bac69cbf0c494b5a777bf80ca4aa8c9560","impliedFormat":1},{"version":"7535665af7687e67bea49e457c44179c2d54b2990d89e9ab9e1b17eadaec1bfb","signature":"29e9ef45578a333ad8df54749d9b84c351f621f96e9223b6eb29748a0142a020"},{"version":"41a70337edbaebfb0fdd366ddf0816fefea5989c75bdffdbb9ff698256951c74","signature":"14ec40ede4588be7502237d1e7e701f90a6507417b6b98401f550bb12e2fbf55"},{"version":"d3781289f931d1fd6da732725be3a924271f3126a60a11f738dab07a9de2f7d8","signature":"4d79eeb5415637be3229c2667895b56383253c77b8b33e61549b5128daf9e37a"},{"version":"9dd6c91ad0cc61ccf6cb430400942911c9898cc5cb568f71741821e7e3b26ec6","signature":"318fa1a3aea63a60b7b66160ac98a8b207968e4969cf41bac4453d4f062fc2dc"},{"version":"f81e13545a32f0e905158afc87f5fe966a0a74efbc167ec094b07aea3d12a6ca","signature":"8acbccc69dd0aeca47b8884ba49bf54b2523749862bfe29f0b4f7f402c6f5d3c"},{"version":"1ab20f387ef7fa5cf94272900952596792f583f45bbd58d9adf2d623349d060e","signature":"ec49ec1ca3ddc1fbcdb45f1740ccd72d20fbf450036286c4373d9d13ddf2c4a2"},{"version":"0d578fa07b7e41030f7ad5176898a0a70a092fc45a264ce67498f63e544344e1","signature":"eb96292ecf52597cf826715047ec8411375f0ac8a43d0bd12f87dd3190838a04"},{"version":"de9544e159891685d316ac4161b4f01b58dda06c70c5bed9ec04c094b4ba5015","signature":"ed74ba876a20726b0452cc66a7dd09544a1cc8a72a092d2ca8b19bc269c27da3"},{"version":"e31542b0347f4025457278d7bc3ddc84529991059c1ab2b0b5bcb9b37cc33836","signature":"2f906b8d1966c352311c18c50f04d1fdf57ac78b8e7f4e0ba837253c6a02bf51"},{"version":"065815c5d2b778f409ae78a366079628d6b28c689647b358ee4cb854e92eead2","signature":"8da47ddef220dd11a8a0f431127f8d083ba95b7e2b45b266233812bcf1f13888"},{"version":"2fdcc3f88b19bda7bc74c8c6430b9e2f6eb6d252d812c508f48669a27b680d5f","signature":"e2ab4c29fa06a89dc35759aaf3354bb06cad41d3d6f1bf9e1ce482187cd1fb91"},{"version":"e21e6d1ce5fbb5508d464a644afa4380845f038b1a0bcd3d188b0e7835215972","signature":"1266933c9feef76278d72770b57be8ed374813e90981d317d21faa6f9de3f7b0"},{"version":"56571c3f44c6312462e8395ed75d05887dcbcb1581a0ad47dd72bcdbb898ea84","signature":"853de26cb0c4a51d7b511bf303ff4d6680bc18d36b3f2f6d7b8008c8927b58a1"},{"version":"80cfb7f027e1ed06149023ea32ba3d176db0325b675ade827d4cdf2b8cd715fc","signature":"9fc3664a9a2be65e8bf0ca4475f184a16c7a0b03e78c77cabe45e47d78bcd3db"},{"version":"051fd85ab3f9cdcc0093554c53224cc3f0a9344a8cf216e629b6682a015b5924","signature":"372e2fee214dd7cef1715d97a7c7926008b29ed71a68d02377cbbbbad4a81328"},{"version":"2009cccc1fb281cb9233e13b14adb47b87ae0c72f7c73355d4ff0a536ad012b4","signature":"e537516e7b69cd96068554445428fd261d806d54ba92343fb91cac4120ae6017"},{"version":"c8493627adf08b4e0d48ebfb2724b2d1d227d26a71625f09b9f7601f5e847459","signature":"5db98cd7b060f49da05790a11db4314bbf4e7df3459462f37257991217d300b9"},{"version":"d0f71922ce0d6ce8aecef7b85158c6726e0db4d0ef23d71f2b14b9a2e5bef9fb","signature":"a29a11ea1f06a29ebc9d88a8439d78598d2d4977115a70705902c117d2a19e76"},{"version":"9625f04479a8d4e2e4f67bcb9f1312480ddc140596661dd95a59dbbe06eee8d8","signature":"788b0fcaf94c8fc0ba34432146cb09bc50470b5f50c5f16b84faa83a3fba4502"},{"version":"70a58316dfec322f94bb980c05315faafd93f6fe6c56015efc7f0a4fb87636e2","signature":"d98d28f45f2fd50c72d82ea27d9fb213df06bc2456eb0748c657c6da8e77a1d4"},{"version":"cb6e4d47248ad5cbeed78f4164cf996fb276d54a580ac52e3a7feb92c4336d77","signature":"86463269677354ddc223e39011b4b5f231cdc5d072d08fb0e4b431a915e1f6eb"},{"version":"fe78af98b38dddb04bbf42a17e0ff5d3509ad062a97cd04d08cadbea7425627c","signature":"58686fcfd1c2f6e21d3dd7f52d347e73a9879aa634acd1baafe5f2c2e4c09e9a"},{"version":"607ee1c34e1b33bf42adba23592a8fc9a8a70cf986619222584c3da9a7685543","signature":"7fb8f6ffdd1cd861e0dd217886ef074bef1d4c88356030506615dc48a8121978"},{"version":"d3816328a097970f46726b8e2f34f1e66fab2d95a2463fe0a3a3460308fc06aa","signature":"0cce1783c4c412541b1118f66a401ee1076d2b45f6de005ffa10d7a3138bdbc3"},{"version":"d605a6d77f9547cc60d5563f8e4b43826ecfe67145715e7701443e6c7000f7d8","signature":"59fd76d117c77ac4f8aa2735ac59e07dac3e7f8abf4e8b5b79d7dcb4448215c4"},{"version":"f9b7540997405acdde3ddd1bc98c2a8ff0039f7dfde4dc699445a017c2311ec3","signature":"5d629ce88038b243d9c777e9c53696b49ed3391e2175a9b88dabb31a76079a06"},{"version":"92c49c13b67f8d21faaa1070dd6c5bb51e83098a434c5ea9d732583581385e38","signature":"da2bf0861b5119eeac5446fc8ab6beddfde0618a9c511d5b82147fb373deac15"},{"version":"a12f80b0021d23f5d69f36f2d6aca668500011c39a1700fae1181998fc85b601","signature":"d0858da5bf20118f452fc36ac2e03115b274084215f8246ffb82ad278da00a7d"},{"version":"63503ae1454fa3f0ff0599f7dcf96e8b2298dca467b1e58d337c8e6494b13227","signature":"0dcb1ef04257f5f5ea519209512f35595f95cfae096947229c1b251a5fa67a14"},{"version":"33d19b3cb7117da8dc04e821cd39a8c3e796376139e6aa05bfd822dfa554bfae","signature":"d395782613b270de87b13d6331a397013e9753fc4428b00f2e294cc29e3e8d76"},{"version":"409daaf670e0781555140c48d214d855775841d1a74d74057a2f9c9b23a8ea93","signature":"cd6b7bbe6bdee5e60c4fbee6907d334808ea07a247374df93136231d359b4795"},{"version":"1cf35944bd6d6683b15c7cddc12a85a3a97c358f3d1b884b52a89d87bb9be6be","signature":"d6ec175376a7c8247cd45ca50a2b4f7bf2f0893a37e3f99c95f859287245e863"},{"version":"d6859319cfab28518e99dba48a2dbb9392e2e112f2dac7911b055a003189b920","signature":"1f0e09320cb86d4f4f26386d828d9b66da11620d331f79073615026f5dbf6978"},{"version":"c3595b97fd7a5a98a6af20b81f87bdea93d963f1c39337739e605281aa964c4a","signature":"d3b1a67f87d6e77f7772bfc777e04387a6bf3d84eb2f18b454f9bd9cefa86afb"},{"version":"3c2ca70abf1d8db31f40785c88b68b356b5fecc93edf626cc31e0c38225f8a4d","signature":"626afa709798521c427847bb617e1379d22b90d6098118ce08e137383dab2965"},{"version":"8a36f4d8f34cebcde784d513a5bc6b6a020cb5f5a78297b2ea92ff5f7f59b183","signature":"9ce8acadf39f2eff3011fb1241b111299e9a3ac144202b12fee6200e6d781027"},{"version":"9728f7b5298a36a858569bfba08c2a2106945f0c7a45610351b73072c85aea1b","signature":"d79d663e6b621d15b39aca1d448793fc2acee759e6e7c10f3432023972ddf007"},{"version":"f46c11b34a70c1196da95cf77b957469dbd6ec94e00e5074041392626c35fa76","signature":"15884642f06d3093d656d698d814e95599a96ee629468206791b359b5e4d137d"},{"version":"963e90bd6a94bd500329447e92ecb2be1efaab48d53d81e6f143dc63cb2aa76f","signature":"c6eff6bde8066f2980b221de77dc801f3a2a27525a9c3879d37426941b7a413c"},{"version":"1746aab5d9264c85832305e5ac252401199168629595ec2d65daccbb4e1778bd","signature":"655ff771dbe8906922d5081fd4ecffc1b2fe97521c9c400cc4f506b81f048645"},{"version":"141dac9588bca23bfc8a13b99560bae0cf818733218861bba342a5418e55d86f","signature":"3d58a3363bb571062abeb1fdc96e174e8a6a61bcdd3e7491c2bf65dbb5a17750"},{"version":"462708b3fc0067a69af6f9df70229485d8ebccbac2a472314a8306a4ef56779f","signature":"3f2b9bd0340a9cbcdbbfdbd7bf828a49c477dddd3473ed7816310700becf5961"},{"version":"0c244f63637cdd383fd0ba6912244f8146a9169eeaf885b2ef136e4d1baedd01","signature":"86122f878833e22a38a54656b9fe61736ba6c103b6a2fa01dae70458aec4353d"},{"version":"eaba057974b09c591a96793d4dbb1de1a59b51ebd0cd056671ee8bb656c7cb66","signature":"c5c9b67f95b65ea2c92336169a4f48b1033a9c4ac73c3acbc5d691a73dc688e8"},{"version":"95ecb59d9c7bf61ced4d45c183d1a43bf03d129ed27239e839599879b92512c6","signature":"d08bdc2df3b64a80c3870fcc3f1a802c1bbd88d9efaefe46bf5a7aeeb749b5ad"},{"version":"776155d42bfa1737a147a7f9ab63f0068b0f12279f86757347d605d8550eae16","signature":"0428da86bb5e41a6da4aedec6af5fb004a74731c9d56bcbe2b6348f1bf44744a"},{"version":"c3d59784aa9468ae61f7f99359eea4b3a9ccc6aec1bb46869aea049c0a0b8812","signature":"975d013c31f48ecb26867d0f98f13d2eaebb4af2bfbe6b5fd9a4d38fdccd5656"},{"version":"f5cb5ee6dfc305bbad84b2990954ce9557db25146764b81e91a22f22b4c650dd","signature":"5022494c36b44f458140adf6060c2f14e107b8984de8596eee5dbcb70cdb9f6b"},{"version":"6f4a74e34595aa6420c4a1df1ff788d1686f7bdfc7259de90d0102f4cf83555f","signature":"12cf7f6e0e2bf8d8e9b8a79d1adae5f8706736dee1e5d25279785ce45c7b0b27"},{"version":"5b2927131599d55e0ee730c7a2afc764ff39199a5d186b510fc3eca82f4ef1ff","signature":"d6fc507f1c2ecd14c0882a0e00a1ba2a580c6e45550a3a5e868d7bee4b1922b6"},{"version":"1beb76f20b97f76d5ac48caa921161255c72c59e93a8571871b069b8dff2bed2","signature":"340b2a38ab87e8aa617f4021a1e4c916453f80cc27d908ab084a1798be18b5c0"},{"version":"2ebd1a1e8ba106bea54bf6cf59f2909a27864c7b35ff1b828d8c7634a6a62179","signature":"f0561579997f9cfd97a6e991d806999dd3b48b6476b03e7d33ca6ea06297b21c"},{"version":"74dc5d77ab2d43e26ae180d7bef1780d7fa0209ef643827ac601c2fdda759321","signature":"c78dfc67b95896fccbc0e65345294a53877ed8e6424c5b8a763c709b68a1c645"},{"version":"22577c900676846354224462f8a6b3e0e5033cd14a501ea46107e67a4ab7863f","signature":"70fd81e903686acf6e994565edb1588cc619b816646ea1a89ac9a47b45d25737"},{"version":"11cea0b3765fa4b59db1607d6b57b775be2575694872762d6613a6ae65207b1f","signature":"58b4a69dbe41ae095711ee1e1abde892fc4b4fa251d73afe4533c28f778ec932"}],"root":[[60,114]],"options":{"allowImportingTsExtensions":true,"composite":true,"declaration":true,"emitDeclarationOnly":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":7,"noFallthroughCasesInSwitch":true,"noImplicitAny":false,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"target":9,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"referencedMap":[[98,1],[92,2],[102,3],[100,4],[101,5],[114,6],[105,7],[103,8],[104,9],[96,10],[97,11],[63,12],[65,13],[64,12],[62,2],[108,14],[106,15],[81,16],[82,17],[99,18],[95,19],[94,20],[107,21],[93,8],[112,22],[111,23],[113,24],[110,8],[71,25],[67,8],[68,8],[69,26],[70,2],[75,27],[74,28],[91,29],[90,8],[89,30],[76,31],[66,2],[78,32],[83,33],[86,34],[85,8],[88,35],[87,36]],"latestChangedDtsFile":"./utils/arrays.d.ts","version":"5.6.3"}
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/small-date@2.0.1/node_modules/small-date/index.d.ts","../src/utils/functions/constant.ts","../src/sorting/types.ts","../src/sorting/comparisonchain.ts","../src/sorting/sorter.ts","../src/sorting/index.ts","../src/utils/nulls.ts","../src/utils/arrays/groupby.ts","../src/utils/arrays/indexby.ts","../src/utils/arrays/statistics.ts","../src/utils/arrays/uniqby.ts","../src/utils/arrays.ts","../src/utils/booleans.ts","../src/utils/empties.ts","../src/utils/errors/withtrycatch.ts","../src/utils/errors.ts","../src/utils/json.ts","../src/utils/numbers/round.ts","../src/utils/numbers.ts","../src/utils/primitives.ts","../src/time/timeunit.ts","../src/time/timebase.ts","../src/time/timeduration.ts","../src/utils/promises.ts","../src/utils/random.ts","../src/utils/records/entries.ts","../src/utils/records.ts","../src/utils/strings/stringparts.ts","../src/utils/strings.ts","../src/utils/index.ts","../src/utils/functions/iff.ts","../src/utils/functions.ts","../src/async/deferred.ts","../src/time/types.ts","../src/time/timeinstantbuilder.ts","../src/time/timeinstant.ts","../src/logger.ts","../src/optional.ts","../src/async/cancelabledeferred.ts","../src/time/timefrequency.ts","../src/async/ratethrottler.ts","../src/async/semaphore.ts","../src/async/index.ts","../src/lazy/lazy.ts","../src/lazy/lazyasync.ts","../src/lazy/index.ts","../src/time/randomtimeduration.ts","../src/time/timerange.ts","../src/time/index.ts","../src/upgrade/errors.ts","../src/upgrade/types.ts","../src/upgrade/gettransitionspath.ts","../src/upgrade/dataupgrader.ts","../src/upgrade/index.ts","../src/index.ts"],"fileIdsList":[[91],[90],[91,97,99,100],[91,98,113],[91,113],[64,88,95,96,101,104,107,112],[102,103],[88],[65],[88,94],[65,90],[60,61,88],[61,62,63],[79,81,92,94,98,105,106],[79,81,83],[79],[64,79,80,88,91,94],[81,88],[59,64,79,80,81,91,92,93],[65,90,92,94],[94,107],[88,108,109,110],[88,109],[109,111],[64,65,66,67,68,69,90],[70],[73],[74,90],[60,89],[65,70,71,72,74,75,77,78,82,83,85,87,90],[74],[76,90],[81,90],[84],[65,70,86],[65,70,87]],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","impliedFormat":1},{"version":"9e8ca8ed051c2697578c023d9c29d6df689a083561feba5c14aedee895853999","affectsGlobalScope":true,"impliedFormat":1},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"45d8ccb3dfd57355eb29749919142d4321a0aa4df6acdfc54e30433d7176600a","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1a94697425a99354df73d9c8291e2ecd4dddd370aed4023c2d6dee6cccb32666","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3f9fc0ec0b96a9e642f11eda09c0be83a61c7b336977f8b9fdb1e9788e925fe","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true,"impliedFormat":1},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true,"impliedFormat":1},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true,"impliedFormat":1},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true,"impliedFormat":1},{"version":"15c1c3d7b2e46e0025417ed6d5f03f419e57e6751f87925ca19dc88297053fe6","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"c77f0c58173b1b3364632db5ee4455bac69cbf0c494b5a777bf80ca4aa8c9560","impliedFormat":1},{"version":"41a70337edbaebfb0fdd366ddf0816fefea5989c75bdffdbb9ff698256951c74","signature":"14ec40ede4588be7502237d1e7e701f90a6507417b6b98401f550bb12e2fbf55"},{"version":"d3781289f931d1fd6da732725be3a924271f3126a60a11f738dab07a9de2f7d8","signature":"4d79eeb5415637be3229c2667895b56383253c77b8b33e61549b5128daf9e37a"},{"version":"9dd6c91ad0cc61ccf6cb430400942911c9898cc5cb568f71741821e7e3b26ec6","signature":"318fa1a3aea63a60b7b66160ac98a8b207968e4969cf41bac4453d4f062fc2dc"},{"version":"f81e13545a32f0e905158afc87f5fe966a0a74efbc167ec094b07aea3d12a6ca","signature":"8acbccc69dd0aeca47b8884ba49bf54b2523749862bfe29f0b4f7f402c6f5d3c"},{"version":"1ab20f387ef7fa5cf94272900952596792f583f45bbd58d9adf2d623349d060e","signature":"ec49ec1ca3ddc1fbcdb45f1740ccd72d20fbf450036286c4373d9d13ddf2c4a2"},{"version":"0d578fa07b7e41030f7ad5176898a0a70a092fc45a264ce67498f63e544344e1","signature":"eb96292ecf52597cf826715047ec8411375f0ac8a43d0bd12f87dd3190838a04"},{"version":"de9544e159891685d316ac4161b4f01b58dda06c70c5bed9ec04c094b4ba5015","signature":"ed74ba876a20726b0452cc66a7dd09544a1cc8a72a092d2ca8b19bc269c27da3"},{"version":"e31542b0347f4025457278d7bc3ddc84529991059c1ab2b0b5bcb9b37cc33836","signature":"2f906b8d1966c352311c18c50f04d1fdf57ac78b8e7f4e0ba837253c6a02bf51"},{"version":"065815c5d2b778f409ae78a366079628d6b28c689647b358ee4cb854e92eead2","signature":"8da47ddef220dd11a8a0f431127f8d083ba95b7e2b45b266233812bcf1f13888"},{"version":"2fdcc3f88b19bda7bc74c8c6430b9e2f6eb6d252d812c508f48669a27b680d5f","signature":"e2ab4c29fa06a89dc35759aaf3354bb06cad41d3d6f1bf9e1ce482187cd1fb91"},{"version":"c16185c9de533d73616855336fff402bf5dd56f5ff88a2afe3df481b65980140","signature":"a5f22814b4eff85225146a76b994aaf8ffa95983469a2e9b3d2327af91bc9d18"},{"version":"56571c3f44c6312462e8395ed75d05887dcbcb1581a0ad47dd72bcdbb898ea84","signature":"853de26cb0c4a51d7b511bf303ff4d6680bc18d36b3f2f6d7b8008c8927b58a1"},{"version":"80cfb7f027e1ed06149023ea32ba3d176db0325b675ade827d4cdf2b8cd715fc","signature":"9fc3664a9a2be65e8bf0ca4475f184a16c7a0b03e78c77cabe45e47d78bcd3db"},{"version":"051fd85ab3f9cdcc0093554c53224cc3f0a9344a8cf216e629b6682a015b5924","signature":"372e2fee214dd7cef1715d97a7c7926008b29ed71a68d02377cbbbbad4a81328"},{"version":"2009cccc1fb281cb9233e13b14adb47b87ae0c72f7c73355d4ff0a536ad012b4","signature":"e537516e7b69cd96068554445428fd261d806d54ba92343fb91cac4120ae6017"},{"version":"c8493627adf08b4e0d48ebfb2724b2d1d227d26a71625f09b9f7601f5e847459","signature":"5db98cd7b060f49da05790a11db4314bbf4e7df3459462f37257991217d300b9"},{"version":"d0f71922ce0d6ce8aecef7b85158c6726e0db4d0ef23d71f2b14b9a2e5bef9fb","signature":"a29a11ea1f06a29ebc9d88a8439d78598d2d4977115a70705902c117d2a19e76"},{"version":"9625f04479a8d4e2e4f67bcb9f1312480ddc140596661dd95a59dbbe06eee8d8","signature":"788b0fcaf94c8fc0ba34432146cb09bc50470b5f50c5f16b84faa83a3fba4502"},{"version":"70a58316dfec322f94bb980c05315faafd93f6fe6c56015efc7f0a4fb87636e2","signature":"d98d28f45f2fd50c72d82ea27d9fb213df06bc2456eb0748c657c6da8e77a1d4"},{"version":"cb6e4d47248ad5cbeed78f4164cf996fb276d54a580ac52e3a7feb92c4336d77","signature":"86463269677354ddc223e39011b4b5f231cdc5d072d08fb0e4b431a915e1f6eb"},{"version":"fe78af98b38dddb04bbf42a17e0ff5d3509ad062a97cd04d08cadbea7425627c","signature":"58686fcfd1c2f6e21d3dd7f52d347e73a9879aa634acd1baafe5f2c2e4c09e9a"},{"version":"607ee1c34e1b33bf42adba23592a8fc9a8a70cf986619222584c3da9a7685543","signature":"7fb8f6ffdd1cd861e0dd217886ef074bef1d4c88356030506615dc48a8121978"},{"version":"d3816328a097970f46726b8e2f34f1e66fab2d95a2463fe0a3a3460308fc06aa","signature":"0cce1783c4c412541b1118f66a401ee1076d2b45f6de005ffa10d7a3138bdbc3"},{"version":"d605a6d77f9547cc60d5563f8e4b43826ecfe67145715e7701443e6c7000f7d8","signature":"59fd76d117c77ac4f8aa2735ac59e07dac3e7f8abf4e8b5b79d7dcb4448215c4"},{"version":"f9b7540997405acdde3ddd1bc98c2a8ff0039f7dfde4dc699445a017c2311ec3","signature":"5d629ce88038b243d9c777e9c53696b49ed3391e2175a9b88dabb31a76079a06"},{"version":"92c49c13b67f8d21faaa1070dd6c5bb51e83098a434c5ea9d732583581385e38","signature":"da2bf0861b5119eeac5446fc8ab6beddfde0618a9c511d5b82147fb373deac15"},{"version":"a12f80b0021d23f5d69f36f2d6aca668500011c39a1700fae1181998fc85b601","signature":"d0858da5bf20118f452fc36ac2e03115b274084215f8246ffb82ad278da00a7d"},{"version":"63503ae1454fa3f0ff0599f7dcf96e8b2298dca467b1e58d337c8e6494b13227","signature":"0dcb1ef04257f5f5ea519209512f35595f95cfae096947229c1b251a5fa67a14"},{"version":"33d19b3cb7117da8dc04e821cd39a8c3e796376139e6aa05bfd822dfa554bfae","signature":"d395782613b270de87b13d6331a397013e9753fc4428b00f2e294cc29e3e8d76"},{"version":"409daaf670e0781555140c48d214d855775841d1a74d74057a2f9c9b23a8ea93","signature":"cd6b7bbe6bdee5e60c4fbee6907d334808ea07a247374df93136231d359b4795"},{"version":"9c31a5ebfe9e723bbb7df1c8a0459464f21f87a09520852dc14cd4778dea5d7c","signature":"e5ae5532b494b21e447ea0a55622caa1f519012c02472145780b57356ed9c3d2"},{"version":"d6859319cfab28518e99dba48a2dbb9392e2e112f2dac7911b055a003189b920","signature":"1f0e09320cb86d4f4f26386d828d9b66da11620d331f79073615026f5dbf6978"},{"version":"c3595b97fd7a5a98a6af20b81f87bdea93d963f1c39337739e605281aa964c4a","signature":"d3b1a67f87d6e77f7772bfc777e04387a6bf3d84eb2f18b454f9bd9cefa86afb"},{"version":"3c2ca70abf1d8db31f40785c88b68b356b5fecc93edf626cc31e0c38225f8a4d","signature":"626afa709798521c427847bb617e1379d22b90d6098118ce08e137383dab2965"},{"version":"8a36f4d8f34cebcde784d513a5bc6b6a020cb5f5a78297b2ea92ff5f7f59b183","signature":"9ce8acadf39f2eff3011fb1241b111299e9a3ac144202b12fee6200e6d781027"},{"version":"c4f88d5f3c6e0d1b87efd8d336d6cd4ef457db83c952de20b90d4808187c8450","signature":"ff1690eb4407b18a88ddc918e4311923bc1f787a8a8f678d5b03fe8922048177"},{"version":"f46c11b34a70c1196da95cf77b957469dbd6ec94e00e5074041392626c35fa76","signature":"15884642f06d3093d656d698d814e95599a96ee629468206791b359b5e4d137d"},{"version":"963e90bd6a94bd500329447e92ecb2be1efaab48d53d81e6f143dc63cb2aa76f","signature":"c6eff6bde8066f2980b221de77dc801f3a2a27525a9c3879d37426941b7a413c"},{"version":"1746aab5d9264c85832305e5ac252401199168629595ec2d65daccbb4e1778bd","signature":"655ff771dbe8906922d5081fd4ecffc1b2fe97521c9c400cc4f506b81f048645"},{"version":"141dac9588bca23bfc8a13b99560bae0cf818733218861bba342a5418e55d86f","signature":"3d58a3363bb571062abeb1fdc96e174e8a6a61bcdd3e7491c2bf65dbb5a17750"},{"version":"462708b3fc0067a69af6f9df70229485d8ebccbac2a472314a8306a4ef56779f","signature":"3f2b9bd0340a9cbcdbbfdbd7bf828a49c477dddd3473ed7816310700becf5961"},{"version":"0c244f63637cdd383fd0ba6912244f8146a9169eeaf885b2ef136e4d1baedd01","signature":"86122f878833e22a38a54656b9fe61736ba6c103b6a2fa01dae70458aec4353d"},{"version":"ba7ad8169c4e0cfeab946431d3e9a2def0f86c928580fcd767d0afb09b5c03f5","signature":"1a3a6cd1cc20eddc55d13ce8a54fabc0bebe0069b2d75d2c738e7d8aa94741bc"},{"version":"5253453362b3bb0b2d215c3ae66b850edb6f65bce45daaf4f2530b5292ab905b","signature":"9e7fcd385ecfdfa65958f8c734a2a73bbfd1ffca8f5ab0240629464e94f332a0"},{"version":"776155d42bfa1737a147a7f9ab63f0068b0f12279f86757347d605d8550eae16","signature":"0428da86bb5e41a6da4aedec6af5fb004a74731c9d56bcbe2b6348f1bf44744a"},{"version":"c3d59784aa9468ae61f7f99359eea4b3a9ccc6aec1bb46869aea049c0a0b8812","signature":"975d013c31f48ecb26867d0f98f13d2eaebb4af2bfbe6b5fd9a4d38fdccd5656"},{"version":"f5cb5ee6dfc305bbad84b2990954ce9557db25146764b81e91a22f22b4c650dd","signature":"5022494c36b44f458140adf6060c2f14e107b8984de8596eee5dbcb70cdb9f6b"},{"version":"6f4a74e34595aa6420c4a1df1ff788d1686f7bdfc7259de90d0102f4cf83555f","signature":"12cf7f6e0e2bf8d8e9b8a79d1adae5f8706736dee1e5d25279785ce45c7b0b27"},{"version":"5b2927131599d55e0ee730c7a2afc764ff39199a5d186b510fc3eca82f4ef1ff","signature":"d6fc507f1c2ecd14c0882a0e00a1ba2a580c6e45550a3a5e868d7bee4b1922b6"},{"version":"1beb76f20b97f76d5ac48caa921161255c72c59e93a8571871b069b8dff2bed2","signature":"340b2a38ab87e8aa617f4021a1e4c916453f80cc27d908ab084a1798be18b5c0"},{"version":"2ebd1a1e8ba106bea54bf6cf59f2909a27864c7b35ff1b828d8c7634a6a62179","signature":"f0561579997f9cfd97a6e991d806999dd3b48b6476b03e7d33ca6ea06297b21c"},{"version":"74dc5d77ab2d43e26ae180d7bef1780d7fa0209ef643827ac601c2fdda759321","signature":"c78dfc67b95896fccbc0e65345294a53877ed8e6424c5b8a763c709b68a1c645"},{"version":"22577c900676846354224462f8a6b3e0e5033cd14a501ea46107e67a4ab7863f","signature":"70fd81e903686acf6e994565edb1588cc619b816646ea1a89ac9a47b45d25737"},{"version":"569c58f09117e840594ae628aec2ca65eaa02f3322e8c70cbf5ba8f1115a04b2","signature":"a4321a18e9f87f996672902385e77ad1fd93f251f4e665f849fbdc32bbfb1cdc"}],"root":[[60,113]],"options":{"allowImportingTsExtensions":true,"composite":true,"declaration":true,"emitDeclarationOnly":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":7,"noFallthroughCasesInSwitch":true,"noImplicitAny":false,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"target":9,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"referencedMap":[[97,1],[91,2],[101,3],[99,4],[100,5],[113,6],[104,7],[102,8],[103,9],[95,10],[96,11],[62,12],[64,13],[63,12],[61,2],[107,14],[105,15],[80,16],[81,17],[98,18],[94,19],[93,20],[106,21],[92,8],[111,22],[110,23],[112,24],[109,8],[70,25],[66,8],[67,8],[68,26],[69,2],[74,27],[73,28],[90,29],[89,8],[88,30],[75,31],[65,2],[77,32],[82,33],[85,34],[84,8],[87,35],[86,36]],"latestChangedDtsFile":"./index.d.ts","version":"5.6.3"}
|
package/dist/utils/arrays.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TComparisonFunction } from "../sorting/index.js";
|
|
2
|
-
import type { TBiPredicate } from "./functions.js";
|
|
2
|
+
import type { TAccumulator, TBiPredicate, TPredicate, TTransformer } from "./functions.js";
|
|
3
3
|
import type { TMaybe } from "./nulls.js";
|
|
4
4
|
export * from './arrays/groupBy.js';
|
|
5
5
|
export * from './arrays/indexBy.js';
|
|
@@ -38,3 +38,12 @@ export declare function sortedArray<T>(arr: ReadonlyArray<T>, sortFn?: TComparis
|
|
|
38
38
|
export declare function includes<T>(arr: TReadableArray<T>, item: unknown, fromIndex?: number): boolean;
|
|
39
39
|
export declare function mapTruthys<T, R>(arr: Array<T>, mapper: (value: T, index: number, array: T[]) => R | undefined): Array<R>;
|
|
40
40
|
export declare function flatMapTruthys<T, R>(arr: Array<T>, mapper: (value: T, index: number, array: T[]) => R | undefined): Array<R>;
|
|
41
|
+
export declare function filterMap<T, R>(array: T[], filterFn: TPredicate<T>, mapFn: TTransformer<T, R>): R[];
|
|
42
|
+
export declare function filterMapReduce<T, U, R>(array: T[], filterFn: TPredicate<T>, mapFn: TTransformer<T, U>, reduceFn: TAccumulator<R, U>, initialValue: R): R;
|
|
43
|
+
/**
|
|
44
|
+
* Partitions the given array in two groups, in the first one there will be any and only values of the array that match the given predicate, in the second one there will be any and only values that don't.
|
|
45
|
+
* @param arr the array of items
|
|
46
|
+
* @param predicate the predicate to use to partition the array
|
|
47
|
+
* @returns a tuple, where the first array contains items matching the predicate, and the second array contains items not matching the predicate.
|
|
48
|
+
*/
|
|
49
|
+
export declare function partition<V>(arr: V[], predicate: TPredicate<V>): [V[], V[]];
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
export * from './functions/bindThis.js';
|
|
2
1
|
export * from './functions/constant.js';
|
|
3
2
|
export * from './functions/iff.js';
|
|
4
3
|
export type TFunction<A, R> = (a: A) => R;
|
|
4
|
+
export type TTransformer<A, R> = TFunction<A, R>;
|
|
5
5
|
export type TVoidFunction = TFunction<void, void>;
|
|
6
6
|
export type TProducer<R> = TFunction<void, R>;
|
|
7
7
|
export type TConsumer<T> = TFunction<T, void>;
|
|
8
8
|
export type TPredicate<T> = TFunction<T, boolean>;
|
|
9
|
+
export type TTypePredicate<T, R extends T> = (t: T) => t is R;
|
|
9
10
|
export type TIdentityFunction<T> = TFunction<T, T>;
|
|
10
11
|
export type TBiFunction<A, B, R> = (a: A, b: B) => R;
|
|
11
12
|
export type TBiConsumer<A, B> = TBiFunction<A, B, void>;
|
|
12
13
|
export type TBiPredicate<T> = TBiFunction<T, T, boolean>;
|
|
14
|
+
export type TAccumulator<A, B> = TBiFunction<A, B, A>;
|
|
13
15
|
export type TAsyncFunction<A, R> = TFunction<A, Promise<R>>;
|
|
14
16
|
export type TAsyncVoidFunction = TAsyncFunction<void, void>;
|
|
15
17
|
export type TAsyncProducer<R> = TAsyncFunction<void, R>;
|
|
@@ -22,3 +24,4 @@ export type TAnyFunction<R> = (...args: unknown[]) => R;
|
|
|
22
24
|
export type TAsyncAnyFunction<R> = (...args: unknown[]) => Promise<R>;
|
|
23
25
|
export declare function isFunction(t: unknown): t is Function;
|
|
24
26
|
export declare function noop(): void;
|
|
27
|
+
export declare function filterWithTypePredicate<T, R extends T>(filter: TPredicate<T>): TTypePredicate<T, R>;
|
package/esbuild/index.cjs
CHANGED
|
@@ -178,6 +178,8 @@ __export(src_exports, {
|
|
|
178
178
|
ErrorCannotInstantiatePresentOptionalWithEmptyValue: () => ErrorCannotInstantiatePresentOptionalWithEmptyValue,
|
|
179
179
|
ErrorGetEmptyOptional: () => ErrorGetEmptyOptional,
|
|
180
180
|
ErrorSetEmptyOptional: () => ErrorSetEmptyOptional,
|
|
181
|
+
Lazy: () => Lazy,
|
|
182
|
+
LazyAsync: () => LazyAsync,
|
|
181
183
|
Logger: () => Logger,
|
|
182
184
|
Optional: () => Optional,
|
|
183
185
|
RandomTimeDuration: () => RandomTimeDuration,
|
|
@@ -194,7 +196,6 @@ __export(src_exports, {
|
|
|
194
196
|
asError: () => asError,
|
|
195
197
|
asPromise: () => asPromise,
|
|
196
198
|
average: () => average,
|
|
197
|
-
bindThis: () => bindThis,
|
|
198
199
|
capitalizeWord: () => capitalizeWord,
|
|
199
200
|
clamp: () => clamp,
|
|
200
201
|
constant: () => constant,
|
|
@@ -222,6 +223,9 @@ __export(src_exports, {
|
|
|
222
223
|
extendArray: () => extendArray,
|
|
223
224
|
extendArrayWith: () => extendArrayWith,
|
|
224
225
|
fill: () => fill,
|
|
226
|
+
filterMap: () => filterMap,
|
|
227
|
+
filterMapReduce: () => filterMapReduce,
|
|
228
|
+
filterWithTypePredicate: () => filterWithTypePredicate,
|
|
225
229
|
first: () => first,
|
|
226
230
|
flatMapTruthys: () => flatMapTruthys,
|
|
227
231
|
groupByBoolean: () => groupByBoolean,
|
|
@@ -277,6 +281,7 @@ __export(src_exports, {
|
|
|
277
281
|
pad: () => pad,
|
|
278
282
|
padLeft: () => padLeft,
|
|
279
283
|
padRight: () => padRight,
|
|
284
|
+
partition: () => partition,
|
|
280
285
|
pick: () => pick,
|
|
281
286
|
pluralize: () => pluralize,
|
|
282
287
|
promiseSequence: () => promiseSequence,
|
|
@@ -569,11 +574,6 @@ function maxBy(arr, getter) {
|
|
|
569
574
|
return max(arr.map(getter));
|
|
570
575
|
}
|
|
571
576
|
|
|
572
|
-
// src/utils/functions/bindThis.ts
|
|
573
|
-
function bindThis(fn, _this) {
|
|
574
|
-
return fn.bind(_this);
|
|
575
|
-
}
|
|
576
|
-
|
|
577
577
|
// src/utils/functions/constant.ts
|
|
578
578
|
function constant(v) {
|
|
579
579
|
return () => v;
|
|
@@ -610,6 +610,9 @@ function isFunction(t) {
|
|
|
610
610
|
}
|
|
611
611
|
function noop() {
|
|
612
612
|
}
|
|
613
|
+
function filterWithTypePredicate(filter) {
|
|
614
|
+
return (t) => filter(t);
|
|
615
|
+
}
|
|
613
616
|
|
|
614
617
|
// src/utils/arrays/uniqBy.ts
|
|
615
618
|
function uniq(arr) {
|
|
@@ -699,6 +702,18 @@ function mapTruthys(arr, mapper) {
|
|
|
699
702
|
function flatMapTruthys(arr, mapper) {
|
|
700
703
|
return arr.flatMap(mapper).filter((value) => value !== void 0);
|
|
701
704
|
}
|
|
705
|
+
function filterMap(array, filterFn, mapFn) {
|
|
706
|
+
return array.filter(filterFn).map(mapFn);
|
|
707
|
+
}
|
|
708
|
+
function filterMapReduce(array, filterFn, mapFn, reduceFn, initialValue) {
|
|
709
|
+
return array.filter(filterFn).map(mapFn).reduce(reduceFn, initialValue);
|
|
710
|
+
}
|
|
711
|
+
function partition(arr, predicate) {
|
|
712
|
+
return arr.reduce((partition2, item) => {
|
|
713
|
+
partition2[predicate(item) ? 0 : 1].push(item);
|
|
714
|
+
return partition2;
|
|
715
|
+
}, [[], []]);
|
|
716
|
+
}
|
|
702
717
|
|
|
703
718
|
// src/utils/booleans.ts
|
|
704
719
|
function isTrue(x) {
|
|
@@ -1066,6 +1081,146 @@ function wrapWithString(str, delimiter) {
|
|
|
1066
1081
|
}
|
|
1067
1082
|
var wrap = wrapWithString;
|
|
1068
1083
|
|
|
1084
|
+
// src/lazy/Lazy.ts
|
|
1085
|
+
var Lazy = class _Lazy {
|
|
1086
|
+
_value = void 0;
|
|
1087
|
+
_initialized = false;
|
|
1088
|
+
_generator;
|
|
1089
|
+
constructor(generator) {
|
|
1090
|
+
this._generator = ensureDefined(generator);
|
|
1091
|
+
}
|
|
1092
|
+
get value() {
|
|
1093
|
+
return this._value;
|
|
1094
|
+
}
|
|
1095
|
+
getOrCreate() {
|
|
1096
|
+
if (!this._initialized) {
|
|
1097
|
+
this._value = this._generator();
|
|
1098
|
+
this._initialized = true;
|
|
1099
|
+
}
|
|
1100
|
+
return this._value;
|
|
1101
|
+
}
|
|
1102
|
+
getOrThrow(errorMessage) {
|
|
1103
|
+
if (!this._initialized)
|
|
1104
|
+
throw new Error(errorMessage);
|
|
1105
|
+
return this._value;
|
|
1106
|
+
}
|
|
1107
|
+
or(t) {
|
|
1108
|
+
if (!this._initialized) {
|
|
1109
|
+
return t;
|
|
1110
|
+
} else {
|
|
1111
|
+
return this._value;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
isPresent() {
|
|
1115
|
+
return this._initialized;
|
|
1116
|
+
}
|
|
1117
|
+
isEmpty() {
|
|
1118
|
+
return !this._initialized;
|
|
1119
|
+
}
|
|
1120
|
+
ifPresent(fn) {
|
|
1121
|
+
if (this.isPresent()) {
|
|
1122
|
+
fn(this._value);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
ifEmpty(fn) {
|
|
1126
|
+
if (this.isEmpty()) {
|
|
1127
|
+
fn();
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
apply(fnPresent, fnEmpty) {
|
|
1131
|
+
if (this.isPresent()) {
|
|
1132
|
+
fnPresent(this._value);
|
|
1133
|
+
} else {
|
|
1134
|
+
fnEmpty();
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
static of(generator) {
|
|
1138
|
+
return new _Lazy(generator);
|
|
1139
|
+
}
|
|
1140
|
+
};
|
|
1141
|
+
|
|
1142
|
+
// src/lazy/LazyAsync.ts
|
|
1143
|
+
var LazyAsync = class _LazyAsync {
|
|
1144
|
+
_promise = void 0;
|
|
1145
|
+
_pending = false;
|
|
1146
|
+
_resolvedValue = void 0;
|
|
1147
|
+
_error = void 0;
|
|
1148
|
+
_generator;
|
|
1149
|
+
constructor(generator) {
|
|
1150
|
+
this._generator = ensureDefined(generator);
|
|
1151
|
+
}
|
|
1152
|
+
getOrCreate() {
|
|
1153
|
+
if (this.isEmpty()) {
|
|
1154
|
+
this._pending = true;
|
|
1155
|
+
this._promise = this._generator();
|
|
1156
|
+
this._promise.then((value) => {
|
|
1157
|
+
this._pending = false;
|
|
1158
|
+
this._resolvedValue = value;
|
|
1159
|
+
}, (err) => {
|
|
1160
|
+
this._pending = false;
|
|
1161
|
+
this._error = err;
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
return this._promise;
|
|
1165
|
+
}
|
|
1166
|
+
isPresent() {
|
|
1167
|
+
return this._promise !== void 0;
|
|
1168
|
+
}
|
|
1169
|
+
isEmpty() {
|
|
1170
|
+
return this._promise === void 0;
|
|
1171
|
+
}
|
|
1172
|
+
isPending() {
|
|
1173
|
+
return this.isPresent() && this._pending === true;
|
|
1174
|
+
}
|
|
1175
|
+
isReady() {
|
|
1176
|
+
return this.isPresent() && this._pending === false;
|
|
1177
|
+
}
|
|
1178
|
+
isResolved() {
|
|
1179
|
+
return this.isReady() && this._error === void 0;
|
|
1180
|
+
}
|
|
1181
|
+
isError() {
|
|
1182
|
+
return this.isReady() && this._error !== void 0;
|
|
1183
|
+
}
|
|
1184
|
+
ifPresent(fn) {
|
|
1185
|
+
if (this.isPresent()) {
|
|
1186
|
+
fn(this._promise);
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
ifEmpty(fn) {
|
|
1190
|
+
if (this.isEmpty()) {
|
|
1191
|
+
fn();
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
ifPending(fn) {
|
|
1195
|
+
if (this.isPending()) {
|
|
1196
|
+
fn(this._promise);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
ifReady(fn) {
|
|
1200
|
+
if (this.isReady()) {
|
|
1201
|
+
fn(this._promise);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
ifResolved(fn) {
|
|
1205
|
+
if (this.isResolved()) {
|
|
1206
|
+
fn(this._resolvedValue);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
ifError(fn) {
|
|
1210
|
+
if (this.isError()) {
|
|
1211
|
+
fn(this._error);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
getOrThrow(errorMessage) {
|
|
1215
|
+
if (!this._promise)
|
|
1216
|
+
throw new Error(errorMessage);
|
|
1217
|
+
return this._promise;
|
|
1218
|
+
}
|
|
1219
|
+
static of(generator) {
|
|
1220
|
+
return new _LazyAsync(generator);
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
|
|
1069
1224
|
// src/time/TimeInstant.ts
|
|
1070
1225
|
var import_small_date = __toESM(require_lib());
|
|
1071
1226
|
|
|
@@ -2586,6 +2741,8 @@ function isUpgradable(obj) {
|
|
|
2586
2741
|
ErrorCannotInstantiatePresentOptionalWithEmptyValue,
|
|
2587
2742
|
ErrorGetEmptyOptional,
|
|
2588
2743
|
ErrorSetEmptyOptional,
|
|
2744
|
+
Lazy,
|
|
2745
|
+
LazyAsync,
|
|
2589
2746
|
Logger,
|
|
2590
2747
|
Optional,
|
|
2591
2748
|
RandomTimeDuration,
|
|
@@ -2602,7 +2759,6 @@ function isUpgradable(obj) {
|
|
|
2602
2759
|
asError,
|
|
2603
2760
|
asPromise,
|
|
2604
2761
|
average,
|
|
2605
|
-
bindThis,
|
|
2606
2762
|
capitalizeWord,
|
|
2607
2763
|
clamp,
|
|
2608
2764
|
constant,
|
|
@@ -2630,6 +2786,9 @@ function isUpgradable(obj) {
|
|
|
2630
2786
|
extendArray,
|
|
2631
2787
|
extendArrayWith,
|
|
2632
2788
|
fill,
|
|
2789
|
+
filterMap,
|
|
2790
|
+
filterMapReduce,
|
|
2791
|
+
filterWithTypePredicate,
|
|
2633
2792
|
first,
|
|
2634
2793
|
flatMapTruthys,
|
|
2635
2794
|
groupByBoolean,
|
|
@@ -2685,6 +2844,7 @@ function isUpgradable(obj) {
|
|
|
2685
2844
|
pad,
|
|
2686
2845
|
padLeft,
|
|
2687
2846
|
padRight,
|
|
2847
|
+
partition,
|
|
2688
2848
|
pick,
|
|
2689
2849
|
pluralize,
|
|
2690
2850
|
promiseSequence,
|
package/esbuild/index.mjs
CHANGED
|
@@ -421,11 +421,6 @@ function maxBy(arr, getter) {
|
|
|
421
421
|
return max(arr.map(getter));
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
-
// src/utils/functions/bindThis.ts
|
|
425
|
-
function bindThis(fn, _this) {
|
|
426
|
-
return fn.bind(_this);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
424
|
// src/utils/functions/constant.ts
|
|
430
425
|
function constant(v) {
|
|
431
426
|
return () => v;
|
|
@@ -462,6 +457,9 @@ function isFunction(t) {
|
|
|
462
457
|
}
|
|
463
458
|
function noop() {
|
|
464
459
|
}
|
|
460
|
+
function filterWithTypePredicate(filter) {
|
|
461
|
+
return (t) => filter(t);
|
|
462
|
+
}
|
|
465
463
|
|
|
466
464
|
// src/utils/arrays/uniqBy.ts
|
|
467
465
|
function uniq(arr) {
|
|
@@ -551,6 +549,18 @@ function mapTruthys(arr, mapper) {
|
|
|
551
549
|
function flatMapTruthys(arr, mapper) {
|
|
552
550
|
return arr.flatMap(mapper).filter((value) => value !== void 0);
|
|
553
551
|
}
|
|
552
|
+
function filterMap(array, filterFn, mapFn) {
|
|
553
|
+
return array.filter(filterFn).map(mapFn);
|
|
554
|
+
}
|
|
555
|
+
function filterMapReduce(array, filterFn, mapFn, reduceFn, initialValue) {
|
|
556
|
+
return array.filter(filterFn).map(mapFn).reduce(reduceFn, initialValue);
|
|
557
|
+
}
|
|
558
|
+
function partition(arr, predicate) {
|
|
559
|
+
return arr.reduce((partition2, item) => {
|
|
560
|
+
partition2[predicate(item) ? 0 : 1].push(item);
|
|
561
|
+
return partition2;
|
|
562
|
+
}, [[], []]);
|
|
563
|
+
}
|
|
554
564
|
|
|
555
565
|
// src/utils/booleans.ts
|
|
556
566
|
function isTrue(x) {
|
|
@@ -918,6 +928,146 @@ function wrapWithString(str, delimiter) {
|
|
|
918
928
|
}
|
|
919
929
|
var wrap = wrapWithString;
|
|
920
930
|
|
|
931
|
+
// src/lazy/Lazy.ts
|
|
932
|
+
var Lazy = class _Lazy {
|
|
933
|
+
_value = void 0;
|
|
934
|
+
_initialized = false;
|
|
935
|
+
_generator;
|
|
936
|
+
constructor(generator) {
|
|
937
|
+
this._generator = ensureDefined(generator);
|
|
938
|
+
}
|
|
939
|
+
get value() {
|
|
940
|
+
return this._value;
|
|
941
|
+
}
|
|
942
|
+
getOrCreate() {
|
|
943
|
+
if (!this._initialized) {
|
|
944
|
+
this._value = this._generator();
|
|
945
|
+
this._initialized = true;
|
|
946
|
+
}
|
|
947
|
+
return this._value;
|
|
948
|
+
}
|
|
949
|
+
getOrThrow(errorMessage) {
|
|
950
|
+
if (!this._initialized)
|
|
951
|
+
throw new Error(errorMessage);
|
|
952
|
+
return this._value;
|
|
953
|
+
}
|
|
954
|
+
or(t) {
|
|
955
|
+
if (!this._initialized) {
|
|
956
|
+
return t;
|
|
957
|
+
} else {
|
|
958
|
+
return this._value;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
isPresent() {
|
|
962
|
+
return this._initialized;
|
|
963
|
+
}
|
|
964
|
+
isEmpty() {
|
|
965
|
+
return !this._initialized;
|
|
966
|
+
}
|
|
967
|
+
ifPresent(fn) {
|
|
968
|
+
if (this.isPresent()) {
|
|
969
|
+
fn(this._value);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
ifEmpty(fn) {
|
|
973
|
+
if (this.isEmpty()) {
|
|
974
|
+
fn();
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
apply(fnPresent, fnEmpty) {
|
|
978
|
+
if (this.isPresent()) {
|
|
979
|
+
fnPresent(this._value);
|
|
980
|
+
} else {
|
|
981
|
+
fnEmpty();
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
static of(generator) {
|
|
985
|
+
return new _Lazy(generator);
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
// src/lazy/LazyAsync.ts
|
|
990
|
+
var LazyAsync = class _LazyAsync {
|
|
991
|
+
_promise = void 0;
|
|
992
|
+
_pending = false;
|
|
993
|
+
_resolvedValue = void 0;
|
|
994
|
+
_error = void 0;
|
|
995
|
+
_generator;
|
|
996
|
+
constructor(generator) {
|
|
997
|
+
this._generator = ensureDefined(generator);
|
|
998
|
+
}
|
|
999
|
+
getOrCreate() {
|
|
1000
|
+
if (this.isEmpty()) {
|
|
1001
|
+
this._pending = true;
|
|
1002
|
+
this._promise = this._generator();
|
|
1003
|
+
this._promise.then((value) => {
|
|
1004
|
+
this._pending = false;
|
|
1005
|
+
this._resolvedValue = value;
|
|
1006
|
+
}, (err) => {
|
|
1007
|
+
this._pending = false;
|
|
1008
|
+
this._error = err;
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
1011
|
+
return this._promise;
|
|
1012
|
+
}
|
|
1013
|
+
isPresent() {
|
|
1014
|
+
return this._promise !== void 0;
|
|
1015
|
+
}
|
|
1016
|
+
isEmpty() {
|
|
1017
|
+
return this._promise === void 0;
|
|
1018
|
+
}
|
|
1019
|
+
isPending() {
|
|
1020
|
+
return this.isPresent() && this._pending === true;
|
|
1021
|
+
}
|
|
1022
|
+
isReady() {
|
|
1023
|
+
return this.isPresent() && this._pending === false;
|
|
1024
|
+
}
|
|
1025
|
+
isResolved() {
|
|
1026
|
+
return this.isReady() && this._error === void 0;
|
|
1027
|
+
}
|
|
1028
|
+
isError() {
|
|
1029
|
+
return this.isReady() && this._error !== void 0;
|
|
1030
|
+
}
|
|
1031
|
+
ifPresent(fn) {
|
|
1032
|
+
if (this.isPresent()) {
|
|
1033
|
+
fn(this._promise);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
ifEmpty(fn) {
|
|
1037
|
+
if (this.isEmpty()) {
|
|
1038
|
+
fn();
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
ifPending(fn) {
|
|
1042
|
+
if (this.isPending()) {
|
|
1043
|
+
fn(this._promise);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
ifReady(fn) {
|
|
1047
|
+
if (this.isReady()) {
|
|
1048
|
+
fn(this._promise);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
ifResolved(fn) {
|
|
1052
|
+
if (this.isResolved()) {
|
|
1053
|
+
fn(this._resolvedValue);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
ifError(fn) {
|
|
1057
|
+
if (this.isError()) {
|
|
1058
|
+
fn(this._error);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
getOrThrow(errorMessage) {
|
|
1062
|
+
if (!this._promise)
|
|
1063
|
+
throw new Error(errorMessage);
|
|
1064
|
+
return this._promise;
|
|
1065
|
+
}
|
|
1066
|
+
static of(generator) {
|
|
1067
|
+
return new _LazyAsync(generator);
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
|
|
921
1071
|
// src/time/TimeInstant.ts
|
|
922
1072
|
var import_small_date = __toESM(require_lib());
|
|
923
1073
|
|
|
@@ -2437,6 +2587,8 @@ export {
|
|
|
2437
2587
|
ErrorCannotInstantiatePresentOptionalWithEmptyValue,
|
|
2438
2588
|
ErrorGetEmptyOptional,
|
|
2439
2589
|
ErrorSetEmptyOptional,
|
|
2590
|
+
Lazy,
|
|
2591
|
+
LazyAsync,
|
|
2440
2592
|
Logger,
|
|
2441
2593
|
Optional,
|
|
2442
2594
|
RandomTimeDuration,
|
|
@@ -2453,7 +2605,6 @@ export {
|
|
|
2453
2605
|
asError,
|
|
2454
2606
|
asPromise,
|
|
2455
2607
|
average,
|
|
2456
|
-
bindThis,
|
|
2457
2608
|
capitalizeWord,
|
|
2458
2609
|
clamp,
|
|
2459
2610
|
constant,
|
|
@@ -2481,6 +2632,9 @@ export {
|
|
|
2481
2632
|
extendArray,
|
|
2482
2633
|
extendArrayWith,
|
|
2483
2634
|
fill,
|
|
2635
|
+
filterMap,
|
|
2636
|
+
filterMapReduce,
|
|
2637
|
+
filterWithTypePredicate,
|
|
2484
2638
|
first,
|
|
2485
2639
|
flatMapTruthys,
|
|
2486
2640
|
groupByBoolean,
|
|
@@ -2536,6 +2690,7 @@ export {
|
|
|
2536
2690
|
pad,
|
|
2537
2691
|
padLeft,
|
|
2538
2692
|
padRight,
|
|
2693
|
+
partition,
|
|
2539
2694
|
pick,
|
|
2540
2695
|
pluralize,
|
|
2541
2696
|
promiseSequence,
|
package/package.json
CHANGED
package/src/Logger.ts
CHANGED
|
@@ -6,13 +6,13 @@ type TLogLevel = keyof Console & typeof LEVELS[ number ]
|
|
|
6
6
|
|
|
7
7
|
const timestamp = () => TimeInstant.now().asTimeString();
|
|
8
8
|
|
|
9
|
-
type TLoggerOpts = {
|
|
9
|
+
export type TLoggerOpts = {
|
|
10
10
|
console: Console;
|
|
11
11
|
enabled: boolean;
|
|
12
12
|
minLevel: Uppercase<TLogLevel>;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export class Logger {
|
|
16
16
|
|
|
17
17
|
private enabled: boolean = true;
|
|
18
18
|
private console: Console;
|
|
@@ -42,3 +42,5 @@ export default class Logger {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
export default Logger;
|
package/src/index.ts
CHANGED
package/src/lazy/Lazy.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { ensureDefined } from "../utils";
|
|
|
6
6
|
* The initialization of the value is done once and only if required (lazy initialization).
|
|
7
7
|
* @author gtomberli
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export class Lazy<T> {
|
|
10
10
|
|
|
11
11
|
private _value: T | undefined = undefined;
|
|
12
12
|
private _initialized: boolean = false;
|
|
@@ -75,3 +75,5 @@ export default class Lazy<T> {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
export default Lazy;
|
package/src/lazy/LazyAsync.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ensureDefined } from "../utils/nulls.js";
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export class LazyAsync<T> {
|
|
4
4
|
|
|
5
5
|
private _promise: Promise<T> | undefined = undefined;
|
|
6
6
|
private _pending: boolean = false;
|
|
@@ -98,3 +98,5 @@ export default class LazyAsync<T> {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
export default LazyAsync;
|
package/src/utils/arrays.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TComparisonFunction } from "../sorting/index.js";
|
|
2
|
-
import type { TBiPredicate } from "./functions.js";
|
|
2
|
+
import type { TAccumulator, TBiPredicate, TPredicate, TTransformer } from "./functions.js";
|
|
3
3
|
import type { TMaybe } from "./nulls.js";
|
|
4
4
|
|
|
5
5
|
export * from './arrays/groupBy.js';
|
|
@@ -76,12 +76,12 @@ export function first<T>( arr: TReadableArray<T>, defaultValue: TMaybe<T> = null
|
|
|
76
76
|
return ( arr.length ? arr[ 0 ] : defaultValue );
|
|
77
77
|
}
|
|
78
78
|
export function last<T>( arr: TReadableArray<T>, defaultValue: TMaybe<T> = null ): TMaybe<T> {
|
|
79
|
-
return( arr.length ? arr[ arr.length - 1 ] : defaultValue );
|
|
79
|
+
return ( arr.length ? arr[ arr.length - 1 ] : defaultValue );
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
export const head = first;
|
|
83
83
|
export function tail<T>( arr: TReadableArray<T> ): T[] {
|
|
84
|
-
return( arr.length ? arr.slice( 1 ) : [] );
|
|
84
|
+
return ( arr.length ? arr.slice( 1 ) : [] );
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
export function sortedArray<T>( arr: Array<T>, sortFn?: TComparisonFunction<T> | undefined ): Array<T>;
|
|
@@ -103,3 +103,24 @@ export function mapTruthys<T, R>( arr: Array<T>, mapper: ( value: T, index: numb
|
|
|
103
103
|
export function flatMapTruthys<T, R>( arr: Array<T>, mapper: ( value: T, index: number, array: T[] ) => R | undefined ): Array<R> {
|
|
104
104
|
return arr.flatMap( mapper ).filter( value => value !== undefined ) as Array<R>;
|
|
105
105
|
}
|
|
106
|
+
|
|
107
|
+
export function filterMap<T, R>( array: T[], filterFn: TPredicate<T>, mapFn: TTransformer<T, R> ): R[] {
|
|
108
|
+
return array.filter( filterFn ).map( mapFn );
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function filterMapReduce<T, U, R>( array: T[], filterFn: TPredicate<T>, mapFn: TTransformer<T, U>, reduceFn: TAccumulator<R, U>, initialValue: R ): R {
|
|
112
|
+
return array.filter( filterFn ).map( mapFn ).reduce( reduceFn, initialValue );
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Partitions the given array in two groups, in the first one there will be any and only values of the array that match the given predicate, in the second one there will be any and only values that don't.
|
|
117
|
+
* @param arr the array of items
|
|
118
|
+
* @param predicate the predicate to use to partition the array
|
|
119
|
+
* @returns a tuple, where the first array contains items matching the predicate, and the second array contains items not matching the predicate.
|
|
120
|
+
*/
|
|
121
|
+
export function partition<V>( arr: V[], predicate: TPredicate<V> ): [ V[], V[] ] {
|
|
122
|
+
return arr.reduce( ( partition, item ) => {
|
|
123
|
+
partition[ ( predicate( item ) ? 0 : 1 ) ].push( item );
|
|
124
|
+
return partition;
|
|
125
|
+
}, [ [], [] ] as [ V[], V[] ] );
|
|
126
|
+
}
|
package/src/utils/functions.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
export * from './functions/bindThis.js';
|
|
3
2
|
export * from './functions/constant.js';
|
|
4
3
|
export * from './functions/iff.js';
|
|
5
4
|
|
|
6
5
|
export type TFunction<A, R> = ( a: A ) => R;
|
|
6
|
+
export type TTransformer<A, R> = TFunction<A, R>;
|
|
7
7
|
export type TVoidFunction = TFunction<void, void>
|
|
8
8
|
export type TProducer<R> = TFunction<void, R>;
|
|
9
9
|
export type TConsumer<T> = TFunction<T, void>;
|
|
10
10
|
export type TPredicate<T> = TFunction<T, boolean>;
|
|
11
|
+
export type TTypePredicate<T, R extends T> = ( t: T ) => t is R;
|
|
11
12
|
export type TIdentityFunction<T> = TFunction<T, T>;
|
|
12
13
|
|
|
13
14
|
export type TBiFunction<A, B, R> = ( a: A, b: B ) => R;
|
|
14
|
-
export type TBiConsumer<A, B> = TBiFunction<A, B, void
|
|
15
|
+
export type TBiConsumer<A, B> = TBiFunction<A, B, void>;
|
|
15
16
|
export type TBiPredicate<T> = TBiFunction<T, T, boolean>;
|
|
17
|
+
export type TAccumulator<A, B> = TBiFunction<A, B, A>;
|
|
16
18
|
|
|
17
19
|
export type TAsyncFunction<A, R> = TFunction<A, Promise<R>>;
|
|
18
20
|
export type TAsyncVoidFunction = TAsyncFunction<void, void>
|
|
@@ -31,3 +33,9 @@ export function isFunction( t: unknown ): t is Function { // eslint-disable-line
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export function noop(): void { } // eslint-disable-line @typescript-eslint/no-empty-function
|
|
36
|
+
|
|
37
|
+
export function filterWithTypePredicate<T, R extends T>( filter: TPredicate<T> ): TTypePredicate<T, R> {
|
|
38
|
+
return ( t: T ): t is R => filter( t );
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function bindThis<F extends Function>(this: void, fn: F, _this: object): F;
|