From 9607e5b42e93816a099fd9213352df9d6f23491f Mon Sep 17 00:00:00 2001 From: lostfictions Date: Fri, 15 Dec 2023 17:13:53 -0500 Subject: [PATCH 1/8] bump deps and rerun prettier --- package.json | 14 +- src/parse-env.ts | 14 +- src/util.ts | 4 +- yarn.lock | 686 +++++++++++++++++++++++++---------------------- 4 files changed, 381 insertions(+), 337 deletions(-) diff --git a/package.json b/package.json index d77cc34..b69d718 100644 --- a/package.json +++ b/package.json @@ -60,15 +60,15 @@ "zod": "^3.13.2" }, "devDependencies": { - "@types/jest": "^29.5.4", - "@types/node": "^16.18.24", - "eslint": "^8.48.0", - "eslint-config-lostfictions": "^6.0.0", - "jest": "^29.6.4", + "@types/jest": "^29.5.11", + "@types/node": "^18.19.3", + "eslint": "^8.55.0", + "eslint-config-lostfictions": "^6.1.0", + "jest": "^29.7.0", "npm-run-all": "^4.1.5", - "prettier": "^3.0.3", + "prettier": "^3.1.1", "ts-jest": "^29.1.1", - "ts-node": "^10.9.1", + "ts-node": "^10.9.2", "typescript": "^4.9.5", "zod": "~3.13.2" }, diff --git a/src/parse-env.ts b/src/parse-env.ts index 2e8b4f2..1228040 100644 --- a/src/parse-env.ts +++ b/src/parse-env.ts @@ -55,9 +55,9 @@ export type RestrictSchemas = { [K in keyof T]: T[K] extends SimpleSchema ? SimpleSchema : T[K] extends DetailedSpec - ? DetailedSpec & - Omit, DetailedSpecKeys> - : never; + ? DetailedSpec & + Omit, DetailedSpecKeys> + : never; }; export type ParsedSchema = T extends any @@ -65,10 +65,10 @@ export type ParsedSchema = T extends any [K in keyof T]: T[K] extends SimpleSchema ? TOut : T[K] extends DetailedSpec - ? T[K]["schema"] extends SimpleSchema - ? TOut - : never - : never; + ? T[K]["schema"] extends SimpleSchema + ? TOut + : never + : never; } : never; diff --git a/src/util.ts b/src/util.ts index 83e19b9..a88eb79 100644 --- a/src/util.ts +++ b/src/util.ts @@ -13,5 +13,5 @@ export type DeepReadonlyObject = { export type DeepReadonly = T extends primitive ? T : T extends Array - ? DeepReadonlyArray - : DeepReadonlyObject; + ? DeepReadonlyArray + : DeepReadonlyObject; diff --git a/yarn.lock b/yarn.lock index 62d8a11..d90d096 100644 --- a/yarn.lock +++ b/yarn.lock @@ -566,10 +566,10 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.8.0.tgz#11195513186f68d42fbf449f9a7136b2c0c92005" integrity sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg== -"@eslint/eslintrc@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.2.tgz#c6936b4b328c64496692f76944e755738be62396" - integrity sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g== +"@eslint/eslintrc@^2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" + integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -581,17 +581,17 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.48.0": - version "8.48.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.48.0.tgz#642633964e217905436033a2bd08bf322849b7fb" - integrity sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw== +"@eslint/js@8.55.0": + version "8.55.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.55.0.tgz#b721d52060f369aa259cf97392403cb9ce892ec6" + integrity sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA== -"@humanwhocodes/config-array@^0.11.10": - version "0.11.11" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.11.tgz#88a04c570dbbc7dd943e4712429c3df09bc32844" - integrity sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA== +"@humanwhocodes/config-array@^0.11.13": + version "0.11.13" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.13.tgz#075dc9684f40a531d9b26b0822153c1e832ee297" + integrity sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ== dependencies: - "@humanwhocodes/object-schema" "^1.2.1" + "@humanwhocodes/object-schema" "^2.0.1" debug "^4.1.1" minimatch "^3.0.5" @@ -600,10 +600,10 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" - integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@humanwhocodes/object-schema@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044" + integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -621,27 +621,27 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.4.tgz#a7e2d84516301f986bba0dd55af9d5fe37f46527" - integrity sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw== +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== dependencies: "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.6.3" - jest-util "^29.6.3" + jest-message-util "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" -"@jest/core@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.4.tgz#265ebee05ec1ff3567757e7a327155c8d6bdb126" - integrity sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg== +"@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== dependencies: - "@jest/console" "^29.6.4" - "@jest/reporters" "^29.6.4" - "@jest/test-result" "^29.6.4" - "@jest/transform" "^29.6.4" + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" @@ -649,33 +649,33 @@ ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.6.3" - jest-config "^29.6.4" - jest-haste-map "^29.6.4" - jest-message-util "^29.6.3" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" jest-regex-util "^29.6.3" - jest-resolve "^29.6.4" - jest-resolve-dependencies "^29.6.4" - jest-runner "^29.6.4" - jest-runtime "^29.6.4" - jest-snapshot "^29.6.4" - jest-util "^29.6.3" - jest-validate "^29.6.3" - jest-watcher "^29.6.4" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" micromatch "^4.0.4" - pretty-format "^29.6.3" + pretty-format "^29.7.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.4.tgz#78ec2c9f8c8829a37616934ff4fea0c028c79f4f" - integrity sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ== +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== dependencies: - "@jest/fake-timers" "^29.6.4" + "@jest/fake-timers" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.6.3" + jest-mock "^29.7.0" "@jest/expect-utils@^29.3.1": version "29.3.1" @@ -684,52 +684,52 @@ dependencies: jest-get-type "^29.2.0" -"@jest/expect-utils@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.4.tgz#17c7dfe6cec106441f218b0aff4b295f98346679" - integrity sha512-FEhkJhqtvBwgSpiTrocquJCdXPsyvNKcl/n7A3u7X4pVoF4bswm11c9d4AV+kfq2Gpv/mM8x7E7DsRvH+djkrg== +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== dependencies: jest-get-type "^29.6.3" -"@jest/expect@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.4.tgz#1d6ae17dc68d906776198389427ab7ce6179dba6" - integrity sha512-Warhsa7d23+3X5bLbrbYvaehcgX5TLYhI03JKoedTiI8uJU4IhqYBWF7OSSgUyz4IgLpUYPkK0AehA5/fRclAA== +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== dependencies: - expect "^29.6.4" - jest-snapshot "^29.6.4" + expect "^29.7.0" + jest-snapshot "^29.7.0" -"@jest/fake-timers@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.4.tgz#45a27f093c43d5d989362a3e7a8c70c83188b4f6" - integrity sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw== +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== dependencies: "@jest/types" "^29.6.3" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.6.3" - jest-mock "^29.6.3" - jest-util "^29.6.3" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" -"@jest/globals@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.4.tgz#4f04f58731b062b44ef23036b79bdb31f40c7f63" - integrity sha512-wVIn5bdtjlChhXAzVXavcY/3PEjf4VqM174BM3eGL5kMxLiZD5CLnbmkEyA1Dwh9q8XjP6E8RwjBsY/iCWrWsA== +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== dependencies: - "@jest/environment" "^29.6.4" - "@jest/expect" "^29.6.4" + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" "@jest/types" "^29.6.3" - jest-mock "^29.6.3" + jest-mock "^29.7.0" -"@jest/reporters@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.4.tgz#9d6350c8a2761ece91f7946e97ab0dabc06deab7" - integrity sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g== +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.6.4" - "@jest/test-result" "^29.6.4" - "@jest/transform" "^29.6.4" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" "@jest/types" "^29.6.3" "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" @@ -743,9 +743,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.6.3" - jest-util "^29.6.3" - jest-worker "^29.6.4" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -774,30 +774,30 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.4.tgz#adf5c79f6e1fb7405ad13d67d9e2b6ff54b54c6b" - integrity sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ== +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== dependencies: - "@jest/console" "^29.6.4" + "@jest/console" "^29.7.0" "@jest/types" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz#86aef66aaa22b181307ed06c26c82802fb836d7b" - integrity sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg== +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== dependencies: - "@jest/test-result" "^29.6.4" + "@jest/test-result" "^29.7.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.4" + jest-haste-map "^29.7.0" slash "^3.0.0" -"@jest/transform@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.4.tgz#a6bc799ef597c5d85b2e65a11fd96b6b239bab5a" - integrity sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA== +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== dependencies: "@babel/core" "^7.11.6" "@jest/types" "^29.6.3" @@ -807,9 +807,9 @@ convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.4" + jest-haste-map "^29.7.0" jest-regex-util "^29.6.3" - jest-util "^29.6.3" + jest-util "^29.7.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" @@ -1034,6 +1034,19 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/eslint@^8.44.9": + version "8.44.9" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.9.tgz#5799663009645637bd1c45b2e1a7c8f4caf89534" + integrity sha512-6yBxcvwnnYoYT1Uk2d+jvIfsuP4mb2EdIxFnrPABj5a/838qe5bGkNLFOiipX4ULQ7XVQvTxOh7jO+BTAiqsEw== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== + "@types/graceful-fs@^4.1.3": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" @@ -1060,14 +1073,19 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^29.5.4": - version "29.5.4" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.4.tgz#9d0a16edaa009a71e6a71a999acd582514dab566" - integrity sha512-PhglGmhWeD46FYOVLt3X7TiWjzwuVGW9wG/4qocPevXMjCmrIc5b6db9WjeGE4QYVpUAWMDv3v0IiBwObY289A== +"@types/jest@^29.5.11": + version "29.5.11" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.11.tgz#0c13aa0da7d0929f078ab080ae5d4ced80fa2f2c" + integrity sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ== dependencies: expect "^29.0.0" pretty-format "^29.0.0" +"@types/json-schema@*": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/json-schema@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" @@ -1088,10 +1106,12 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.6.tgz#040a64d7faf9e5d9e940357125f0963012e66f04" integrity sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ== -"@types/node@^16.18.24": - version "16.18.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.24.tgz#f21925dd56cd3467b4e1e0c5071d0f2af5e9a316" - integrity sha512-zvSN2Esek1aeLdKDYuntKAYjti9Z2oT4I8bfkLLhIxHlv3dwZ5vvATxOc31820iYm4hQRCwjUgDpwSMFjfTUnw== +"@types/node@^18.19.3": + version "18.19.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.3.tgz#e4723c4cb385641d61b983f6fe0b716abd5f8fc0" + integrity sha512-k5fggr14DwAytoA/t8rPrIz++lXK7/DqckthCmoZOKNsEbJkId4Z//BqgApXBUGrGddrigYa1oqheo/7YmW4rg== + dependencies: + undici-types "~5.26.4" "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -1339,6 +1359,11 @@ "@typescript-eslint/types" "6.5.0" eslint-visitor-keys "^3.4.1" +"@ungap/structured-clone@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" + integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -1537,12 +1562,12 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -babel-jest@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.4.tgz#98dbc45d1c93319c82a8ab4a478b670655dd2585" - integrity sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw== +babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== dependencies: - "@jest/transform" "^29.6.4" + "@jest/transform" "^29.7.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.6.3" @@ -1812,6 +1837,19 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" + create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -2170,12 +2208,13 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-lostfictions@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-lostfictions/-/eslint-config-lostfictions-6.0.0.tgz#6b46e8e5e61aa7f89e165b962e668801a2f1b1a1" - integrity sha512-1RbMKNuLWJFvoY62RRCCpPH5Rh6zeNk3GcO1gycjpzszvhYpyZMWRusvQE+iDJb6mSPiQYWTWg27wjOBzOyYvw== +eslint-config-lostfictions@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-lostfictions/-/eslint-config-lostfictions-6.1.0.tgz#6b7914c4423754a7472b40d96152a13bdb501a67" + integrity sha512-v+u1vTtlHL5/63S6f7a8RvBQCUNBRoQ0/G7FpFDGx3QqMEWW+ZzZPTIC4NWaCbdtCgM/JU0nnM6vDHXhy41HDA== dependencies: "@rushstack/eslint-patch" "^1.3.2" + "@types/eslint" "^8.44.9" "@typescript-eslint/eslint-plugin" "6.2.0" "@typescript-eslint/parser" "^6.2.0" eslint-config-prettier "^8.9.0" @@ -2399,18 +2438,19 @@ eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@^8.48.0: - version "8.48.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.48.0.tgz#bf9998ba520063907ba7bfe4c480dc8be03c2155" - integrity sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg== +eslint@^8.55.0: + version "8.55.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.55.0.tgz#078cb7b847d66f2c254ea1794fa395bf8e7e03f8" + integrity sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.2" - "@eslint/js" "8.48.0" - "@humanwhocodes/config-array" "^0.11.10" + "@eslint/eslintrc" "^2.1.4" + "@eslint/js" "8.55.0" + "@humanwhocodes/config-array" "^0.11.13" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" + "@ungap/structured-clone" "^1.2.0" ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -2526,16 +2566,16 @@ expect@^29.0.0: jest-message-util "^29.3.1" jest-util "^29.3.1" -expect@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.4.tgz#a6e6f66d4613717859b2fe3da98a739437b6f4b8" - integrity sha512-F2W2UyQ8XYyftHT57dtfg8Ue3X5qLgm2sSug0ivvLRH/VKNRL/pDxg/TH7zVzbQB0tu80clNFy6LU7OS/VSEKA== +expect@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== dependencies: - "@jest/expect-utils" "^29.6.4" + "@jest/expect-utils" "^29.7.0" jest-get-type "^29.6.3" - jest-matcher-utils "^29.6.4" - jest-message-util "^29.6.3" - jest-util "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -3338,84 +3378,83 @@ iterator.prototype@^1.1.0: has-tostringtag "^1.0.0" reflect.getprototypeof "^1.0.3" -jest-changed-files@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.6.3.tgz#97cfdc93f74fb8af2a1acb0b78f836f1fb40c449" - integrity sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg== +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== dependencies: execa "^5.0.0" - jest-util "^29.6.3" + jest-util "^29.7.0" p-limit "^3.1.0" -jest-circus@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.4.tgz#f074c8d795e0cc0f2ebf0705086b1be6a9a8722f" - integrity sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw== +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== dependencies: - "@jest/environment" "^29.6.4" - "@jest/expect" "^29.6.4" - "@jest/test-result" "^29.6.4" + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^1.0.0" is-generator-fn "^2.0.0" - jest-each "^29.6.3" - jest-matcher-utils "^29.6.4" - jest-message-util "^29.6.3" - jest-runtime "^29.6.4" - jest-snapshot "^29.6.4" - jest-util "^29.6.3" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" p-limit "^3.1.0" - pretty-format "^29.6.3" + pretty-format "^29.7.0" pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.4.tgz#ad52f2dfa1b0291de7ec7f8d7c81ac435521ede0" - integrity sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ== +jest-cli@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== dependencies: - "@jest/core" "^29.6.4" - "@jest/test-result" "^29.6.4" + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" "@jest/types" "^29.6.3" chalk "^4.0.0" + create-jest "^29.7.0" exit "^0.1.2" - graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.6.4" - jest-util "^29.6.3" - jest-validate "^29.6.3" - prompts "^2.0.1" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" yargs "^17.3.1" -jest-config@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.4.tgz#eff958ee41d4e1ee7a6106d02b74ad9fc427d79e" - integrity sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A== +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.6.4" + "@jest/test-sequencer" "^29.7.0" "@jest/types" "^29.6.3" - babel-jest "^29.6.4" + babel-jest "^29.7.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.6.4" - jest-environment-node "^29.6.4" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" jest-get-type "^29.6.3" jest-regex-util "^29.6.3" - jest-resolve "^29.6.4" - jest-runner "^29.6.4" - jest-util "^29.6.3" - jest-validate "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.6.3" + pretty-format "^29.7.0" slash "^3.0.0" strip-json-comments "^3.1.1" @@ -3429,45 +3468,45 @@ jest-diff@^29.3.1: jest-get-type "^29.2.0" pretty-format "^29.3.1" -jest-diff@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.4.tgz#85aaa6c92a79ae8cd9a54ebae8d5b6d9a513314a" - integrity sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw== +jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== dependencies: chalk "^4.0.0" diff-sequences "^29.6.3" jest-get-type "^29.6.3" - pretty-format "^29.6.3" + pretty-format "^29.7.0" -jest-docblock@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.6.3.tgz#293dca5188846c9f7c0c2b1bb33e5b11f21645f2" - integrity sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ== +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== dependencies: detect-newline "^3.0.0" -jest-each@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.3.tgz#1956f14f5f0cb8ae0b2e7cabc10bb03ec817c142" - integrity sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg== +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== dependencies: "@jest/types" "^29.6.3" chalk "^4.0.0" jest-get-type "^29.6.3" - jest-util "^29.6.3" - pretty-format "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" -jest-environment-node@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.4.tgz#4ce311549afd815d3cafb49e60a1e4b25f06d29f" - integrity sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ== +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== dependencies: - "@jest/environment" "^29.6.4" - "@jest/fake-timers" "^29.6.4" + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.6.3" - jest-util "^29.6.3" + jest-mock "^29.7.0" + jest-util "^29.7.0" jest-get-type@^29.2.0: version "29.2.0" @@ -3479,10 +3518,10 @@ jest-get-type@^29.6.3: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== -jest-haste-map@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.4.tgz#97143ce833829157ea7025204b08f9ace609b96a" - integrity sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog== +jest-haste-map@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" + integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== dependencies: "@jest/types" "^29.6.3" "@types/graceful-fs" "^4.1.3" @@ -3491,20 +3530,20 @@ jest-haste-map@^29.6.4: fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.6.3" - jest-util "^29.6.3" - jest-worker "^29.6.4" + jest-util "^29.7.0" + jest-worker "^29.7.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz#b9661bc3aec8874e59aff361fa0c6d7cd507ea01" - integrity sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q== +jest-leak-detector@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== dependencies: jest-get-type "^29.6.3" - pretty-format "^29.6.3" + pretty-format "^29.7.0" jest-matcher-utils@^29.3.1: version "29.3.1" @@ -3516,15 +3555,15 @@ jest-matcher-utils@^29.3.1: jest-get-type "^29.2.0" pretty-format "^29.3.1" -jest-matcher-utils@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.4.tgz#327db7ababea49455df3b23e5d6109fe0c709d24" - integrity sha512-KSzwyzGvK4HcfnserYqJHYi7sZVqdREJ9DMPAKVbS98JsIAvumihaNUbjrWw0St7p9IY7A9UskCW5MYlGmBQFQ== +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== dependencies: chalk "^4.0.0" - jest-diff "^29.6.4" + jest-diff "^29.7.0" jest-get-type "^29.6.3" - pretty-format "^29.6.3" + pretty-format "^29.7.0" jest-message-util@^29.3.1: version "29.3.1" @@ -3541,10 +3580,10 @@ jest-message-util@^29.3.1: slash "^3.0.0" stack-utils "^2.0.3" -jest-message-util@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.3.tgz#bce16050d86801b165f20cfde34dc01d3cf85fbf" - integrity sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA== +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== dependencies: "@babel/code-frame" "^7.12.13" "@jest/types" "^29.6.3" @@ -3552,18 +3591,18 @@ jest-message-util@^29.6.3: chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.6.3" + pretty-format "^29.7.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.3.tgz#433f3fd528c8ec5a76860177484940628bdf5e0a" - integrity sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg== +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== dependencies: "@jest/types" "^29.6.3" "@types/node" "*" - jest-util "^29.6.3" + jest-util "^29.7.0" jest-pnp-resolver@^1.2.2: version "1.2.2" @@ -3575,67 +3614,67 @@ jest-regex-util@^29.6.3: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== -jest-resolve-dependencies@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz#20156b33c7eacbb6bb77aeba4bed0eab4a3f8734" - integrity sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA== +jest-resolve-dependencies@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== dependencies: jest-regex-util "^29.6.3" - jest-snapshot "^29.6.4" + jest-snapshot "^29.7.0" -jest-resolve@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.4.tgz#e34cb06f2178b429c38455d98d1a07572ac9faa3" - integrity sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q== +jest-resolve@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.4" + jest-haste-map "^29.7.0" jest-pnp-resolver "^1.2.2" - jest-util "^29.6.3" - jest-validate "^29.6.3" + jest-util "^29.7.0" + jest-validate "^29.7.0" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.4.tgz#b3b8ccb85970fde0fae40c73ee11eb75adccfacf" - integrity sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw== +jest-runner@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== dependencies: - "@jest/console" "^29.6.4" - "@jest/environment" "^29.6.4" - "@jest/test-result" "^29.6.4" - "@jest/transform" "^29.6.4" + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" - jest-docblock "^29.6.3" - jest-environment-node "^29.6.4" - jest-haste-map "^29.6.4" - jest-leak-detector "^29.6.3" - jest-message-util "^29.6.3" - jest-resolve "^29.6.4" - jest-runtime "^29.6.4" - jest-util "^29.6.3" - jest-watcher "^29.6.4" - jest-worker "^29.6.4" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.4.tgz#b0bc495c9b6b12a0a7042ac34ca9bb85f8cd0ded" - integrity sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA== +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== dependencies: - "@jest/environment" "^29.6.4" - "@jest/fake-timers" "^29.6.4" - "@jest/globals" "^29.6.4" + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" "@jest/source-map" "^29.6.3" - "@jest/test-result" "^29.6.4" - "@jest/transform" "^29.6.4" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" @@ -3643,40 +3682,40 @@ jest-runtime@^29.6.4: collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.6.4" - jest-message-util "^29.6.3" - jest-mock "^29.6.3" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" jest-regex-util "^29.6.3" - jest-resolve "^29.6.4" - jest-snapshot "^29.6.4" - jest-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.4.tgz#9833eb6b66ff1541c7fd8ceaa42d541f407b4876" - integrity sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA== +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.6.4" - "@jest/transform" "^29.6.4" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" "@jest/types" "^29.6.3" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.6.4" + expect "^29.7.0" graceful-fs "^4.2.9" - jest-diff "^29.6.4" + jest-diff "^29.7.0" jest-get-type "^29.6.3" - jest-matcher-utils "^29.6.4" - jest-message-util "^29.6.3" - jest-util "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" natural-compare "^1.4.0" - pretty-format "^29.6.3" + pretty-format "^29.7.0" semver "^7.5.3" jest-util@^29.0.0, jest-util@^29.3.1: @@ -3691,10 +3730,10 @@ jest-util@^29.0.0, jest-util@^29.3.1: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-util@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.3.tgz#e15c3eac8716440d1ed076f09bc63ace1aebca63" - integrity sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA== +jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== dependencies: "@jest/types" "^29.6.3" "@types/node" "*" @@ -3703,51 +3742,51 @@ jest-util@^29.6.3: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.3.tgz#a75fca774cfb1c5758c70d035d30a1f9c2784b4d" - integrity sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg== +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== dependencies: "@jest/types" "^29.6.3" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.6.3" leven "^3.1.0" - pretty-format "^29.6.3" + pretty-format "^29.7.0" -jest-watcher@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.4.tgz#633eb515ae284aa67fd6831f1c9d1b534cf0e0ba" - integrity sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ== +jest-watcher@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== dependencies: - "@jest/test-result" "^29.6.4" + "@jest/test-result" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.6.3" + jest-util "^29.7.0" string-length "^4.0.1" -jest-worker@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.4.tgz#f34279f4afc33c872b470d4af21b281ac616abd3" - integrity sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q== +jest-worker@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== dependencies: "@types/node" "*" - jest-util "^29.6.3" + jest-util "^29.7.0" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.4.tgz#7c48e67a445ba264b778253b5d78d4ebc9d0a622" - integrity sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw== +jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== dependencies: - "@jest/core" "^29.6.4" + "@jest/core" "^29.7.0" "@jest/types" "^29.6.3" import-local "^3.0.2" - jest-cli "^29.6.4" + jest-cli "^29.7.0" "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" @@ -4351,10 +4390,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" - integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== +prettier@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848" + integrity sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw== pretty-format@^29.0.0, pretty-format@^29.3.1: version "29.3.1" @@ -4365,10 +4404,10 @@ pretty-format@^29.0.0, pretty-format@^29.3.1: ansi-styles "^5.0.0" react-is "^18.0.0" -pretty-format@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.3.tgz#d432bb4f1ca6f9463410c3fb25a0ba88e594ace7" - integrity sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw== +pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== dependencies: "@jest/schemas" "^29.6.3" ansi-styles "^5.0.0" @@ -4980,10 +5019,10 @@ ts-jest@^29.1.1: semver "^7.5.3" yargs-parser "^21.0.1" -ts-node@^10.9.1: - version "10.9.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" - integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== +ts-node@^10.9.2: + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== dependencies: "@cspotcode/source-map-support" "^0.8.0" "@tsconfig/node10" "^1.0.7" @@ -5122,6 +5161,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + update-browserslist-db@^1.0.9: version "1.0.10" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" From 07df63e9780d5eb272a6acdf683d4a1fd1494c53 Mon Sep 17 00:00:00 2001 From: lostfictions Date: Fri, 15 Dec 2023 17:34:51 -0500 Subject: [PATCH 2/8] inline colorette --- package.json | 3 -- src/reporter.ts | 2 +- src/tty-colors.ts | 89 +++++++++++++++++++++++++++++++++++++++++++++++ yarn.lock | 5 --- 4 files changed, 90 insertions(+), 9 deletions(-) create mode 100644 src/tty-colors.ts diff --git a/package.json b/package.json index b69d718..2c141ed 100644 --- a/package.json +++ b/package.json @@ -53,9 +53,6 @@ "jest": "jest --colors --watch", "prepublishOnly": "run-s -l test build" }, - "dependencies": { - "colorette": "^2.0.19" - }, "peerDependencies": { "zod": "^3.13.2" }, diff --git a/src/reporter.ts b/src/reporter.ts index f560c27..59a89c9 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -1,5 +1,5 @@ import { ZodError, ZodErrorMap, ZodIssueCode } from "zod"; -import { yellow, red, cyan, green } from "colorette"; +import { yellow, red, cyan, green } from "./tty-colors.js"; import { Schemas } from "./parse-env.js"; // Even though we also have our own formatter, we pass a custom error map to diff --git a/src/tty-colors.ts b/src/tty-colors.ts new file mode 100644 index 0000000..ea883fd --- /dev/null +++ b/src/tty-colors.ts @@ -0,0 +1,89 @@ +/* + * This file adapted from module "colorette", originally found here: + * https://github.com/jorgebucaran/colorette/blob/0928e67466a34e50b53c7a908f32e738c3904846/index.js + * + * Copyright © Jorge Bucaran <> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the 'Software'), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +import { isatty } from "tty"; + +const { + env = {}, + argv = [], + platform = "", +} = typeof process === "undefined" ? {} : process; + +const isDisabled = "NO_COLOR" in env || argv.includes("--no-color"); +const isForced = "FORCE_COLOR" in env || argv.includes("--color"); +const isWindows = platform === "win32"; +const isDumbTerminal = env["TERM"] === "dumb"; + +const isCompatibleTerminal = Boolean( + isatty(1) && env["TERM"] && !isDumbTerminal, +); + +const isCI = + "CI" in env && + ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env); + +export const isColorSupported = + !isDisabled && + (isForced || (isWindows && !isDumbTerminal) || isCompatibleTerminal || isCI); + +const replaceClose = ( + index: number, + str: string, + close: string, + replace: string, + head = str.slice(0, index) + replace, + tail = str.slice(index + close.length), + next = tail.indexOf(close), +): string => + head + (next < 0 ? tail : replaceClose(next, tail, close, replace)); + +const clearBleed = ( + index: number, + str: string, + open: string, + close: string, + replace: string, +) => + index < 0 + ? open + str + close + : open + replaceClose(index, str, close, replace) + close; + +const filterEmpty = + (open: string, close: string, replace = open, at = open.length + 1) => + (str: string) => + str || !(str === "" || str === undefined) + ? clearBleed(String(str).indexOf(close, at), str, open, close, replace) + : ""; + +const create = (open: number, close: number, replace?: string) => + isColorSupported + ? filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace) + : String; + +export const red = create(31, 39); +export const green = create(32, 39); +export const yellow = create(33, 39); +export const blue = create(34, 39); +export const magenta = create(35, 39); +export const cyan = create(36, 39); diff --git a/yarn.lock b/yarn.lock index d90d096..23657d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1815,11 +1815,6 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^2.0.19: - version "2.0.20" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" - integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" From 6179357ec1a02e677996c2bf09246540facbb96d Mon Sep 17 00:00:00 2001 From: lostfictions Date: Fri, 15 Dec 2023 18:03:38 -0500 Subject: [PATCH 3/8] slightly rearrange package.json --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2c141ed..9043707 100644 --- a/package.json +++ b/package.json @@ -2,16 +2,13 @@ "name": "znv", "version": "0.4.0", "description": "Parse your environment with Zod schemas", - "type": "module", + "license": "MIT", "keywords": [ "env", "process.env", "zod", "validation" ], - "main": "dist-cjs/index.js", - "types": "dist/index.d.ts", - "module": "dist/index.js", "author": "s ", "homepage": "https://github.com/lostfictions/znv", "repository": { @@ -21,6 +18,10 @@ "bugs": { "url": "https://github.com/lostfictions/znv/issues" }, + "type": "module", + "main": "dist-cjs/index.js", + "types": "dist/index.d.ts", + "module": "dist/index.js", "files": [ "dist/", "dist-cjs/" @@ -37,7 +38,6 @@ } } }, - "license": "MIT", "scripts": { "build": "run-s -l build:*", "build:clean": "rm -rf dist/ dist-cjs/", From 5c416bf0f7cded85ae407930b46ba43c63fa1a04 Mon Sep 17 00:00:00 2001 From: lostfictions Date: Fri, 15 Dec 2023 18:06:13 -0500 Subject: [PATCH 4/8] add dummy-colors.ts; move files around and fix typos --- README.md | 2 ++ src/parse-env.ts | 6 +++--- src/reporter.ts | 6 +++--- src/util/dummy-colors.ts | 10 ++++++++++ src/{ => util}/tty-colors.ts | 0 src/{util.ts => util/type-helpers.ts} | 0 6 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 src/util/dummy-colors.ts rename src/{ => util}/tty-colors.ts (100%) rename src/{util.ts => util/type-helpers.ts} (100%) diff --git a/README.md b/README.md index cbab1f2..ff749ea 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ about final API design are welcome. ```bash npm i znv zod # or +pnpm add znv zod +# or yarn add znv zod ``` diff --git a/src/parse-env.ts b/src/parse-env.ts index 1228040..b9ad586 100644 --- a/src/parse-env.ts +++ b/src/parse-env.ts @@ -1,9 +1,9 @@ import * as z from "zod"; import { getSchemaWithPreprocessor } from "./preprocessors.js"; -import { ErrorWithContext, reportErrors, errorMap } from "./reporter.js"; +import { type ErrorWithContext, reportErrors, errorMap } from "./reporter.js"; -import type { DeepReadonlyObject } from "./util.js"; +import type { DeepReadonlyObject } from "./util/type-helpers.js"; export type SimpleSchema = z.ZodType< TOut, @@ -102,7 +102,7 @@ export const inferSchemas = ( /** * Parses the passed environment object using the provided map of Zod schemas - * and returns the immutably-typed, parsed environment.. + * and returns the immutably-typed, parsed environment. */ export function parseEnv( env: Record, diff --git a/src/reporter.ts b/src/reporter.ts index 59a89c9..8ad1e8d 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -1,12 +1,12 @@ import { ZodError, ZodErrorMap, ZodIssueCode } from "zod"; -import { yellow, red, cyan, green } from "./tty-colors.js"; -import { Schemas } from "./parse-env.js"; +import { yellow, red, cyan, green } from "./util/tty-colors.js"; +import type { Schemas } from "./parse-env.js"; // Even though we also have our own formatter, we pass a custom error map to // Zod's `.parse()` for two reasons: // - to ensure that no other consumer of zod in the codebase has set a default // error map that might override our formatting -// - to return slightly friendly error messages in some common scenarios. +// - to return slightly friendlier error messages in some common scenarios. export const errorMap: ZodErrorMap = (issue, ctx) => { if ( issue.code === ZodIssueCode.invalid_type && diff --git a/src/util/dummy-colors.ts b/src/util/dummy-colors.ts new file mode 100644 index 0000000..6eed0bd --- /dev/null +++ b/src/util/dummy-colors.ts @@ -0,0 +1,10 @@ +// These exports mirror the exports in its sibling file, `tty-colors.ts`. It +// exists to provide compatibility with environments where the `tty` module +// isn't available. + +export const red = String; +export const green = String; +export const yellow = String; +export const blue = String; +export const magenta = String; +export const cyan = String; diff --git a/src/tty-colors.ts b/src/util/tty-colors.ts similarity index 100% rename from src/tty-colors.ts rename to src/util/tty-colors.ts diff --git a/src/util.ts b/src/util/type-helpers.ts similarity index 100% rename from src/util.ts rename to src/util/type-helpers.ts From 392e2b6f5e258073d92362d8416e8a398266fb7c Mon Sep 17 00:00:00 2001 From: lostfictions Date: Fri, 15 Dec 2023 19:32:16 -0500 Subject: [PATCH 5/8] further simplify tty-colors --- src/util/tty-colors.ts | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/util/tty-colors.ts b/src/util/tty-colors.ts index ea883fd..6ac2215 100644 --- a/src/util/tty-colors.ts +++ b/src/util/tty-colors.ts @@ -58,28 +58,23 @@ const replaceClose = ( ): string => head + (next < 0 ? tail : replaceClose(next, tail, close, replace)); -const clearBleed = ( - index: number, - str: string, - open: string, - close: string, - replace: string, -) => +const clearBleed = (index: number, str: string, open: string, close: string) => index < 0 ? open + str + close - : open + replaceClose(index, str, close, replace) + close; + : open + replaceClose(index, str, close, open) + close; -const filterEmpty = - (open: string, close: string, replace = open, at = open.length + 1) => - (str: string) => - str || !(str === "" || str === undefined) - ? clearBleed(String(str).indexOf(close, at), str, open, close, replace) - : ""; +const filterEmpty = (open: string, close: string) => (str: unknown) => + str || !(str === "" || str === undefined) + ? clearBleed( + String(str).indexOf(close, open.length + 1), + String(str), + open, + close, + ) + : ""; -const create = (open: number, close: number, replace?: string) => - isColorSupported - ? filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace) - : String; +const create = (open: number, close: number) => + isColorSupported ? filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`) : String; export const red = create(31, 39); export const green = create(32, 39); From 743bbc9d23dc31c8a7e26f259614979bce0019b7 Mon Sep 17 00:00:00 2001 From: lostfictions Date: Fri, 15 Dec 2023 19:32:46 -0500 Subject: [PATCH 6/8] add compat entrypoint --- package.json | 10 +++++++++ src/compat.ts | 17 +++++++++++++++ src/extra-schemas.test.ts | 2 +- src/index.ts | 19 +++++++++++++++++ src/parse-env.test.ts | 2 +- src/parse-env.ts | 26 +++++++++++++++++++---- src/preprocessors.ts | 2 +- src/reporter.ts | 44 +++++++++++++++++++++++++++++++++------ src/util/dummy-colors.ts | 10 --------- 9 files changed, 109 insertions(+), 23 deletions(-) create mode 100644 src/compat.ts delete mode 100644 src/util/dummy-colors.ts diff --git a/package.json b/package.json index 9043707..21ca040 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,16 @@ "types": "./dist-cjs/index.d.ts", "default": "./dist-cjs/index.js" } + }, + "./compat": { + "import": { + "types": "./dist/compat.d.ts", + "default": "./dist/compat.js" + }, + "require": { + "types": "./dist-cjs/compat.d.ts", + "default": "./dist-cjs/compat.js" + } } }, "scripts": { diff --git a/src/compat.ts b/src/compat.ts new file mode 100644 index 0000000..bd467fa --- /dev/null +++ b/src/compat.ts @@ -0,0 +1,17 @@ +export { z } from "zod"; +export * from "./parse-env.js"; +export * from "./preprocessors.js"; +export * from "./extra-schemas.js"; + +import { parseEnvImpl, type ParseEnv } from "./parse-env.js"; + +/** + * Parses the passed environment object using the provided map of Zod schemas + * and returns the immutably-typed, parsed environment. Compatible with + * serverless and browser environments. + */ +export const parseEnv: ParseEnv = ( + env, + schemas, + reporterOrTokenFormatters = {}, +) => parseEnvImpl(env, schemas, reporterOrTokenFormatters); diff --git a/src/extra-schemas.test.ts b/src/extra-schemas.test.ts index ca2a2e7..fae90a4 100644 --- a/src/extra-schemas.test.ts +++ b/src/extra-schemas.test.ts @@ -1,4 +1,4 @@ -import { parseEnv } from "./parse-env.js"; +import { parseEnv } from "./index.js"; import { deprecate } from "./extra-schemas.js"; describe("extra schemas", () => { diff --git a/src/index.ts b/src/index.ts index 4832e7a..7f56964 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,3 +2,22 @@ export { z } from "zod"; export * from "./parse-env.js"; export * from "./preprocessors.js"; export * from "./extra-schemas.js"; + +import { parseEnvImpl, type ParseEnv } from "./parse-env.js"; +import { cyan, green, red, yellow } from "./util/tty-colors.js"; + +/** + * Parses the passed environment object using the provided map of Zod schemas + * and returns the immutably-typed, parsed environment. + */ +export const parseEnv: ParseEnv = ( + env, + schemas, + reporterOrTokenFormatters = { + formatVarName: yellow, + formatObjKey: green, + formatReceivedValue: cyan, + formatDefaultValue: cyan, + formatHeader: red, + }, +) => parseEnvImpl(env, schemas, reporterOrTokenFormatters); diff --git a/src/parse-env.test.ts b/src/parse-env.test.ts index 1dbe0b2..60be22e 100644 --- a/src/parse-env.test.ts +++ b/src/parse-env.test.ts @@ -1,6 +1,6 @@ import * as z from "zod"; -import { parseEnv } from "./parse-env.js"; +import { parseEnv } from "./index.js"; import { port } from "./extra-schemas.js"; // FIXME: many of these don't need to be part of parseCore tests, or at minimum diff --git a/src/parse-env.ts b/src/parse-env.ts index b9ad586..1ef8b4e 100644 --- a/src/parse-env.ts +++ b/src/parse-env.ts @@ -1,7 +1,13 @@ import * as z from "zod"; import { getSchemaWithPreprocessor } from "./preprocessors.js"; -import { type ErrorWithContext, reportErrors, errorMap } from "./reporter.js"; +import { + makeDefaultReporter, + errorMap, + type TokenFormatters, + type ErrorWithContext, + type Reporter, +} from "./reporter.js"; import type { DeepReadonlyObject } from "./util/type-helpers.js"; @@ -100,14 +106,26 @@ export const inferSchemas = ( schemas: T & RestrictSchemas, ): T & RestrictSchemas => schemas; +export type ParseEnv = ( + env: Record, + schemas: T & RestrictSchemas, + reporterOrTokenFormatters?: Reporter | TokenFormatters, +) => DeepReadonlyObject>; + /** * Parses the passed environment object using the provided map of Zod schemas * and returns the immutably-typed, parsed environment. */ -export function parseEnv( +export function parseEnvImpl( env: Record, - schemas: T & RestrictSchemas, + schemas: T, + reporterOrTokenFormatters: Reporter | TokenFormatters, ): DeepReadonlyObject> { + const reporter = + typeof reporterOrTokenFormatters === "function" + ? reporterOrTokenFormatters + : makeDefaultReporter(reporterOrTokenFormatters); + const parsed: Record = {} as any; const errors: ErrorWithContext[] = []; @@ -173,7 +191,7 @@ export function parseEnv( } if (errors.length > 0) { - throw new Error(reportErrors(errors, schemas)); + throw new Error(reporter(errors, schemas)); } return parsed as DeepReadonlyObject>; diff --git a/src/preprocessors.ts b/src/preprocessors.ts index 048c44f..a24e308 100644 --- a/src/preprocessors.ts +++ b/src/preprocessors.ts @@ -1,6 +1,6 @@ import * as z from "zod"; -import { assertNever } from "./util.js"; +import { assertNever } from "./util/type-helpers.js"; const { ZodFirstPartyTypeKind: TypeName } = z; diff --git a/src/reporter.ts b/src/reporter.ts index 8ad1e8d..df7d14b 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -1,5 +1,4 @@ import { ZodError, ZodErrorMap, ZodIssueCode } from "zod"; -import { yellow, red, cyan, green } from "./util/tty-colors.js"; import type { Schemas } from "./parse-env.js"; // Even though we also have our own formatter, we pass a custom error map to @@ -25,15 +24,48 @@ export interface ErrorWithContext { defaultValue: unknown; } +export interface TokenFormatters { + /** Formatter for the env var name. */ + formatVarName?: (key: string) => string; + + /** For parsed objects with errors, formatter for object keys. */ + formatObjKey?: (key: string) => string; + + /** Formatter for the actual value we received for the env var. */ + formatReceivedValue?: (val: unknown) => string; + + /** Formatter for the default value provided for the schema. */ + formatDefaultValue?: (val: unknown) => string; + + /** Formatter for the error summary header. */ + formatHeader?: (header: string) => string; +} + const indent = (str: string, amt: number) => `${" ".repeat(amt)}${str}`; +export type Reporter = (errors: ErrorWithContext[], schemas: Schemas) => string; + +export function makeDefaultReporter(formatters: TokenFormatters) { + const reporter: Reporter = (errors, schemas) => + reportErrors(errors, schemas, formatters); + + return reporter; +} + export function reportErrors( errors: ErrorWithContext[], schemas: Schemas, + { + formatVarName = String, + formatObjKey = String, + formatReceivedValue = String, + formatDefaultValue = String, + formatHeader = String, + }: TokenFormatters = {}, ): string { const formattedErrors = errors.map( ({ key, receivedValue, error, defaultUsed, defaultValue }) => { - let title = `[${yellow(key)}]:`; + let title = `[${formatVarName(key)}]:`; const desc = schemas[key]?.description; if (desc) { @@ -49,7 +81,7 @@ export function reportErrors( if (fieldErrorEntries.length > 0) { message.push(indent("Errors on object keys:", 2)); for (const [objKey, keyErrors] of fieldErrorEntries) { - message.push(indent(`[${green(objKey)}]:`, 4)); + message.push(indent(`[${formatObjKey(objKey)}]:`, 4)); for (const fe of keyErrors) message.push(indent(fe, 6)); } } @@ -65,7 +97,7 @@ export function reportErrors( message.push( indent( - `(received ${cyan( + `(received ${formatReceivedValue( receivedValue === undefined ? "undefined" : JSON.stringify(receivedValue), @@ -77,7 +109,7 @@ export function reportErrors( if (defaultUsed) { message.push( indent( - `(used default of ${cyan( + `(used default of ${formatDefaultValue( defaultValue === undefined ? "undefined" : JSON.stringify(defaultValue), @@ -91,7 +123,7 @@ export function reportErrors( }, ); - return `${red( + return `${formatHeader( "Errors found while parsing environment:", )}\n${formattedErrors.join("\n\n")}\n`; } diff --git a/src/util/dummy-colors.ts b/src/util/dummy-colors.ts deleted file mode 100644 index 6eed0bd..0000000 --- a/src/util/dummy-colors.ts +++ /dev/null @@ -1,10 +0,0 @@ -// These exports mirror the exports in its sibling file, `tty-colors.ts`. It -// exists to provide compatibility with environments where the `tty` module -// isn't available. - -export const red = String; -export const green = String; -export const yellow = String; -export const blue = String; -export const magenta = String; -export const cyan = String; From 01ddc9602030d0ce3193869d72968a731cb094ad Mon Sep 17 00:00:00 2001 From: lostfictions Date: Fri, 15 Dec 2023 20:59:29 -0500 Subject: [PATCH 7/8] more comments --- src/index.ts | 3 +++ src/parse-env.ts | 5 +++++ src/reporter.ts | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/src/index.ts b/src/index.ts index 7f56964..f6319bb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,9 @@ export * from "./extra-schemas.js"; import { parseEnvImpl, type ParseEnv } from "./parse-env.js"; import { cyan, green, red, yellow } from "./util/tty-colors.js"; +// This entrypoint provides a colorized reporter by default; this requires tty +// detection, which in turn relies on Node's built-in `tty` module. + /** * Parses the passed environment object using the provided map of Zod schemas * and returns the immutably-typed, parsed environment. diff --git a/src/parse-env.ts b/src/parse-env.ts index 1ef8b4e..b1f0a85 100644 --- a/src/parse-env.ts +++ b/src/parse-env.ts @@ -115,6 +115,11 @@ export type ParseEnv = ( /** * Parses the passed environment object using the provided map of Zod schemas * and returns the immutably-typed, parsed environment. + * + * This version of `parseEnv` is intended for internal use and requires a + * reporter or token formatters to be passed in. The versions exported in + * `index.js` and `compat.js` provide defaults for this third parameter, making + * it optional. */ export function parseEnvImpl( env: Record, diff --git a/src/reporter.ts b/src/reporter.ts index df7d14b..42c5c19 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -17,10 +17,15 @@ export const errorMap: ZodErrorMap = (issue, ctx) => { }; export interface ErrorWithContext { + /** The env var name. */ key: string; + /** The actual value present in `process.env[key]`, or undefined. */ receivedValue: unknown; + /** `ZodError` if Zod parsing failed, or `Error` if a preprocessor threw. */ error: unknown; + /** If a default was provided, whether the default value was used. */ defaultUsed: boolean; + /** If a default was provided, the given default value. */ defaultValue: unknown; } From 46292911eb5ac26c844ea452b3706302236ad02a Mon Sep 17 00:00:00 2001 From: lostfictions Date: Fri, 15 Dec 2023 20:59:34 -0500 Subject: [PATCH 8/8] further amend readme --- README.md | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff749ea..1ff0e55 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,12 @@ optionally provide defaults (which can be matched against `NODE_ENV` values like `production` or `development`), as well as help strings that will be included in the error thrown when an env var is missing. +## Features + +- No dependencies +- Fully type-safe +- Compatible with serverless environments (import `znv/compat` instead of `znv`) + ## Status Unstable: znv has not yet hit v1.0.0, and per semver there may be breaking @@ -31,7 +37,7 @@ about final API design are welcome. - [Quickstart](#quickstart) - [Motivation](#motivation) - [Usage](#usage) - - [`parseEnv`](#parseenvenvironment-schemas) + - [`parseEnv`](#parseenvenvironment-schemas-reporterOrFormatters) - [Extra schemas](#extra-schemas) - [Coercion rules](#coercion-rules) - [Comparison to other libraries](#comparison-to-other-libraries) @@ -202,7 +208,7 @@ environments is not straightforward. ## Usage -### `parseEnv(environment, schemas)` +### `parseEnv(environment, schemas, reporterOrFormatters?)` Parse the given `environment` using the given `schemas`. Returns a read-only object that maps the keys of the `schemas` object to their respective parsed @@ -211,6 +217,13 @@ values. Throws if any schema fails to parse its respective env var. The error aggregates all parsing failures for the schemas. +Optionally, you can pass a custom error reporter as the third parameter to +`parseEnv` to customize how errors are displayed. The reporter is a function +that receives error details and returns a `string`. Alternately, you can pass an +object of _token formatters_ as the third parameter to `parseEnv`; this can be +useful if you want to retain the default error reporting format but want to +customize some aspects of it (for example, by redacting secrets). + #### `environment: Record` You usually want to pass in `process.env` as the first argument. @@ -310,6 +323,66 @@ pass a `DetailedSpec` object that has the following fields: `NODE_ENV: z.enum(["production", "development", "test", "ci"])` to enforce that `NODE_ENV` is always defined and is one of those four expected values. +#### `reporterOrFormatters?: Reporter | TokenFormatters` + +An optional error reporter or object of error token formatters, for customizing +the displayed output when a validation error occurs. + +- `Reporter: (errors: ErrorWithContext[], schemas: Schemas) => string` + + A reporter is a function that takes a list of errors and the schemas you + passed to `parseEnv` and returns a `string`. Each error has the following + format: + + ```ts + { + /** The env var name. */ + key: string; + /** The actual value present in `process.env[key]`, or undefined. */ + receivedValue: unknown; + /** `ZodError` if Zod parsing failed, or `Error` if a preprocessor threw. */ + error: unknown; + /** If a default was provided, whether the default value was used. */ + defaultUsed: boolean; + /** If a default was provided, the given default value. */ + defaultValue: unknown; + } + ``` + +- `TokenFormatters` + + An object with the following structure: + + ```ts + { + /** Formatter for the env var name. */ + formatVarName?: (key: string) => string; + + /** For parsed objects with errors, formatter for object keys. */ + formatObjKey?: (key: string) => string; + + /** Formatter for the actual value we received for the env var. */ + formatReceivedValue?: (val: unknown) => string; + + /** Formatter for the default value provided for the schema. */ + formatDefaultValue?: (val: unknown) => string; + + /** Formatter for the error summary header. */ + formatHeader?: (header: string) => string; + } + ``` + + For example, if you want to redact value names, you can invoke `parseEnv` like + this: + + ```ts + export const { SOME_VAL } = parseEnv( + process.env, + { SOME_VAL: z.number().nonnegative() }, + { formatReceivedValue: () => "" }, + ); + ``` + ### Extra schemas znv exports a very small number of extra schemas for common env var types.