File Explorer

/var/lang/lib/node_modules/npm/node_modules/@npmcli/package-json/lib

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 /.

update-workspaces.js626 B · 27 lines
const updateWorkspaces = ({ content, originalContent = {} }) => {  const newWorkspaces = content.workspaces   if (!newWorkspaces) {    return originalContent  }   // validate workspaces content being appended  const hasInvalidWorkspaces = () =>    newWorkspaces.some(w => !(typeof w === 'string'))  if (!newWorkspaces.length || hasInvalidWorkspaces()) {    throw Object.assign(      new TypeError('workspaces should be an array of strings.'),      { code: 'EWORKSPACESINVALID' }    )  }   return {    ...originalContent,    workspaces: [      ...newWorkspaces,    ],  }} module.exports = updateWorkspaces