Skip to content

Commit 0cc9d4c

Browse files
authored
feat(deps): @npmcli/config@3.0.0 - introduce automatic workspace roots (#4372)
1 parent 8732f39 commit 0cc9d4c

10 files changed

Lines changed: 230 additions & 102 deletions

File tree

node_modules/@npmcli/config/lib/env-replace.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
const envExpr = /(\\*)\$\{([^}]+)\}/g
44

55
module.exports = (f, env) => f.replace(envExpr, (orig, esc, name) => {
6-
const val = env[name] !== undefined ? env[name] : `\$\{${name}\}`
6+
const val = env[name] !== undefined ? env[name] : `$\{${name}}`
77

88
// consume the escape chars that are relevant.
9-
if (esc.length % 2)
9+
if (esc.length % 2) {
1010
return orig.substr((esc.length + 1) / 2)
11+
}
1112

1213
return (esc.substr(esc.length / 2)) + val
1314
})

0 commit comments

Comments
 (0)