PHP 8.2.30
Preview: add-git-sha.js Size: 427 B
/proc/self/root/opt/alt/alt-nodejs18/root/lib/node_modules/npm/node_modules/pacote/lib/util/add-git-sha.js

// add a sha to a git remote url spec
const addGitSha = (spec, sha) => {
  if (spec.hosted) {
    const h = spec.hosted
    const opt = { noCommittish: true }
    const base = h.https && h.auth ? h.https(opt) : h.shortcut(opt)

    return `${base}#${sha}`
  } else {
    // don't use new URL for this, because it doesn't handle scp urls
    return spec.rawSpec.replace(/#.*$/, '') + `#${sha}`
  }
}

module.exports = addGitSha

Directory Contents

Dirs: 0 × Files: 7

Name Size Perms Modified Actions
427 B lrw-r--r-- 2026-03-09 09:08:37
Edit Download
610 B lrw-r--r-- 2026-03-09 09:08:37
Edit Download
824 B lrw-r--r-- 2026-03-09 09:08:37
Edit Download
567 B lrw-r--r-- 2026-03-09 09:08:37
Edit Download
222 B lrw-r--r-- 2026-03-09 09:08:37
Edit Download
914 B lrw-r--r-- 2026-03-09 09:08:37
Edit Download
238 B lrw-r--r-- 2026-03-09 09:08:37
Edit Download

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