Skip to content

[Snyk] Upgrade zod from 3.22.4 to 3.23.7#218

Open
karlclement wants to merge 1 commit into
developmentfrom
snyk-upgrade-3e56a4718987982e73aba03fd2855c67
Open

[Snyk] Upgrade zod from 3.22.4 to 3.23.7#218
karlclement wants to merge 1 commit into
developmentfrom
snyk-upgrade-3e56a4718987982e73aba03fd2855c67

Conversation

@karlclement

Copy link
Copy Markdown
Contributor

snyk-top-banner

Snyk has created this PR to upgrade zod from 3.22.4 to 3.23.7.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 64 versions ahead of your current version.

  • The recommended version was released on 21 days ago.

Release notes
Package name: zod
  • 3.23.7 - 2024-05-07

    Commits:

  • 3.23.6 - 2024-05-03

    Commits:

  • 3.23.5 - 2024-04-29

    Commits:

  • 3.23.4 - 2024-04-23

    Commits:

  • 3.23.3 - 2024-04-22

    Commits:

  • 3.23.2 - 2024-04-22

    Commits:

  • 3.23.1 - 2024-04-22

    This changes the default generics back to any to prevent breakages with common packager like @ hookform/resolvers:

    - class ZodType<Output = unknown, Def extends ZodTypeDef = ZodTypeDef, Input = unknown> {}
    + class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = any> {}

    Commits:

  • 3.23.0 - 2024-04-21

    Zod 3.23 is now available. This is the final 3.x release before Zod 4.0. To try it out:

    npm install zod

    Features

    z.string().date()

    Zod can now validate ISO 8601 date strings. Thanks @ igalklebanov! #1766

    const schema = z.string().date();
    schema.parse("2022-01-01"); // OK

    z.string().time()

    Zod can now validate ISO 8601 time strings. Thanks @ igalklebanov! #1766

    const schema = z.string().time();
    schema.parse("12:00:00"); // OK

    You can specify sub-second precision using the precision option:

    const schema = z.string().time({ precision: 3 });
    schema.parse("12:00:00.123"); // OK
    schema.parse("12:00:00.123456"); // Error
    schema.parse("12:00:00"); // Error

    z.string().duration()

    Zod can now validate ISO 8601 duration strings. Thanks @ mastermatt! #3265

    const schema = z.string().duration();
    schema.parse("P3Y6M4DT12H30M5S"); // OK

    Improvements to z.string().datetime()

    Thanks @ bchrobot #2522

    You can now allow unqualified (timezone-less) datetimes using the local: true flag.

    const schema = z.string().datetime({ local: true });
    schema.parse("2022-01-01T12:00:00"); // OK

    Plus, Zod now validates the day-of-month correctly to ensure no invalid dates (e.g. February 30th) pass validation. Thanks @ szamanr! #3391

    z.string().base64()

    Zod can now validate base64 strings. Thanks @ StefanTerdell! #3047

    const schema = z.string().base64();
    schema.parse("SGVsbG8gV29ybGQ="); // OK

    Improved discriminated unions

    The following can now be used as discriminator keys in z.discriminatedUnion():

    • ZodOptional
    • ZodNullable
    • ZodReadonly
    • ZodBranded
    • ZodCatch
    const schema = z.discriminatedUnion("type", [
      z.object({ type: z.literal("A").optional(), value: z.number() }),
      z.object({ type: z.literal("B").nullable(), value: z.string() }),
      z.object({ type: z.literal("C").readonly(), value: z.boolean() }),
      z.object({ type: z.literal("D").brand<"D">(), value: z.boolean() }),
      z.object({ type: z.literal("E").catch("E"), value: z.unknown() }),
    ]);

    Misc

    Breaking changes

    There are no breaking changes to the public API of Zod. However some changes can impact ecosystem tools that rely on Zod internals.

    ZodFirstPartySchemaTypes

    Three new types have been added to the ZodFirstPartySchemaTypes union. This may impact some codegen libraries. #3247

    +  | ZodPipeline<any, any>
    +  | ZodReadonly<any>
    +  | ZodSymbol;

    Unrecognized keys in .pick() and .omit()

    This version fixes a bug where unknown keys were accidentally accepted in .pick() and omit(). This has been fixed, which could cause compiler errors in some user code. #3255

    z.object({ 
      name: z.string() 
    }).pick({
      notAKey: true // no longer allowed
    })

    Bugfixes and performance

    Docs and ecosystem

    New Contributors

Snyk has created this PR to upgrade zod from 3.22.4 to 3.23.7.

See this package in npm:
zod

See this project in Snyk:
https://app.snyk.io/org/k-qm5/project/e35818e6-7574-4a03-88cf-ff3081e48e1d?utm_source=github&utm_medium=referral&page=upgrade-pr
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 29, 2024

Copy link
Copy Markdown

Deploying squire-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 31d5929
Status: ✅  Deploy successful!
Preview URL: https://c43b68a2.echolayer-web-sveltekit.pages.dev
Branch Preview URL: https://snyk-upgrade-3e56a4718987982.echolayer-web-sveltekit.pages.dev

View logs

@karlclement karlclement self-assigned this May 29, 2024
@ghost

ghost commented May 29, 2024

Copy link
Copy Markdown

Hi there, Squire here! 👋

Here's what I can do today:

  • /squire review - Call me to perform a review of this PR
  • /squire clear - delete all comments Squire has left in this PR.
  • /squire summary - I'll summarize the current state of the PR in a comment based on the latest commits.
  • /squire update-description - I'll update the PR description with a summary of the current state of the PR based on the latest commits.
  • /squire help - I'll remind you of all the commands I can do.

You can always clear and then run review again if you've committed more to get a fresh review.

For more info, including how to add our generated PR descriptions to a template, check out our docs: https://docs.squire.ai/

@ghost

ghost commented May 29, 2024

Copy link
Copy Markdown

Pull request summary created by Squire AI

Summary

This pull request, automatically generated by Snyk, upgrades the zod package from version 3.22.4 to 3.23.7 in package.json. The upgrade addresses potential vulnerabilities or issues identified by Snyk, ensuring the project's dependencies remain secure and up-to-date. The intent behind this change is to maintain the project's security posture by keeping its dependencies current, as evidenced by the detailed reference to the Snyk project page.

a8eb317...31d5929

File Summary

File Changes

  • package.json: Updated the zod package from version 3.22.4 to 3.23.7.

a8eb317...31d5929

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed by Squire AI

  • 1 comments were added to this review.
  • How did we do? 👍 👎

Comment thread package.json
@@ -70,6 +70,6 @@
"titleize": "^3.0.0",
"typescript-cookie": "^1.0.6",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import statement for titleize in DetailsTitle.svelte has a typo (titlelize). Correcting it to import titleize from 'titleize'; will ensure the module is properly imported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSDoc hints are lost after using .extend Prisma XOR with Zod > 3.21.1 not working

2 participants