@karmaniverous/get-dotenv 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -89,17 +89,9 @@ const getDotenv = async function () {
|
|
|
89
89
|
if (dynamicPath && !excludeDynamic) {
|
|
90
90
|
const dynamic = new Function(`return ${(await _fsExtra.default.readFile(dynamicPath)).toString()}`)()(dotenv);
|
|
91
91
|
Object.keys(dynamic).forEach(key => {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
});
|
|
96
|
-
} catch ({
|
|
97
|
-
message
|
|
98
|
-
}) {
|
|
99
|
-
Object.assign(dotenv, {
|
|
100
|
-
[key]: `ERROR: ${message}`
|
|
101
|
-
});
|
|
102
|
-
}
|
|
92
|
+
Object.assign(dotenv, {
|
|
93
|
+
[key]: typeof dynamic[key] === 'function' ? dynamic[key](dotenv) : dynamic[key]
|
|
94
|
+
});
|
|
103
95
|
});
|
|
104
96
|
}
|
|
105
97
|
|
|
@@ -119,7 +111,23 @@ const getDotenv = async function () {
|
|
|
119
111
|
if (log) console.log(dotenv);
|
|
120
112
|
|
|
121
113
|
// Load process.env.
|
|
122
|
-
if (loadProcess) Object.assign(process.env, dotenv
|
|
114
|
+
if (loadProcess) Object.assign(process.env, dotenv, {
|
|
115
|
+
getdotenvOptions: JSON.stringify({
|
|
116
|
+
dotenvToken,
|
|
117
|
+
dynamicPath,
|
|
118
|
+
env,
|
|
119
|
+
excludeDynamic,
|
|
120
|
+
excludeEnv,
|
|
121
|
+
excludeGlobal,
|
|
122
|
+
excludePrivate,
|
|
123
|
+
excludePublic,
|
|
124
|
+
loadProcess,
|
|
125
|
+
log,
|
|
126
|
+
outputPath,
|
|
127
|
+
paths,
|
|
128
|
+
privateToken
|
|
129
|
+
})
|
|
130
|
+
});
|
|
123
131
|
return dotenv;
|
|
124
132
|
};
|
|
125
133
|
|
|
@@ -201,7 +209,7 @@ const getDotenvSync = function () {
|
|
|
201
209
|
|
|
202
210
|
// Load process.env.
|
|
203
211
|
if (loadProcess) Object.assign(process.env, dotenv, {
|
|
204
|
-
|
|
212
|
+
getdotenvOptions: JSON.stringify({
|
|
205
213
|
dotenvToken,
|
|
206
214
|
dynamicPath,
|
|
207
215
|
env,
|
|
@@ -99,11 +99,12 @@ export const getDotenv = async ({
|
|
|
99
99
|
`return ${(await fs.readFile(dynamicPath)).toString()}`
|
|
100
100
|
)()(dotenv);
|
|
101
101
|
Object.keys(dynamic).forEach((key) => {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
Object.assign(dotenv, {
|
|
103
|
+
[key]:
|
|
104
|
+
typeof dynamic[key] === 'function'
|
|
105
|
+
? dynamic[key](dotenv)
|
|
106
|
+
: dynamic[key],
|
|
107
|
+
});
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -128,7 +129,24 @@ export const getDotenv = async ({
|
|
|
128
129
|
if (log) console.log(dotenv);
|
|
129
130
|
|
|
130
131
|
// Load process.env.
|
|
131
|
-
if (loadProcess)
|
|
132
|
+
if (loadProcess)
|
|
133
|
+
Object.assign(process.env, dotenv, {
|
|
134
|
+
getdotenvOptions: JSON.stringify({
|
|
135
|
+
dotenvToken,
|
|
136
|
+
dynamicPath,
|
|
137
|
+
env,
|
|
138
|
+
excludeDynamic,
|
|
139
|
+
excludeEnv,
|
|
140
|
+
excludeGlobal,
|
|
141
|
+
excludePrivate,
|
|
142
|
+
excludePublic,
|
|
143
|
+
loadProcess,
|
|
144
|
+
log,
|
|
145
|
+
outputPath,
|
|
146
|
+
paths,
|
|
147
|
+
privateToken,
|
|
148
|
+
}),
|
|
149
|
+
});
|
|
132
150
|
|
|
133
151
|
return dotenv;
|
|
134
152
|
};
|
|
@@ -236,7 +254,7 @@ export const getDotenvSync = ({
|
|
|
236
254
|
// Load process.env.
|
|
237
255
|
if (loadProcess)
|
|
238
256
|
Object.assign(process.env, dotenv, {
|
|
239
|
-
|
|
257
|
+
getdotenvOptions: JSON.stringify({
|
|
240
258
|
dotenvToken,
|
|
241
259
|
dynamicPath,
|
|
242
260
|
env,
|