UNPKG

@tsed/config

Version:
14 lines (13 loc) 422 B
import { jsonParse } from "../../utils/jsonParse.js"; export class EnvsConfigSource { getAll() { const { parseJson = true } = this.options; return Object.entries(process.env).reduce((obj, [key, value]) => { const formattedValue = parseJson ? jsonParse(value) : value; return { ...obj, [key]: formattedValue }; }, {}); } }