PHP 8.2.30
Preview: env-replace.js Size: 414 B
//opt/alt/alt-nodejs20/root/lib/node_modules/npm/node_modules/@npmcli/config/lib/env-replace.js

// replace any ${ENV} values with the appropriate environ.

const envExpr = /(?<!\\)(\\*)\$\{([^${}]+)\}/g

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

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

  return (esc.slice(esc.length / 2)) + val
})

Directory Contents

Dirs: 1 × Files: 9

Name Size Perms Modified Actions
- drwxr-xr-x 2026-03-14 07:02:08
Edit Download
414 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
707 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
28.21 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
455 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
2.18 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
3.38 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
1.36 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
574 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
914 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).