Improved
API pruning
Bug Fixes
- add originalValue to TestContext type (#1527) (fcc5ae7), closes /github.com/abnersajr/DefinitelyTyped/blob/a186d99d0c3a92424691a82130374a1b9145c7cd/types/yup/index.d.ts#L446
Unclaimed project
Are you a maintainer of yup? Claim this project to take control of your public changelog and roadmap.
Changelog
Dead simple Object schema validation
Last updated 6 days ago
mixed schema are no longer treated as the base class for other schema types. It hasn't been for a while, but we've done some nasty prototype slinging to make it behave like it was. Now typescript types should be 1 to 1 with the actual classes yup exposes.In general this should not affect anything unless you are extending (via addMethod or otherwise) mixed prototype.
import {
- mixed,
+ Schema,
} from 'yup';
- addMethod(mixed, 'method', impl)
+ addMethod(Schema, 'method', impl)
when() has been changed to make it easier to type. values are always passed as an array and schema, and options always the second and third argument. this is no longer set to the schema instance. and all functions must return a schema to be type safe string()
- .when('other', function (other) => {
- if (other) return this.required()
+ .when('other', ([other], schema) => {
+ return other ? schema.required() : schema
})
Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞
Interactive roadmaps, guides and other educational content to help developers grow in their careers.
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
The open source coding agent.