diff --git a/package.json b/package.json index 1db37ab..4d550fe 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "chalk": "^5.0.0", "dedent": "^0.7.0", "dotenv-flow": "^3.2.0", - "envalid": "^7.2.2", + "envalid": "^7.3.0", "eslint": "^8.9.0", "execa": "^6.1.0", "fs-extra": "^10.0.0", diff --git a/src/scripts/4-results/generate-geosemantica-layer-styles.ts b/src/scripts/4-results/generate-geosemantica-layer-styles.ts index b6119ec..a327a2a 100644 --- a/src/scripts/4-results/generate-geosemantica-layer-styles.ts +++ b/src/scripts/4-results/generate-geosemantica-layer-styles.ts @@ -432,10 +432,8 @@ const script = async () => { output.write(` Done.\n`); const { COPY_TO_CLIPBOARD: layerStyleToCopy } = cleanEnv({ - COPY_TO_CLIPBOARD: envalid.str< - "background" | "buildings" | "foreground" | "" - >({ - choices: ["background", "buildings", "foreground", ""], + COPY_TO_CLIPBOARD: envalid.str({ + choices: ["background", "buildings", "foreground", ""] as const, default: "", }), }); diff --git a/src/scripts/4-results/generate-poster.ts b/src/scripts/4-results/generate-poster.ts index 0131535..0c34d37 100644 --- a/src/scripts/4-results/generate-poster.ts +++ b/src/scripts/4-results/generate-poster.ts @@ -33,8 +33,8 @@ const script = async () => { ); const { EXTENSION: extension } = cleanEnv({ - EXTENSION: envalid.str<"pdf" | "jpg" | "png">({ - choices: ["pdf", "jpg", "png"], + EXTENSION: envalid.str({ + choices: ["pdf", "jpg", "png"] as const, default: "pdf", }), }); diff --git a/src/shared/stage-results/get-locale-from-env.ts b/src/shared/stage-results/get-locale-from-env.ts index ac18921..be2897c 100644 --- a/src/shared/stage-results/get-locale-from-env.ts +++ b/src/shared/stage-results/get-locale-from-env.ts @@ -7,10 +7,10 @@ export type Locale = "en" | "ru"; export const getLocaleFromEnv = (): Locale => { const env = cleanEnv({ LOCALE: envalid.str({ + choices: ["ru", "en"] as const, default: "ru", - choices: ["ru", "en"], }), }); - return env.LOCALE as Locale; + return env.LOCALE; }; diff --git a/yarn.lock b/yarn.lock index 9e85be6..e136c4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3431,10 +3431,10 @@ entities@~2.1.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== -envalid@^7.2.2: - version "7.2.2" - resolved "https://registry.yarnpkg.com/envalid/-/envalid-7.2.2.tgz#f3219f85e692002dca0f28076740227d30c817e3" - integrity sha512-bl/3VF5PhoF26HlDWiE0NRRHUbKT/+UDP/+0JtOFmhUwK3cUPS7JgWYGbE8ArvA61T+SyNquxscLCS6y4Wnpdw== +envalid@^7.3.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/envalid/-/envalid-7.3.0.tgz#9d5eda789216cfdd8c55ff0d6fe30ddff38e52d5" + integrity sha512-RWAAXLU+s884YwbVQ+D8OYRIspo7hvF9zPTvjToVzqZknHwycAuGiiHG/XiI1UDY/PeYSlMwQvMUGb25n06iwA== dependencies: tslib "2.3.1"