PATH: //lib/node_modules/npm/node_modules/@npmcli/package-json/lib
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 index.js
↓
X
📄 update-dependencies.js
↓
X
📄 update-scripts.js
↓
X
📄 update-workspaces.js
↓
X
SAVING...
BERHASIL DIUBAH!
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
SIMPAN PERUBAHAN