@mirite/zod-to-mongoose 0.0.1 → 0.0.3
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/package.json +2 -2
- package/readme.md +2 -2
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirite/zod-to-mongoose",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Package for creating mongoose schemas out of Zod schemas for type safety, and removing duplicate effort.",
|
|
5
|
-
"types": "dist/_tsup-dts-rollup.d.ts",
|
|
5
|
+
"types": "./dist/_tsup-dts-rollup.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
package/readme.md
CHANGED
|
@@ -33,7 +33,7 @@ const result = await model.create({
|
|
|
33
33
|
````
|
|
34
34
|
|
|
35
35
|
### Advanced
|
|
36
|
-
If you pass a connection, the model will be created,
|
|
36
|
+
If you pass a connection, the model will be created, registered with the connection, and returned for use.
|
|
37
37
|
```typescript
|
|
38
38
|
import { createSchema } from "@mirite/zod-to-mongoose";
|
|
39
39
|
|
|
@@ -64,4 +64,4 @@ Only a subset of Zod types are supported. The following types are supported:
|
|
|
64
64
|
- `z.object()` (Nested objects are supported)
|
|
65
65
|
- `z.union()` (Type safety is not guaranteed)
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
Another major caveat is that no additional validation is performed on the Mongoose schema. It is recommended to use Zod for validation before saving to the database, as well as on retrieval if there are data integrity concerns.
|