@dotenvx/next-env 2.2.0 → 2.2.1

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 +59 -48
  2. package/package.json +2 -2
package/dist/index.cjs CHANGED
@@ -5965,8 +5965,8 @@ var require_dist = __commonJS({
5965
5965
  const processEnv2 = options.processEnv || process.env;
5966
5966
  const runningParsed = options.runningParsed || {};
5967
5967
  const matches = value.match(/\$\(([^)]+(?:\)[^(]*)*)\)/g) || [];
5968
- return matches.reduce((newValue, match) => {
5969
- const command = match.slice(2, -1);
5968
+ return matches.reduce((newValue, match2) => {
5969
+ const command = match2.slice(2, -1);
5970
5970
  let result;
5971
5971
  try {
5972
5972
  result = execSync(command, { env: { ...processEnv2, ...runningParsed } }).toString();
@@ -5974,7 +5974,7 @@ var require_dist = __commonJS({
5974
5974
  throw new Errors({ command, message: e.message.trim() }).commandSubstitutionFailed();
5975
5975
  }
5976
5976
  result = chomp(result);
5977
- return newValue.replace(match, result);
5977
+ return newValue.replace(match2, result);
5978
5978
  }, value);
5979
5979
  }
5980
5980
  module22.exports = evaluate2;
@@ -5993,9 +5993,9 @@ var require_dist = __commonJS({
5993
5993
  }
5994
5994
  const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
5995
5995
  let result = value;
5996
- let match;
5997
- while ((match = regex.exec(result)) !== null) {
5998
- const [template, bracedExpression, unbracedExpression] = match;
5996
+ let match2;
5997
+ while ((match2 = regex.exec(result)) !== null) {
5998
+ const [template, bracedExpression, unbracedExpression] = match2;
5999
5999
  const expression = bracedExpression || unbracedExpression;
6000
6000
  const opRegex = /(:\+|\+|:-|-)/;
6001
6001
  const opMatch = expression.match(opRegex);
@@ -6275,8 +6275,8 @@ var require_dist = __commonJS({
6275
6275
  return false;
6276
6276
  };
6277
6277
  exports22.removeBackslashes = (str) => {
6278
- return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
6279
- return match === "\\" ? "" : match;
6278
+ return str.replace(REGEX_REMOVE_BACKSLASH, (match2) => {
6279
+ return match2 === "\\" ? "" : match2;
6280
6280
  });
6281
6281
  };
6282
6282
  exports22.escapeLast = (input, char, lastIdx) => {
@@ -6821,11 +6821,11 @@ var require_dist = __commonJS({
6821
6821
  let index = 0;
6822
6822
  const chars = [];
6823
6823
  while (index < pattern.length) {
6824
- const match = parseRepeatedExtglob(pattern.slice(index), false);
6825
- if (!match || match.type !== "*") {
6824
+ const match2 = parseRepeatedExtglob(pattern.slice(index), false);
6825
+ if (!match2 || match2.type !== "*") {
6826
6826
  return;
6827
6827
  }
6828
- const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
6828
+ const branches = splitTopLevel(match2.body).map((branch2) => branch2.trim());
6829
6829
  if (branches.length !== 1) {
6830
6830
  return;
6831
6831
  }
@@ -6834,7 +6834,7 @@ var require_dist = __commonJS({
6834
6834
  return;
6835
6835
  }
6836
6836
  chars.push(branch);
6837
- index += match.end + 1;
6837
+ index += match2.end + 1;
6838
6838
  }
6839
6839
  if (chars.length < 1) {
6840
6840
  return;
@@ -6845,11 +6845,11 @@ var require_dist = __commonJS({
6845
6845
  var repeatedExtglobRecursion = (pattern) => {
6846
6846
  let depth = 0;
6847
6847
  let value = pattern.trim();
6848
- let match = parseRepeatedExtglob(value);
6849
- while (match) {
6848
+ let match2 = parseRepeatedExtglob(value);
6849
+ while (match2) {
6850
6850
  depth++;
6851
- value = match.body.trim();
6852
- match = parseRepeatedExtglob(value);
6851
+ value = match2.body.trim();
6852
+ match2 = parseRepeatedExtglob(value);
6853
6853
  }
6854
6854
  return depth;
6855
6855
  };
@@ -7116,10 +7116,10 @@ var require_dist = __commonJS({
7116
7116
  push({ type: "text", value });
7117
7117
  continue;
7118
7118
  }
7119
- const match = /^\\+/.exec(remaining());
7119
+ const match2 = /^\\+/.exec(remaining());
7120
7120
  let slashes = 0;
7121
- if (match && match[0].length > 2) {
7122
- slashes = match[0].length;
7121
+ if (match2 && match2[0].length > 2) {
7122
+ slashes = match2[0].length;
7123
7123
  state.index += slashes;
7124
7124
  if (slashes % 2 !== 0) {
7125
7125
  value += "\\";
@@ -7404,10 +7404,10 @@ var require_dist = __commonJS({
7404
7404
  if (value === "$" || value === "^") {
7405
7405
  value = `\\${value}`;
7406
7406
  }
7407
- const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
7408
- if (match) {
7409
- value += match[0];
7410
- state.index += match[0].length;
7407
+ const match2 = REGEX_NON_SPECIAL_CHARS.exec(remaining());
7408
+ if (match2) {
7409
+ value += match2[0];
7410
+ state.index += match2[0].length;
7411
7411
  }
7412
7412
  push({ type: "text", value });
7413
7413
  continue;
@@ -7617,11 +7617,11 @@ var require_dist = __commonJS({
7617
7617
  case "**/.*":
7618
7618
  return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
7619
7619
  default: {
7620
- const match = /^(.*?)\.(\w+)$/.exec(str);
7621
- if (!match) return;
7622
- const source2 = create(match[1]);
7620
+ const match2 = /^(.*?)\.(\w+)$/.exec(str);
7621
+ if (!match2) return;
7622
+ const source2 = create(match2[1]);
7623
7623
  if (!source2) return;
7624
- return source2 + DOT_LITERAL + match[2];
7624
+ return source2 + DOT_LITERAL + match2[2];
7625
7625
  }
7626
7626
  }
7627
7627
  };
@@ -7670,8 +7670,8 @@ var require_dist = __commonJS({
7670
7670
  isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
7671
7671
  }
7672
7672
  const matcher = (input, returnObject = false) => {
7673
- const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
7674
- const result = { glob, state, regex, posix, input, output, match, isMatch };
7673
+ const { isMatch, match: match2, output } = picomatch.test(input, regex, options, { glob, posix });
7674
+ const result = { glob, state, regex, posix, input, output, match: match2, isMatch };
7675
7675
  if (typeof opts.onResult === "function") {
7676
7676
  opts.onResult(result);
7677
7677
  }
@@ -7705,20 +7705,20 @@ var require_dist = __commonJS({
7705
7705
  }
7706
7706
  const opts = options || {};
7707
7707
  const format = opts.format || (posix ? utils.toPosixSlashes : null);
7708
- let match = input === glob;
7709
- let output = match && format ? format(input) : input;
7710
- if (match === false) {
7708
+ let match2 = input === glob;
7709
+ let output = match2 && format ? format(input) : input;
7710
+ if (match2 === false) {
7711
7711
  output = format ? format(input) : input;
7712
- match = output === glob;
7712
+ match2 = output === glob;
7713
7713
  }
7714
- if (match === false || opts.capture === true) {
7714
+ if (match2 === false || opts.capture === true) {
7715
7715
  if (opts.matchBase === true || opts.basename === true) {
7716
- match = picomatch.matchBase(input, regex, options, posix);
7716
+ match2 = picomatch.matchBase(input, regex, options, posix);
7717
7717
  } else {
7718
- match = regex.exec(output);
7718
+ match2 = regex.exec(output);
7719
7719
  }
7720
7720
  }
7721
- return { isMatch: Boolean(match), match, output };
7721
+ return { isMatch: Boolean(match2), match: match2, output };
7722
7722
  };
7723
7723
  picomatch.matchBase = (input, glob, options) => {
7724
7724
  const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
@@ -7788,9 +7788,18 @@ var require_dist = __commonJS({
7788
7788
  module22.exports = picomatch;
7789
7789
  }
7790
7790
  });
7791
+ var require_match = __commonJS2({
7792
+ "src/match.js"(exports22, module22) {
7793
+ var picomatch = require_picomatch2();
7794
+ function match2(patterns, options) {
7795
+ return picomatch(patterns, options);
7796
+ }
7797
+ module22.exports = match2;
7798
+ }
7799
+ });
7791
7800
  var require_scan2 = __commonJS2({
7792
7801
  "src/scan.js"(exports22, module22) {
7793
- var picomatch = require_picomatch2();
7802
+ var createMatch = require_match();
7794
7803
  function list(value) {
7795
7804
  if (value === void 0 || value === null) {
7796
7805
  return [];
@@ -7843,21 +7852,21 @@ var require_dist = __commonJS({
7843
7852
  }
7844
7853
  const ik = list(options.ik);
7845
7854
  const ek = list(options.ek);
7846
- const include = picomatch(ik, { ignore: ek });
7847
- const exclude = picomatch(ek);
7855
+ const include = createMatch(ik, { ignore: ek });
7856
+ const exclude = createMatch(ek);
7848
7857
  const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
7849
7858
  const parsed = {};
7850
7859
  let lines = (src || "").toString();
7851
7860
  if (options.convertWindowsNewlines !== false) {
7852
7861
  lines = lines.replace(/\r\n?/mg, "\n");
7853
7862
  }
7854
- let match;
7855
- while ((match = LINE.exec(lines)) !== null) {
7856
- const name = match[1];
7863
+ let match2;
7864
+ while ((match2 = LINE.exec(lines)) !== null) {
7865
+ const name = match2[1];
7857
7866
  if (exclude(name) || ik.length > 0 && !include(name)) {
7858
7867
  continue;
7859
7868
  }
7860
- const raw = match[2];
7869
+ const raw = match2[2];
7861
7870
  const quote = getQuote(raw);
7862
7871
  const value = clean(raw, quote, options);
7863
7872
  let parsedValue = value;
@@ -8035,7 +8044,7 @@ var require_dist = __commonJS({
8035
8044
  var encrypted2 = require_encrypted();
8036
8045
  var evaluate2 = require_evaluate();
8037
8046
  var expand2 = require_expand();
8038
- var picomatch = require_picomatch2();
8047
+ var match2 = require_match();
8039
8048
  var publickeys2 = require_publickeys();
8040
8049
  var scan2 = require_scan2();
8041
8050
  function list(value) {
@@ -8118,8 +8127,8 @@ var require_dist = __commonJS({
8118
8127
  const processEnv2 = options.processEnv || process.env;
8119
8128
  const ring = options.ring || {};
8120
8129
  const publicKeyHexes = options.publicKeyHexes || [];
8121
- const include = picomatch(ik, { ignore: ek });
8122
- const exclude = picomatch(ek);
8130
+ const include = match2(ik, { ignore: ek });
8131
+ const exclude = match2(ek);
8123
8132
  function inProcessEnv(name) {
8124
8133
  return Object.prototype.hasOwnProperty.call(processEnv2, name);
8125
8134
  }
@@ -8243,7 +8252,7 @@ var require_dist = __commonJS({
8243
8252
  "^(\\s*)?(export\\s+)?" + escapedKey + "\\s*=\\s*([\"'`]?)" + escapedOriginalValue + "\\3" + enforceEndOfLine,
8244
8253
  "m"
8245
8254
  );
8246
- return src.replace(currentPart, function(match, spaces = "", exportPart = "", quote = "") {
8255
+ return src.replace(currentPart, function(match2, spaces = "", exportPart = "", quote = "") {
8247
8256
  let newPart = `${key}=${quote}${replaceValue}${quote}`;
8248
8257
  const newlineMatch = src.match(new RegExp(`${escapedKey}\\s*=\\s*
8249
8258
 
@@ -8297,6 +8306,7 @@ var require_dist = __commonJS({
8297
8306
  var keypair = require_keypair();
8298
8307
  var keyring = require_keyring();
8299
8308
  var keyringSync = require_keyring().sync;
8309
+ var match = require_match();
8300
8310
  var parse = require_parse2();
8301
8311
  var parseSync2 = require_parse2().sync;
8302
8312
  var publickeys = require_publickeys();
@@ -8313,6 +8323,7 @@ var require_dist = __commonJS({
8313
8323
  keypair,
8314
8324
  keyring,
8315
8325
  keyringSync,
8326
+ match,
8316
8327
  parse,
8317
8328
  parseSync: parseSync2,
8318
8329
  publickeys,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotenvx/next-env",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "dotenvx drop-in replacement for @next/env",
5
5
  "license": "BSD-3-Clause",
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  "prepublishOnly": "npm pack --dry-run"
24
24
  },
25
25
  "devDependencies": {
26
- "@dotenvx/primitives": "1.7.2",
26
+ "@dotenvx/primitives": "1.8.0",
27
27
  "esbuild": "^0.28.1"
28
28
  }
29
29
  }