
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
ts-zod-decorators
Advanced tools
This repository enhances the functionality of the Zod library by providing validation decorators. Zod is a TypeScript-first schema declaration and validation library. The added decorators make it easier to validate data against predefined schemas in TypeS
This repository enhances the functionality of the Zod library by providing validation decorators. Zod is a TypeScript-first schema declaration and validation library. The added decorators make it easier to validate data against predefined schemas in TypeScript projects.
npm install ts-zod-decorators
import { ZodInput, Validate } from 'ts-zod-decorators';
import * as z from 'zod';
const schema = z.object({ name: z.string(), age: z.number() });
class Foo {
@Validate
public bar(@ZodInput(schema) input: z.infer<typeof schema>) {}
}
import { ZodInput, Validate, ZodOutput } from 'ts-zod-decorators';
import * as z from 'zod';
const schema = z.object({ name: z.string(), age: z.number() });
class Foo {
@Validate
@ZodOutput(schema)
public bar(input: unknown): Promise<z.infer<schema>> {
return Promise.resolve({ name: 'foo', age: 1 });
}
}
FAQs
This repository enhances the functionality of the Zod library by providing validation decorators. Zod is a TypeScript-first schema declaration and validation library. The added decorators make it easier to validate data against predefined schemas in TypeS
The npm package ts-zod-decorators receives a total of 143 weekly downloads. As such, ts-zod-decorators popularity was classified as not popular.
We found that ts-zod-decorators demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.