Files
yup/.gitignore
Jason Quense 366f7d8e28 Merge next into master (#1547)
* feat: stricter `when` types and API (#1542)

BREAKING CHANGE: 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

```diff
 string()
-   .when('other', function (other) => {
-      if (other) return this.required()
+   .when('other', ([other], schema) => {
+     return other ? schema.required() : schema
  })
```

* feat: concat() is shallow and does not merge (#1541)

BREAKING CHANGE: 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

* docs: update readme

* chore: update to readonly arrays and test string type narrowing

* test: add boolean tests

* docs: more docs

* feat: allow mixed schema to specify type check

* feat: simplify base class hierarchy (#1543)

BREAKING CHANGE: `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. 

```diff
import {
-  mixed,
+  Schema,
} from 'yup';

- addMethod(mixed, 'method', impl)
+ addMethod(Schema, 'method', impl)
```

* chore: prep work for toggling coercion

* Publish v1.0.0-alpha.4

* chore: docs

* feat!: add json() method and remove default object/array coercion

BREAKING CHANGE: object and array schema no longer parse JSON strings by default, nor do they return `null` for invalid casts.

```ts
object().json().cast('{}')
array().json().cast('[]')
```
to mimic the previous behavior

* feat: Make Array generic consistent with others

BREAKING CHANGE: types only, `ArraySchema`  initial generic is the array type not the type of the array element. `array<T>()` is still the inner type.

* Publish v1.0.0-beta.0

* docs

* chore: improve internal test run APIs and Error handling (#1545)

* docs

* WIP

* chore: clean up internal test running APIs

* fix order

* feat: flat bundles and size reductions

Use rollup to produce flat bundles of yup.

* Publish v1.0.0-beta.1

* docs: pre release note

Co-authored-by: Michael Li <xiaoyu.tamu@gmail.com>
2022-01-03 12:25:20 -05:00

81 lines
1.2 KiB
Plaintext

# Logs
logs
*.log
dts/
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# Commenting this out is preferred by some people, see
# https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules
# Users Environment Variables
.lock-wscript
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Windows
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Ignore build files
lib/
es/