Skip to content

Commit

Permalink
refactor: use magicast .includes helper (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelhdzdev authored Oct 30, 2023
1 parent 3cfb478 commit 3097dd3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/commands/module/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,10 @@ export default defineCommand({
if (!config.modules) {
config.modules = []
}
for (let i = 0; i < config.modules.length; i++) {
if (config.modules[i] === r.pkgName) {
consola.info(`\`${r.pkgName}\` is already in the \`modules\``)
return
}

if (config.modules.includes(r.pkgName)) {
consola.info(`\`${r.pkgName}\` is already in the \`modules\``)
return
}
consola.info(`Adding \`${r.pkgName}\` to the \`modules\``)
config.modules.push(r.pkgName)
Expand Down

0 comments on commit 3097dd3

Please sign in to comment.