Skip to content

Commit fc8f0ad

Browse files
committed
Make nodejsPlatformTypes a set
1 parent ab20c2a commit fc8f0ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/commands/cdxgen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const {
2424
const toLower = (arg: string) => arg.toLowerCase()
2525
const arrayToLower = (arg: string[]) => arg.map(toLower)
2626

27-
const nodejsPlatformTypes = [
27+
const nodejsPlatformTypes = new Set([
2828
'javascript',
2929
'js',
3030
'nodejs',
@@ -33,7 +33,7 @@ const nodejsPlatformTypes = [
3333
'ts',
3434
'tsx',
3535
'typescript'
36-
]
36+
])
3737

3838
const yargsConfig = {
3939
configuration: {
@@ -168,7 +168,7 @@ export const cdxgen: CliSubcommand = {
168168
let cleanupPackageLock = false
169169
if (
170170
yargv.type !== 'yarn' &&
171-
nodejsPlatformTypes.includes(yargv.type) &&
171+
nodejsPlatformTypes.has(yargv.type) &&
172172
existsSync('./yarn.lock')
173173
) {
174174
if (existsSync('./package-lock.json')) {

0 commit comments

Comments
 (0)