@zelgadis87/utils-core 5.3.0 → 5.3.1
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/.rollup/index.cjs +196 -15
- package/.rollup/index.cjs.map +1 -1
- package/.rollup/index.d.ts +113 -7
- package/.rollup/index.mjs +196 -16
- package/.rollup/index.mjs.map +1 -1
- package/.rollup/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/lazy/Cached.ts +216 -0
- package/src/lazy/Lazy.ts +4 -0
- package/src/lazy/LazyAsync.ts +4 -0
- package/src/lazy/_index.ts +1 -0
- package/src/utils/arrays/indexBy.ts +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/utils/functions/constant.ts","../src/utils/nulls.ts","../src/optional.ts","../src/time/timeunit.ts","../src/time/timebase.ts","../src/time/timeduration.ts","../src/sorting/types.ts","../src/sorting/sorter.ts","../src/sorting/_index.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/records/entries.ts","../src/utils/records.ts","../src/utils/css.ts","../src/utils/empties.ts","../src/utils/operations.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/utils/promises.ts","../src/utils/random.ts","../src/utils/strings/stringparts.ts","../src/utils/strings.ts","../src/utils/_index.ts","../src/utils/functions/iff.ts","../src/utils/functions/predicatebuilder.ts","../src/utils/functions/_index.ts","../src/utils/functions.ts","../src/async/deferred.ts","../src/time/constants.ts","../src/time/types.ts","../src/time/timeinstantbuilder.ts","../src/time/timeinstant.ts","../src/logger.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/lazydictionary.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":[[94,101,102],[93],[94,100,116],[94,116],[61,67,89,99,103,107,110,115],[104,105,106],[89],[60],[89,98],[60,93],[65,66],[59,64,65,89,98],[62,63,64,96,98,100,108,109],[62,64,86],[62],[62,63,67,89,94,98],[64,89],[62,63,64,67,94,96,97],[60,93,95,96,98],[98,110],[89,95],[112,114],[89,111,112,113],[89,112],[60,72,73,75,76,77,78,80,81,83,84,85,86,88,93],[60,61,67,68,69,70,71,93],[72],[75,89],[60,79],[78,80,93],[59,92],[59,90,91],[80],[60,80,82,93],[64,93],[83],[74],[60,72,87],[60,72,88]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","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":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","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":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},"97b4610fc57d7cb7bcd15d1c202d20ac13a0e62139d73b74b3728059972c214b","974f6b38739fa55710a8d952b844a9966c1c3ddd57b3d995f528c7436014740d","9d731ba242d613c2ca90c151356621d90655703a2dde7b470c5a2aeb7a4d2c0f","d8c0717016b8bbec4175b6a305e92a6a97e23ad2394e679651f1daa0651c8721","7c3bfec21c91a0573d6b274aeeb88535e98edba40ee671fbf58bc4b6ec739099","caa5148346ef8007b2666eb429fe49551ead61bab426ce75ada21d635a6b493c","d3781289f931d1fd6da732725be3a924271f3126a60a11f738dab07a9de2f7d8","04e7c40153b200903b1bbae64cac1f0f5b169d7d13f4b52892cd38a5cae42555","5143161b3eb7c229459037342dc8c08b3d83caf2eefdc0eca32e936b2f6d2ff3","9bb731f3e096c8fefced74e859609e059b9dfb51a3c9e03aae66853658a7f392","ddbee494557800bde90b7798b5ee9019758af82dcf9bfa61303a9740f67ca55f","065815c5d2b778f409ae78a366079628d6b28c689647b358ee4cb854e92eead2","2fdcc3f88b19bda7bc74c8c6430b9e2f6eb6d252d812c508f48669a27b680d5f","8fcc72bb0b96ec234b146f45df6617000d892cfae267029713ee978a0a1f1d82","56571c3f44c6312462e8395ed75d05887dcbcb1581a0ad47dd72bcdbb898ea84","70c8b0b1b54592827549014aac9193b037f6e1545572611c1b62c9a1b3c49739","b94823044eb88016e2983f27cd03908d0bf9a09c6d039af6fc026b86b051fd21","a46374f16a16216d0b5b81c73044e4cb28dcc1dc9302757091548cc98e12d5b2","378e70c02bd89d6b9aaa5b9330c4d63d6b5fc3063dbaf48501b8cba0b66fd7be","8b8d66cde1dfd47c100b94d4cb0260ea18e295985755ee6cfc5b050474a299a4","f8767e0060c57dc52f2979f2f606e3c4ffcdda3461b670f5149e155a4318b708","90c482f7c2132fa8fcb44d05e914a9b541b52d7660e7572e7ae69f7fbb1b4541","3f7431b9ae7f791fa6a21e289d8b7d0cb43d9e3e2bd40d34a236f2507a57db46","d0f71922ce0d6ce8aecef7b85158c6726e0db4d0ef23d71f2b14b9a2e5bef9fb","d25b8301aced1d8db8b7456a2a76e9a2cb7f134c0e913f90585a95704de736e6","70a58316dfec322f94bb980c05315faafd93f6fe6c56015efc7f0a4fb87636e2","c50d92b66b0b827cca09519452a1bb77dfbbc370b14bc412685d6ed291d33977","02e0d326f67f99158a21740b1d839fe4f47c88699c74e80f4c80de5cc513b5f0","4b138f8cb1344d1062368b0fd0a8b7a4bc38dad34e8515f8333eadfba67fd439","eaff56964bd490f30099b5ad721e75870c4a032471ce4246e2a9aca2d149a73a","ea48d1f7ba16c713639db5b7ba6d15004ddcad9abb70aa3851a1057a006d29c6","f1c9ce005dfab7214e6c57516b25a7c3f6b1523b9a83e6c2fb86368157139391","cbadb93e0efda2ac169da49518530cc1c13f26a1b9dd5850ebef9cc899742c99","f44be29660d29fd101dd71ea1f7ace66cae61fca94ed3353940c59f666baf914","eb791885d12b9705c35c8703b6b3a49f0bcfdbb96d5a00b8bff5bd222ade45b4","c516228d6b75220a25338869ed1aa20cdacd95d1da3d0cde029d1b6cee28f319","f15931a4c4029a3ca8817875a7e67f16e123dfd5943ea5786c1e17c06a7659f3","a2243579f8b0ba6f4233adeff78f6d192ccbd22325e8c304acf7c20477cb3372","45e436b76d4ea3d38b63d91f99132327998e13bd2aedb94af8bde80da0ac1cf6","b972ff1ec657ab712203281b96e1a6d5fef2cdb77e72b920df830dd6644f3982","ae5b83c9754e8146a88f1e7e1ec82b8ac40589b9541156780068952f21e7b9a2","43501c9d2147c49e15765a559f560f79c87f6e7b83436ba0ea522870df1061e6","141dac9588bca23bfc8a13b99560bae0cf818733218861bba342a5418e55d86f","1169850a4c64b90116e950c9b1ed1647cc42cdc0406aaef72accb23fa31de94a","37f6203f49f4cc6f5810c37b56f30d37d4374f1e3865010604f093a5b230efd1","52f761770e5a798add318d552a80f71d72cc3d6346149b3edefc4bb0cec95c9b","5253453362b3bb0b2d215c3ae66b850edb6f65bce45daaf4f2530b5292ab905b","13e6352373152686a4cb50d944016ae117aba28d7a6c7c0d182bd0ce176c9cce","5062430bb78a002a22e696f31216331490a0847d4bb84a1efac1d32cbaebcc66","1012d17c9bc77cdca9b913d9aa658cddfd9436bfca537dd2a51528262b0f8109","4f47067f81a6ac0c9ff28cbd5ed810a21ed5e0933db8866c110d044f8d02e855","101af4aa7dbc1e81255965e9959cf6117f16e8573f61fe853b11cc73a4790640","5b2927131599d55e0ee730c7a2afc764ff39199a5d186b510fc3eca82f4ef1ff","ce8de69cc158052736c206413883472a49b94d182bef19c38430b2da75fe71eb","123953eda79c2e207b266eeb23e32ed233cf3cbbb9022a399189cbf61dfddbbb","3e11c4733414b0fd622a6c7fb89d19c2218d453e7a8c8c01c4d31310f61b978d","22577c900676846354224462f8a6b3e0e5033cd14a501ea46107e67a4ab7863f","470e7c461e6c3284465505b0ddc0b240dea9c996845f237144dc6044b0094887"],"root":[[59,116]],"options":{"allowImportingTsExtensions":true,"composite":false,"declaration":false,"declarationMap":false,"emitDeclarationOnly":false,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"module":99,"noEmitHelpers":true,"noFallthroughCasesInSwitch":true,"noImplicitAny":false,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"target":9,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"referencedMap":[[103,1],[94,2],[101,3],[102,4],[116,5],[107,6],[104,7],[105,8],[106,7],[99,9],[61,10],[67,11],[66,12],[65,2],[110,13],[108,14],[63,15],[64,16],[100,17],[98,18],[97,19],[109,20],[96,21],[115,22],[114,23],[113,24],[112,7],[89,25],[72,26],[68,7],[69,7],[70,27],[71,2],[76,28],[80,29],[79,30],[93,31],[92,32],[90,7],[91,2],[81,33],[60,2],[83,34],[85,35],[86,36],[75,37],[74,7],[88,38],[87,39]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116],"version":"5.9.2"}
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/utils/functions/constant.ts","../src/utils/nulls.ts","../src/optional.ts","../src/time/timeunit.ts","../src/time/timebase.ts","../src/time/timeduration.ts","../src/sorting/types.ts","../src/sorting/sorter.ts","../src/sorting/_index.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/records/entries.ts","../src/utils/records.ts","../src/utils/css.ts","../src/utils/empties.ts","../src/utils/operations.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/utils/promises.ts","../src/utils/random.ts","../src/utils/strings/stringparts.ts","../src/utils/strings.ts","../src/utils/_index.ts","../src/utils/functions/iff.ts","../src/utils/functions/predicatebuilder.ts","../src/utils/functions/_index.ts","../src/utils/functions.ts","../src/async/deferred.ts","../src/time/constants.ts","../src/time/types.ts","../src/time/timeinstantbuilder.ts","../src/time/timeinstant.ts","../src/logger.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/lazydictionary.ts","../src/lazy/cached.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":[[94,101,102],[93],[94,100,117],[94,117],[61,67,89,99,103,108,111,116],[104,105,106,107],[60,64,89,94,98,99],[89],[60],[89,98],[60,93],[65,66],[59,64,65,89,98],[62,63,64,96,98,100,109,110],[62,64,86],[62],[62,63,67,89,94,98],[64,89],[62,63,64,67,94,96,97],[60,93,95,96,98],[98,111],[89,95],[113,115],[89,112,113,114],[89,113],[60,72,73,75,76,77,78,80,81,83,84,85,86,88,93],[60,61,67,68,69,70,71,93],[72],[75,89],[60,79],[78,80,93],[59,92],[59,90,91],[80],[60,80,82,93],[64,93],[83],[74],[60,72,87],[60,72,88]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","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":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","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":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},"97b4610fc57d7cb7bcd15d1c202d20ac13a0e62139d73b74b3728059972c214b",{"version":"974f6b38739fa55710a8d952b844a9966c1c3ddd57b3d995f528c7436014740d","signature":"26d664c8bd390124da755369abb46e32f59c4a7b2d34afbe8a3cdd73dfd05f6a"},{"version":"9d731ba242d613c2ca90c151356621d90655703a2dde7b470c5a2aeb7a4d2c0f","signature":"bb0e1c6c9873d069c8585d22bf0d827ee16b863bd72304fdd7905a1d2bafb94e"},"d8c0717016b8bbec4175b6a305e92a6a97e23ad2394e679651f1daa0651c8721","7c3bfec21c91a0573d6b274aeeb88535e98edba40ee671fbf58bc4b6ec739099",{"version":"caa5148346ef8007b2666eb429fe49551ead61bab426ce75ada21d635a6b493c","signature":"480ac82e1d700ee85b4bf6017d71ab9c0bdbfb61e8c6542d72567a7066dd1051"},{"version":"d3781289f931d1fd6da732725be3a924271f3126a60a11f738dab07a9de2f7d8","signature":"4d79eeb5415637be3229c2667895b56383253c77b8b33e61549b5128daf9e37a"},{"version":"04e7c40153b200903b1bbae64cac1f0f5b169d7d13f4b52892cd38a5cae42555","signature":"1e8929b769d7ef7a92fd776e340d7e795163c82119e79c0584e63460a39bc212"},{"version":"5143161b3eb7c229459037342dc8c08b3d83caf2eefdc0eca32e936b2f6d2ff3","signature":"ac1e60dde0f406f199f7ba55a4e6672672ba0e1f168287bfce3a5850b1d1baf1"},{"version":"9bb731f3e096c8fefced74e859609e059b9dfb51a3c9e03aae66853658a7f392","signature":"7c3cba64a692fecb43ac72f63682567b08bfd43d4a2635021cb402f0e01e210f"},{"version":"1cc3a703c2993dcb9608429c7bf7c5d629923207dfdfafee578d2db7442dc55f","signature":"d1f7f36db43a5f077c931622d953b76407c2091f2c2456e4441ceb4717b0a0de"},{"version":"065815c5d2b778f409ae78a366079628d6b28c689647b358ee4cb854e92eead2","signature":"8da47ddef220dd11a8a0f431127f8d083ba95b7e2b45b266233812bcf1f13888"},{"version":"2fdcc3f88b19bda7bc74c8c6430b9e2f6eb6d252d812c508f48669a27b680d5f","signature":"e2ab4c29fa06a89dc35759aaf3354bb06cad41d3d6f1bf9e1ce482187cd1fb91"},{"version":"8fcc72bb0b96ec234b146f45df6617000d892cfae267029713ee978a0a1f1d82","signature":"e5b82c43693ed38e7a36ddd94ee902619f7a347d8710e87061cccbbb6d7fe4ca"},"56571c3f44c6312462e8395ed75d05887dcbcb1581a0ad47dd72bcdbb898ea84",{"version":"70c8b0b1b54592827549014aac9193b037f6e1545572611c1b62c9a1b3c49739","signature":"46e174a254ea0e7b245c8dc35fcb430608e4d0bfba777e4c019a3a9ba055433b"},{"version":"b94823044eb88016e2983f27cd03908d0bf9a09c6d039af6fc026b86b051fd21","signature":"b7fb90103dc08cf90bec58f65c7d3de2f8a25410e7641311aa8156a18d78387e"},{"version":"a46374f16a16216d0b5b81c73044e4cb28dcc1dc9302757091548cc98e12d5b2","signature":"bf9ac00497f14af2cd1578e76cee191b7af9aa5bd657fa69e9eb7c972eab5453"},"378e70c02bd89d6b9aaa5b9330c4d63d6b5fc3063dbaf48501b8cba0b66fd7be","8b8d66cde1dfd47c100b94d4cb0260ea18e295985755ee6cfc5b050474a299a4",{"version":"f8767e0060c57dc52f2979f2f606e3c4ffcdda3461b670f5149e155a4318b708","signature":"27855538eb5e86ebcb82eeaa4b4fbae816686f922d235920e585bc57e1829668"},{"version":"90c482f7c2132fa8fcb44d05e914a9b541b52d7660e7572e7ae69f7fbb1b4541","signature":"bb45e88f8ffd472fe1d183d404e24435f1a3c91dda352362530a4ce3aa6f3a0c"},{"version":"3f7431b9ae7f791fa6a21e289d8b7d0cb43d9e3e2bd40d34a236f2507a57db46","signature":"b9115d738885990a2574782d6b28acd0121d145c5c1ab14593cdb4d7a09fc511"},"d0f71922ce0d6ce8aecef7b85158c6726e0db4d0ef23d71f2b14b9a2e5bef9fb",{"version":"d25b8301aced1d8db8b7456a2a76e9a2cb7f134c0e913f90585a95704de736e6","signature":"d89529fc712f1462709febaee1905cbdcb62a9863fd9b22638b8923eb16be2e9"},"70a58316dfec322f94bb980c05315faafd93f6fe6c56015efc7f0a4fb87636e2",{"version":"c50d92b66b0b827cca09519452a1bb77dfbbc370b14bc412685d6ed291d33977","signature":"57bd25f9ba4de40de020fb142b4906c3283ed255fa310e20bcf682b2bd938f82"},{"version":"02e0d326f67f99158a21740b1d839fe4f47c88699c74e80f4c80de5cc513b5f0","signature":"e430a8dd3a6948218c1a6bee846325188fe0e0e0ad218cd3e959043c4eb24431"},{"version":"4b138f8cb1344d1062368b0fd0a8b7a4bc38dad34e8515f8333eadfba67fd439","signature":"7c9ecd4cb18a753eaa5001d5dafe992cdd263474b078d006dd945ce9f9f8a112"},{"version":"eaff56964bd490f30099b5ad721e75870c4a032471ce4246e2a9aca2d149a73a","signature":"a214cb7674ea917cd12866a1e973cfa0c674cfb3571b27ab08036d3b58683692"},{"version":"ea48d1f7ba16c713639db5b7ba6d15004ddcad9abb70aa3851a1057a006d29c6","signature":"133c2c646abcef0342babf68388e9c39aeb66a11b98cec91018aa3b32a14689e"},{"version":"f1c9ce005dfab7214e6c57516b25a7c3f6b1523b9a83e6c2fb86368157139391","signature":"1866b8ac774b21b5e2324ea228ec1414753f0abb511fa939256dd5c4024ad754"},{"version":"cbadb93e0efda2ac169da49518530cc1c13f26a1b9dd5850ebef9cc899742c99","signature":"80f5e541cc3f1efd0f44863687cc201993f149d218490bf58b5de53364c704e1"},{"version":"f44be29660d29fd101dd71ea1f7ace66cae61fca94ed3353940c59f666baf914","signature":"b4089a46f3991d019b4ef9a173c78663e9ecfe571261c61f6eb7e90fd59e442d"},{"version":"eb791885d12b9705c35c8703b6b3a49f0bcfdbb96d5a00b8bff5bd222ade45b4","signature":"9689291b32464a65610dd9de9b58e2e0e0fcb9e8cd2a1760b867e72f80601356"},{"version":"c516228d6b75220a25338869ed1aa20cdacd95d1da3d0cde029d1b6cee28f319","signature":"a8507cb07b2b50e1fd4d2a3a198538675a8f13a456ef4dad1c9843e973edbce9"},"f15931a4c4029a3ca8817875a7e67f16e123dfd5943ea5786c1e17c06a7659f3",{"version":"a2243579f8b0ba6f4233adeff78f6d192ccbd22325e8c304acf7c20477cb3372","signature":"4bf9800765ab21c5faf551e72074f12473fe1c6718efc0586188df09359cb234"},{"version":"45e436b76d4ea3d38b63d91f99132327998e13bd2aedb94af8bde80da0ac1cf6","signature":"14311410bc72fc59cd347b676a75f209479bceb0b0294d5a9285ae2746cb79f1"},{"version":"b972ff1ec657ab712203281b96e1a6d5fef2cdb77e72b920df830dd6644f3982","signature":"df2b47efe8bbf54bf494853619ffd0babc181695d4b65adff59d21da82d0312d"},{"version":"ae5b83c9754e8146a88f1e7e1ec82b8ac40589b9541156780068952f21e7b9a2","signature":"09a62f4bbcd618cbbbf19a2bdaf8b08c2dfc17ca71d795f8191dba8e2da7f98b"},{"version":"43501c9d2147c49e15765a559f560f79c87f6e7b83436ba0ea522870df1061e6","signature":"ddfccc296127843c5b204e359ecda0cdb987705c8306722967a889b4a9ba8379"},{"version":"141dac9588bca23bfc8a13b99560bae0cf818733218861bba342a5418e55d86f","signature":"3d58a3363bb571062abeb1fdc96e174e8a6a61bcdd3e7491c2bf65dbb5a17750"},{"version":"1169850a4c64b90116e950c9b1ed1647cc42cdc0406aaef72accb23fa31de94a","signature":"edaa819d2cda320db8a15b0345db7f7589cdc27fd94f8fb464f46677670ac427"},{"version":"37f6203f49f4cc6f5810c37b56f30d37d4374f1e3865010604f093a5b230efd1","signature":"cdb7a8fa8314942d7e149f25242996fbf6f2e7f0e7da19b958726981325b5e91"},{"version":"9e0a1aa258df69eadd4cb0268adbb5514437b67b1a1d939b925194f6f74e263c","signature":"490241975c2ec59f666f51ed3c0e7adc4dbf26963712aa01506b0b64a7c085f9"},{"version":"1f5b2f5622aa8ec787aaa7d1f00bc9d3588fab96d94a721633ce18021c97c571","signature":"20f962e184263b58d36498c1eb31aff5fc3d69dbc305b25b4b8e063c4f8f04dc"},{"version":"13e6352373152686a4cb50d944016ae117aba28d7a6c7c0d182bd0ce176c9cce","signature":"be0a97abb04589ab9c8a1186667481e0969e020087416d9eb8bee5cec57f69e3"},{"version":"1199f8cc3b092562b2681e3f79c290dc4ae270574e89130eacab1be6a798b591","signature":"ce41c6eec49fb965823d872b9a78c95e12ae6a5bd9500f78263e81e705183d05"},{"version":"6c5909433463444176c99ba6276aa4cf9d91e1ea7496b640ab2be3bcea68ebec","signature":"8e68a922b01802aa90ae8976c31339b1f014564cb213a7936eaf63918292aa8f"},{"version":"1012d17c9bc77cdca9b913d9aa658cddfd9436bfca537dd2a51528262b0f8109","signature":"975d013c31f48ecb26867d0f98f13d2eaebb4af2bfbe6b5fd9a4d38fdccd5656"},{"version":"4f47067f81a6ac0c9ff28cbd5ed810a21ed5e0933db8866c110d044f8d02e855","signature":"36c65fb17300b0e8f2b90fd9a48be672c8342dc101698bcd8ecc3c6aab679e21"},{"version":"101af4aa7dbc1e81255965e9959cf6117f16e8573f61fe853b11cc73a4790640","signature":"58e49c02bb92ca745437c5ce7bd068e11ee2ad1313171db3949b662dfbc04441"},"5b2927131599d55e0ee730c7a2afc764ff39199a5d186b510fc3eca82f4ef1ff",{"version":"ce8de69cc158052736c206413883472a49b94d182bef19c38430b2da75fe71eb","signature":"c2b8c9951fff3bf59901b9efdae3ddc11b89f77deaeceb66ab299ceeb2737fcd"},{"version":"123953eda79c2e207b266eeb23e32ed233cf3cbbb9022a399189cbf61dfddbbb","signature":"08dccec6fc0c466ee550f9f84b89d88d17ff2b9c80cb3c9f4138e5e60b2c4039"},{"version":"3e11c4733414b0fd622a6c7fb89d19c2218d453e7a8c8c01c4d31310f61b978d","signature":"4e5f8dd5a2c15896f4547444291938881a33044bcfaf82c16a80fb0d7f3441f3"},{"version":"22577c900676846354224462f8a6b3e0e5033cd14a501ea46107e67a4ab7863f","signature":"70fd81e903686acf6e994565edb1588cc619b816646ea1a89ac9a47b45d25737"},{"version":"470e7c461e6c3284465505b0ddc0b240dea9c996845f237144dc6044b0094887","signature":"ee5829ba071cdf53ccbd789a46a4bfb3b85833395fc8361352c0cae454d8e3ad"}],"root":[[59,117]],"options":{"allowImportingTsExtensions":true,"composite":false,"declaration":false,"declarationMap":false,"emitDeclarationOnly":false,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"module":99,"noEmitHelpers":true,"noFallthroughCasesInSwitch":true,"noImplicitAny":false,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"target":9,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"referencedMap":[[103,1],[94,2],[101,3],[102,4],[117,5],[108,6],[107,7],[104,8],[105,9],[106,8],[99,10],[61,11],[67,12],[66,13],[65,2],[111,14],[109,15],[63,16],[64,17],[100,18],[98,19],[97,20],[110,21],[96,22],[116,23],[115,24],[114,25],[113,8],[89,26],[72,27],[68,8],[69,8],[70,28],[71,2],[76,29],[80,30],[79,31],[93,32],[92,33],[90,8],[91,2],[81,34],[60,2],[83,35],[85,36],[86,37],[75,38],[74,8],[88,39],[87,40]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117],"version":"5.9.2"}
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import Deferred from "../async/Deferred.js";
|
|
2
|
+
import Logger from "../Logger.js";
|
|
3
|
+
import TimeDuration from "../time/TimeDuration.js";
|
|
4
|
+
import TimeInstant from "../time/TimeInstant.js";
|
|
5
|
+
import { asError, noop, withTryCatch, type TConsumer } from "../utils/_index.js";
|
|
6
|
+
import { ensureDefined } from "../utils/nulls.js";
|
|
7
|
+
|
|
8
|
+
const logger = new Logger( 'Cached' );
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A cached value with stale-while-revalidate pattern.
|
|
12
|
+
* On initialization, the class starts calculating the async result (isPending() === true).
|
|
13
|
+
* When complete, the class will store the generated value (isReady() === true).
|
|
14
|
+
* After maxStale duration, the value becomes stale and will refresh in background on next access (isStale() === true).
|
|
15
|
+
* After maxAge has passed, the cached value is no longer used (isExpired() === true).
|
|
16
|
+
*/
|
|
17
|
+
export class Cached<T> {
|
|
18
|
+
|
|
19
|
+
/** Current promise for the value generation. */
|
|
20
|
+
private _promise: Promise<T> | undefined = undefined;
|
|
21
|
+
|
|
22
|
+
/** Flag indicating if a generation is currently in progress. */
|
|
23
|
+
private _pending: boolean = false;
|
|
24
|
+
|
|
25
|
+
/** The last successfully generated value. */
|
|
26
|
+
private _resolvedValue: T | undefined = undefined;
|
|
27
|
+
|
|
28
|
+
/** Function that generates the cached value. */
|
|
29
|
+
private _generator: () => Promise<T>;
|
|
30
|
+
|
|
31
|
+
/** Timestamp of the last successful value generation. */
|
|
32
|
+
private _generatedAt: TimeInstant = TimeInstant.ZERO;
|
|
33
|
+
|
|
34
|
+
/** The duration for which value should be kept cached. After maxAge from the last generated value, this object is considered empty. */
|
|
35
|
+
private _maxAge: TimeDuration;
|
|
36
|
+
|
|
37
|
+
/** The duration for which the value should be served from cache, even if stale. Has no effect if greater or equal to maxAge. */
|
|
38
|
+
private _maxStale: TimeDuration;
|
|
39
|
+
|
|
40
|
+
/** Callback invoked when new data becomes available. */
|
|
41
|
+
private _onNewDataAvailable: TConsumer<T> = noop;
|
|
42
|
+
|
|
43
|
+
/** Callback invoked when generation fails. */
|
|
44
|
+
private _onError: TConsumer<Error> = err => logger.error( 'Cache generation failed:', err );
|
|
45
|
+
|
|
46
|
+
private constructor(
|
|
47
|
+
generator: () => Promise<T>,
|
|
48
|
+
maxAge: TimeDuration,
|
|
49
|
+
maxStale: TimeDuration
|
|
50
|
+
) {
|
|
51
|
+
this._generator = ensureDefined( generator );
|
|
52
|
+
this._maxAge = ensureDefined( maxAge );
|
|
53
|
+
this._maxStale = ensureDefined( TimeDuration.lowest( maxAge, maxStale ) );
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Gets the cached value.
|
|
58
|
+
* Returns fresh data if available, stale data while revalidating, or triggers generation if empty/expired.
|
|
59
|
+
* @returns Promise resolving to the cached value.
|
|
60
|
+
*/
|
|
61
|
+
public async get(): Promise<T> {
|
|
62
|
+
if ( this.isPending() ) {
|
|
63
|
+
return this._promise!;
|
|
64
|
+
} else if ( this.isEmpty() || this.isExpired() ) {
|
|
65
|
+
this._promise = this.generate();
|
|
66
|
+
return this._promise!;
|
|
67
|
+
} else {
|
|
68
|
+
if ( this.isStale() ) {
|
|
69
|
+
// Start re-generating the contents, while serving stale data.
|
|
70
|
+
void this.generate();
|
|
71
|
+
}
|
|
72
|
+
return this._resolvedValue!;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Generates a new value using the generator function.
|
|
78
|
+
* Sets up promise handlers for success and error cases.
|
|
79
|
+
* @returns The generation promise.
|
|
80
|
+
*/
|
|
81
|
+
private generate() {
|
|
82
|
+
if ( this._pending )
|
|
83
|
+
return this._promise;
|
|
84
|
+
this._pending = true;
|
|
85
|
+
|
|
86
|
+
const deferred = new Deferred<T>();
|
|
87
|
+
this._generator().then( value => {
|
|
88
|
+
this._pending = false;
|
|
89
|
+
this._resolvedValue = value;
|
|
90
|
+
this._generatedAt = TimeInstant.now();
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
deferred.resolve( value );
|
|
94
|
+
withTryCatch( () => this._onNewDataAvailable( value ) );
|
|
95
|
+
}, error => {
|
|
96
|
+
const err = asError( error );
|
|
97
|
+
this._pending = false;
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
deferred.reject( err );
|
|
101
|
+
withTryCatch( () => this._onError( err ) );
|
|
102
|
+
} );
|
|
103
|
+
|
|
104
|
+
return deferred.asPromise();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Checks if value has been requested at least once.
|
|
109
|
+
* @returns True if a promise exists.
|
|
110
|
+
*/
|
|
111
|
+
protected isPresent() {
|
|
112
|
+
return this._promise !== undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Checks value has never been requested.
|
|
117
|
+
* @returns True if empty.
|
|
118
|
+
*/
|
|
119
|
+
protected isEmpty() {
|
|
120
|
+
return this._promise === undefined;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Checks if value generation is currently in progress.
|
|
125
|
+
* @returns True if generation is pending.
|
|
126
|
+
*/
|
|
127
|
+
public isPending() {
|
|
128
|
+
return this.isPresent() && this._pending === true;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Checks if value is stored and fresh.
|
|
133
|
+
* @returns True if stored and fresh.
|
|
134
|
+
*/
|
|
135
|
+
public isReady() {
|
|
136
|
+
return this.isPresent() && this.getAge().isLessThan( this._maxAge );
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// protected isResolved() {
|
|
140
|
+
// return this.isReady() && this._error === undefined;
|
|
141
|
+
// }
|
|
142
|
+
|
|
143
|
+
// protected isError() {
|
|
144
|
+
// return this.isReady() && this._error !== undefined;
|
|
145
|
+
// }
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Checks if cached value is stale (older than maxStale duration).
|
|
149
|
+
* @returns True if value is stale.
|
|
150
|
+
*/
|
|
151
|
+
public isStale() {
|
|
152
|
+
return this.isPresent() && this.getAge().isGreaterThan( this._maxStale );
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Checks if cached value is expired (older than maxAge duration).
|
|
157
|
+
* @returns True if value is expired.
|
|
158
|
+
*/
|
|
159
|
+
public isExpired() {
|
|
160
|
+
return this.isPresent() && this.getAge().isGreaterThan( this._maxAge );
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Gets the timestamp when the value was last successfully generated.
|
|
165
|
+
* @returns The last update timestamp.
|
|
166
|
+
*/
|
|
167
|
+
public getLastUpdated(): TimeInstant {
|
|
168
|
+
return this._generatedAt;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Gets the age of the cached value.
|
|
173
|
+
* @returns The duration since the value was last generated.
|
|
174
|
+
*/
|
|
175
|
+
public getAge(): TimeDuration {
|
|
176
|
+
return this._generatedAt.distanceFromNow();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Invalidates the cache by resetting the generation timestamp.
|
|
181
|
+
* Next access will trigger fresh generation.
|
|
182
|
+
*/
|
|
183
|
+
public invalidate(): void {
|
|
184
|
+
this._generatedAt = TimeInstant.ZERO;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Sets a callback to be invoked when new data becomes available.
|
|
189
|
+
* @param callback Function to call with the new value.
|
|
190
|
+
*/
|
|
191
|
+
public onNewDataAvailable( callback: TConsumer<T> ): void {
|
|
192
|
+
this._onNewDataAvailable = ensureDefined( callback );
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Sets a callback to be invoked when generation fails.
|
|
197
|
+
* @param callback Function to call with the error.
|
|
198
|
+
*/
|
|
199
|
+
public onError( callback: TConsumer<Error> ): void {
|
|
200
|
+
this._onError = ensureDefined( callback );
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Creates a new Cached instance.
|
|
205
|
+
* @param generator Function that generates the value to cache.
|
|
206
|
+
* @param maxAge Maximum duration for which cached value is considered valid.
|
|
207
|
+
* @param maxStale Maximum duration for which stale value is served while revalidating. Defaults to maxAge.
|
|
208
|
+
* @returns A new Cached instance.
|
|
209
|
+
*/
|
|
210
|
+
public static of<T>( generator: () => Promise<T>, maxAge: TimeDuration, maxStale: TimeDuration = maxAge ): Cached<T> {
|
|
211
|
+
const cached = new Cached( generator, maxAge, maxStale );
|
|
212
|
+
void cached.get();
|
|
213
|
+
return cached;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
}
|
package/src/lazy/Lazy.ts
CHANGED
package/src/lazy/LazyAsync.ts
CHANGED
package/src/lazy/_index.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
|
|
2
|
-
import { TFunction, TKeysOfType } from "../_index";
|
|
2
|
+
import { TFunction, TKeysOfType, identity } from "../_index";
|
|
3
3
|
|
|
4
|
-
export function indexByString<V, K extends TKeysOfType<V, string
|
|
5
|
-
return indexByStringWith( arr, t => t[ field ] as string );
|
|
4
|
+
export function indexByString<V, K extends TKeysOfType<V, string>, R = V>( arr: V[], field: K, valueMapper: TFunction<V, R> = v => v as unknown as R ): Record<V[K] & string, R> {
|
|
5
|
+
return indexByStringWith( arr, t => t[ field ] as string, valueMapper );
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export function indexByNumber<V, K extends TKeysOfType<V, number
|
|
9
|
-
return indexByNumberWith( arr, t => t[ field ] as number );
|
|
8
|
+
export function indexByNumber<V, K extends TKeysOfType<V, number>, R = V>( arr: V[], field: K, valueMapper: TFunction<V, R> = v => v as unknown as R ): Record<V[K] & number, R> {
|
|
9
|
+
return indexByNumberWith( arr, t => t[ field ] as number, valueMapper );
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export function indexBySymbol<V, K extends TKeysOfType<V, symbol
|
|
13
|
-
return indexBySymbolWith( arr, t => t[ field ] as symbol );
|
|
12
|
+
export function indexBySymbol<V, K extends TKeysOfType<V, symbol>, R = V>( arr: V[], field: K, valueMapper: TFunction<V, R> = v => v as unknown as R ): Record<V[K] & symbol, R> {
|
|
13
|
+
return indexBySymbolWith( arr, t => t[ field ] as symbol, valueMapper );
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export function indexByStringWith<V>( arr: V[],
|
|
17
|
-
return doIndexByWith<string, V>( arr,
|
|
16
|
+
export function indexByStringWith<V, R = V>( arr: V[], keyGetter: TFunction<V, string>, valueMapper: TFunction<V, R> = v => v as unknown as R ): Record<string, R> {
|
|
17
|
+
return doIndexByWith<string, V, R>( arr, keyGetter, valueMapper );
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function indexByNumberWith<V>( arr: V[],
|
|
21
|
-
return doIndexByWith<number, V>( arr,
|
|
20
|
+
export function indexByNumberWith<V, R = V>( arr: V[], keyGetter: TFunction<V, number>, valueMapper: TFunction<V, R> = v => v as unknown as R ): Record<number, R> {
|
|
21
|
+
return doIndexByWith<number, V, R>( arr, keyGetter, valueMapper );
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export function indexBySymbolWith<V>( arr: V[],
|
|
25
|
-
return doIndexByWith<symbol, V>( arr,
|
|
24
|
+
export function indexBySymbolWith<V, R = V>( arr: V[], keyGetter: TFunction<V, symbol>, valueMapper: TFunction<V, R> = v => v as unknown as R ): Record<symbol, R> {
|
|
25
|
+
return doIndexByWith<symbol, V, R>( arr, keyGetter, valueMapper );
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function doIndexByWith<K extends string | number | symbol, V>( arr: V[],
|
|
28
|
+
function doIndexByWith<K extends string | number | symbol, V, R = V>( arr: V[], keyGetter: TFunction<V, K>, valueMapper: TFunction<V, R> = v => v as unknown as R ): Record<K, R> {
|
|
29
29
|
return arr.reduce( ( dict, cur ) => {
|
|
30
|
-
const key =
|
|
30
|
+
const key = keyGetter( cur );
|
|
31
31
|
if ( key !== null && key !== undefined ) {
|
|
32
32
|
if ( dict[ key ] ) {
|
|
33
33
|
throw new Error( `Multiple values indexed by same key "${ String( key ) }".` );
|
|
34
34
|
}
|
|
35
|
-
dict[ key ] = cur;
|
|
35
|
+
dict[ key ] = valueMapper( cur );
|
|
36
36
|
}
|
|
37
37
|
return dict;
|
|
38
|
-
}, {} as Record<K,
|
|
38
|
+
}, {} as Record<K, R> );
|
|
39
39
|
}
|
|
40
40
|
|