vue-types

Vue Prop Types definitions

MIT License

Downloads
394.6K
Stars
551
Committers
18

Bot releases are visible (Hide)

vue-types - [email protected] Latest Release

Published by dwightjack 3 months ago

See changelog.

vue-types - [email protected]

Published by dwightjack 3 months ago

See changelog.

vue-types - [email protected]

Published by dwightjack 6 months ago

See the changelog.

vue-types - [email protected]

Published by dwightjack about 1 year ago

See changelog.

vue-types - [email protected]

Published by dwightjack over 1 year ago

vue-types - [email protected]

Published by dwightjack over 1 year ago

vue-types - [email protected]

Published by dwightjack over 1 year ago

vue-types - v5.0.2

Published by dwightjack almost 2 years ago

Fix

  • expose the validateType function in the shim build (fixes #319)
vue-types - v5.0.1

Published by dwightjack almost 2 years ago

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 (https://github.com/dwightjack/vue-types/issues/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 supports null 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.
vue-types - v4.2.1

Published by dwightjack about 2 years ago

Bugfix Release

vue-types - v4.2.0

Published by dwightjack about 2 years ago

Main Changes

Other Changes

New Contributors

Full Changelog: https://github.com/dwightjack/vue-types/compare/4.1.1...4.2.0

vue-types - v4.2.0-rc.1

Published by dwightjack over 2 years ago

  • Add the nullable validator (#215)
vue-types - v4.1.1

Published by dwightjack about 3 years ago

Bugfix Release

vue-types - v4.1.1-rc.1

Published by dwightjack about 3 years ago

BugFix

  • fix oneOfType regression (#188)
vue-types - v4.1.1-rc.0

Published by dwightjack about 3 years ago

Bugfix

vue-types - v4.1.0

Published by dwightjack about 3 years ago

Minor Changes

  • Added TypeScript casting on the following validators (#135 , #138 , #136):
    • string
    • number / integer
    • any
    • oneOfType
  • Added dedicated TS documentation

Thanks to @victorgarciaesgi for the great contribution.

vue-types - v4.1.0-rc.1

Published by dwightjack about 3 years ago

Features

  • Add TypeScript casting on the following validators (#135 , #138 , #136):
    • string
    • number / integer
    • any
    • oneOfType
  • Add dedicated TS documentation

Thanks to @victorgarciaesgi for the great contribution.

vue-types - v4.0.3

Published by dwightjack about 3 years ago

Bugfix

  • Shim: validators generated with customType cannot be called multiple times because of redefine issue (#162 thanks @iamricogo)
vue-types - v4.0.2

Published by dwightjack about 3 years ago

Bugfix

vue-types - v4.0.1

Published by dwightjack about 3 years ago

Bugfix

Package Rankings
Top 6.69% on Proxy.golang.org
Top 1.61% on Npmjs.org
Top 31.99% on Repo1.maven.org
Related Projects