Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zod-validation-error

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zod-validation-error - npm Package Versions

23

3.4.0

Diff

Changelog

Source

3.4.0

Minor Changes

  • 3a7928c: Customize error messages using a MessageBuilder.
jmike
published 3.3.1 •

Changelog

Source

3.3.1

Patch Changes

  • 42bc4fe: Test Version Packages fix
jmike
published 3.3.0 •

Changelog

Source

3.3.0

Minor Changes

  • 66f5b5d: Match ZodError via heuristics instead of relying on instanceof.

    Why? Because we want to ensure that zod-validation-error works smoothly even when multiple versions of zod have been installed in the same project.

jmike
published 3.2.0 •

Changelog

Source

3.2.0

Minor Changes

  • 6b4e8a0: Introduce fromError API which is a less strict version of fromZodError
  • 35a28c6: Add runtime check in fromZodError and throw dev-friendly TypeError suggesting usage of fromError instead
jmike
published 3.1.0 •

Changelog

Source

3.1.0

Minor Changes

  • 3f5e391: Better error messages for zod.function() types
jmike
published 3.0.3 •

Changelog

Source

3.0.3

Patch Changes

  • 2f1ef27: Bundle code as a single index.js (cjs) or index.mjs (esm) file. Restore exports configuration in package.json.
jmike
published 3.0.2 •

Changelog

Source

3.0.2

Patch Changes

  • 24b773c: Revert package.json exports causing dependant projects to fail
jmike
published 3.0.1 •

Changelog

Source

3.0.1

Patch Changes

  • 3382fbc: 1. Fix issue with ErrorOptions not being found in earlier to es2022 typescript configs. 2. Add exports definition to package.json to help bundlers (e.g. rollup) identify the right module to use.
jmike
published 3.0.0 •

Changelog

Source

3.0.0

Major Changes

  • deb4639: BREAKING CHANGE: Refactor ValidationError to accept ErrorOptions as second parameter.

    What changed?

    Previously, ValidationError accepted Array<ZodIssue> as 2nd parameter. Now, it accepts ErrorOptions which contains a cause property. If cause is a ZodError then it will extract the attached issues and expose them over error.details.

    Why?

    This change allows us to use ValidationError like a native JavaScript Error. For example, we can now do:

    import { ValidationError } from 'zod-validation-error';
    
    try {
      // attempt to do something that might throw an error
    } catch (err) {
      throw new ValidationError('Something went deeply wrong', { cause: err });
    }
    

    How can you update your code?

    If you are using ValidationError directly, then you need to update your code to pass ErrorOptions as a 2nd parameter.

    import { ValidationError } from 'zod-validation-error';
    
    // before
    const err = new ValidationError('Something went wrong', zodError.issues);
    
    // after
    const err = new ValidationError('Something went wrong', { cause: zodError });
    

    If you were never using ValidationError directly, then you don't need to do anything.

jmike
published 2.1.0 •

Changelog

Source

2.1.0

Minor Changes

  • b084ad5: Add includePath option to allow users take control on whether to include the erroneous property name in their error messages.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc