@dotenvx/primitives 0.9.0 → 0.10.0
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.
- package/dist/index.cjs +12 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6215,6 +6215,7 @@ var require_keyring = __commonJS({
|
|
|
6215
6215
|
}
|
|
6216
6216
|
function keyring2(options = {}) {
|
|
6217
6217
|
const ring = options.ring || {};
|
|
6218
|
+
const provider = options.provider;
|
|
6218
6219
|
const processEnv = options.processEnv || process.env;
|
|
6219
6220
|
const keysFilepaths = Array.isArray(options.fk) ? options.fk : [options.fk || ".env.keys"];
|
|
6220
6221
|
const privateKeyValues = keysFilepaths.reduce((acc, filepath) => {
|
|
@@ -6232,6 +6233,17 @@ var require_keyring = __commonJS({
|
|
|
6232
6233
|
} catch (_e) {
|
|
6233
6234
|
}
|
|
6234
6235
|
}
|
|
6236
|
+
if (typeof provider === "function") {
|
|
6237
|
+
for (const publicKeyHex in ring) {
|
|
6238
|
+
if (ring[publicKeyHex]) {
|
|
6239
|
+
continue;
|
|
6240
|
+
}
|
|
6241
|
+
const privateKeyHex = provider(publicKeyHex);
|
|
6242
|
+
if (privateKeyHex) {
|
|
6243
|
+
ring[publicKeyHex] = privateKeyHex;
|
|
6244
|
+
}
|
|
6245
|
+
}
|
|
6246
|
+
}
|
|
6235
6247
|
return ring;
|
|
6236
6248
|
}
|
|
6237
6249
|
module2.exports = keyring2;
|
package/package.json
CHANGED