Skip to content

Commit adc864c

Browse files
committed
Publish v1.0.0-beta.2
1 parent 89080b1 commit adc864c

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed

CHANGELOG.md

+79
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,82 @@
1+
# [1.0.0-beta.2](https://github.com/jquense/yup/compare/v0.32.11...v1.0.0-beta.2) (2022-01-21)
2+
3+
4+
### Bug Fixes
5+
6+
* add originalValue to TestContext type ([#1527](https://github.com/jquense/yup/issues/1527)) ([fcc5ae7](https://github.com/jquense/yup/commit/fcc5ae710a1b3ef4b799532291faf894bdbcc11b)), closes [/github.com/abnersajr/DefinitelyTyped/blob/a186d99d0c3a92424691a82130374a1b9145c7cd/types/yup/index.d.ts#L446](https://github.com//github.com/abnersajr/DefinitelyTyped/blob/a186d99d0c3a92424691a82130374a1b9145c7cd/types/yup/index.d.ts/issues/L446)
7+
8+
9+
* Merge next into master (#1547) ([366f7d8](https://github.com/jquense/yup/commit/366f7d8e280b021bbd7a4a4d3cfc8fa0cce00c8b)), closes [#1547](https://github.com/jquense/yup/issues/1547) [#1542](https://github.com/jquense/yup/issues/1542) [#1541](https://github.com/jquense/yup/issues/1541) [#1543](https://github.com/jquense/yup/issues/1543) [#1545](https://github.com/jquense/yup/issues/1545)
10+
11+
12+
### Features
13+
14+
* add Tuple type ([#1546](https://github.com/jquense/yup/issues/1546)) ([a8febdd](https://github.com/jquense/yup/commit/a8febddcfbe42358e63194ae8da582e66b746edf))
15+
16+
17+
### BREAKING CHANGES
18+
19+
* The function version of `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
20+
21+
```diff
22+
string()
23+
- .when('other', function (other) => {
24+
- if (other) return this.required()
25+
+ .when('other', ([other], schema) => {
26+
+ return other ? schema.required() : schema
27+
})
28+
```
29+
* concat works shallowly now. Previously concat functioned like a deep merge for object, which produced confusing behavior with incompatible concat'ed schema. Now concat for objects works similar to how it works for other types, the provided schema is applied on top of the existing schema, producing a new schema that is the same as calling each builder method in order
30+
31+
* docs: update readme
32+
33+
* chore: update to readonly arrays and test string type narrowing
34+
35+
* test: add boolean tests
36+
37+
* docs: more docs
38+
39+
* feat: allow mixed schema to specify type check
40+
* `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.
41+
42+
In general this should not affect anything unless you are extending (via `addMethod` or otherwise) `mixed` prototype.
43+
44+
```diff
45+
import {
46+
- mixed,
47+
+ Schema,
48+
} from 'yup';
49+
50+
- addMethod(mixed, 'method', impl)
51+
+ addMethod(Schema, 'method', impl)
52+
```
53+
54+
* chore: prep work for toggling coercion
55+
56+
* Publish v1.0.0-alpha.4
57+
58+
* chore: docs
59+
60+
* feat!: add json() method and remove default object/array coercion
61+
* object and array schema no longer parse JSON strings by default, nor do they return `null` for invalid casts.
62+
63+
```ts
64+
object().json().cast('{}')
65+
array().json().cast('[]')
66+
```
67+
to mimic the previous behavior
68+
69+
* feat: Make Array generic consistent with others
70+
* types only, `ArraySchema` initial generic is the array type not the type of the array element. `array<T>()` is still the inner type.
71+
72+
* Publish v1.0.0-beta.0
73+
74+
* docs
75+
76+
77+
78+
79+
180
## [0.32.11](https://github.com/jquense/yup/compare/v0.32.10...v0.32.11) (2021-10-12)
281

382

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yup",
3-
"version": "1.0.0-beta.1",
3+
"version": "1.0.0-beta.2",
44
"description": "Dead simple Object schema validation",
55
"main": "lib/index.js",
66
"module": "lib/index.esm.js",

0 commit comments

Comments
 (0)