The base config's declared Vars (legacy, no-schema path).
The base config's declared Env.
The base config's schema type (or undefined).
The override's declared Env (defaults to BaseEnv).
The override's schema type (or undefined).
The base config to extend.
Optionalschema?: BaseSchemaThe base config's Zod object schema (or any safeParse-shaped validator).
Optionaloverrides: Omit<An optional override slice; dynamic functions here
are typed with the merged schema's input (base and override variables
alike).
Optionaldynamic?: DynamicMap<OptionalenvVars?: Record<Deep-merged with the base's envVars (override wins on a clash).
Optionalschema?: OverrideSchemaExtends the base schema (override wins on a clash); see the merge table above.
Optionalvars?: Partial<MergedGetDotenvVars<BaseSchema, OverrideSchema, BaseVars, OverrideVars>>Deep-merged with the base's vars (override wins on a clash).
A new, typed config document with the merge semantics above applied.
The merged schema; see the merge table above.
Extend a base getdotenv config document with an override slice, returning a new typed config. Neither
basenoroverridesis mutated (#96).Merge semantics, by key:
schemadynamicrequiredKeysplugins,rootOptionDefaults,rootOptionVisibility,scripts,vars,envVars(plain objects)defaultsDeepsemantics).The override's
dynamicfunctions are typed against the merged schema's input, so they see both base and override variables. CallingextendGetDotenvConfig(base)with no overrides returns an equivalent config (a new object, structurally the same asbase).