Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/workspaces/get-workspaces.js')
-rw-r--r--lib/workspaces/get-workspaces.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/workspaces/get-workspaces.js b/lib/workspaces/get-workspaces.js
index 3eb8e4865..91b007455 100644
--- a/lib/workspaces/get-workspaces.js
+++ b/lib/workspaces/get-workspaces.js
@@ -5,16 +5,11 @@ const rpj = require('read-package-json-fast')
// Returns an Map of paths to workspaces indexed by workspace name
// { foo => '/path/to/foo' }
-const getWorkspaces = async (filters, { path, includeWorkspaceRoot }) => {
+const getWorkspaces = async (filters, { path }) => {
// TODO we need a better error to be bubbled up here if this rpj call fails
const pkg = await rpj(resolve(path, 'package.json'))
const workspaces = await mapWorkspaces({ cwd: path, pkg })
- let res = new Map()
- if (includeWorkspaceRoot)
- res.set(pkg.name, path)
-
- if (!filters.length)
- res = new Map([...res, ...workspaces])
+ const res = filters.length ? new Map() : workspaces
for (const filterArg of filters) {
for (const [workspaceName, workspacePath] of workspaces.entries()) {