Skip to content

Commit 57b81f4

Browse files
committed
docs
1 parent 0b0b659 commit 57b81f4

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

CHANGELOG-pre.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# [1.0.0-beta.0](https://github.com/jquense/yup/compare/v1.0.0-alpha.4...v1.0.0-beta.0) (2021-12-29)
2+
3+
4+
* feat!: add json() method and remove default object/array coercion ([94b73c4](https://github.com/jquense/yup/commit/94b73c438b3d355253f488325e06c69378e71fc1))
5+
6+
7+
### Features
8+
9+
* Make Array generic consistent with others ([a82353f](https://github.com/jquense/yup/commit/a82353f37735daec6e42d18bd4cc0efe52a20f50))
10+
11+
12+
### BREAKING CHANGES
13+
14+
* types only, `ArraySchema` initial generic is the array type not the type of the array element. `array<T>()` is still the inner type.
15+
* object and array schema no longer parse JSON strings by default, nor do they return `null` for invalid casts.
16+
17+
```ts
18+
object().json().cast('{}')
19+
array().json().cast('[]')
20+
```
21+
to mimic the previous behavior
22+
23+
24+
125
# [1.0.0-alpha.4](https://github.com/jquense/yup/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2021-12-29)
226

327
### Bug Fixes

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,7 @@ and use the result as the limit.
13991399

14001400
Define an array schema. Arrays can be typed or not, When specifying the element type, `cast` and `isValid`
14011401
will apply to the elements as well. Options passed into `isValid` are passed also passed to child schemas.
1402+
14021403
Inherits from [`Schema`](#Schema).
14031404

14041405
```js
@@ -1418,9 +1419,7 @@ array().of(yup.number());
14181419
array(yup.number());
14191420
```
14201421

1421-
The default `cast` behavior for `array` is: [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)
1422-
1423-
Failed casts return: `null`;
1422+
Arrays have no default casting behavior.
14241423

14251424
#### `array.of(type: Schema): this`
14261425

0 commit comments

Comments
 (0)