From ef7de4ada8fce0bb9ec1cd74e505dec5054136af Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Fri, 24 Jul 2026 00:08:55 -0700 Subject: [PATCH] Apply type narrowing to `decrypt` Same logic applies, just forgot to do this in 8374efadfc751aa2a5db43cff96109ffb230690b --- src/command.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/command.js b/src/command.js index 454e06f..b4d4973 100644 --- a/src/command.js +++ b/src/command.js @@ -121,6 +121,7 @@ export async function decrypt(options = {}, { args = [] } = {}) { logger = {} } = options; + /** @type {Record} */ const env = await readFile(inFile, { encoding: 'utf-8' }).then(parseEnv); logger.debug?.('Environment variables read and parsed.'); if (Object.keys(env).length === 0) { @@ -131,12 +132,6 @@ export async function decrypt(options = {}, { args = [] } = {}) { let prf = null; /** @type {Env} */const decryptedEnv = {}; for (const [envVar, value] of Object.entries(env)) { - if (value === undefined) { - logger.info?.(`Environment variable "${envVar}" is unset, skipping decryption.`); - decryptedEnv[envVar] = ''; - continue; - } - const parsedValue = parseEnvpassEncrypted(value); if (parsedValue === null) { decryptedEnv[envVar] = value; -- 2.47.3