Socket
Socket
Sign inDemoInstall

zod

Package Overview
Dependencies
0
Maintainers
1
Versions
359
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.4

2

package.json
{
"name": "zod",
"version": "1.0.2",
"version": "1.0.4",
"description": "Typescript-first schema declaration and validation library with static type inference",

@@ -5,0 +5,0 @@ "main": "index.ts",

@@ -1,21 +0,14 @@

import * as z from '.';
// import * as z from '.';
interface Category {
name: string;
categories: Array<Category>;
}
// interface Category {
// name: string;
// categories: Array<Category>;
// }
const Cat: z.ZodType<Category> = z.lazy(() => {
// console.log(Cat);
return z.object({
name: z.string(),
categories: z.array(Cat),
});
});
// const inp = z.string();
// const outp = z.number();
// const fun = z.function(z.tuple([inp]), outp);
// fun.validate((s)=>{
// return 4
// })
// const Cat: z.ZodType<Category> = z.lazy(() => {
// // console.log(Cat);
// return z.object({
// name: z.string(),
// categories: z.array(Cat),
// });
// });

@@ -7,3 +7,3 @@ import * as z from './base';

export interface ZodTupleDef<
T extends [z.ZodAny, ...z.ZodAny[]] = [z.ZodAny, ...z.ZodAny[]]
T extends [z.ZodAny, ...z.ZodAny[]] | [] = [z.ZodAny, ...z.ZodAny[]]
> extends z.ZodTypeDef {

@@ -15,7 +15,7 @@ t: z.ZodTypes.tuple;

export class ZodTuple<
T extends [z.ZodAny, ...z.ZodAny[]] = [z.ZodAny, ...z.ZodAny[]]
T extends [z.ZodAny, ...z.ZodAny[]] | [] = [z.ZodAny, ...z.ZodAny[]]
> extends z.ZodType<z.TypeOfTuple<T>, ZodTupleDef<T>> {
toJSON = () => ({
t: this._def.t,
items: this._def.items.map(item => item.toJSON()),
items: (this._def.items as any[]).map(item => item.toJSON()),
});

@@ -28,3 +28,3 @@

static create = <T extends [z.ZodAny, ...z.ZodAny[]]>(
static create = <T extends [z.ZodAny, ...z.ZodAny[]] | []>(
schemas: T

@@ -31,0 +31,0 @@ ): ZodTuple<T> => {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc