Socket
Socket
Sign inDemoInstall

zod

Package Overview
Dependencies
Maintainers
1
Versions
361
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zod - npm Package Compare versions

Comparing version 1.10.3 to 1.10.4

2

lib/src/index.d.ts

@@ -47,3 +47,3 @@ import { ZodString, ZodStringDef } from './types/string';

declare const recordType: <Value extends ZodType<any, any> = ZodType<any, any>>(valueType: Value) => ZodRecord<Value>;
declare const functionType: <T extends ZodTuple<any> = ZodTuple<[]>, U extends ZodType<any, any> = ZodVoid>(args?: T | undefined, returns?: U | undefined) => ZodFunction<T, U>;
declare const functionType: <T extends ZodTuple<any> = ZodTuple<[]>, U extends ZodType<any, any> = ZodUnknown>(args?: T | undefined, returns?: U | undefined) => ZodFunction<T, U>;
declare const lazyType: <T extends ZodType<any, any>>(getter: () => T) => ZodLazy<T>;

@@ -50,0 +50,0 @@ declare const literalType: <T extends import("./helpers/primitive").Primitive>(value: T) => ZodLiteral<T>;

"use strict";
// import * as z from '.';
// const asdf = z
// .function()
// .args(z.string())
// .returns(z.unknown())
// .implement(arg => {
// return arg.length;
// });
// type asdf = string extends unknown ? true : false;
//# sourceMappingURL=playground.js.map
import * as z from './base';
import { ZodTuple } from './tuple';
import { ZodVoid } from './void';
import { ZodUnknown } from './unknown';
export interface ZodFunctionDef<Args extends ZodTuple<any> = ZodTuple<any>, Returns extends z.ZodTypeAny = z.ZodTypeAny> extends z.ZodTypeDef {

@@ -15,5 +15,5 @@ t: z.ZodTypes.function;

returns: <NewReturnType extends z.ZodType<any, any>>(returnType: NewReturnType) => ZodFunction<Args, NewReturnType>;
implement: (func: TypeOfFunction<Args, Returns>) => TypeOfFunction<Args, Returns>;
validate: (func: TypeOfFunction<Args, Returns>) => TypeOfFunction<Args, Returns>;
static create: <T extends ZodTuple<any> = ZodTuple<[]>, U extends z.ZodType<any, any> = ZodVoid>(args?: T | undefined, returns?: U | undefined) => ZodFunction<T, U>;
implement: <F extends TypeOfFunction<Args, Returns>>(func: F) => F;
validate: <F extends TypeOfFunction<Args, Returns>>(func: F) => F;
static create: <T extends ZodTuple<any> = ZodTuple<[]>, U extends z.ZodType<any, any> = ZodUnknown>(args?: T | undefined, returns?: U | undefined) => ZodFunction<T, U>;
toJSON: () => {

@@ -20,0 +20,0 @@ t: z.ZodTypes.function;

@@ -36,6 +36,3 @@ "use strict";

var tuple_1 = require("./tuple");
// import { ZodUndefined } from './undefined';
// import { ZodNull } from './null';
// import { ZodUnion } from './union';
var void_1 = require("./void");
var unknown_1 = require("./unknown");
var ZodFunction = /** @class */ (function (_super) {

@@ -75,3 +72,3 @@ __extends(ZodFunction, _super);

args: args || tuple_1.ZodTuple.create([]),
returns: returns || void_1.ZodVoid.create(),
returns: returns || unknown_1.ZodUnknown.create(),
});

@@ -78,0 +75,0 @@ };

{
"name": "zod",
"version": "1.10.3",
"version": "1.10.4",
"description": "TypeScript-first schema declaration and validation library with static type inference",

@@ -39,2 +39,3 @@ "main": "./lib/src/index.js",

"build": "yarn run clean && tsc --p tsconfig.package.json",
"buildall": "yarn add typescript@3.4 && yarn build && yarn add typescript@3.5 && yarn build && yarn add typescript@3.6 && yarn build && yarn add typescript@3.7 && yarn build && yarn add typescript@3.8 && yarn build && yarn add typescript@3.9 && yarn build && yarn add typescript@4 && yarn build && yarn add typescript@3.3 && yarn build",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",

@@ -41,0 +42,0 @@ "lint": "tslint -p tsconfig.json",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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