PHP 8.2.30
Preview: make-error.js Size: 861 B
//opt/alt/alt-nodejs20/root/lib/node_modules/npm/node_modules.bundled/@npmcli/git/lib/make-error.js

const {
  GitConnectionError,
  GitPathspecError,
  GitUnknownError,
} = require('./errors.js')

const connectionErrorRe = new RegExp([
  'remote error: Internal Server Error',
  'The remote end hung up unexpectedly',
  'Connection timed out',
  'Operation timed out',
  'Failed to connect to .* Timed out',
  'Connection reset by peer',
  'SSL_ERROR_SYSCALL',
  'The requested URL returned error: 503',
].join('|'))

const missingPathspecRe = /pathspec .* did not match any file\(s\) known to git/

function makeError (er) {
  const message = er.stderr
  let gitEr
  if (connectionErrorRe.test(message)) {
    gitEr = new GitConnectionError(message)
  } else if (missingPathspecRe.test(message)) {
    gitEr = new GitPathspecError(message)
  } else {
    gitEr = new GitUnknownError(message)
  }
  return Object.assign(gitEr, er)
}

module.exports = makeError

Directory Contents

Dirs: 0 × Files: 13

Name Size Perms Modified Actions
4.82 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
579 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
316 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
242 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
222 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
216 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
3.97 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
861 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
1.58 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
652 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
1.27 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
109 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
339 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download

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