Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): bump zod from 3.7.3 to 3.8.1 #2660

Merged
merged 1 commit into from
Aug 23, 2021

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 23, 2021

Bumps zod from 3.7.3 to 3.8.1.

Release notes

Sourced from zod's releases.

v3.8.0

Release: zod@3.8.0 What's new:

z.preprocess

This lets you transform input data before it is parsed by your schema. This is useful for several use cases, notably type coercion. Usage:

const coercedString = z.preprocess(
  val => String(val),
  z.string()
)
mySchema.parse(12); // => "12"
mySchema.parse(true); // => "true"

CUID validation

Courtesy of @​alii

const cuid = z.string().cuid()
cuid.parse("ckopqwooh000001la8mbi2im9");

Improved .deepPartial()

The .deepPartial() method on object schemas now recursively traverses through ZodArray, ZodTuple, ZodOptional, and ZodNullable elements. Previously, this method only worked in hierarchies of simple object schemas.

const mySchema = z.object({
  name: z.string(),
  array: z.array(z.object({ asdf: z.string() })),
  tuple: z.tuple([
    z.object({ value: z.string() })
  ]),
}) 
const partialed = mySchema.deepPartial();
type partialed = z.infer<typeof partialed>;
/*
{
name?: string | undefined;
array?: {
asdf?: string | undefined;
}[] | undefined;
tuple?: [{value?: string}] | undefined;
}
*/
</tr></table>

... (truncated)

Changelog

Sourced from zod's changelog.

Changelog

3.8

  • Add z.preprocess
  • Implement CUID validation on ZodString (z.string().cuid())
  • Improved .deepPartial(): now recursively operates on arrays, tuples, optionals, and nullables (in addition to objects)

3.7

  • Eliminate ZodNonEmptyArray, add Cardinality to ZodArray
  • Add optional error message to ZodArray.nonempty
  • Add .gt/.gte/.lt/.lte to ZodNumber

3.6

  • Add IE11 support
  • ZodError.flatten now optionally accepts a map function for customizing the output
  • .void() now only accepts undefined, not null.
  • z.enum now supports Readonly string tuples

3.5

  • Add discriminator to all first-party schema defs

3.4

  • unknown and any schemas are always interpreted as optional. Reverts change from 3.3.

3.3

  • HUGE speed improvements
  • Added benchmarking: yarn benchmark
  • Type signature of ZodType#_parse has changed. This will affects users who have implemented custom subclasses of ZodType.
  • [reverted] Object fields of type unknown are no longer inferred as optional.

3.2

  • Certain methods (.or, .transform) now return a new instance that wrap the current instance, instead of trying to avoid additional nesting. For example:
z.union([z.string(), z.number()]).or(z.boolean());
// previously
// => ZodUnion<[ZodString, ZodNumber, ZodBoolean]>
// now
// => ZodUnion<[ZodUnion<[ZodString, ZodNumber]>, ZodBoolean]>

This change was made due to recursion limitations in TypeScript 4.3 that made it impossible to properly type these methods.

... (truncated)

Commits

Dependabot compatibility score

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 rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will 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 version will 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 dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [zod](https://github.com/colinhacks/zod) from 3.7.3 to 3.8.1.
- [Release notes](https://github.com/colinhacks/zod/releases)
- [Changelog](https://github.com/colinhacks/zod/blob/master/CHANGELOG.md)
- [Commits](https://github.com/colinhacks/zod/commits)

---
updated-dependencies:
- dependency-name: zod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Aug 23, 2021
@mergify mergify bot merged commit a9c7f5d into develop Aug 23, 2021
@mergify mergify bot deleted the dependabot/npm_and_yarn/zod-3.8.1 branch August 23, 2021 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants