Skip to content

Commit d1f38c9

Browse files
committed
fix: ensure showTypesInInstall returns boolean
1 parent 36519cb commit d1f38c9

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

app/composables/useInstallCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function useInstallCommand(
1515

1616
// Check if we should show @types in install command
1717
const showTypesInInstall = computed(() => {
18-
return settings.value.includeTypesInInstall && toValue(typesPackageName)
18+
return settings.value.includeTypesInInstall && !!toValue(typesPackageName)
1919
})
2020

2121
const installCommandParts = computed(() => {

test/nuxt/composables/use-install-command.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,9 @@ describe('useInstallCommand', () => {
214214
})
215215

216216
it('should only include main command when @types disabled via settings', () => {
217-
// Pre-set the settings to disable types
218-
localStorage.setItem(
219-
'npmx-settings',
220-
JSON.stringify({ relativeDates: false, includeTypesInInstall: false }),
221-
)
217+
// Get settings and disable includeTypesInInstall directly
218+
const { settings } = useSettings()
219+
settings.value.includeTypesInInstall = false
222220

223221
const { fullInstallCommand, showTypesInInstall } = useInstallCommand(
224222
'express',

0 commit comments

Comments
 (0)