Changelog - 2026-09-12
A blank env line no longer beats its default at module load
FixIn one line. Ten framework constants read process.env directly with ??, which an empty string walks straight past. A blank line now means "use the default".
ts
// APP_ENV_APPLICATION_TIMEZONE= (present, empty)
// before: '' after: 'Asia/Ho_Chi_Minh'What changed
APPLICATION_ENV_PREFIX=empty is safe. The prefix became'', every name matched, and the environment map held the whole ofprocess.env. Boot then failed on the first unrelated empty system variable, andapplicationEnvironment.keys()published the names of every host secret.- Ten reads fixed. In
@venizia/ignis-helpers:APPLICATION_ENV_PREFIX,APP_ENV_APPLICATION_TIMEZONE, and five winston plus one pino logger settings. In@venizia/ignis:APP_ENV_APPLICATION_NAMEand every name the startup banner prints. blankToUndefined. New, exported from the root barrel and from@venizia/ignis-helpers/core. It answersundefinedforundefined,''and whitespace, and a trimmed string otherwise. Prefer it to||, which also swallows'0'.
ts
import { blankToUndefined } from '@venizia/ignis-helpers/core';
const host = blankToUndefined(process.env.APP_ENV_REDIS_HOST) ?? 'localhost';applicationEnvironment.get(key, { defaultValue }) already treats a blank line as missing and needs no wrapper.
Who is affected
- You leave these names unset. Nothing changes.
- A deployment of yours sets one of them to empty. You now get the documented default instead of a blank.
- You set
APPLICATION_ENV_PREFIXto a real prefix. Unchanged.