yarn-changed-workspaces
Advanced tools
Comparing version 2.0.7 to 2.0.8
{ | ||
"name": "yarn-changed-workspaces", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"main": "./src/index.js", | ||
@@ -5,0 +5,0 @@ "bin": "./bin/cli.js", |
@@ -11,11 +11,13 @@ const _ = require("lodash"); | ||
}) => { | ||
const result = {}; | ||
const formatName = (str) => (keyNaming ? _[keyNaming](str) : str); | ||
const normalizeName = (str) => (namespace ? str.replace(namespace, "") : str); | ||
const workspaces = await getChangedWorkspaces({ branch, projectRoot }); | ||
return Object.entries(workspaces).reduce((obj, [id, files]) => { | ||
if (files.length <= 0) return obj; | ||
return { ...obj, [formatName(normalizeName(id))]: files }; | ||
}, {}); | ||
Object.entries(workspaces).map(([id, files]) => { | ||
if (files.length <= 0) return; | ||
result[formatName(normalizeName(id))] = files; | ||
}); | ||
return result; | ||
}; | ||
module.exports.getChangedWorkspacesIds = getChangedWorkspacesIds; |
23129
635