import coerceRecordTypes from './utils/coerce-record-types'; import { registerAs } from '@nestjs/config'; import { z } from 'zod'; export const localSchema = z.object({ production: z.boolean(), port: z.number().optional(), }); export type LocalConfig = z.infer; export const localConfig = registerAs('local', () => { const env = coerceRecordTypes(process.env); const config: LocalConfig = localSchema.strict().parse({ production: env['PRODUCTION'], port: env['PORT'], }); return config; });