@dotenvx/primitives 0.9.0 → 0.11.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.
Files changed (2) hide show
  1. package/dist/index.cjs +15 -1
  2. 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;
@@ -6296,12 +6308,14 @@ var require_parse = __commonJS({
6296
6308
  function parse2(src, options = {}) {
6297
6309
  const overload = options.overload;
6298
6310
  const processEnv = options.processEnv || process.env;
6311
+ const fk = options.fk;
6312
+ const provider = options.provider;
6299
6313
  const publicKeyHexes = publickeys2(src);
6300
6314
  let ring = {};
6301
6315
  for (const publicKeyHex of publicKeyHexes) {
6302
6316
  ring[publicKeyHex] = "";
6303
6317
  }
6304
- ring = keyring2({ processEnv, ring });
6318
+ ring = keyring2({ processEnv, ring, fk, provider });
6305
6319
  function inProcessEnv(name) {
6306
6320
  return Object.prototype.hasOwnProperty.call(processEnv, name);
6307
6321
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.9.0",
2
+ "version": "0.11.0",
3
3
  "name": "@dotenvx/primitives",
4
4
  "description": "a secure dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",