Releases: dwightjack/vue-types
Releases · dwightjack/vue-types
[email protected]
[email protected]
[email protected]
See the changelog.
[email protected]
[email protected]
[email protected]
[email protected]
v5.0.2
v5.0.1
Note: v5.0.0 has been skipped due to an internal bug. Please use v5.0.1 or above.
Breaking Changes
Default for booleans
bool().def(undefined)
explicitly sets the default: undefined
property on the type instead of removing it (#284):
const type = bool().def(true) // { type: Boolean, default: true }
// vue-types@4
type.def(undefined)// { type: Boolean }
// vue-types@5
type.def(undefined)// { type: Boolean, default: undefined }
Nullable strict validation
nullable
validates only when a prop value is === null
. This change makes it easier to use it with other validators like oneOfType
.
oneOfType
and oneOf
strict validation
When passed a oneOf
validator, oneOfType
checks the actual values instead of their types.
const type = oneOfType([oneOf(['auto', 'fit-content'] as const), Number]);
// vue-types@4
typeof type === string | number
// @vue-types@5
typeof type === 'auto' | 'fit-content' | number
This makes it easier to define complex validators mixing specific values and generic types.
Standalone Nuxt module
Nuxt support has been moved to a dedicated module: vue-types-nuxt
including support for both Nuxt@2 and Nuxt@3. See the usage documentation here: https://dwightjack.github.io/vue-types/guide/installation.html#nuxt
Minor Changes
oneOf
supportsnull
as a value:oneOf(['on', 'off', null])
- Support for union types in
oneOf
(#147)
Other Changes and Notes
- Documentation migrated to VitePress.
- Repository structure converted to an NPM monorepo.