@tsed/config
Version:
Configuration management for Ts.ED
14 lines (13 loc) • 422 B
JavaScript
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
};
}, {});
}
}