@zelgadis87/utils-core 5.4.3 → 5.4.5
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 +256 -12
- package/.rollup/index.cjs.map +1 -1
- package/.rollup/index.d.ts +209 -9
- package/.rollup/index.mjs +256 -13
- package/.rollup/index.mjs.map +1 -1
- package/.rollup/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +13 -0
- package/package.json +1 -1
- package/src/upgrade/DataUpgrader.ts +109 -4
- package/src/upgrade/DataUpgraderBuilder.ts +169 -0
- package/src/upgrade/_index.ts +1 -0
- package/src/utils/operations.ts +63 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/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/strings/stringparts.ts","../src/utils/strings.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/_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,88],[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,79,80,82,83,85,86,87,88,93],[60,61,67,68,69,70,71,93],[60,72],[75,89],[60,81],[80,82,93],[59,92],[59,90,91],[82],[60,82,84,93],[72,79],[64,93],[72,85],[74],[60,72,78],[60,72,79]],"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":"7930df26d688beec28561d10bffded4cb140b6576774e74dfd6ade485ff6ae5d","signature":"1706ddc734afe16ededdc73b12800de59159b8fc1f95d237357a19dbb3ba2017"},"d8c0717016b8bbec4175b6a305e92a6a97e23ad2394e679651f1daa0651c8721","7c3bfec21c91a0573d6b274aeeb88535e98edba40ee671fbf58bc4b6ec739099",{"version":"caa5148346ef8007b2666eb429fe49551ead61bab426ce75ada21d635a6b493c","signature":"480ac82e1d700ee85b4bf6017d71ab9c0bdbfb61e8c6542d72567a7066dd1051"},{"version":"d3781289f931d1fd6da732725be3a924271f3126a60a11f738dab07a9de2f7d8","signature":"4d79eeb5415637be3229c2667895b56383253c77b8b33e61549b5128daf9e37a"},{"version":"04e7c40153b200903b1bbae64cac1f0f5b169d7d13f4b52892cd38a5cae42555","signature":"1e8929b769d7ef7a92fd776e340d7e795163c82119e79c0584e63460a39bc212"},{"version":"5143161b3eb7c229459037342dc8c08b3d83caf2eefdc0eca32e936b2f6d2ff3","signature":"ac1e60dde0f406f199f7ba55a4e6672672ba0e1f168287bfce3a5850b1d1baf1"},{"version":"9bb731f3e096c8fefced74e859609e059b9dfb51a3c9e03aae66853658a7f392","signature":"7c3cba64a692fecb43ac72f63682567b08bfd43d4a2635021cb402f0e01e210f"},{"version":"56e3835871eed19c9de92b780c5e7b3577dec86aa0233a4a0b593c99872c2fe2","signature":"b83f12746862dc2cd51884912b044f565a6262510502a884d425713acb3eb1a3"},{"version":"edd0834f060b31c45e5f55442f641e36387a0a3220c002df420ce6bb9657bd6a","signature":"dbdc8fb15a0dfdcd4d099efe5879199fe3be64f5ad25884628240d07462b8fda"},{"version":"2fdcc3f88b19bda7bc74c8c6430b9e2f6eb6d252d812c508f48669a27b680d5f","signature":"e2ab4c29fa06a89dc35759aaf3354bb06cad41d3d6f1bf9e1ce482187cd1fb91"},{"version":"d29ecad88ad6053bdc3ebc932c8d9e84ff94efd9aaecd460d5791bc4fa93901c","signature":"f516f9b4cbb94682c921ad93ffbdcc17c1cea66df9dab3bb5107d2418b12c9d8"},"56571c3f44c6312462e8395ed75d05887dcbcb1581a0ad47dd72bcdbb898ea84",{"version":"70c8b0b1b54592827549014aac9193b037f6e1545572611c1b62c9a1b3c49739","signature":"46e174a254ea0e7b245c8dc35fcb430608e4d0bfba777e4c019a3a9ba055433b"},{"version":"b94823044eb88016e2983f27cd03908d0bf9a09c6d039af6fc026b86b051fd21","signature":"b7fb90103dc08cf90bec58f65c7d3de2f8a25410e7641311aa8156a18d78387e"},{"version":"a46374f16a16216d0b5b81c73044e4cb28dcc1dc9302757091548cc98e12d5b2","signature":"bf9ac00497f14af2cd1578e76cee191b7af9aa5bd657fa69e9eb7c972eab5453"},"378e70c02bd89d6b9aaa5b9330c4d63d6b5fc3063dbaf48501b8cba0b66fd7be",{"version":"4b138f8cb1344d1062368b0fd0a8b7a4bc38dad34e8515f8333eadfba67fd439","signature":"7c9ecd4cb18a753eaa5001d5dafe992cdd263474b078d006dd945ce9f9f8a112"},{"version":"eaff56964bd490f30099b5ad721e75870c4a032471ce4246e2a9aca2d149a73a","signature":"a214cb7674ea917cd12866a1e973cfa0c674cfb3571b27ab08036d3b58683692"},{"version":"82b15fabb5a17f19197011af318a33320744f16e0b469b7a912f6e56660774a1","signature":"e00e4ca1b7e059a87e1370616947ae0b83170026e3a5d9fc9de73673f9ded0f3"},{"version":"f8767e0060c57dc52f2979f2f606e3c4ffcdda3461b670f5149e155a4318b708","signature":"27855538eb5e86ebcb82eeaa4b4fbae816686f922d235920e585bc57e1829668"},{"version":"90c482f7c2132fa8fcb44d05e914a9b541b52d7660e7572e7ae69f7fbb1b4541","signature":"bb45e88f8ffd472fe1d183d404e24435f1a3c91dda352362530a4ce3aa6f3a0c"},{"version":"3f7431b9ae7f791fa6a21e289d8b7d0cb43d9e3e2bd40d34a236f2507a57db46","signature":"b9115d738885990a2574782d6b28acd0121d145c5c1ab14593cdb4d7a09fc511"},"d0f71922ce0d6ce8aecef7b85158c6726e0db4d0ef23d71f2b14b9a2e5bef9fb",{"version":"d25b8301aced1d8db8b7456a2a76e9a2cb7f134c0e913f90585a95704de736e6","signature":"d89529fc712f1462709febaee1905cbdcb62a9863fd9b22638b8923eb16be2e9"},"70a58316dfec322f94bb980c05315faafd93f6fe6c56015efc7f0a4fb87636e2",{"version":"c50d92b66b0b827cca09519452a1bb77dfbbc370b14bc412685d6ed291d33977","signature":"57bd25f9ba4de40de020fb142b4906c3283ed255fa310e20bcf682b2bd938f82"},{"version":"e2924a5d56da359185232b46e3361b3a3616e431cedf318a227d6b707806713a","signature":"88f584acf34ffb3227744af5b08fd07a8179b864b5c533b2ada9cb9817e7dbc0"},{"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":"a66abaac7517e3681bbbd5855eed32bc9815fe33cfb9477980b4bd68f75eecfe","signature":"f45c5ad4589dc6dd6a2e4d6728179c7064b4c860154479c6a6a3dd8fee1c80f8"},{"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":"637bb04f2270e0567d615f367331f72bfda1fe159d18acf044069f198952cfa0","signature":"8234f7792b162ab0ac6b3e0ee0be4ee2230ab5bb4e1e7a36b85994bc9525e5ce"},{"version":"6c5909433463444176c99ba6276aa4cf9d91e1ea7496b640ab2be3bcea68ebec","signature":"8e68a922b01802aa90ae8976c31339b1f014564cb213a7936eaf63918292aa8f"},{"version":"fe4780cedbf4b3a526f7964bada488d9fa1a252e959c11b4b86080afaf982e8e","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],[82,30],[81,31],[93,32],[92,33],[90,8],[91,2],[83,34],[60,2],[85,35],[80,36],[87,37],[88,38],[75,39],[74,8],[79,40],[78,41]],"semanticDiagnosticsPerFile":[61],"version":"5.9.3"}
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/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/strings/stringparts.ts","../src/utils/strings.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/_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/dataupgraderbuilder.ts","../src/upgrade/dataupgrader.ts","../src/upgrade/_index.ts","../src/index.ts"],"fileIdsList":[[94,101,102],[93],[94,100,118],[94,118],[61,67,89,99,103,108,111,117],[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,88],[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,116],[89,112,113,114,115],[113,116],[89,113],[60,72,73,75,76,77,79,80,82,83,85,86,87,88,93],[60,61,67,68,69,70,71,93],[60,72],[75,89],[60,81],[80,82,93],[59,92],[59,90,91],[82],[60,82,84,93],[72,79],[64,93],[72,85],[74],[60,72,78],[60,72,79]],"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","7930df26d688beec28561d10bffded4cb140b6576774e74dfd6ade485ff6ae5d","d8c0717016b8bbec4175b6a305e92a6a97e23ad2394e679651f1daa0651c8721","7c3bfec21c91a0573d6b274aeeb88535e98edba40ee671fbf58bc4b6ec739099","caa5148346ef8007b2666eb429fe49551ead61bab426ce75ada21d635a6b493c","d3781289f931d1fd6da732725be3a924271f3126a60a11f738dab07a9de2f7d8","04e7c40153b200903b1bbae64cac1f0f5b169d7d13f4b52892cd38a5cae42555","5143161b3eb7c229459037342dc8c08b3d83caf2eefdc0eca32e936b2f6d2ff3","9bb731f3e096c8fefced74e859609e059b9dfb51a3c9e03aae66853658a7f392","56e3835871eed19c9de92b780c5e7b3577dec86aa0233a4a0b593c99872c2fe2","edd0834f060b31c45e5f55442f641e36387a0a3220c002df420ce6bb9657bd6a","2fdcc3f88b19bda7bc74c8c6430b9e2f6eb6d252d812c508f48669a27b680d5f","d29ecad88ad6053bdc3ebc932c8d9e84ff94efd9aaecd460d5791bc4fa93901c","56571c3f44c6312462e8395ed75d05887dcbcb1581a0ad47dd72bcdbb898ea84","70c8b0b1b54592827549014aac9193b037f6e1545572611c1b62c9a1b3c49739","b94823044eb88016e2983f27cd03908d0bf9a09c6d039af6fc026b86b051fd21","a46374f16a16216d0b5b81c73044e4cb28dcc1dc9302757091548cc98e12d5b2","378e70c02bd89d6b9aaa5b9330c4d63d6b5fc3063dbaf48501b8cba0b66fd7be","4b138f8cb1344d1062368b0fd0a8b7a4bc38dad34e8515f8333eadfba67fd439","eaff56964bd490f30099b5ad721e75870c4a032471ce4246e2a9aca2d149a73a",{"version":"76becfd0c116a7b2a6e13722f0a1c4666f8e44041b7d30fc4ed9d8c43be837b2","signature":"f74a82be00a533d69747c66191e764451b82e0899498f2a0eb7447c8c80baa78"},{"version":"f8767e0060c57dc52f2979f2f606e3c4ffcdda3461b670f5149e155a4318b708","signature":"27855538eb5e86ebcb82eeaa4b4fbae816686f922d235920e585bc57e1829668"},"90c482f7c2132fa8fcb44d05e914a9b541b52d7660e7572e7ae69f7fbb1b4541","3f7431b9ae7f791fa6a21e289d8b7d0cb43d9e3e2bd40d34a236f2507a57db46","d0f71922ce0d6ce8aecef7b85158c6726e0db4d0ef23d71f2b14b9a2e5bef9fb","d25b8301aced1d8db8b7456a2a76e9a2cb7f134c0e913f90585a95704de736e6","70a58316dfec322f94bb980c05315faafd93f6fe6c56015efc7f0a4fb87636e2","c50d92b66b0b827cca09519452a1bb77dfbbc370b14bc412685d6ed291d33977","e2924a5d56da359185232b46e3361b3a3616e431cedf318a227d6b707806713a",{"version":"ea48d1f7ba16c713639db5b7ba6d15004ddcad9abb70aa3851a1057a006d29c6","signature":"133c2c646abcef0342babf68388e9c39aeb66a11b98cec91018aa3b32a14689e"},"f1c9ce005dfab7214e6c57516b25a7c3f6b1523b9a83e6c2fb86368157139391","cbadb93e0efda2ac169da49518530cc1c13f26a1b9dd5850ebef9cc899742c99","f44be29660d29fd101dd71ea1f7ace66cae61fca94ed3353940c59f666baf914","eb791885d12b9705c35c8703b6b3a49f0bcfdbb96d5a00b8bff5bd222ade45b4","c516228d6b75220a25338869ed1aa20cdacd95d1da3d0cde029d1b6cee28f319","f15931a4c4029a3ca8817875a7e67f16e123dfd5943ea5786c1e17c06a7659f3","a2243579f8b0ba6f4233adeff78f6d192ccbd22325e8c304acf7c20477cb3372","45e436b76d4ea3d38b63d91f99132327998e13bd2aedb94af8bde80da0ac1cf6","a66abaac7517e3681bbbd5855eed32bc9815fe33cfb9477980b4bd68f75eecfe","ae5b83c9754e8146a88f1e7e1ec82b8ac40589b9541156780068952f21e7b9a2","43501c9d2147c49e15765a559f560f79c87f6e7b83436ba0ea522870df1061e6","141dac9588bca23bfc8a13b99560bae0cf818733218861bba342a5418e55d86f","1169850a4c64b90116e950c9b1ed1647cc42cdc0406aaef72accb23fa31de94a","37f6203f49f4cc6f5810c37b56f30d37d4374f1e3865010604f093a5b230efd1","9e0a1aa258df69eadd4cb0268adbb5514437b67b1a1d939b925194f6f74e263c","1f5b2f5622aa8ec787aaa7d1f00bc9d3588fab96d94a721633ce18021c97c571","13e6352373152686a4cb50d944016ae117aba28d7a6c7c0d182bd0ce176c9cce","637bb04f2270e0567d615f367331f72bfda1fe159d18acf044069f198952cfa0","6c5909433463444176c99ba6276aa4cf9d91e1ea7496b640ab2be3bcea68ebec","fe4780cedbf4b3a526f7964bada488d9fa1a252e959c11b4b86080afaf982e8e","4f47067f81a6ac0c9ff28cbd5ed810a21ed5e0933db8866c110d044f8d02e855","101af4aa7dbc1e81255965e9959cf6117f16e8573f61fe853b11cc73a4790640","5b2927131599d55e0ee730c7a2afc764ff39199a5d186b510fc3eca82f4ef1ff","ce8de69cc158052736c206413883472a49b94d182bef19c38430b2da75fe71eb","123953eda79c2e207b266eeb23e32ed233cf3cbbb9022a399189cbf61dfddbbb",{"version":"ba5691491170e44bf65feb4718bbf20bbd796234bba30eb0d2d159e462864013","signature":"f870eed8a05d8e9a6e36c077d214fb1d50e0df8d2807bd8f95d5275d11b52be9"},{"version":"5eba0d84fc09a9d6af5b4cc571479f63f4ec05e6d23b3832ed77433de86959f8","signature":"326277b5f6ac3464fcc88810c7a2705a1d1437f7a8839db53a4d05c48b4020ed"},{"version":"5a00e767b9253513dfecc98100df2d673308b771860ea5ef665f9ccd526e593d","signature":"4f35f3111c2a8b407c923f6f303a5d6842a3986d11ef5b87653429b32f3aec6e"},"470e7c461e6c3284465505b0ddc0b240dea9c996845f237144dc6044b0094887"],"root":[[59,118]],"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],[118,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],[117,23],[116,24],[115,25],[114,26],[113,8],[89,27],[72,28],[68,8],[69,8],[70,29],[71,2],[76,30],[82,31],[81,32],[93,33],[92,34],[90,8],[91,2],[83,35],[60,2],[85,36],[80,37],[87,38],[88,39],[75,40],[74,8],[79,41],[78,42]],"errors":true,"version":"5.9.3"}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## 5.4.5
|
|
2
|
+
|
|
3
|
+
### Patch Changes
|
|
4
|
+
|
|
5
|
+
- f032597: Operations: Added Operation.map for type-safe result transformation
|
|
6
|
+
- 42d50fe: DataUpgrader: Added DataUpgraderBuilder that prevents duplicate, backward, and incomplete upgrade paths at compile-time
|
|
7
|
+
|
|
8
|
+
## 5.4.4
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 5118dc8: Operations: Can now combine nested operations
|
|
13
|
+
|
|
1
14
|
## 5.4.3
|
|
2
15
|
|
|
3
16
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -3,20 +3,84 @@ import { isDefined, isNumber, isPositiveNumber, jsonCloneDeep, TJsonSerializable
|
|
|
3
3
|
import { EmptyUpgradeError, UnavailableUpgradeError } from "./errors";
|
|
4
4
|
import getTransitionsPath from "./getTransitionsPath";
|
|
5
5
|
import { TPossibleFromVersion, TPossibleVersion, TTransitionMatrix, TUpgradable, TUpgradeFunction, TVersionMap } from "./types";
|
|
6
|
+
import type { DataUpgraderBuilder } from "./DataUpgraderBuilder.js";
|
|
6
7
|
|
|
7
8
|
const VERSION_FIELD = "$version";
|
|
8
9
|
|
|
9
10
|
export interface IDataUpgrader<XStar extends TUpgradable, XLatest extends XStar> {
|
|
11
|
+
/**
|
|
12
|
+
* Upgrades data from any version to the latest version.
|
|
13
|
+
*
|
|
14
|
+
* @param data - Data object from any version (must contain valid $version field)
|
|
15
|
+
* @returns Promise resolving to data at the latest version
|
|
16
|
+
*/
|
|
10
17
|
upgrade( data: XStar ): Promise<XLatest>;
|
|
11
18
|
}
|
|
12
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Versioned data migration system for transparently upgrading serialized data to the latest version.
|
|
22
|
+
*
|
|
23
|
+
* DataUpgrader manages the migration of data structures across multiple versions, automatically
|
|
24
|
+
* finding the shortest upgrade path and applying transformations. This is particularly useful for
|
|
25
|
+
* handling persisted data that may be in any historical format.
|
|
26
|
+
*
|
|
27
|
+
* **Key Use Case:** Reading serialized data of unknown version and migrating it transparently.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* // Step 1: Define all historical versions with $version discriminator
|
|
32
|
+
* type TSerializedData_V1 = { name: string; $version: 1 };
|
|
33
|
+
* type TSerializedData_V2 = { name: string; age: number; $version: 2 };
|
|
34
|
+
* type TSerializedData_V3 = { name: string; age: number; email: string; $version: 3 };
|
|
35
|
+
*
|
|
36
|
+
* // Step 2: Create union type and current version type
|
|
37
|
+
* type TSerializedData_Vstar = TSerializedData_V1 | TSerializedData_V2 | TSerializedData_V3;
|
|
38
|
+
* type TSerializedData = TSerializedData_V3;
|
|
39
|
+
*
|
|
40
|
+
* // Step 3: Create upgrader with transition functions
|
|
41
|
+
* const upgrader = DataUpgrader.create<TSerializedData_Vstar, TSerializedData>(3)
|
|
42
|
+
* .addTransition(1, 2, async (data: TSerializedData_V1) => ({
|
|
43
|
+
* ...data,
|
|
44
|
+
* age: 0,
|
|
45
|
+
* $version: 2
|
|
46
|
+
* }))
|
|
47
|
+
* .addTransition(2, 3, async (data: TSerializedData_V2) => ({
|
|
48
|
+
* ...data,
|
|
49
|
+
* email: "",
|
|
50
|
+
* $version: 3
|
|
51
|
+
* }))
|
|
52
|
+
* .addTransition(1, 3, async (data: TSerializedData_V1) => ({
|
|
53
|
+
* // Optional: Direct path for efficiency
|
|
54
|
+
* ...data,
|
|
55
|
+
* age: 0,
|
|
56
|
+
* email: "",
|
|
57
|
+
* $version: 3
|
|
58
|
+
* }));
|
|
59
|
+
*
|
|
60
|
+
* // Step 4: Use in data loading - handles any version transparently
|
|
61
|
+
* async function loadData(json: string): Promise<TSerializedData> {
|
|
62
|
+
* const data = parseJson<TSerializedData_Vstar>(json);
|
|
63
|
+
* return await upgrader.upgrade(data);
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* // Works with any version:
|
|
67
|
+
* const v1 = await loadData('{"name":"Alice","$version":1}'); // → V3
|
|
68
|
+
* const v2 = await loadData('{"name":"Bob","age":25,"$version":2}'); // → V3
|
|
69
|
+
* const v3 = await loadData('{"name":"Carol","age":30,"email":"c@example.com","$version":3}'); // → V3
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @typeParam X - Union type of all possible data versions (must extend TUpgradable)
|
|
73
|
+
* @typeParam XLatest - The latest version type (must extend X)
|
|
74
|
+
*
|
|
75
|
+
* @see {@link isUpgradable | Type guard for checking if data is upgradable}
|
|
76
|
+
* @see {@link DataUpgrader.Errors | Error types for upgrade failures}
|
|
77
|
+
*/
|
|
13
78
|
export class DataUpgrader<X extends TUpgradable, XLatest extends X> implements IDataUpgrader<X, XLatest> {
|
|
14
79
|
|
|
15
|
-
private transitions: TTransitionMatrix<X> = {};
|
|
16
|
-
|
|
17
80
|
private constructor(
|
|
18
|
-
private latestVersion: XLatest[ typeof VERSION_FIELD ]
|
|
19
|
-
|
|
81
|
+
private latestVersion: XLatest[ typeof VERSION_FIELD ],
|
|
82
|
+
private transitions: TTransitionMatrix<X> = {}
|
|
83
|
+
) {}
|
|
20
84
|
|
|
21
85
|
public addTransition<
|
|
22
86
|
XFrom extends TVersionMap<X>[ XFromNumber ],
|
|
@@ -85,6 +149,24 @@ export class DataUpgrader<X extends TUpgradable, XLatest extends X> implements I
|
|
|
85
149
|
return new DataUpgrader<X, XLatestVersion>( latest );
|
|
86
150
|
}
|
|
87
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Creates a DataUpgrader from a DataUpgraderBuilder instance.
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
public static fromBuilder<
|
|
157
|
+
X extends TUpgradable,
|
|
158
|
+
XLatestVersion extends X,
|
|
159
|
+
>(
|
|
160
|
+
builder: DataUpgraderBuilder<any, X, any>,
|
|
161
|
+
latestVersion: XLatestVersion[ typeof VERSION_FIELD ]
|
|
162
|
+
) {
|
|
163
|
+
// Extract transitions from builder and convert to strongly-typed TTransitionMatrix
|
|
164
|
+
// This type assertion is safe because the builder has validated all transitions
|
|
165
|
+
// at compile-time via its type parameters
|
|
166
|
+
const transitions = builder.getTransitions() as TTransitionMatrix<X>;
|
|
167
|
+
return new DataUpgrader<X, XLatestVersion>( latestVersion, transitions );
|
|
168
|
+
}
|
|
169
|
+
|
|
88
170
|
public static Errors = {
|
|
89
171
|
EmptyUpgrade: EmptyUpgradeError,
|
|
90
172
|
UnavailableUpgrade: UnavailableUpgradeError
|
|
@@ -97,3 +179,26 @@ export function isUpgradable( obj: TJsonSerializable ): obj is TUpgradable {
|
|
|
97
179
|
}
|
|
98
180
|
|
|
99
181
|
export default DataUpgrader;
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The current system is unable to catch the following problems at compile-time:
|
|
187
|
+
* type A_V1 = { a: number, $version: 1 }
|
|
188
|
+
* type A_V2 = { a: number, b: number, $version: 2 }
|
|
189
|
+
* type A_V3 = { a: number, b: number, c: string, $version: 3 }
|
|
190
|
+
* type A_Vstar = A_V1 | A_V2 | A_V3;
|
|
191
|
+
* type A = A_V3;
|
|
192
|
+
*
|
|
193
|
+
* const DU1 = DataUpgrader.create<A_Vstar, A>( 3 );
|
|
194
|
+
*
|
|
195
|
+
* const DU2 = DataUpgrader.create<A_Vstar, A>( 3 )
|
|
196
|
+
* .addTransition( 1, 3, x => ( { ...x, b: 2, c: "foo", $version: 3 } ) )
|
|
197
|
+
* .addTransition( 1, 3, x => ( { ...x, b: 3, c: "bar", $version: 3 } ) )
|
|
198
|
+
* ;
|
|
199
|
+
*
|
|
200
|
+
* const DU3 = DataUpgrader.create<A_Vstar, A>( 3 )
|
|
201
|
+
* .addTransition( 1, 2, x => ( { ...x, b: 2, $version: 2 } ) )
|
|
202
|
+
* .addTransition( 2, 1, x => ( { ...x, $version: 1 } ) )
|
|
203
|
+
* ;
|
|
204
|
+
*/
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { TTransitionMatrix, TUpgradable } from "./types";
|
|
2
|
+
import DataUpgrader from "./DataUpgrader";
|
|
3
|
+
|
|
4
|
+
type TTransitionRecord = readonly [from: number, to: number];
|
|
5
|
+
|
|
6
|
+
type TContainsTransition<
|
|
7
|
+
T extends readonly TTransitionRecord[],
|
|
8
|
+
From extends number,
|
|
9
|
+
To extends number
|
|
10
|
+
> = T extends readonly [infer First, ...infer Rest]
|
|
11
|
+
? First extends readonly [From, To]
|
|
12
|
+
? true
|
|
13
|
+
: TContainsTransition<Rest & readonly TTransitionRecord[], From, To>
|
|
14
|
+
: false;
|
|
15
|
+
|
|
16
|
+
type TAddTransition<
|
|
17
|
+
T extends readonly TTransitionRecord[],
|
|
18
|
+
From extends number,
|
|
19
|
+
To extends number
|
|
20
|
+
> = TContainsTransition<T, From, To> extends true ? never : readonly [...T, readonly [From, To]];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Builder for creating type-safe DataUpgrader instances with compile-time safety.
|
|
24
|
+
*
|
|
25
|
+
* Prevents at compile-time:
|
|
26
|
+
* - Missing upgrade paths (incomplete version coverage)
|
|
27
|
+
* - Duplicate transition definitions
|
|
28
|
+
* - Backward transitions (e.g., version 2 → 1)
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Step 1: Define all historical versions with $version discriminator
|
|
33
|
+
* type V1 = { name: string; $version: 1 };
|
|
34
|
+
* type V2 = { name: string; age: number; $version: 2 };
|
|
35
|
+
* type V3 = { name: string; age: number; email: string; $version: 3 };
|
|
36
|
+
*
|
|
37
|
+
* // Step 2: Build the upgrader with type-safe transitions
|
|
38
|
+
* const upgrader = DataUpgraderBuilder.start<V1>()
|
|
39
|
+
* .addTransition<V1, V2>(1, 2, async (data) => ({
|
|
40
|
+
* ...data,
|
|
41
|
+
* age: 0,
|
|
42
|
+
* $version: 2
|
|
43
|
+
* }))
|
|
44
|
+
* .addTransition<V2, V3>(2, 3, async (data) => ({
|
|
45
|
+
* ...data,
|
|
46
|
+
* email: "",
|
|
47
|
+
* $version: 3
|
|
48
|
+
* }))
|
|
49
|
+
* .addShortcut<V1, V3>(1, 3, async (data) => ({
|
|
50
|
+
* // Optional: Direct path for efficiency
|
|
51
|
+
* ...data,
|
|
52
|
+
* age: 0,
|
|
53
|
+
* email: "",
|
|
54
|
+
* $version: 3
|
|
55
|
+
* }))
|
|
56
|
+
* .build<V3>(3);
|
|
57
|
+
*
|
|
58
|
+
* // Step 3: Use the upgrader
|
|
59
|
+
* async function loadData(json: string): Promise<V3> {
|
|
60
|
+
* const data = JSON.parse(json);
|
|
61
|
+
* return await upgrader.upgrade(data);
|
|
62
|
+
* }
|
|
63
|
+
*
|
|
64
|
+
* // Works with any version:
|
|
65
|
+
* const v1 = await loadData('{"name":"Alice","$version":1}'); // → V3
|
|
66
|
+
* const v2 = await loadData('{"name":"Bob","age":25,"$version":2}'); // → V3
|
|
67
|
+
* const v3 = await loadData('{"name":"Carol","age":30,"email":"c@example.com","$version":3}'); // → V3
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export class DataUpgraderBuilder<
|
|
71
|
+
VLowest extends TUpgradable,
|
|
72
|
+
VUnion extends TUpgradable = VLowest,
|
|
73
|
+
TTransitions extends readonly TTransitionRecord[] = readonly []
|
|
74
|
+
> {
|
|
75
|
+
|
|
76
|
+
private constructor(
|
|
77
|
+
private transitions: Record<number, Record<number, { from: number; to: number; apply: (data: unknown) => Promise<unknown> }>> = {}
|
|
78
|
+
) {}
|
|
79
|
+
|
|
80
|
+
/** Starts building a new DataUpgrader from the lowest version. */
|
|
81
|
+
public static start<V1 extends TUpgradable>(): DataUpgraderBuilder<V1, V1, readonly []> {
|
|
82
|
+
return new DataUpgraderBuilder<V1, V1, readonly []>();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Adds a sequential transition from the current version to the next version.
|
|
87
|
+
* Prevents backward transitions and duplicates at compile-time.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* builder.addTransition<V1, V2>(1, 2, async (d) => ({ ...d, extra: 0, $version: 2 }))
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
public addTransition<
|
|
95
|
+
VNext extends TUpgradable,
|
|
96
|
+
VCurrent extends TUpgradable & VUnion,
|
|
97
|
+
NewUnion extends TUpgradable = VUnion | VNext,
|
|
98
|
+
Current extends number = VCurrent["$version"],
|
|
99
|
+
Next extends number = VNext["$version"],
|
|
100
|
+
NewTransitions extends readonly TTransitionRecord[] = TAddTransition<TTransitions, Current, Next>
|
|
101
|
+
>(
|
|
102
|
+
fromVersion: Current,
|
|
103
|
+
toVersion: Next,
|
|
104
|
+
apply: (data: VCurrent) => Promise<VNext> | VNext
|
|
105
|
+
): DataUpgraderBuilder<VLowest, NewUnion, NewTransitions> {
|
|
106
|
+
const newTransitions = {
|
|
107
|
+
...this.transitions,
|
|
108
|
+
[toVersion]: {
|
|
109
|
+
...(this.transitions[toVersion] ?? {}),
|
|
110
|
+
[fromVersion]: { from: fromVersion, to: toVersion, apply: async (d: unknown) => apply(d as VCurrent) }
|
|
111
|
+
}
|
|
112
|
+
} satisfies typeof this.transitions;
|
|
113
|
+
const builder = new DataUpgraderBuilder<VLowest, NewUnion, NewTransitions>(newTransitions);
|
|
114
|
+
return builder;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Adds a shortcut transition between arbitrary versions.
|
|
119
|
+
* Both versions must already be in the accumulated union type.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* builder.addShortcut<V1, V3>(1, 3, async (d) => ({ ...d, extra: 0, flag: false, $version: 3 }))
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
public addShortcut<
|
|
127
|
+
VFrom extends TUpgradable & VUnion,
|
|
128
|
+
VTo extends TUpgradable & VUnion,
|
|
129
|
+
From extends number = VFrom["$version"],
|
|
130
|
+
To extends number = VTo["$version"],
|
|
131
|
+
NewTransitions extends readonly TTransitionRecord[] = TAddTransition<TTransitions, From, To>
|
|
132
|
+
>(
|
|
133
|
+
fromVersion: From,
|
|
134
|
+
toVersion: To,
|
|
135
|
+
apply: (data: VFrom) => Promise<VTo> | VTo
|
|
136
|
+
): DataUpgraderBuilder<VLowest, VUnion, NewTransitions> {
|
|
137
|
+
const newTransitions = {
|
|
138
|
+
...this.transitions,
|
|
139
|
+
[toVersion]: {
|
|
140
|
+
...(this.transitions[toVersion] ?? {}),
|
|
141
|
+
[fromVersion]: { from: fromVersion, to: toVersion, apply: async (d: unknown) => apply(d as VFrom) }
|
|
142
|
+
}
|
|
143
|
+
} satisfies typeof this.transitions;
|
|
144
|
+
const builder = new DataUpgraderBuilder<VLowest, VUnion, NewTransitions>(newTransitions);
|
|
145
|
+
return builder;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Builds the DataUpgrader with the specified latest version.
|
|
150
|
+
* The latest version must be in the accumulated union type.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* const upgrader = builder.build<V3>(3);
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
public build<VLatest extends TUpgradable & VUnion>(
|
|
158
|
+
latestVersion: VLatest["$version"]
|
|
159
|
+
): DataUpgrader<VUnion, VLatest> {
|
|
160
|
+
return DataUpgrader.fromBuilder<VUnion, VLatest>(this, latestVersion);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** @internal */
|
|
164
|
+
getTransitions(): Record<number, Record<number, { from: number; to: number; apply: (data: unknown) => Promise<unknown> }>> {
|
|
165
|
+
return this.transitions;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export default DataUpgraderBuilder;
|
package/src/upgrade/_index.ts
CHANGED
package/src/utils/operations.ts
CHANGED
|
@@ -37,6 +37,7 @@ export type TValidation<T, E = Error> = {
|
|
|
37
37
|
export type TAsyncValidation<T, E = Error> = Promise<TValidation<T, E>>;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
+
|
|
40
41
|
* An error class that aggregates multiple errors from a combined operation.
|
|
41
42
|
* Used by `Operation.combine` to represent failures from multiple operations.
|
|
42
43
|
*
|
|
@@ -58,6 +59,44 @@ export class OperationAggregateError<E = Error> extends Error {
|
|
|
58
59
|
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Recursively extracts the innermost error type from potentially nested OperationAggregateError.
|
|
64
|
+
* This enables `Operation.combine` to return accurate error types after flattening.
|
|
65
|
+
*
|
|
66
|
+
* @template E - The error type to flatten
|
|
67
|
+
* @example
|
|
68
|
+
* TOperationAggregateFlattenedError<string> // string
|
|
69
|
+
* TOperationAggregateFlattenedError<OperationAggregateError<string>> // string
|
|
70
|
+
* TOperationAggregateFlattenedError<Error | OperationAggregateError<string>> // Error | string
|
|
71
|
+
*/
|
|
72
|
+
type TOperationAggregateFlattenedError<E> = E extends OperationAggregateError<infer Inner> ? TOperationAggregateFlattenedError<Inner> : E;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Combines multiple operation results into a single result.
|
|
76
|
+
* - If all operations succeed, returns success with an array of all data values.
|
|
77
|
+
* - If any operation fails, returns failure with an `OperationAggregateError` containing all errors.
|
|
78
|
+
*
|
|
79
|
+
* When combining operations whose error type is already `OperationAggregateError<E>`,
|
|
80
|
+
* the errors are automatically flattened to avoid nesting (e.g., combining results from
|
|
81
|
+
* previous `combine` calls).
|
|
82
|
+
*
|
|
83
|
+
* @template T - The success data type of individual operations
|
|
84
|
+
* @template E - The error type of individual operations (defaults to Error)
|
|
85
|
+
* @param results - Array of operation results to combine
|
|
86
|
+
* @returns A single operation with either all data or all aggregated errors (flattened)
|
|
87
|
+
*/
|
|
88
|
+
function combine<T, E = Error>( results: TReadableArray<TOperation<T, E>> ): TOperation<T[], OperationAggregateError<TOperationAggregateFlattenedError<E>>> {
|
|
89
|
+
const [ successes, failures ] = partition( results, r => r.success ) as [ TOperationSuccess<T>[], TOperationFailure<E>[] ];
|
|
90
|
+
if ( failures.length === 0 ) {
|
|
91
|
+
return { success: true, data: successes.map( r => r.data ) } as const;
|
|
92
|
+
}
|
|
93
|
+
const allErrors = failures.flatMap( r => {
|
|
94
|
+
const error = r.error;
|
|
95
|
+
return error instanceof OperationAggregateError ? error.errors : [ error ];
|
|
96
|
+
} ) as TOperationAggregateFlattenedError<E>[];
|
|
97
|
+
return { success: false, error: new OperationAggregateError( allErrors ) };
|
|
98
|
+
}
|
|
99
|
+
|
|
61
100
|
export const Operation = {
|
|
62
101
|
|
|
63
102
|
ok: <const T>( data: T ) => {
|
|
@@ -105,17 +144,30 @@ export const Operation = {
|
|
|
105
144
|
},
|
|
106
145
|
|
|
107
146
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* @template T - The success data type
|
|
113
|
-
* @template
|
|
114
|
-
* @
|
|
115
|
-
* @
|
|
147
|
+
* Transforms the success value of an operation using the provided function.
|
|
148
|
+
* If the operation is a failure, it is returned unchanged (same reference).
|
|
149
|
+
* The transformation function is never called on a failure.
|
|
150
|
+
*
|
|
151
|
+
* @template T - The input success data type
|
|
152
|
+
* @template U - The output success data type
|
|
153
|
+
* @template E - The error type (preserved exactly)
|
|
154
|
+
* @param op - The operation result to transform
|
|
155
|
+
* @param fn - Pure function applied to the success value
|
|
156
|
+
* @returns A new success with the transformed value, or the original failure
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* Operation.map(Operation.ok(1), x => x * 2);
|
|
160
|
+
* // => { success: true, data: 2 }
|
|
161
|
+
*
|
|
162
|
+
* Operation.map(Operation.ko('err'), x => x * 2);
|
|
163
|
+
* // => { success: false, error: 'err' }
|
|
116
164
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
165
|
+
map: <T, U, E>( op: TOperation<T, E>, fn: ( data: T ) => U ): TOperation<U, E> => {
|
|
166
|
+
if ( op.success ) {
|
|
167
|
+
return { success: true, data: fn( op.data ) };
|
|
168
|
+
}
|
|
169
|
+
return op;
|
|
120
170
|
},
|
|
171
|
+
|
|
172
|
+
combine,
|
|
121
173
|
}
|