Releases: CatchMe2/envase
Releases · CatchMe2/envase
v1.3.0
What's Changed
- Implement createConfig by @kibertoad in #17
New Contributors
- @kibertoad made their first contribution in #17
✨ Added
createConfig — Typed computed configuration values
- Introduced
createConfig, a new helper that builds onparseEnvto support computed (derived) configuration values. - Computed values:
- Are calculated after schema validation
- Receive the fully parsed and typed config (not raw strings)
- Support flat and deeply nested structures
- Are deep-merged with the parsed schema output
- Full TypeScript type inference for:
- Parsed environment variables
- Computed values (including nested and mixed structures)
- Computed functions are skipped if schema validation fails, ensuring safety and correctness.
const config = createConfig(process.env, {
schema: {
db: {
host: envvar('DB_HOST', z.string()),
port: envvar('DB_PORT', z.coerce.number()),
},
},
computed: {
dbUrl: (raw) => `${raw.db.host}:${raw.db.port}`,
},
});
**Full Changelog**: https://github.com/CatchMe2/envase/compare/v1.2.2...v1.3.0