From 552b640a0cc401399c06f4ecc6714fedef78f520 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Wed, 14 Feb 2024 13:13:22 -0500 Subject: [PATCH] Build --- dist/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9f81554..e18cd05 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8,14 +8,14 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.envsubst = void 0; -const REGEXP = new RegExp("\\$\\{?([A-Z_]+)\\}?"); +const REGEXP = new RegExp("\\$([A-Z_]+)|\\$\\{([A-Z_]+)\\}"); +function replacer(_match, p1, p2) { + return process.env[p2 ?? p1] ?? ""; +} function envsubst(str) { return str.replace(REGEXP, replacer); } exports.envsubst = envsubst; -function replacer(_match, k) { - return process.env[k] ?? ""; -} /***/ }),