Skip to content

Commit

Permalink
feat(deps): @npmcli/config@3.0.0 - introduce automatic workspace roots (
Browse files Browse the repository at this point in the history
  • Loading branch information
nlf committed Feb 7, 2022
1 parent 8732f39 commit 0cc9d4c
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 102 deletions.
5 changes: 3 additions & 2 deletions node_modules/@npmcli/config/lib/env-replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
const envExpr = /(\\*)\$\{([^}]+)\}/g

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

// consume the escape chars that are relevant.
if (esc.length % 2)
if (esc.length % 2) {
return orig.substr((esc.length + 1) / 2)
}

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

0 comments on commit 0cc9d4c

Please sign in to comment.