diff --git a/BUILD_SHA b/BUILD_SHA index 808cb0c..e805e14 100644 --- a/BUILD_SHA +++ b/BUILD_SHA @@ -1 +1 @@ -05e544d9f7557435922ee406d0e6b43b252b7c31 +ccf540ad8d625dbc0db78e03ed51278113d8c446 diff --git a/dprint.json b/dprint.json index 14dd782..f5cdac9 100644 --- a/dprint.json +++ b/dprint.json @@ -4,7 +4,8 @@ "quoteStyle": "preferSingle", "semiColons": "asi", "binaryExpression.operatorPosition": "sameLine", - "newLineKind": "auto" + "newLineKind": "auto", + "arguments.preferHanging": "always" }, "json": {}, "markdown": {}, diff --git a/package.json b/package.json index 9afd979..9d91d11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "resultar", - "version": "1.1.4", + "version": "1.1.5", "description": "Result pattern for typescript", "type": "module", "packageManager": "pnpm@9.4.0", @@ -16,9 +16,7 @@ "node": ">=20" }, "outDir": "./dist", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build": "tsup && git rev-parse HEAD > BUILD_SHA", "format": "dprint fmt", @@ -33,9 +31,7 @@ "type": "git", "url": "git+https://github.com/inaiat/resultar.git" }, - "keywords": [ - "plugin" - ], + "keywords": ["plugin"], "contributors": [ "Inaiat ", "Tomaz Haidar " @@ -52,8 +48,7 @@ }, "homepage": "https://github.com/inaiat/resultar", "devDependencies": { - "@sinclair/typebox": "^0.32.33", - "@types/node": "^20.14.5", + "@types/node": "^20.14.9", "dprint": "^0.46.3", "eslint": "^9.5.0", "eslint-plugin-import": "^2.29.1", @@ -64,12 +59,12 @@ "semver": "^7.6.2", "testdouble": "^3.20.2", "tsup": "^8.1.0", - "tsx": "^4.15.6", - "typedoc": "^0.25.13", + "tsx": "^4.15.7", + "typedoc": "^0.26.2", "typedoc-github-wiki-theme": "2.0.0", - "typedoc-plugin-markdown": "4.0.3", - "typescript": "5.4.5", - "typescript-eslint": "^7.13.1" + "typedoc-plugin-markdown": "4.1.0", + "typescript": "5.5.2", + "typescript-eslint": "^7.14.1" }, "tsup": { "sourcemap": true, @@ -77,13 +72,8 @@ "clean": true, "bundle": true, "target": "node18", - "format": [ - "esm", - "cjs" - ], - "entry": [ - "src/**/*.ts" - ] + "format": ["esm", "cjs"], + "entry": ["src/**/*.ts"] }, "directories": { "test": "test" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d9f1441..d28f29e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,12 +8,9 @@ importers: .: devDependencies: - '@sinclair/typebox': - specifier: ^0.32.33 - version: 0.32.33 '@types/node': - specifier: ^20.14.5 - version: 20.14.5 + specifier: ^20.14.9 + version: 20.14.9 dprint: specifier: ^0.46.3 version: 0.46.3 @@ -22,7 +19,7 @@ importers: version: 9.5.0 eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.13.1(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0) + version: 2.29.1(@typescript-eslint/parser@7.14.1(eslint@9.5.0)(typescript@5.5.2))(eslint@9.5.0) eslint-plugin-n: specifier: ^17.9.0 version: 17.9.0(eslint@9.5.0) @@ -43,25 +40,25 @@ importers: version: 3.20.2 tsup: specifier: ^8.1.0 - version: 8.1.0(typescript@5.4.5) + version: 8.1.0(typescript@5.5.2) tsx: - specifier: ^4.15.6 - version: 4.15.6 + specifier: ^4.15.7 + version: 4.15.7 typedoc: - specifier: ^0.25.13 - version: 0.25.13(typescript@5.4.5) + specifier: ^0.26.2 + version: 0.26.2(typescript@5.5.2) typedoc-github-wiki-theme: specifier: 2.0.0 - version: 2.0.0(typedoc-plugin-markdown@4.0.3(typedoc@0.25.13(typescript@5.4.5))) + version: 2.0.0(typedoc-plugin-markdown@4.1.0(typedoc@0.26.2(typescript@5.5.2))) typedoc-plugin-markdown: - specifier: 4.0.3 - version: 4.0.3(typedoc@0.25.13(typescript@5.4.5)) + specifier: 4.1.0 + version: 4.1.0(typedoc@0.26.2(typescript@5.5.2)) typescript: - specifier: 5.4.5 - version: 5.4.5 + specifier: 5.5.2 + version: 5.5.2 typescript-eslint: - specifier: ^7.13.1 - version: 7.13.1(eslint@9.5.0)(typescript@5.4.5) + specifier: ^7.14.1 + version: 7.14.1(eslint@9.5.0)(typescript@5.5.2) packages: @@ -402,8 +399,8 @@ packages: cpu: [x64] os: [win32] - '@sinclair/typebox@0.32.33': - resolution: {integrity: sha512-jM50BfkKA0fwfj0uRRO6asfNfbU0oZipJIb/bL2+BUH/THjuEf2BMiqBOvKfBji5Z9t59NboZQGNfKZbdV50Iw==} + '@shikijs/core@1.9.1': + resolution: {integrity: sha512-EmUful2MQtY8KgCF1OkBtOuMcvaZEvmdubhW0UHCGXi21O9dRLeADVCj+k6ZS+de7Mz9d2qixOXJ+GLhcK3pXg==} '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} @@ -411,14 +408,14 @@ packages: '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - '@types/node@20.14.5': - resolution: {integrity: sha512-aoRR+fJkZT2l0aGOJhuA8frnCSoNX6W7U2mpNq63+BxBIj5BQFt8rHy627kijCmm63ijdSdwvGgpUsU6MBsZZA==} + '@types/node@20.14.9': + resolution: {integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} - '@typescript-eslint/eslint-plugin@7.13.1': - resolution: {integrity: sha512-kZqi+WZQaZfPKnsflLJQCz6Ze9FFSMfXrrIOcyargekQxG37ES7DJNpJUE9Q/X5n3yTIP/WPutVNzgknQ7biLg==} + '@typescript-eslint/eslint-plugin@7.14.1': + resolution: {integrity: sha512-aAJd6bIf2vvQRjUG3ZkNXkmBpN+J7Wd0mfQiiVCJMu9Z5GcZZdcc0j8XwN/BM97Fl7e3SkTXODSk4VehUv7CGw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -428,8 +425,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@7.13.1': - resolution: {integrity: sha512-1ELDPlnLvDQ5ybTSrMhRTFDfOQEOXNM+eP+3HT/Yq7ruWpciQw+Avi73pdEbA4SooCawEWo3dtYbF68gN7Ed1A==} + '@typescript-eslint/parser@7.14.1': + resolution: {integrity: sha512-8lKUOebNLcR0D7RvlcloOacTOWzOqemWEWkKSVpMZVF/XVcwjPR+3MD08QzbW9TCGJ+DwIc6zUSGZ9vd8cO1IA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -438,12 +435,12 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@7.13.1': - resolution: {integrity: sha512-adbXNVEs6GmbzaCpymHQ0MB6E4TqoiVbC0iqG3uijR8ZYfpAXMGttouQzF4Oat3P2GxDVIrg7bMI/P65LiQZdg==} + '@typescript-eslint/scope-manager@7.14.1': + resolution: {integrity: sha512-gPrFSsoYcsffYXTOZ+hT7fyJr95rdVe4kGVX1ps/dJ+DfmlnjFN/GcMxXcVkeHDKqsq6uAcVaQaIi3cFffmAbA==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/type-utils@7.13.1': - resolution: {integrity: sha512-aWDbLu1s9bmgPGXSzNCxELu+0+HQOapV/y+60gPXafR8e2g1Bifxzevaa+4L2ytCWm+CHqpELq4CSoN9ELiwCg==} + '@typescript-eslint/type-utils@7.14.1': + resolution: {integrity: sha512-/MzmgNd3nnbDbOi3LfasXWWe292+iuo+umJ0bCCMCPc1jLO/z2BQmWUUUXvXLbrQey/JgzdF/OV+I5bzEGwJkQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -452,12 +449,12 @@ packages: typescript: optional: true - '@typescript-eslint/types@7.13.1': - resolution: {integrity: sha512-7K7HMcSQIAND6RBL4kDl24sG/xKM13cA85dc7JnmQXw2cBDngg7c19B++JzvJHRG3zG36n9j1i451GBzRuHchw==} + '@typescript-eslint/types@7.14.1': + resolution: {integrity: sha512-mL7zNEOQybo5R3AavY+Am7KLv8BorIv7HCYS5rKoNZKQD9tsfGUpO4KdAn3sSUvTiS4PQkr2+K0KJbxj8H9NDg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/typescript-estree@7.13.1': - resolution: {integrity: sha512-uxNr51CMV7npU1BxZzYjoVz9iyjckBduFBP0S5sLlh1tXYzHzgZ3BR9SVsNed+LmwKrmnqN3Kdl5t7eZ5TS1Yw==} + '@typescript-eslint/typescript-estree@7.14.1': + resolution: {integrity: sha512-k5d0VuxViE2ulIO6FbxxSZaxqDVUyMbXcidC8rHvii0I56XZPv8cq+EhMns+d/EVIL41sMXqRbK3D10Oza1bbA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' @@ -465,14 +462,14 @@ packages: typescript: optional: true - '@typescript-eslint/utils@7.13.1': - resolution: {integrity: sha512-h5MzFBD5a/Gh/fvNdp9pTfqJAbuQC4sCN2WzuXme71lqFJsZtLbjxfSk4r3p02WIArOF9N94pdsLiGutpDbrXQ==} + '@typescript-eslint/utils@7.14.1': + resolution: {integrity: sha512-CMmVVELns3nak3cpJhZosDkm63n+DwBlDX8g0k4QUa9BMnF+lH2lr3d130M1Zt1xxmB3LLk3NV7KQCq86ZBBhQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 - '@typescript-eslint/visitor-keys@7.13.1': - resolution: {integrity: sha512-k/Bfne7lrP7hcb7m9zSsgcBmo+8eicqqfNAJ7uUY+jkTFpKeH2FSkWpFRtimBxgkyvqfu9jTPRbYOvud6isdXA==} + '@typescript-eslint/visitor-keys@7.14.1': + resolution: {integrity: sha512-Crb+F75U1JAEtBeQGxSKwI60hZmmzaqA3z9sYsVm8X7W5cwLEm5bRe0/uXS6+MR/y8CVpKSR/ontIAIEPFcEkA==} engines: {node: ^18.18.0 || >=20.0.0} acorn-jsx@5.3.2: @@ -496,9 +493,6 @@ packages: resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} engines: {node: '>=12'} - ansi-sequence-parser@1.1.1: - resolution: {integrity: sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==} - ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -715,6 +709,10 @@ packages: resolution: {integrity: sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==} engines: {node: '>=10.13.0'} + entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -1197,9 +1195,6 @@ packages: resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} hasBin: true - jsonc-parser@3.2.1: - resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} - keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -1214,6 +1209,9 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + linkify-it@5.0.0: + resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} + load-tsconfig@0.2.5: resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -1242,11 +1240,13 @@ packages: lunr@2.3.9: resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} - marked@4.3.0: - resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} - engines: {node: '>= 12'} + markdown-it@14.1.0: + resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} hasBin: true + mdurl@2.0.0: + resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} + merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -1423,6 +1423,10 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + punycode.js@2.3.1: + resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} + engines: {node: '>=6'} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -1522,8 +1526,8 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shiki@0.14.7: - resolution: {integrity: sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==} + shiki@1.9.1: + resolution: {integrity: sha512-8PDkgb5ja3nfujTjvC4VytL6wGOGCtFAClUb2r3QROevYXxcq+/shVJK5s6gy0HZnjaJgFxd6BpPqpRfqne5rA==} side-channel@1.0.6: resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} @@ -1683,8 +1687,8 @@ packages: typescript: optional: true - tsx@4.15.6: - resolution: {integrity: sha512-is0VQQlfNZRHEuSSTKA6m4xw74IU4AizmuB6lAYLRt9XtuyeQnyJYexhNZOPCB59SqC4JzmSzPnHGBXxf3k0hA==} + tsx@4.15.7: + resolution: {integrity: sha512-u3H0iSFDZM3za+VxkZ1kywdCeHCn+8/qHQS1MNoO2sONDgD95HlWtt8aB23OzeTmFP9IU4/8bZUdg58Uu5J4cg==} engines: {node: '>=18.0.0'} hasBin: true @@ -1721,20 +1725,21 @@ packages: peerDependencies: typedoc-plugin-markdown: '>=4.0.0' - typedoc-plugin-markdown@4.0.3: - resolution: {integrity: sha512-0tZbeVGGCd4+lpoIX+yHWgUfyaLZCQCgJOpuVdTtOtD3+jKaedJ4sl/tkNaYBPeWVKiyDkSHfGuHkq53jlzIFg==} + typedoc-plugin-markdown@4.1.0: + resolution: {integrity: sha512-sUiEJVaa6+MOFShRy14j1OP/VXC5OLyHNecJ2nKeGuBy2M3YiMatSLoIiddFAqVptSuILJTZiJzCBIY6yzAVyg==} + engines: {node: '>= 18'} peerDependencies: - typedoc: 0.25.x + typedoc: 0.26.x - typedoc@0.25.13: - resolution: {integrity: sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ==} - engines: {node: '>= 16'} + typedoc@0.26.2: + resolution: {integrity: sha512-q/t+M+PZqhN9gPWLBZ3CCvP+KT8O1tyYkSzEYbcQ6mo89avdIrMlBEl3vfo5BgSzwC6Lbmq0W64E8RkY+eVsLA==} + engines: {node: '>= 18'} hasBin: true peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x - typescript-eslint@7.13.1: - resolution: {integrity: sha512-pvLEuRs8iS9s3Cnp/Wt//hpK8nKc8hVa3cLljHqzaJJQYP8oys8GUyIFqtlev+2lT/fqMPcyQko+HJ6iYK3nFA==} + typescript-eslint@7.14.1: + resolution: {integrity: sha512-Eo1X+Y0JgGPspcANKjeR6nIqXl4VL5ldXLc15k4m9upq+eY5fhU2IueiEZL6jmHrKH8aCfbIvM/v3IrX5Hg99w==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -1743,11 +1748,14 @@ packages: typescript: optional: true - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} + typescript@5.5.2: + resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} engines: {node: '>=14.17'} hasBin: true + uc.micro@2.1.0: + resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} + unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -1766,12 +1774,6 @@ packages: validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} - vscode-oniguruma@1.7.0: - resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} - - vscode-textmate@8.0.0: - resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} - webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} @@ -2043,97 +2045,97 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.18.0': optional: true - '@sinclair/typebox@0.32.33': {} + '@shikijs/core@1.9.1': {} '@types/estree@1.0.5': {} '@types/json5@0.0.29': {} - '@types/node@20.14.5': + '@types/node@20.14.9': dependencies: undici-types: 5.26.5 '@types/normalize-package-data@2.4.4': {} - '@typescript-eslint/eslint-plugin@7.13.1(@typescript-eslint/parser@7.13.1(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@7.14.1(@typescript-eslint/parser@7.14.1(eslint@9.5.0)(typescript@5.5.2))(eslint@9.5.0)(typescript@5.5.2)': dependencies: '@eslint-community/regexpp': 4.10.1 - '@typescript-eslint/parser': 7.13.1(eslint@9.5.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.13.1 - '@typescript-eslint/type-utils': 7.13.1(eslint@9.5.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.13.1(eslint@9.5.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.13.1 + '@typescript-eslint/parser': 7.14.1(eslint@9.5.0)(typescript@5.5.2) + '@typescript-eslint/scope-manager': 7.14.1 + '@typescript-eslint/type-utils': 7.14.1(eslint@9.5.0)(typescript@5.5.2) + '@typescript-eslint/utils': 7.14.1(eslint@9.5.0)(typescript@5.5.2) + '@typescript-eslint/visitor-keys': 7.14.1 eslint: 9.5.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.4.5) + ts-api-utils: 1.3.0(typescript@5.5.2) optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.13.1(eslint@9.5.0)(typescript@5.4.5)': + '@typescript-eslint/parser@7.14.1(eslint@9.5.0)(typescript@5.5.2)': dependencies: - '@typescript-eslint/scope-manager': 7.13.1 - '@typescript-eslint/types': 7.13.1 - '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.13.1 + '@typescript-eslint/scope-manager': 7.14.1 + '@typescript-eslint/types': 7.14.1 + '@typescript-eslint/typescript-estree': 7.14.1(typescript@5.5.2) + '@typescript-eslint/visitor-keys': 7.14.1 debug: 4.3.5 eslint: 9.5.0 optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@7.13.1': + '@typescript-eslint/scope-manager@7.14.1': dependencies: - '@typescript-eslint/types': 7.13.1 - '@typescript-eslint/visitor-keys': 7.13.1 + '@typescript-eslint/types': 7.14.1 + '@typescript-eslint/visitor-keys': 7.14.1 - '@typescript-eslint/type-utils@7.13.1(eslint@9.5.0)(typescript@5.4.5)': + '@typescript-eslint/type-utils@7.14.1(eslint@9.5.0)(typescript@5.5.2)': dependencies: - '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.4.5) - '@typescript-eslint/utils': 7.13.1(eslint@9.5.0)(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 7.14.1(typescript@5.5.2) + '@typescript-eslint/utils': 7.14.1(eslint@9.5.0)(typescript@5.5.2) debug: 4.3.5 eslint: 9.5.0 - ts-api-utils: 1.3.0(typescript@5.4.5) + ts-api-utils: 1.3.0(typescript@5.5.2) optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@7.13.1': {} + '@typescript-eslint/types@7.14.1': {} - '@typescript-eslint/typescript-estree@7.13.1(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@7.14.1(typescript@5.5.2)': dependencies: - '@typescript-eslint/types': 7.13.1 - '@typescript-eslint/visitor-keys': 7.13.1 + '@typescript-eslint/types': 7.14.1 + '@typescript-eslint/visitor-keys': 7.14.1 debug: 4.3.5 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.4 semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) + ts-api-utils: 1.3.0(typescript@5.5.2) optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.13.1(eslint@9.5.0)(typescript@5.4.5)': + '@typescript-eslint/utils@7.14.1(eslint@9.5.0)(typescript@5.5.2)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.5.0) - '@typescript-eslint/scope-manager': 7.13.1 - '@typescript-eslint/types': 7.13.1 - '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.14.1 + '@typescript-eslint/types': 7.14.1 + '@typescript-eslint/typescript-estree': 7.14.1(typescript@5.5.2) eslint: 9.5.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@7.13.1': + '@typescript-eslint/visitor-keys@7.14.1': dependencies: - '@typescript-eslint/types': 7.13.1 + '@typescript-eslint/types': 7.14.1 eslint-visitor-keys: 3.4.3 acorn-jsx@5.3.2(acorn@8.12.0): @@ -2153,8 +2155,6 @@ snapshots: ansi-regex@6.0.1: {} - ansi-sequence-parser@1.1.1: {} - ansi-styles@3.2.1: dependencies: color-convert: 1.9.3 @@ -2399,6 +2399,8 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.2.1 + entities@4.5.0: {} + error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 @@ -2523,11 +2525,11 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.13.1(eslint@9.5.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@9.5.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.14.1(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint@9.5.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.13.1(eslint@9.5.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.14.1(eslint@9.5.0)(typescript@5.5.2) eslint: 9.5.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: @@ -2540,7 +2542,7 @@ snapshots: eslint: 9.5.0 eslint-compat-utils: 0.5.1(eslint@9.5.0) - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.14.1(eslint@9.5.0)(typescript@5.5.2))(eslint@9.5.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -2550,7 +2552,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.5.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.13.1(eslint@9.5.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@9.5.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.14.1(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint@9.5.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -2561,7 +2563,7 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.13.1(eslint@9.5.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.14.1(eslint@9.5.0)(typescript@5.5.2) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -2980,8 +2982,6 @@ snapshots: dependencies: minimist: 1.2.8 - jsonc-parser@3.2.1: {} - keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -2995,6 +2995,10 @@ snapshots: lines-and-columns@1.2.4: {} + linkify-it@5.0.0: + dependencies: + uc.micro: 2.1.0 + load-tsconfig@0.2.5: {} locate-path@5.0.0: @@ -3015,7 +3019,16 @@ snapshots: lunr@2.3.9: {} - marked@4.3.0: {} + markdown-it@14.1.0: + dependencies: + argparse: 2.0.1 + entities: 4.5.0 + linkify-it: 5.0.0 + mdurl: 2.0.0 + punycode.js: 2.3.1 + uc.micro: 2.1.0 + + mdurl@2.0.0: {} merge-stream@2.0.0: {} @@ -3173,6 +3186,8 @@ snapshots: prelude-ls@1.2.1: {} + punycode.js@2.3.1: {} + punycode@2.3.1: {} queue-microtask@1.2.3: {} @@ -3293,12 +3308,9 @@ snapshots: shebang-regex@3.0.0: {} - shiki@0.14.7: + shiki@1.9.1: dependencies: - ansi-sequence-parser: 1.1.1 - jsonc-parser: 3.2.1 - vscode-oniguruma: 1.7.0 - vscode-textmate: 8.0.0 + '@shikijs/core': 1.9.1 side-channel@1.0.6: dependencies: @@ -3436,9 +3448,9 @@ snapshots: tree-kill@1.2.2: {} - ts-api-utils@1.3.0(typescript@5.4.5): + ts-api-utils@1.3.0(typescript@5.5.2): dependencies: - typescript: 5.4.5 + typescript: 5.5.2 ts-interface-checker@0.1.13: {} @@ -3449,7 +3461,7 @@ snapshots: minimist: 1.2.8 strip-bom: 3.0.0 - tsup@8.1.0(typescript@5.4.5): + tsup@8.1.0(typescript@5.5.2): dependencies: bundle-require: 4.2.1(esbuild@0.21.5) cac: 6.7.14 @@ -3466,12 +3478,12 @@ snapshots: sucrase: 3.35.0 tree-kill: 1.2.2 optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - ts-node - tsx@4.15.6: + tsx@4.15.7: dependencies: esbuild: 0.21.5 get-tsconfig: 4.7.5 @@ -3518,34 +3530,37 @@ snapshots: is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 - typedoc-github-wiki-theme@2.0.0(typedoc-plugin-markdown@4.0.3(typedoc@0.25.13(typescript@5.4.5))): + typedoc-github-wiki-theme@2.0.0(typedoc-plugin-markdown@4.1.0(typedoc@0.26.2(typescript@5.5.2))): dependencies: - typedoc-plugin-markdown: 4.0.3(typedoc@0.25.13(typescript@5.4.5)) + typedoc-plugin-markdown: 4.1.0(typedoc@0.26.2(typescript@5.5.2)) - typedoc-plugin-markdown@4.0.3(typedoc@0.25.13(typescript@5.4.5)): + typedoc-plugin-markdown@4.1.0(typedoc@0.26.2(typescript@5.5.2)): dependencies: - typedoc: 0.25.13(typescript@5.4.5) + typedoc: 0.26.2(typescript@5.5.2) - typedoc@0.25.13(typescript@5.4.5): + typedoc@0.26.2(typescript@5.5.2): dependencies: lunr: 2.3.9 - marked: 4.3.0 + markdown-it: 14.1.0 minimatch: 9.0.4 - shiki: 0.14.7 - typescript: 5.4.5 + shiki: 1.9.1 + typescript: 5.5.2 + yaml: 2.4.5 - typescript-eslint@7.13.1(eslint@9.5.0)(typescript@5.4.5): + typescript-eslint@7.14.1(eslint@9.5.0)(typescript@5.5.2): dependencies: - '@typescript-eslint/eslint-plugin': 7.13.1(@typescript-eslint/parser@7.13.1(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.13.1(eslint@9.5.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.13.1(eslint@9.5.0)(typescript@5.4.5) + '@typescript-eslint/eslint-plugin': 7.14.1(@typescript-eslint/parser@7.14.1(eslint@9.5.0)(typescript@5.5.2))(eslint@9.5.0)(typescript@5.5.2) + '@typescript-eslint/parser': 7.14.1(eslint@9.5.0)(typescript@5.5.2) + '@typescript-eslint/utils': 7.14.1(eslint@9.5.0)(typescript@5.5.2) eslint: 9.5.0 optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - typescript@5.4.5: {} + typescript@5.5.2: {} + + uc.micro@2.1.0: {} unbox-primitive@1.0.2: dependencies: @@ -3571,10 +3586,6 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - vscode-oniguruma@1.7.0: {} - - vscode-textmate@8.0.0: {} - webidl-conversions@4.0.2: {} whatwg-url@7.1.0: diff --git a/src/utils.ts b/src/utils.ts index 91ded4d..a8f33a5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -196,8 +196,6 @@ type TraverseWithAllErrors = Combine exte ] ? Result, EmptyArrayToNever> : never -const appendValueToEndOfList = (value: T) => (list: T[]): T[] => [...list, value] - export type CombineResults< T extends ReadonlyArray>, > = IsLiteralArray extends 1 ? Traverse @@ -226,17 +224,19 @@ export const combineResultAsyncList = ( */ export const combineResultList = ( resultList: ReadonlyArray>, -): Result => - resultList.reduce>( // eslint-disable-line unicorn/no-array-reduce - (acc, result) => - acc.isOk() - ? (result.isErr() - ? err(result.error) - : acc.map(appendValueToEndOfList(result.value))) - : acc, - ok([]), - ) +): Result => { + let acc = ok([]) as Result + for (const result of resultList) { + if (result.isErr()) { + acc = err(result.error) + break + } else { + acc.map((list) => list.push(result.value)) + } + } + return acc +} /* This is the typesafe version of Promise.all * * Takes a list of ResultAsync and success if all inner results are Ok values @@ -256,15 +256,18 @@ export const combineResultAsyncListWithAllErrors = ( */ export const combineResultListWithAllErrors = ( resultList: ReadonlyArray>, -): Result => - resultList.reduce>( // eslint-disable-line unicorn/no-array-reduce - (acc, result) => - result.isErr() - ? (acc.isErr() - ? err([...acc.error, result.error]) - : err([result.error])) - : (acc.isErr() - ? acc - : ok([...acc.value, result.value])), - ok([]), - ) +): Result => { + let acc = ok([]) as Result + + for (const result of resultList) { + if (result.isErr() && acc.isErr()) { + acc.error.push(result.error) + } else if (result.isErr() && acc.isOk()) { + acc = err([result.error]) + } else if (result.isOk() && acc.isOk()) { + acc.value.push(result.value) + } + // do nothing when result.isOk() && acc.isErr() + } + return acc +}