react-firebase-admin
react-firebase-admin copied to clipboard
Bump yup from 0.32.5 to 1.0.2
Bumps yup from 0.32.5 to 1.0.2.
Release notes
Sourced from yup's releases.
v1 Because I finally got around to it
v1.0.0-beta.7
Fixes published artifacts for the
mainfieldv1.0.0-beta.5 - partial fixes and cast migration path
Beta 5 fixes
partialanddeepPartialmaking it work correctly withlazyschema. Specifically the optionality is added after lazy is evaluated but before any otherwhenconditions are added. This makes it consistent with other conditional schema, where runtime conditions always supersede previous schema configuration. This allows for optional overrides if necessary.const person = object({ name: string().required(), age: number().required(), legalGuardian: string().when('age', { is: (age) => age != null && age < 18, then: (schema) => schema.required(), }), });const optionalPerson = person.partial()
person.cast({name: 'James', age: 6 }) // => TypeError legalGuardian required
// age is still required b/c it's applied after the
partialoptionalPerson.cast({name: 'James', age: 6 }) // => TypeError legalGuardian requiredThis works slightly differently for
lazywhich have no schema to "start" with:const config = object({ nameOrIdNumber: lazy((value) => { if (typeof value === 'number') return number().required() return string().required() }), });const opti = config.partial()
config.cast({}) // => TypeError nameOrIdNumber is required
config.partial().cast({}) // => {}
Cast optionality migration path
A larger breaking change in v1 is the assertion of optionality during
cast, making previous patterns likestring().nullable().required()no longer possible. Generally this pattern is used when deserialized data is not valid to start, but will become valid through user input such as with an HTML form. v1 no longer allows this, but in order to make migration easier we've added an option tocastthat mimics the previous behavior (not exactly but closely).const name = string().required() </tr></table>
... (truncated)
Changelog
Sourced from yup's changelog.
1.0.2 (2023-02-27)
Bug Fixes
1.0.1 (2023-02-25)
1.0.0 (2023-02-08)
Migrating from 0.x to 1.0.0: #1906
1.0.0-beta.8 (2022-11-10)
Bug Fixes
- check if field exists when generating defaults (37f686c)
- correct minor typo in README (#1760) (62786c4)
- don't return any for oneOf (74c5bc5), closes #1675
- export more types (f250109)
- string().notRequired() (#1824) (dcb4b63)
- TS 4.8 compat (bc74c34)
- types: undefined defaults produce optional outputs (1afbac0)
Features
- add some more type exports (d5e9c99)
- Export ValidateOptions, ISchema for external use (#1812) (584df11)
- respect nullable() with oneOf (#1757) (61ec302), closes #768 #104
- simplify email validation (440db3e)
BREAKING CHANGES
- previously
oneOfrequired addingnullexplicitly to allowed values when using oneOf. Folks have found this confusing and unintuitive so I am deferring and adjusting the behavior- Use a simpler regex for email addresses that aligns with browsers, and add docs about how to override.
... (truncated)
Commits
- See full diff in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)