Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zod-form-data

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zod-form-data - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

10

dist/index.d.ts
import { ZodString, ZodNumber, z, ZodArray, ZodTypeAny, ZodEffects, ZodObject } from 'zod';
type InputType<DefaultType extends ZodTypeAny> = {
(): ZodEffects<DefaultType, DefaultType["_output"], unknown>;
<ProvidedType extends ZodTypeAny>(schema: ProvidedType): ZodEffects<ProvidedType, ProvidedType["_output"], unknown>;
(): ZodEffects<DefaultType>;
<ProvidedType extends ZodTypeAny>(schema: ProvidedType): ZodEffects<ProvidedType>;
};

@@ -55,6 +55,6 @@ /**

*/
declare const repeatableOfType: <T extends z.ZodTypeAny>(schema: T) => z.ZodEffects<z.ZodArray<T, "many">, T["_output"], unknown>;
declare const repeatableOfType: <T extends z.ZodTypeAny>(schema: T) => z.ZodEffects<z.ZodArray<T, "many">, T["_output"][], T["_input"][]>;
type FormDataType = {
<T extends z.ZodRawShape>(shape: T): ZodEffects<ZodObject<T>, ZodObject<T>["_output"], unknown>;
<T extends z.ZodTypeAny>(schema: T): ZodEffects<T, T["_output"], unknown>;
<T extends z.ZodRawShape>(shape: T): ZodEffects<ZodObject<T>>;
<T extends z.ZodTypeAny>(schema: T): ZodEffects<T>;
};

@@ -61,0 +61,0 @@ declare const json: <T extends z.ZodTypeAny>(schema: T) => z.ZodEffects<T, T["_output"], T["_input"]>;

{
"name": "zod-form-data",
"version": "1.3.0",
"version": "1.3.1",
"main": "./dist/index.cjs.js",

@@ -5,0 +5,0 @@ "module": "./dist/index.esm.js",

@@ -14,8 +14,6 @@ import { setPath } from "set-get";

type InputType<DefaultType extends ZodTypeAny> = {
(): ZodEffects<DefaultType, DefaultType["_output"], unknown>;
<ProvidedType extends ZodTypeAny>(schema: ProvidedType): ZodEffects<
ProvidedType,
ProvidedType["_output"],
unknown
>;
(): ZodEffects<DefaultType>;
<ProvidedType extends ZodTypeAny>(
schema: ProvidedType
): ZodEffects<ProvidedType>;
};

@@ -39,3 +37,3 @@

export const text: InputType<ZodString> = (schema = z.string()) =>
z.preprocess(preprocessIfValid(stripEmpty), schema);
z.preprocess(preprocessIfValid(stripEmpty), schema) as any;

@@ -60,3 +58,3 @@ /**

schema
);
) as any;

@@ -94,3 +92,3 @@ type CheckboxOpts = {

return val instanceof File && val.size === 0 ? undefined : val;
}, schema);
}, schema) as any;

@@ -110,3 +108,3 @@ /**

return [val];
}, schema);
}, schema) as any;
};

@@ -120,4 +118,3 @@

schema: T
): ZodEffects<ZodArray<T>, T["_output"], unknown> =>
repeatable(z.array(schema));
): ZodEffects<ZodArray<T>> => repeatable(z.array(schema));

@@ -127,8 +124,4 @@ const entries = z.array(z.tuple([z.string(), z.any()]));

type FormDataType = {
<T extends z.ZodRawShape>(shape: T): ZodEffects<
ZodObject<T>,
ZodObject<T>["_output"],
unknown
>;
<T extends z.ZodTypeAny>(schema: T): ZodEffects<T, T["_output"], unknown>;
<T extends z.ZodRawShape>(shape: T): ZodEffects<ZodObject<T>>;
<T extends z.ZodTypeAny>(schema: T): ZodEffects<T>;
};

@@ -189,5 +182,3 @@

*/
export const formData: FormDataType = <T extends z.ZodRawShape | z.ZodTypeAny>(
shapeOrSchema: T
) =>
export const formData: FormDataType = (shapeOrSchema: any): any =>
z.preprocess(

@@ -194,0 +185,0 @@ processFormData,

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