UNPKG

@dotenv-run/core

Version:

core library to load environment variables with monorepo support

34 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.build = void 0; function build(processEnv, runtime, globalVar, define) { const values = Object.keys(processEnv).reduce((env, key) => { const value = runtime ? `globalThis.${globalVar}.${key}` : JSON.stringify(processEnv[key]); env.raw[key] = processEnv[key]; env.stringified[key] = value; env.full[`process.env.${key}`] = value; env.full[`import.meta.env.${key}`] = value; return env; }, { raw: {}, stringified: define ? { [define]: runtime ? `globalThis.${globalVar}` : JSON.stringify(processEnv), } : {}, full: define ? { [define]: runtime ? `globalThis.${globalVar}` : JSON.stringify(processEnv), } : {}, }); return values; } exports.build = build; //# sourceMappingURL=build.js.map