@ptolemy2002/zod-utils
v1.2.0
Published
Various utilities for working with Zod schemas.
Readme
Zod Utils
Various utilities for working with Zod schemas.
Table of Contents
- Type Reference - Complete type definitions for all exported types
util- Utilities for working with Zod schemas and errors- clone - Utility for cloning Zod schemas without affecting the original
- interpret - Utilities for formatting Zod errors as strings
- prefixIssuePath - Utility for prepending a path prefix to a Zod issue
- typeGuards - Type guards for Zod-related values
- validate - Schema-wrapping factories for creating validators
Peer Dependencies
zod^4.3.6
Commands
The following commands exist in the project:
npm run uninstall- Uninstalls all dependencies for the librarynpm run reinstall- Uninstalls and then Reinstalls all dependencies for the librarynpm run build- Builds the librarynpm run release- Publishes the library to npm without changing the versionnpm run release-patch- Publishes the library to npm with a patch version bumpnpm run release-minor- Publishes the library to npm with a minor version bumpnpm run release-major- Publishes the library to npm with a major version bumpnpm run test- Runs the tests for the librarynpm run test:coverage- Runs the tests for the library and generates a coverage reportnpm run test:watch- Runs the tests for the library in watch modenpm run typecheck- Identifies any type errors in the library
Testing Guide
This library uses Jest with ts-jest for testing TypeScript code.
Running Tests
# Run all tests
npm test
# Run tests in watch mode (re-runs on file changes)
npm run test:watch
# Run tests with coverage report
npm run test:coverageTest files are located in ./test and any __tests__ directories within the ./src directory. Generally, test files should be named with a .test.ts suffix.
