@layerzerolabs/zod-utils 0.0.67 → 0.0.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,21 +6,21 @@
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  CLI Using tsup config: /home/runner/work/monorepo-internal/monorepo-internal/packages/zod-utils/tsup.config.ts
9
- CLI Target: es2022
9
+ CLI Target: ES2023
10
10
  CLI Cleaning output folder
11
11
  CJS Build start
12
12
  ESM Build start
13
- ESM dist/index.js 4.21 KB
14
- ESM dist/schema.js 332.00 B
15
- ESM dist/CJDRGNOS.js 1.95 KB
16
- ESM dist/schema.js.map 70.00 B
17
- ESM dist/index.js.map 11.03 KB
18
- ESM dist/CJDRGNOS.js.map 5.78 KB
19
- ESM ⚡️ Build success in 209ms
20
13
  CJS dist/index.cjs 5.45 KB
21
14
  CJS dist/schema.cjs 1.38 KB
22
- CJS dist/TDC7YIO4.cjs 2.29 KB
15
+ CJS dist/WBHGMCS2.cjs 2.29 KB
23
16
  CJS dist/index.cjs.map 11.04 KB
24
17
  CJS dist/schema.cjs.map 71.00 B
25
- CJS dist/TDC7YIO4.cjs.map 5.78 KB
26
- CJS ⚡️ Build success in 209ms
18
+ CJS dist/WBHGMCS2.cjs.map 5.93 KB
19
+ CJS ⚡️ Build success in 264ms
20
+ ESM dist/schema.js 332.00 B
21
+ ESM dist/25UQQMRA.js 1.95 KB
22
+ ESM dist/index.js 4.21 KB
23
+ ESM dist/schema.js.map 70.00 B
24
+ ESM dist/25UQQMRA.js.map 5.92 KB
25
+ ESM dist/index.js.map 11.03 KB
26
+ ESM ⚡️ Build success in 265ms
@@ -40,5 +40,5 @@ var bindFunctionPointerArgs = /* @__PURE__ */ __name((params) => params, "bindFu
40
40
  var bindPartialFunctionPointerArgs = /* @__PURE__ */ __name((params) => params, "bindPartialFunctionPointerArgs");
41
41
 
42
42
  export { __name, bindFunctionPointerArgs, bindPartialFunctionPointerArgs, createExtendableFunctionPointerWithCurriedArgsSchema, createFunctionPointerSchema, createFunctionPointerWithArgsSchema, customSchema, functionSchema, schemaIsFunctionSchema };
43
- //# sourceMappingURL=CJDRGNOS.js.map
44
- //# sourceMappingURL=CJDRGNOS.js.map
43
+ //# sourceMappingURL=25UQQMRA.js.map
44
+ //# sourceMappingURL=25UQQMRA.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schema.ts"],"names":["functionSchemaTag","Symbol","functionSchema","input","output","obj","z","object","Object","defineProperty","value","writable","parse","i","Error","schemaIsFunctionSchema","schema","hasOwn","customSchema","validate","custom","createFunctionPointerSchema","pointer","createFunctionPointerWithArgsSchema","shape","args","createExtendableFunctionPointerWithCurriedArgsSchema","array","any","bindFunctionPointerArgs","params","bindPartialFunctionPointerArgs"],"mappings":";;;;AAwBA,IAAMA,iBAAAA,GAAoBC,OAAO,uBAAA,CAAA;AAG1B,IAAMC,cAAAA,mBAAiB,MAAA,CAAA,CAAqD,EAC/EC,KAAAA,EACAC,QAAM,KAIT;AACG,EAAA,MAAMC,GAAAA,GAAMC,EAAEC,MAAAA,CAAO;AACjBJ,IAAAA,KAAAA;AACAC,IAAAA;GACJ,CAAA;AACAI,EAAAA,MAAAA,CAAOC,cAAAA,CAAeJ,KAAKL,iBAAAA,EAAmB;IAAEU,KAAAA,EAAO,IAAA;IAAMC,QAAAA,EAAU;GAAM,CAAA;AAI7EN,EAAAA,GAAAA,CAAIO,KAAAA,GAAQ,CAACC,CAAAA,KAAAA;AACT,IAAA,IAAI,OAAOA,MAAM,UAAA,EAAY;AACzB,MAAA,MAAM,IAAIC,KAAAA,CAAM,CAAA,EAAGD,CAAAA,CAAAA,kBAAAA,CAAqB,CAAA;AAC5C,IAAA;AAGA,IAAA,OAAOA,CAAAA;AACX,EAAA,CAAA;AACA,EAAA,OAAOR,GAAAA;AAMX,CAAA,EA7B8B,gBAAA;AA+BvB,IAAMU,sBAAAA,2BACTC,MAAAA,KAAAA;AAEA,EAAA,OAAOR,MAAAA,CAAOS,MAAAA,CAAOD,MAAAA,EAAQhB,iBAAAA,CAAAA;AACjC,CAAA,EAJsC,wBAAA;AAM/B,IAAMkB,+BAAe,MAAA,CAAA,CAAIC,QAAAA,KAC5Bb,CAAAA,CAAEc,MAAAA,CAAUD,QAAAA,CAAAA,EADY,cAAA;AAGrB,IAAME,2BAAAA,mBAA8B,MAAA,CAAA,MACvCf,CAAAA,CAAEC,MAAAA,CAAO;;AAELe,EAAAA,OAAAA,EAASJ,YAAAA;AACb,CAAA,CAAA,EAJuC,6BAAA;AAMpC,IAAMK,mCAAAA,mBAAsC,MAAA,CAAA,MAG/CjB,CAAAA,CAAEC,MAAAA,CAAO;EACLe,OAAAA,EAASD,2BAAAA,GAAiCG,KAAAA,CAAMF,OAAAA;AAChDG,EAAAA,IAAAA,EAAMP,YAAAA;AACV,CAAA,CAAA,EAN+C,qCAAA;AAa5C,IAAMQ,oDAAAA,mBAAuD,MAAA,CAAA,MAIhEpB,CAAAA,CAAEC,MAAAA,CAAO;EACLe,OAAAA,EAASD,2BAAAA,GAGLG,KAAAA,CAAMF,OAAAA;AACVG,EAAAA,IAAAA,EAAMnB,CAAAA,CAAEqB,KAAAA,CAAMrB,CAAAA,CAAEsB,GAAAA,EAAG;AACvB,CAAA,CAAA,EAVgE,sDAAA;AAY7D,IAAMC,uBAAAA,mBAA0B,MAAA,CAAA,CAA4BC,MAAAA,KAG7DA,MAAAA,EAHiC,yBAAA;AAKhC,IAAMC,8BAAAA,mBAAiC,MAAA,CAAA,CAA4BD,MAAAA,KAGpEA,MAAAA,EAHwC,gCAAA","file":"CJDRGNOS.js","sourcesContent":["import { z } from 'zod/v4';\n\nimport type {\n FunctionPointer,\n UnderlyingMethodOfFunctionPointer,\n} from '@layerzerolabs/common-utils';\n\ntype IsPromise<T> =\n T extends z.ZodOptional<infer I>\n ? IsPromise<I>\n : T extends z.ZodDefault<infer I>\n ? IsPromise<I>\n : T extends z.ZodNullable<infer I>\n ? IsPromise<I>\n : T extends z.ZodPromise<any>\n ? true\n : false;\n\nexport type InferredArray<T extends z.ZodType[], Output extends any[] = []> = T extends []\n ? Output\n : T extends [infer Head, ...infer Tail extends z.ZodType[]]\n ? InferredArray<Tail, [...Output, z.infer<Head>]>\n : never;\n\nconst functionSchemaTag = Symbol('__FUNCTION_SCHEMA_TAG');\n\n//this essentially replicates the functionality of z.function in zod v3\nexport const functionSchema = <Input extends z.ZodTuple, Output extends z.ZodType>({\n input,\n output,\n}: {\n input: Input;\n output: Output;\n}) => {\n const obj = z.object({\n input,\n output,\n });\n Object.defineProperty(obj, functionSchemaTag, { value: true, writable: false });\n //we don't expect the function to actually be an object with an input field and an output field\n //so we override the parse function. we can't actually parse functions since input and output\n //types are lost at runtime, but we can check the runtime type of the object\n obj.parse = (i) => {\n if (typeof i !== 'function') {\n throw new Error(`${i} is not a function`);\n }\n //the return type here just has to match the inference of z.object,\n //the actual inference of the schema will be the z.ZodType custom\n return i as any;\n };\n return obj as unknown as z.ZodType<\n (\n ...args: z.infer<Input>\n //z.ZodPromise<T> infers as T, not Promise<T>\n ) => IsPromise<Output> extends true ? Promise<z.infer<Output>> : z.infer<Output>\n >;\n};\n\nexport const schemaIsFunctionSchema = (\n schema: z.ZodType,\n): schema is ReturnType<typeof functionSchema> => {\n return Object.hasOwn(schema, functionSchemaTag);\n};\n\nexport const customSchema = <T>(validate?: (data: any) => T) =>\n z.custom<T>(validate) as z.ZodType<T>;\n\nexport const createFunctionPointerSchema = <T extends FunctionPointer = FunctionPointer>() =>\n z.object({\n // FIXME this can be a real schema\n pointer: customSchema<T>(),\n });\n\nexport const createFunctionPointerWithArgsSchema = <\n T extends FunctionPointer = FunctionPointer,\n>() =>\n z.object({\n pointer: createFunctionPointerSchema<T>().shape.pointer,\n args: customSchema<Parameters<UnderlyingMethodOfFunctionPointer<T>>>(),\n });\n\nexport type ConstrainedGenericFunctionPointer<_ReturnType extends Promise<any>> = FunctionPointer<\n ReturnType<<T extends (...args: any[]) => _ReturnType>() => T>\n>;\n\n// This type doesn't work correctly\nexport const createExtendableFunctionPointerWithCurriedArgsSchema = <\n _BaseArgs extends any[],\n _ReturnType extends Promise<any>,\n>() =>\n z.object({\n pointer: createFunctionPointerSchema<\n // FIXME type args correctly\n ConstrainedGenericFunctionPointer<_ReturnType>\n >().shape.pointer,\n args: z.array(z.any()),\n });\n\nexport const bindFunctionPointerArgs = <T extends FunctionPointer>(params: {\n pointer: T;\n args: Parameters<UnderlyingMethodOfFunctionPointer<T>>;\n}) => params;\n\nexport const bindPartialFunctionPointerArgs = <T extends FunctionPointer>(params: {\n pointer: T;\n args: Partial<Parameters<UnderlyingMethodOfFunctionPointer<T>>>;\n}) => params;\n\nexport type BuildZodObject<T extends object> = z.ZodObject<\n {\n [K in keyof T]: z.ZodType<T[K]>;\n },\n z.core.$strip\n>;\n"]}
1
+ {"version":3,"sources":["../src/schema.ts"],"names":["functionSchemaTag","Symbol","functionSchema","input","output","obj","z","object","Object","defineProperty","value","writable","parse","i","Error","schemaIsFunctionSchema","schema","hasOwn","customSchema","validate","custom","createFunctionPointerSchema","pointer","createFunctionPointerWithArgsSchema","shape","args","createExtendableFunctionPointerWithCurriedArgsSchema","array","any","bindFunctionPointerArgs","params","bindPartialFunctionPointerArgs"],"mappings":";;;;AAwBA,IAAMA,iBAAAA,GAAoBC,OAAO,uBAAA,CAAA;AAG1B,IAAMC,cAAAA,mBAAiB,MAAA,CAAA,CAAqD,EAC/EC,KAAAA,EACAC,QAAM,KAIT;AACG,EAAA,MAAMC,GAAAA,GAAMC,EAAEC,MAAAA,CAAO;AACjBJ,IAAAA,KAAAA;AACAC,IAAAA;GACJ,CAAA;AACAI,EAAAA,MAAAA,CAAOC,cAAAA,CAAeJ,KAAKL,iBAAAA,EAAmB;IAAEU,KAAAA,EAAO,IAAA;IAAMC,QAAAA,EAAU;GAAM,CAAA;AAI7EN,EAAAA,GAAAA,CAAIO,KAAAA,GAAQ,CAACC,CAAAA,KAAAA;AACT,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AA,CAAA,CAA4BD,MAAAA,KAGpEA,MAAAA,EAHwC,gCAAA","file":"25UQQMRA.js","sourcesContent":["import { z } from 'zod/v4';\n\nimport type {\n FunctionPointer,\n UnderlyingMethodOfFunctionPointer,\n} from '@layerzerolabs/common-utils';\n\ntype IsPromise<T> =\n T extends z.ZodOptional<infer I>\n ? IsPromise<I>\n : T extends z.ZodDefault<infer I>\n ? IsPromise<I>\n : T extends z.ZodNullable<infer I>\n ? IsPromise<I>\n : T extends z.ZodPromise<any>\n ? true\n : false;\n\nexport type InferredArray<T extends z.ZodType[], Output extends any[] = []> = T extends []\n ? Output\n : T extends [infer Head, ...infer Tail extends z.ZodType[]]\n ? InferredArray<Tail, [...Output, z.infer<Head>]>\n : never;\n\nconst functionSchemaTag = Symbol('__FUNCTION_SCHEMA_TAG');\n\n//this essentially replicates the functionality of z.function in zod v3\nexport const functionSchema = <Input extends z.ZodTuple, Output extends z.ZodType>({\n input,\n output,\n}: {\n input: Input;\n output: Output;\n}) => {\n const obj = z.object({\n input,\n output,\n });\n Object.defineProperty(obj, functionSchemaTag, { value: true, writable: false });\n //we don't expect the function to actually be an object with an input field and an output field\n //so we override the parse function. we can't actually parse functions since input and output\n //types are lost at runtime, but we can check the runtime type of the object\n obj.parse = (i) => {\n if (typeof i !== 'function') {\n throw new Error(`${i} is not a function`);\n }\n //the return type here just has to match the inference of z.object,\n //the actual inference of the schema will be the z.ZodType custom\n return i as any;\n };\n return obj as unknown as z.ZodType<\n (\n ...args: z.infer<Input>\n //z.ZodPromise<T> infers as T, not Promise<T>\n ) => IsPromise<Output> extends true ? Promise<z.infer<Output>> : z.infer<Output>\n >;\n};\n\nexport const schemaIsFunctionSchema = (\n schema: z.ZodType,\n): schema is ReturnType<typeof functionSchema> => {\n return Object.hasOwn(schema, functionSchemaTag);\n};\n\nexport const customSchema = <T>(validate?: (data: any) => T) =>\n z.custom<T>(validate) as z.ZodType<T>;\n\nexport const createFunctionPointerSchema = <T extends FunctionPointer = FunctionPointer>() =>\n z.object({\n // FIXME this can be a real schema\n pointer: customSchema<T>(),\n });\n\nexport const createFunctionPointerWithArgsSchema = <\n T extends FunctionPointer = FunctionPointer,\n>() =>\n z.object({\n pointer: createFunctionPointerSchema<T>().shape.pointer,\n args: customSchema<Parameters<UnderlyingMethodOfFunctionPointer<T>>>(),\n });\n\nexport type ConstrainedGenericFunctionPointer<_ReturnType extends Promise<any>> = FunctionPointer<\n ReturnType<<T extends (...args: any[]) => _ReturnType>() => T>\n>;\n\n// This type doesn't work correctly\nexport const createExtendableFunctionPointerWithCurriedArgsSchema = <\n _BaseArgs extends any[],\n _ReturnType extends Promise<any>,\n>() =>\n z.object({\n pointer: createFunctionPointerSchema<\n // FIXME type args correctly\n ConstrainedGenericFunctionPointer<_ReturnType>\n >().shape.pointer,\n args: z.array(z.any()),\n });\n\nexport const bindFunctionPointerArgs = <T extends FunctionPointer>(params: {\n pointer: T;\n args: Parameters<UnderlyingMethodOfFunctionPointer<T>>;\n}) => params;\n\nexport const bindPartialFunctionPointerArgs = <T extends FunctionPointer>(params: {\n pointer: T;\n args: Partial<Parameters<UnderlyingMethodOfFunctionPointer<T>>>;\n}) => params;\n\nexport type FunctionPointerWithArgs<T extends FunctionPointer> = {\n pointer: T;\n args: Parameters<UnderlyingMethodOfFunctionPointer<T>>;\n};\n\nexport type BuildZodObject<T extends object> = z.ZodObject<\n {\n [K in keyof T]: z.ZodType<T[K]>;\n },\n z.core.$strip\n>;\n"]}
@@ -50,5 +50,5 @@ exports.createFunctionPointerWithArgsSchema = createFunctionPointerWithArgsSchem
50
50
  exports.customSchema = customSchema;
51
51
  exports.functionSchema = functionSchema;
52
52
  exports.schemaIsFunctionSchema = schemaIsFunctionSchema;
53
- //# sourceMappingURL=TDC7YIO4.cjs.map
54
- //# sourceMappingURL=TDC7YIO4.cjs.map
53
+ //# sourceMappingURL=WBHGMCS2.cjs.map
54
+ //# sourceMappingURL=WBHGMCS2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schema.ts"],"names":["functionSchemaTag","Symbol","functionSchema","input","output","obj","z","object","Object","defineProperty","value","writable","parse","i","Error","schemaIsFunctionSchema","schema","hasOwn","customSchema","validate","custom","createFunctionPointerSchema","pointer","createFunctionPointerWithArgsSchema","shape","args","createExtendableFunctionPointerWithCurriedArgsSchema","array","any","bindFunctionPointerArgs","params","bindPartialFunctionPointerArgs"],"mappings":";;;;;;AAwBA,IAAMA,iBAAAA,GAAoBC,OAAO,uBAAA,CAAA;AAG1B,IAAMC,cAAAA,mBAAiB,MAAA,CAAA,CAAqD,EAC/EC,KAAAA,EACAC,QAAM,KAIT;AACG,EAAA,MAAMC,GAAAA,GAAMC,KAAEC,MAAAA,CAAO;AACjBJ,IAAAA,KAAAA;AACAC,IAAAA;GACJ,CAAA;AACAI,EAAAA,MAAAA,CAAOC,cAAAA,CAAeJ,KAAKL,iBAAAA,EAAmB;IAAEU,KAAAA,EAAO,IAAA;IAAMC,QAAAA,EAAU;GAAM,CAAA;AAI7EN,EAAAA,GAAAA,CAAIO,KAAAA,GAAQ,CAACC,CAAAA,KAAAA;AACT,IAAA,IAAI,OAAOA,MAAM,UAAA,EAAY;AACzB,MAAA,MAAM,IAAIC,KAAAA,CAAM,CAAA,EAAGD,CAAAA,CAAAA,kBAAAA,CAAqB,CAAA;AAC5C,IAAA;AAGA,IAAA,OAAOA,CAAAA;AACX,EAAA,CAAA;AACA,EAAA,OAAOR,GAAAA;AAMX,CAAA,EA7B8B,gBAAA;AA+BvB,IAAMU,sBAAAA,2BACTC,MAAAA,KAAAA;AAEA,EAAA,OAAOR,MAAAA,CAAOS,MAAAA,CAAOD,MAAAA,EAAQhB,iBAAAA,CAAAA;AACjC,CAAA,EAJsC,wBAAA;AAM/B,IAAMkB,+BAAe,MAAA,CAAA,CAAIC,QAAAA,KAC5Bb,IAAAA,CAAEc,MAAAA,CAAUD,QAAAA,CAAAA,EADY,cAAA;AAGrB,IAAME,2BAAAA,mBAA8B,MAAA,CAAA,MACvCf,IAAAA,CAAEC,MAAAA,CAAO;;AAELe,EAAAA,OAAAA,EAASJ,YAAAA;AACb,CAAA,CAAA,EAJuC,6BAAA;AAMpC,IAAMK,mCAAAA,mBAAsC,MAAA,CAAA,MAG/CjB,IAAAA,CAAEC,MAAAA,CAAO;EACLe,OAAAA,EAASD,2BAAAA,GAAiCG,KAAAA,CAAMF,OAAAA;AAChDG,EAAAA,IAAAA,EAAMP,YAAAA;AACV,CAAA,CAAA,EAN+C,qCAAA;AAa5C,IAAMQ,oDAAAA,mBAAuD,MAAA,CAAA,MAIhEpB,IAAAA,CAAEC,MAAAA,CAAO;EACLe,OAAAA,EAASD,2BAAAA,GAGLG,KAAAA,CAAMF,OAAAA;AACVG,EAAAA,IAAAA,EAAMnB,IAAAA,CAAEqB,KAAAA,CAAMrB,IAAAA,CAAEsB,GAAAA,EAAG;AACvB,CAAA,CAAA,EAVgE,sDAAA;AAY7D,IAAMC,uBAAAA,mBAA0B,MAAA,CAAA,CAA4BC,MAAAA,KAG7DA,MAAAA,EAHiC,yBAAA;AAKhC,IAAMC,8BAAAA,mBAAiC,MAAA,CAAA,CAA4BD,MAAAA,KAGpEA,MAAAA,EAHwC,gCAAA","file":"TDC7YIO4.cjs","sourcesContent":["import { z } from 'zod/v4';\n\nimport type {\n FunctionPointer,\n UnderlyingMethodOfFunctionPointer,\n} from '@layerzerolabs/common-utils';\n\ntype IsPromise<T> =\n T extends z.ZodOptional<infer I>\n ? IsPromise<I>\n : T extends z.ZodDefault<infer I>\n ? IsPromise<I>\n : T extends z.ZodNullable<infer I>\n ? IsPromise<I>\n : T extends z.ZodPromise<any>\n ? true\n : false;\n\nexport type InferredArray<T extends z.ZodType[], Output extends any[] = []> = T extends []\n ? Output\n : T extends [infer Head, ...infer Tail extends z.ZodType[]]\n ? InferredArray<Tail, [...Output, z.infer<Head>]>\n : never;\n\nconst functionSchemaTag = Symbol('__FUNCTION_SCHEMA_TAG');\n\n//this essentially replicates the functionality of z.function in zod v3\nexport const functionSchema = <Input extends z.ZodTuple, Output extends z.ZodType>({\n input,\n output,\n}: {\n input: Input;\n output: Output;\n}) => {\n const obj = z.object({\n input,\n output,\n });\n Object.defineProperty(obj, functionSchemaTag, { value: true, writable: false });\n //we don't expect the function to actually be an object with an input field and an output field\n //so we override the parse function. we can't actually parse functions since input and output\n //types are lost at runtime, but we can check the runtime type of the object\n obj.parse = (i) => {\n if (typeof i !== 'function') {\n throw new Error(`${i} is not a function`);\n }\n //the return type here just has to match the inference of z.object,\n //the actual inference of the schema will be the z.ZodType custom\n return i as any;\n };\n return obj as unknown as z.ZodType<\n (\n ...args: z.infer<Input>\n //z.ZodPromise<T> infers as T, not Promise<T>\n ) => IsPromise<Output> extends true ? Promise<z.infer<Output>> : z.infer<Output>\n >;\n};\n\nexport const schemaIsFunctionSchema = (\n schema: z.ZodType,\n): schema is ReturnType<typeof functionSchema> => {\n return Object.hasOwn(schema, functionSchemaTag);\n};\n\nexport const customSchema = <T>(validate?: (data: any) => T) =>\n z.custom<T>(validate) as z.ZodType<T>;\n\nexport const createFunctionPointerSchema = <T extends FunctionPointer = FunctionPointer>() =>\n z.object({\n // FIXME this can be a real schema\n pointer: customSchema<T>(),\n });\n\nexport const createFunctionPointerWithArgsSchema = <\n T extends FunctionPointer = FunctionPointer,\n>() =>\n z.object({\n pointer: createFunctionPointerSchema<T>().shape.pointer,\n args: customSchema<Parameters<UnderlyingMethodOfFunctionPointer<T>>>(),\n });\n\nexport type ConstrainedGenericFunctionPointer<_ReturnType extends Promise<any>> = FunctionPointer<\n ReturnType<<T extends (...args: any[]) => _ReturnType>() => T>\n>;\n\n// This type doesn't work correctly\nexport const createExtendableFunctionPointerWithCurriedArgsSchema = <\n _BaseArgs extends any[],\n _ReturnType extends Promise<any>,\n>() =>\n z.object({\n pointer: createFunctionPointerSchema<\n // FIXME type args correctly\n ConstrainedGenericFunctionPointer<_ReturnType>\n >().shape.pointer,\n args: z.array(z.any()),\n });\n\nexport const bindFunctionPointerArgs = <T extends FunctionPointer>(params: {\n pointer: T;\n args: Parameters<UnderlyingMethodOfFunctionPointer<T>>;\n}) => params;\n\nexport const bindPartialFunctionPointerArgs = <T extends FunctionPointer>(params: {\n pointer: T;\n args: Partial<Parameters<UnderlyingMethodOfFunctionPointer<T>>>;\n}) => params;\n\nexport type BuildZodObject<T extends object> = z.ZodObject<\n {\n [K in keyof T]: z.ZodType<T[K]>;\n },\n z.core.$strip\n>;\n"]}
1
+ {"version":3,"sources":["../src/schema.ts"],"names":["functionSchemaTag","Symbol","functionSchema","input","output","obj","z","object","Object","defineProperty","value","writable","parse","i","Error","schemaIsFunctionSchema","schema","hasOwn","customSchema","validate","custom","createFunctionPointerSchema","pointer","createFunctionPointerWithArgsSchema","shape","args","createExtendableFunctionPointerWithCurriedArgsSchema","array","any","bindFunctionPointerArgs","params","bindPartialFunctionPointerArgs"],"mappings":";;;;;;AAwBA,IAAMA,iBAAAA,GAAoBC,OAAO,uBAAA,CAAA;AAG1B,IAAMC,cAAAA,mBAAiB,MAAA,CAAA,CAAqD,EAC/EC,KAAAA,EACAC,QAAM,KAIT;AACG,EAAA,MAAMC,GAAAA,GAAMC,KAAEC,MAAAA,CAAO;AACjBJ,IAAAA,KAAAA;AACAC,IAAAA;GACJ,CAAA;AACAI,EAAAA,MAAAA,CAAOC,cAAAA,CAAeJ,KAAKL,iBAAAA,EAAmB;IAAEU,KAAAA,EAAO,IAAA;IAAMC,QAAAA,EAAU;GAAM,CAAA;AAI7EN,EAAAA,GAAAA,CAAIO,KAAAA,GAAQ,CAACC,CAAAA,KAAAA;AACT,IAAA,IAAI,OAAOA,MAAM,UAAA,EAAY;AACzB,MAAA,MAAM,IAAIC,KAAAA,CAAM,CAAA,EAAGD,CAAAA,CAAAA,kBAAAA,CAAqB,CAAA;AAC5C,IAAA;AAGA,IAAA,OAAOA,CAAAA;AACX,EAAA,CAAA;AACA,EAAA,OAAOR,GAAAA;AAMX,CAAA,EA7B8B,gBAAA;AA+BvB,IAAMU,sBAAAA,2BACTC,MAAAA,KAAAA;AAEA,EAAA,OAAOR,MAAAA,CAAOS,MAAAA,CAAOD,MAAAA,EAAQhB,iBAAAA,CAAAA;AACjC,CAAA,EAJsC,wBAAA;AAM/B,IAAMkB,+BAAe,MAAA,CAAA,CAAIC,QAAAA,KAC5Bb,IAAAA,CAAEc,MAAAA,CAAUD,QAAAA,CAAAA,EADY,cAAA;AAGrB,IAAME,2BAAAA,mBAA8B,MAAA,CAAA,MACvCf,IAAAA,CAAEC,MAAAA,CAAO;;AAELe,EAAAA,OAAAA,EAASJ,YAAAA;AACb,CAAA,CAAA,EAJuC,6BAAA;AAMpC,IAAMK,mCAAAA,mBAAsC,MAAA,CAAA,MAG/CjB,IAAAA,CAAEC,MAAAA,CAAO;EACLe,OAAAA,EAASD,2BAAAA,GAAiCG,KAAAA,CAAMF,OAAAA;AAChDG,EAAAA,IAAAA,EAAMP,YAAAA;AACV,CAAA,CAAA,EAN+C,qCAAA;AAa5C,IAAMQ,oDAAAA,mBAAuD,MAAA,CAAA,MAIhEpB,IAAAA,CAAEC,MAAAA,CAAO;EACLe,OAAAA,EAASD,2BAAAA,GAGLG,KAAAA,CAAMF,OAAAA;AACVG,EAAAA,IAAAA,EAAMnB,IAAAA,CAAEqB,KAAAA,CAAMrB,IAAAA,CAAEsB,GAAAA,EAAG;AACvB,CAAA,CAAA,EAVgE,sDAAA;AAY7D,IAAMC,uBAAAA,mBAA0B,MAAA,CAAA,CAA4BC,MAAAA,KAG7DA,MAAAA,EAHiC,yBAAA;AAKhC,IAAMC,8BAAAA,mBAAiC,MAAA,CAAA,CAA4BD,MAAAA,KAGpEA,MAAAA,EAHwC,gCAAA","file":"WBHGMCS2.cjs","sourcesContent":["import { z } from 'zod/v4';\n\nimport type {\n FunctionPointer,\n UnderlyingMethodOfFunctionPointer,\n} from '@layerzerolabs/common-utils';\n\ntype IsPromise<T> =\n T extends z.ZodOptional<infer I>\n ? IsPromise<I>\n : T extends z.ZodDefault<infer I>\n ? IsPromise<I>\n : T extends z.ZodNullable<infer I>\n ? IsPromise<I>\n : T extends z.ZodPromise<any>\n ? true\n : false;\n\nexport type InferredArray<T extends z.ZodType[], Output extends any[] = []> = T extends []\n ? Output\n : T extends [infer Head, ...infer Tail extends z.ZodType[]]\n ? InferredArray<Tail, [...Output, z.infer<Head>]>\n : never;\n\nconst functionSchemaTag = Symbol('__FUNCTION_SCHEMA_TAG');\n\n//this essentially replicates the functionality of z.function in zod v3\nexport const functionSchema = <Input extends z.ZodTuple, Output extends z.ZodType>({\n input,\n output,\n}: {\n input: Input;\n output: Output;\n}) => {\n const obj = z.object({\n input,\n output,\n });\n Object.defineProperty(obj, functionSchemaTag, { value: true, writable: false });\n //we don't expect the function to actually be an object with an input field and an output field\n //so we override the parse function. we can't actually parse functions since input and output\n //types are lost at runtime, but we can check the runtime type of the object\n obj.parse = (i) => {\n if (typeof i !== 'function') {\n throw new Error(`${i} is not a function`);\n }\n //the return type here just has to match the inference of z.object,\n //the actual inference of the schema will be the z.ZodType custom\n return i as any;\n };\n return obj as unknown as z.ZodType<\n (\n ...args: z.infer<Input>\n //z.ZodPromise<T> infers as T, not Promise<T>\n ) => IsPromise<Output> extends true ? Promise<z.infer<Output>> : z.infer<Output>\n >;\n};\n\nexport const schemaIsFunctionSchema = (\n schema: z.ZodType,\n): schema is ReturnType<typeof functionSchema> => {\n return Object.hasOwn(schema, functionSchemaTag);\n};\n\nexport const customSchema = <T>(validate?: (data: any) => T) =>\n z.custom<T>(validate) as z.ZodType<T>;\n\nexport const createFunctionPointerSchema = <T extends FunctionPointer = FunctionPointer>() =>\n z.object({\n // FIXME this can be a real schema\n pointer: customSchema<T>(),\n });\n\nexport const createFunctionPointerWithArgsSchema = <\n T extends FunctionPointer = FunctionPointer,\n>() =>\n z.object({\n pointer: createFunctionPointerSchema<T>().shape.pointer,\n args: customSchema<Parameters<UnderlyingMethodOfFunctionPointer<T>>>(),\n });\n\nexport type ConstrainedGenericFunctionPointer<_ReturnType extends Promise<any>> = FunctionPointer<\n ReturnType<<T extends (...args: any[]) => _ReturnType>() => T>\n>;\n\n// This type doesn't work correctly\nexport const createExtendableFunctionPointerWithCurriedArgsSchema = <\n _BaseArgs extends any[],\n _ReturnType extends Promise<any>,\n>() =>\n z.object({\n pointer: createFunctionPointerSchema<\n // FIXME type args correctly\n ConstrainedGenericFunctionPointer<_ReturnType>\n >().shape.pointer,\n args: z.array(z.any()),\n });\n\nexport const bindFunctionPointerArgs = <T extends FunctionPointer>(params: {\n pointer: T;\n args: Parameters<UnderlyingMethodOfFunctionPointer<T>>;\n}) => params;\n\nexport const bindPartialFunctionPointerArgs = <T extends FunctionPointer>(params: {\n pointer: T;\n args: Partial<Parameters<UnderlyingMethodOfFunctionPointer<T>>>;\n}) => params;\n\nexport type FunctionPointerWithArgs<T extends FunctionPointer> = {\n pointer: T;\n args: Parameters<UnderlyingMethodOfFunctionPointer<T>>;\n};\n\nexport type BuildZodObject<T extends object> = z.ZodObject<\n {\n [K in keyof T]: z.ZodType<T[K]>;\n },\n z.core.$strip\n>;\n"]}
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var TDC7YIO4_cjs = require('./TDC7YIO4.cjs');
3
+ var WBHGMCS2_cjs = require('./WBHGMCS2.cjs');
4
4
  var v4 = require('zod/v4');
5
5
 
6
6
  var RESOLVING = Symbol("mapOnSchema/resolving");
@@ -18,7 +18,7 @@ function mapOnSchema(schema, fn) {
18
18
  results.set(s, result);
19
19
  return result;
20
20
  }
21
- TDC7YIO4_cjs.__name(mapElement, "mapElement");
21
+ WBHGMCS2_cjs.__name(mapElement, "mapElement");
22
22
  function mapInner() {
23
23
  if (schema instanceof v4.z.ZodObject) {
24
24
  const newShape = {};
@@ -69,7 +69,7 @@ function mapOnSchema(schema, fn) {
69
69
  return new v4.z.ZodLazy({
70
70
  ...schema.def,
71
71
  // NB: This leaks `fn` into the schema, but there is no other way to support recursive schemas
72
- getter: /* @__PURE__ */ TDC7YIO4_cjs.__name(() => mapElement(schema.def.getter()), "getter")
72
+ getter: /* @__PURE__ */ WBHGMCS2_cjs.__name(() => mapElement(schema.def.getter()), "getter")
73
73
  });
74
74
  } else if (schema instanceof v4.z.ZodPromise) {
75
75
  return new v4.z.ZodPromise({
@@ -108,50 +108,50 @@ function mapOnSchema(schema, fn) {
108
108
  return schema;
109
109
  }
110
110
  }
111
- TDC7YIO4_cjs.__name(mapInner, "mapInner");
111
+ WBHGMCS2_cjs.__name(mapInner, "mapInner");
112
112
  return fn(mapInner());
113
113
  }
114
- TDC7YIO4_cjs.__name(mapOnSchema, "mapOnSchema");
114
+ WBHGMCS2_cjs.__name(mapOnSchema, "mapOnSchema");
115
115
  function zodDeepPartial(schema) {
116
116
  return mapOnSchema(schema, (s) => s?.optional?.());
117
117
  }
118
- TDC7YIO4_cjs.__name(zodDeepPartial, "zodDeepPartial");
118
+ WBHGMCS2_cjs.__name(zodDeepPartial, "zodDeepPartial");
119
119
  function zodDeepRequired(schema) {
120
120
  return mapOnSchema(schema, (s) => s?.nonoptional?.());
121
121
  }
122
- TDC7YIO4_cjs.__name(zodDeepRequired, "zodDeepRequired");
122
+ WBHGMCS2_cjs.__name(zodDeepRequired, "zodDeepRequired");
123
123
 
124
124
  Object.defineProperty(exports, "bindFunctionPointerArgs", {
125
125
  enumerable: true,
126
- get: function () { return TDC7YIO4_cjs.bindFunctionPointerArgs; }
126
+ get: function () { return WBHGMCS2_cjs.bindFunctionPointerArgs; }
127
127
  });
128
128
  Object.defineProperty(exports, "bindPartialFunctionPointerArgs", {
129
129
  enumerable: true,
130
- get: function () { return TDC7YIO4_cjs.bindPartialFunctionPointerArgs; }
130
+ get: function () { return WBHGMCS2_cjs.bindPartialFunctionPointerArgs; }
131
131
  });
132
132
  Object.defineProperty(exports, "createExtendableFunctionPointerWithCurriedArgsSchema", {
133
133
  enumerable: true,
134
- get: function () { return TDC7YIO4_cjs.createExtendableFunctionPointerWithCurriedArgsSchema; }
134
+ get: function () { return WBHGMCS2_cjs.createExtendableFunctionPointerWithCurriedArgsSchema; }
135
135
  });
136
136
  Object.defineProperty(exports, "createFunctionPointerSchema", {
137
137
  enumerable: true,
138
- get: function () { return TDC7YIO4_cjs.createFunctionPointerSchema; }
138
+ get: function () { return WBHGMCS2_cjs.createFunctionPointerSchema; }
139
139
  });
140
140
  Object.defineProperty(exports, "createFunctionPointerWithArgsSchema", {
141
141
  enumerable: true,
142
- get: function () { return TDC7YIO4_cjs.createFunctionPointerWithArgsSchema; }
142
+ get: function () { return WBHGMCS2_cjs.createFunctionPointerWithArgsSchema; }
143
143
  });
144
144
  Object.defineProperty(exports, "customSchema", {
145
145
  enumerable: true,
146
- get: function () { return TDC7YIO4_cjs.customSchema; }
146
+ get: function () { return WBHGMCS2_cjs.customSchema; }
147
147
  });
148
148
  Object.defineProperty(exports, "functionSchema", {
149
149
  enumerable: true,
150
- get: function () { return TDC7YIO4_cjs.functionSchema; }
150
+ get: function () { return WBHGMCS2_cjs.functionSchema; }
151
151
  });
152
152
  Object.defineProperty(exports, "schemaIsFunctionSchema", {
153
153
  enumerable: true,
154
- get: function () { return TDC7YIO4_cjs.schemaIsFunctionSchema; }
154
+ get: function () { return WBHGMCS2_cjs.schemaIsFunctionSchema; }
155
155
  });
156
156
  exports.mapOnSchema = mapOnSchema;
157
157
  exports.zodDeepPartial = zodDeepPartial;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { __name } from './CJDRGNOS.js';
2
- export { bindFunctionPointerArgs, bindPartialFunctionPointerArgs, createExtendableFunctionPointerWithCurriedArgsSchema, createFunctionPointerSchema, createFunctionPointerWithArgsSchema, customSchema, functionSchema, schemaIsFunctionSchema } from './CJDRGNOS.js';
1
+ import { __name } from './25UQQMRA.js';
2
+ export { bindFunctionPointerArgs, bindPartialFunctionPointerArgs, createExtendableFunctionPointerWithCurriedArgsSchema, createFunctionPointerSchema, createFunctionPointerWithArgsSchema, customSchema, functionSchema, schemaIsFunctionSchema } from './25UQQMRA.js';
3
3
  import { z } from 'zod/v4';
4
4
 
5
5
  var RESOLVING = Symbol("mapOnSchema/resolving");
package/dist/schema.cjs CHANGED
@@ -1,40 +1,40 @@
1
1
  'use strict';
2
2
 
3
- var TDC7YIO4_cjs = require('./TDC7YIO4.cjs');
3
+ var WBHGMCS2_cjs = require('./WBHGMCS2.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "bindFunctionPointerArgs", {
8
8
  enumerable: true,
9
- get: function () { return TDC7YIO4_cjs.bindFunctionPointerArgs; }
9
+ get: function () { return WBHGMCS2_cjs.bindFunctionPointerArgs; }
10
10
  });
11
11
  Object.defineProperty(exports, "bindPartialFunctionPointerArgs", {
12
12
  enumerable: true,
13
- get: function () { return TDC7YIO4_cjs.bindPartialFunctionPointerArgs; }
13
+ get: function () { return WBHGMCS2_cjs.bindPartialFunctionPointerArgs; }
14
14
  });
15
15
  Object.defineProperty(exports, "createExtendableFunctionPointerWithCurriedArgsSchema", {
16
16
  enumerable: true,
17
- get: function () { return TDC7YIO4_cjs.createExtendableFunctionPointerWithCurriedArgsSchema; }
17
+ get: function () { return WBHGMCS2_cjs.createExtendableFunctionPointerWithCurriedArgsSchema; }
18
18
  });
19
19
  Object.defineProperty(exports, "createFunctionPointerSchema", {
20
20
  enumerable: true,
21
- get: function () { return TDC7YIO4_cjs.createFunctionPointerSchema; }
21
+ get: function () { return WBHGMCS2_cjs.createFunctionPointerSchema; }
22
22
  });
23
23
  Object.defineProperty(exports, "createFunctionPointerWithArgsSchema", {
24
24
  enumerable: true,
25
- get: function () { return TDC7YIO4_cjs.createFunctionPointerWithArgsSchema; }
25
+ get: function () { return WBHGMCS2_cjs.createFunctionPointerWithArgsSchema; }
26
26
  });
27
27
  Object.defineProperty(exports, "customSchema", {
28
28
  enumerable: true,
29
- get: function () { return TDC7YIO4_cjs.customSchema; }
29
+ get: function () { return WBHGMCS2_cjs.customSchema; }
30
30
  });
31
31
  Object.defineProperty(exports, "functionSchema", {
32
32
  enumerable: true,
33
- get: function () { return TDC7YIO4_cjs.functionSchema; }
33
+ get: function () { return WBHGMCS2_cjs.functionSchema; }
34
34
  });
35
35
  Object.defineProperty(exports, "schemaIsFunctionSchema", {
36
36
  enumerable: true,
37
- get: function () { return TDC7YIO4_cjs.schemaIsFunctionSchema; }
37
+ get: function () { return WBHGMCS2_cjs.schemaIsFunctionSchema; }
38
38
  });
39
39
  //# sourceMappingURL=schema.cjs.map
40
40
  //# sourceMappingURL=schema.cjs.map
package/dist/schema.d.ts CHANGED
@@ -34,6 +34,10 @@ export declare const bindPartialFunctionPointerArgs: <T extends FunctionPointer>
34
34
  pointer: T;
35
35
  args: Partial<Parameters<UnderlyingMethodOfFunctionPointer<T>>>;
36
36
  };
37
+ export type FunctionPointerWithArgs<T extends FunctionPointer> = {
38
+ pointer: T;
39
+ args: Parameters<UnderlyingMethodOfFunctionPointer<T>>;
40
+ };
37
41
  export type BuildZodObject<T extends object> = z.ZodObject<{
38
42
  [K in keyof T]: z.ZodType<T[K]>;
39
43
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,KAAK,EACR,eAAe,EACf,iCAAiC,EACpC,MAAM,6BAA6B,CAAC;AAErC,KAAK,SAAS,CAAC,CAAC,IACZ,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAC1B,SAAS,CAAC,CAAC,CAAC,GACZ,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAC7B,SAAS,CAAC,CAAC,CAAC,GACZ,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAC9B,SAAS,CAAC,CAAC,CAAC,GACZ,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GACzB,IAAI,GACJ,KAAK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I;IAC7D,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,UAAU,CAAC,iCAAiC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,CAAC,SAAS,CACtD;KACK,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,EACD,CAAC,CAAC,IAAI,CAAC,MAAM,CAChB,CAAC"}
package/dist/schema.js CHANGED
@@ -1,3 +1,3 @@
1
- export { bindFunctionPointerArgs, bindPartialFunctionPointerArgs, createExtendableFunctionPointerWithCurriedArgsSchema, createFunctionPointerSchema, createFunctionPointerWithArgsSchema, customSchema, functionSchema, schemaIsFunctionSchema } from './CJDRGNOS.js';
1
+ export { bindFunctionPointerArgs, bindPartialFunctionPointerArgs, createExtendableFunctionPointerWithCurriedArgsSchema, createFunctionPointerSchema, createFunctionPointerWithArgsSchema, customSchema, functionSchema, schemaIsFunctionSchema } from './25UQQMRA.js';
2
2
  //# sourceMappingURL=schema.js.map
3
3
  //# sourceMappingURL=schema.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/zod-utils",
3
- "version": "0.0.67",
3
+ "version": "0.0.74",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -15,12 +15,12 @@
15
15
  "types": "./dist/index.d.ts",
16
16
  "dependencies": {
17
17
  "zod": "3.25.56",
18
- "@layerzerolabs/common-utils": "0.0.67"
18
+ "@layerzerolabs/common-utils": "0.0.74"
19
19
  },
20
20
  "devDependencies": {
21
21
  "tsup": "^8.4.0",
22
- "@layerzerolabs/tsup-configuration": "0.0.67",
23
- "@layerzerolabs/typescript-configuration": "0.0.67"
22
+ "@layerzerolabs/tsup-configuration": "0.0.74",
23
+ "@layerzerolabs/typescript-configuration": "0.0.74"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "restricted",
package/src/schema.ts CHANGED
@@ -106,6 +106,11 @@ export const bindPartialFunctionPointerArgs = <T extends FunctionPointer>(params
106
106
  args: Partial<Parameters<UnderlyingMethodOfFunctionPointer<T>>>;
107
107
  }) => params;
108
108
 
109
+ export type FunctionPointerWithArgs<T extends FunctionPointer> = {
110
+ pointer: T;
111
+ args: Parameters<UnderlyingMethodOfFunctionPointer<T>>;
112
+ };
113
+
109
114
  export type BuildZodObject<T extends object> = z.ZodObject<
110
115
  {
111
116
  [K in keyof T]: z.ZodType<T[K]>;