File Explorer

/proc/4/root/var/lang/lib/node_modules/npm/node_modules/pacote/lib/util

This explorer reads the filesystem of the server it runs on, so /workspace/user isn't present here. Browsing and the terminal still work against this server's own disk from /.

add-git-sha.js602 B · 19 lines
// add a sha to a git remote url specconst 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    // strip the committish with indexOf/slice to avoid a regexp redos    const hashIndex = spec.rawSpec.indexOf('#')    const base = hashIndex === -1 ? spec.rawSpec : spec.rawSpec.slice(0, hashIndex)    return `${base}#${sha}`  }} module.exports = addGitSha