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 2.0.0-alpha.2 to 2.0.0-alpha.3

6

lib/src/types/base.d.ts

@@ -54,2 +54,3 @@ import { ParseParams } from '../parser';

refinement: (refinement: Check<Type>) => this;
wrap: (value: Type, params?: ParseParams) => ZodValue<this>;
constructor(def: Def);

@@ -60,2 +61,7 @@ abstract toJSON: () => object;

}
export declare class ZodValue<S extends ZodType<any, any>> {
value: S['_type'];
schema: S;
constructor(schema: S, value: S['_type']);
}
export {};

64

lib/src/types/base.js

@@ -45,26 +45,2 @@ "use strict";

var ZodType = /** @class */ (function () {
// mask = <P extends maskUtil.Params<Type>>(_params: P): ZodType<maskUtil.Pick<Type, P>> => {
// return Masker(this, _params) as any;
// };
// pick = <Params extends maskUtil.Params<Type>>(_params: Params): maskUtil.Mask<Type, Params> => {
// return 'asdf' as any;
// };
// Wrapper = class<Type, Schema> {
// value: Type;
// schema: Schema;
// constructor(schema: Schema, value: Type) {
// this.value = value;
// this.schema = schema;
// }
// };
// wrap: (value: this['_type'], params?: ParseParams) => any = (value, params) => {
// const parsed = this.parse(value, params);
// return new this.Wrapper<this['_type'], this>(this, parsed);
// // return new ZodValue(this, this.parse(value, params));
// };
// wrap: (value: Type, params?: ParseParams) => ZodValue<this> = (value, params) => {
// const parsed = this.parse(value, params);
// return new ZodValue(this, parsed);
// // return new ZodValue(this, this.parse(value, params));
// };
function ZodType(def) {

@@ -90,2 +66,26 @@ var _this = this;

};
// mask = <P extends maskUtil.Params<Type>>(_params: P): ZodType<maskUtil.Pick<Type, P>> => {
// return Masker(this, _params) as any;
// };
// pick = <Params extends maskUtil.Params<Type>>(_params: Params): maskUtil.Mask<Type, Params> => {
// return 'asdf' as any;
// };
// Wrapper = class<Type, Schema> {
// value: Type;
// schema: Schema;
// constructor(schema: Schema, value: Type) {
// this.value = value;
// this.schema = schema;
// }
// };
// wrap: (value: this['_type'], params?: ParseParams) => any = (value, params) => {
// const parsed = this.parse(value, params);
// return new this.Wrapper<this['_type'], this>(this, parsed);
// // return new ZodValue(this, this.parse(value, params));
// };
this.wrap = function (value, params) {
var parsed = _this.parse(value, params);
return new ZodValue(_this, parsed);
// return new ZodValue(this, this.parse(value, params));
};
this.parse = parser_1.ZodParser(def);

@@ -115,10 +115,10 @@ this._def = def;

exports.ZodType = ZodType;
// export class ZodValue<S extends ZodType<any, any>> {
// value: S['_type'];
// schema: S;
// constructor(schema: S, value: S['_type']) {
// this.value = value;
// this.schema = schema;
// }
// }
var ZodValue = /** @class */ (function () {
function ZodValue(schema, value) {
this.value = value;
this.schema = schema;
}
return ZodValue;
}());
exports.ZodValue = ZodValue;
//# sourceMappingURL=base.js.map
{
"name": "zod",
"version": "2.0.0-alpha.2",
"version": "2.0.0-alpha.3",
"description": "TypeScript-first schema declaration and validation library with static type inference",

@@ -5,0 +5,0 @@ "main": "./lib/src/index.js",

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