[ Root System Explorer ]
Location:
Root
/
opt
/
alt
/
alt-nodejs20
/
root
/
usr
/
lib
/
node_modules
/
npm
/
node_modules
/
@npmcli
/
package-json
/
lib
+ Folder
+ File
Upload
Editing: update-workspaces.js
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
SAVE CHANGES
[ CANCEL ]
Name
Type
Actions
.. (Parent Directory)
📄 index.js
FILE
Ren
[EDIT]
DEL
📄 normalize.js
FILE
Ren
[EDIT]
DEL
📄 read-package.js
FILE
Ren
[EDIT]
DEL
📄 update-dependencies.js
FILE
Ren
[EDIT]
DEL
📄 update-scripts.js
FILE
Ren
[EDIT]
DEL
📄 update-workspaces.js
FILE
Ren
[EDIT]
DEL