@kubb/plugin-zod 5.1.3 → 5.1.5
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.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -3
package/dist/index.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ type PrinterZodFactory = ast.PrinterFactoryOptions<'zod', PrinterZodOptions, str
|
|
|
106
106
|
* const code = printer.print(stringNode) // "z.string()"
|
|
107
107
|
* ```
|
|
108
108
|
*/
|
|
109
|
-
declare const printerZod: (options?: PrinterZodOptions | undefined) => ast.Printer<PrinterZodFactory>;
|
|
109
|
+
export declare const printerZod: (options?: PrinterZodOptions | undefined) => ast.Printer<PrinterZodFactory>;
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region src/printers/printerZodMini.d.ts
|
|
112
112
|
/**
|
|
@@ -180,7 +180,7 @@ type PrinterZodMiniFactory = ast.PrinterFactoryOptions<'zod-mini', PrinterZodMin
|
|
|
180
180
|
* const code = printer.print(optionalStringNode) // "z.optional(z.string())"
|
|
181
181
|
* ```
|
|
182
182
|
*/
|
|
183
|
-
declare const printerZodMini: (options?: PrinterZodMiniOptions | undefined) => ast.Printer<PrinterZodMiniFactory>;
|
|
183
|
+
export declare const printerZodMini: (options?: PrinterZodMiniOptions | undefined) => ast.Printer<PrinterZodMiniFactory>;
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region src/types.d.ts
|
|
186
186
|
/**
|
|
@@ -442,14 +442,14 @@ declare global {
|
|
|
442
442
|
* When `mini: true`, schemas use the Zod Mini functional API instead of
|
|
443
443
|
* chainable methods.
|
|
444
444
|
*/
|
|
445
|
-
declare const zodGenerator: import("kubb/kit").Generator<PluginZod, unknown>;
|
|
445
|
+
export declare const zodGenerator: import("kubb/kit").Generator<PluginZod, unknown>;
|
|
446
446
|
//#endregion
|
|
447
447
|
//#region src/plugin.d.ts
|
|
448
448
|
/**
|
|
449
449
|
* Canonical plugin name for `@kubb/plugin-zod`. Used for driver lookups and
|
|
450
450
|
* cross-plugin dependency references.
|
|
451
451
|
*/
|
|
452
|
-
declare const pluginZodName = "plugin-zod";
|
|
452
|
+
export declare const pluginZodName = "plugin-zod";
|
|
453
453
|
/**
|
|
454
454
|
* Generates Zod v4 schemas from an OpenAPI spec. Use them to validate API
|
|
455
455
|
* responses at runtime, build form schemas, or feed back into router libraries
|
|
@@ -476,7 +476,7 @@ declare const pluginZodName = "plugin-zod";
|
|
|
476
476
|
* })
|
|
477
477
|
* ```
|
|
478
478
|
*/
|
|
479
|
-
declare const pluginZod: (options?: Options | undefined) => import("kubb/kit").Plugin<PluginZod>;
|
|
479
|
+
export declare const pluginZod: (options?: Options | undefined) => import("kubb/kit").Plugin<PluginZod>;
|
|
480
480
|
//#endregion
|
|
481
481
|
//#region src/resolvers/resolverZod.d.ts
|
|
482
482
|
/**
|
|
@@ -494,7 +494,7 @@ declare const pluginZod: (options?: Options | undefined) => import("kubb/kit").P
|
|
|
494
494
|
* resolverZod.schema.typeName('pet') // 'PetSchemaType'
|
|
495
495
|
* ```
|
|
496
496
|
*/
|
|
497
|
-
declare const resolverZod: ResolverZod;
|
|
497
|
+
export declare const resolverZod: ResolverZod;
|
|
498
498
|
//#endregion
|
|
499
|
-
export { type PluginZod, type PrinterZodFactory, type PrinterZodMiniFactory, type PrinterZodMiniNodes, type PrinterZodMiniOptions, type PrinterZodNodes, type PrinterZodOptions, type ResolverZod, pluginZod as default
|
|
499
|
+
export { type PluginZod, type PrinterZodFactory, type PrinterZodMiniFactory, type PrinterZodMiniNodes, type PrinterZodMiniOptions, type PrinterZodNodes, type PrinterZodOptions, type ResolverZod, pluginZod as default };
|
|
500
500
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1546,7 +1546,7 @@ const printerZodMini = ast.createPrinter((options) => {
|
|
|
1546
1546
|
...node,
|
|
1547
1547
|
regexType: this.options.regexType
|
|
1548
1548
|
})}`;
|
|
1549
|
-
return node.unique ? `${base}.refine(items => new Set(items).size === items.length, { message: "Array entries must be unique" })` : base;
|
|
1549
|
+
return node.unique ? `${base}.check(z.refine(items => new Set(items).size === items.length, { message: "Array entries must be unique" }))` : base;
|
|
1550
1550
|
},
|
|
1551
1551
|
tuple(node) {
|
|
1552
1552
|
return `z.tuple(${buildList(mapSchemaItems(node, (item) => this.transform(item)).map(({ output }) => output).filter(Boolean))})`;
|