@decaf-ts/as-zod 1.11.0 → 1.13.0
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/lib/cjs/index.cjs +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/types/index.d.cts +3 -3
- package/lib/types/index.d.mts +3 -3
- package/package.json +1 -1
- package/lib/types/index.d.ts +0 -9
- package/lib/types/overrides.d.ts +0 -8
- package/lib/types/zod.d.ts +0 -17
package/lib/cjs/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ __exportStar(require("./overrides.cjs"), exports);
|
|
|
24
24
|
* @const VERSION
|
|
25
25
|
* @memberOf module:as-zod
|
|
26
26
|
*/
|
|
27
|
-
exports.VERSION = "1.
|
|
27
|
+
exports.VERSION = "1.12.0";
|
|
28
28
|
decoration_1.Metadata.registerLibrary("@decaf-ts/as-zod", exports.VERSION);
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
|
30
30
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js
CHANGED
package/lib/types/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from "./zod.
|
|
2
|
-
export * from "./overrides.
|
|
1
|
+
export * from "./zod.d.cts";
|
|
2
|
+
export * from "./overrides.d.cts";
|
|
3
3
|
/**
|
|
4
4
|
* @description Current version of the reflection package
|
|
5
5
|
* @summary Stores the semantic version number of the package
|
|
6
6
|
* @const VERSION
|
|
7
7
|
* @memberOf module:as-zod
|
|
8
8
|
*/
|
|
9
|
-
export declare const VERSION = "1.
|
|
9
|
+
export declare const VERSION = "1.12.0";
|
package/lib/types/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from "./zod.
|
|
2
|
-
export * from "./overrides.
|
|
1
|
+
export * from "./zod.d.mts";
|
|
2
|
+
export * from "./overrides.d.mts";
|
|
3
3
|
/**
|
|
4
4
|
* @description Current version of the reflection package
|
|
5
5
|
* @summary Stores the semantic version number of the package
|
|
6
6
|
* @const VERSION
|
|
7
7
|
* @memberOf module:as-zod
|
|
8
8
|
*/
|
|
9
|
-
export declare const VERSION = "1.
|
|
9
|
+
export declare const VERSION = "1.12.0";
|
package/package.json
CHANGED
package/lib/types/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./zod";
|
|
2
|
-
export * from "./overrides";
|
|
3
|
-
/**
|
|
4
|
-
* @description Current version of the reflection package
|
|
5
|
-
* @summary Stores the semantic version number of the package
|
|
6
|
-
* @const VERSION
|
|
7
|
-
* @memberOf module:as-zod
|
|
8
|
-
*/
|
|
9
|
-
export declare const VERSION = "1.10.0";
|
package/lib/types/overrides.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Model, ValidatorOptions, ExtendedMetadata } from "@decaf-ts/decorator-validation";
|
|
2
|
-
import { Constructor } from "@decaf-ts/decoration";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
export declare function zodify(type: string | string[], zz?: any): any;
|
|
5
|
-
export declare function zodifyValidation(zod: any, type: string, values: ValidatorOptions): any;
|
|
6
|
-
export declare function modelToZod<M extends Model, META extends ExtendedMetadata<M>>(model: M | Constructor<M>): z.ZodObject<{
|
|
7
|
-
[x: string]: any;
|
|
8
|
-
}, z.core.$strip>;
|
package/lib/types/zod.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Model } from "@decaf-ts/decorator-validation";
|
|
2
|
-
import type { Constructor } from "@decaf-ts/decoration";
|
|
3
|
-
import type { ZodArray, ZodBigInt, ZodBoolean, ZodDate, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodSet, ZodString, ZodTypeAny } from "zod";
|
|
4
|
-
type BaseZodSchemaFor<T> = T extends string ? ZodString : T extends number ? ZodNumber : T extends boolean ? ZodBoolean : T extends bigint ? ZodBigInt : T extends Date ? ZodDate : T extends any[] ? ZodArray<ZodTypeAny> : T extends Set<any> ? ZodSet<ZodTypeAny> : T extends Model ? ZodObject<any> : ZodTypeAny;
|
|
5
|
-
export type ZodSchemaFor<T> = undefined extends T ? ZodOptional<BaseZodSchemaFor<Exclude<T, undefined>>> : null extends T ? ZodNullable<BaseZodSchemaFor<NonNullable<T>>> : BaseZodSchemaFor<T>;
|
|
6
|
-
export type ZodShapeFor<M> = {
|
|
7
|
-
[K in keyof M as M[K] extends (...args: any[]) => any ? never : K]: ZodSchemaFor<M[K]>;
|
|
8
|
-
};
|
|
9
|
-
export type ZodFrom<M extends Model> = ZodObject<ZodShapeFor<M>>;
|
|
10
|
-
export type ListOf<T> = T[];
|
|
11
|
-
export type SetOf<T> = Set<T>;
|
|
12
|
-
declare module "zod" {
|
|
13
|
-
namespace z {
|
|
14
|
-
function from<M extends Model>(model: Constructor<M>): ZodFrom<M>;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export {};
|