Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const add = new Command()
"add",
packageManager === "deno" ? "--npm" : "",
...item.dependencies,
], { cwd });
].filter(Boolean), { cwd });
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, though a conditional spread (...(packageManager === "deno" ? ["--npm"] : [])) is safer since it only targets the intended argument rather than silently filtering out any falsy values in item.dependencies too.

}
}

Expand Down