Skip to content

Commit

Permalink
Make nodejsPlatformTypes a set
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Dec 2, 2024
1 parent ab20c2a commit fc8f0ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commands/cdxgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const {
const toLower = (arg: string) => arg.toLowerCase()
const arrayToLower = (arg: string[]) => arg.map(toLower)

const nodejsPlatformTypes = [
const nodejsPlatformTypes = new Set([
'javascript',
'js',
'nodejs',
Expand All @@ -33,7 +33,7 @@ const nodejsPlatformTypes = [
'ts',
'tsx',
'typescript'
]
])

const yargsConfig = {
configuration: {
Expand Down Expand Up @@ -168,7 +168,7 @@ export const cdxgen: CliSubcommand = {
let cleanupPackageLock = false
if (
yargv.type !== 'yarn' &&
nodejsPlatformTypes.includes(yargv.type) &&
nodejsPlatformTypes.has(yargv.type) &&
existsSync('./yarn.lock')
) {
if (existsSync('./package-lock.json')) {
Expand Down

0 comments on commit fc8f0ad

Please sign in to comment.