@zodyac/zod-mongoose 3.0.0 → 3.1.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/CHANGELOG.md +2 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types, SchemaTypes, SchemaOptions, Schema } from 'mongoose';
|
|
1
|
+
import { Types, SchemaTypes, SchemaDefinition, SchemaTypeOptions, SchemaOptions, Schema } from 'mongoose';
|
|
2
2
|
import { z, ZodType, ZodRawShape, ZodObject } from 'zod';
|
|
3
3
|
|
|
4
4
|
declare namespace zm {
|
|
@@ -66,8 +66,8 @@ declare namespace zm {
|
|
|
66
66
|
of?: Constructor;
|
|
67
67
|
}
|
|
68
68
|
type mField = mString | mNumber | mBoolean | mDate | mObjectId | mUUID | mMixed<unknown> | mArray<unknown> | _Schema<unknown> | mMap<unknown, unknown>;
|
|
69
|
-
type _Schema<T> = {
|
|
70
|
-
[K in keyof T]: _Field<T[K]> | _Schema<T[K]>;
|
|
69
|
+
type _Schema<T> = SchemaDefinition & {
|
|
70
|
+
[K in keyof T]: (_Field<T[K]> & SchemaTypeOptions<T[K]>) | _Schema<T[K]>;
|
|
71
71
|
};
|
|
72
72
|
type UnwrapZodType<T> = T extends ZodType<infer K> ? K : never;
|
|
73
73
|
type EffectValidator<T> = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types, SchemaTypes, SchemaOptions, Schema } from 'mongoose';
|
|
1
|
+
import { Types, SchemaTypes, SchemaDefinition, SchemaTypeOptions, SchemaOptions, Schema } from 'mongoose';
|
|
2
2
|
import { z, ZodType, ZodRawShape, ZodObject } from 'zod';
|
|
3
3
|
|
|
4
4
|
declare namespace zm {
|
|
@@ -66,8 +66,8 @@ declare namespace zm {
|
|
|
66
66
|
of?: Constructor;
|
|
67
67
|
}
|
|
68
68
|
type mField = mString | mNumber | mBoolean | mDate | mObjectId | mUUID | mMixed<unknown> | mArray<unknown> | _Schema<unknown> | mMap<unknown, unknown>;
|
|
69
|
-
type _Schema<T> = {
|
|
70
|
-
[K in keyof T]: _Field<T[K]> | _Schema<T[K]>;
|
|
69
|
+
type _Schema<T> = SchemaDefinition & {
|
|
70
|
+
[K in keyof T]: (_Field<T[K]> & SchemaTypeOptions<T[K]>) | _Schema<T[K]>;
|
|
71
71
|
};
|
|
72
72
|
type UnwrapZodType<T> = T extends ZodType<infer K> ? K : never;
|
|
73
73
|
type EffectValidator<T> = {
|