@ptolemy2002/zod-utils 1.0.0 → 1.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/README.md +1 -0
- package/dist/clone.d.ts +2 -0
- package/dist/clone.js +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ Various utilities for working with Zod schemas.
|
|
|
4
4
|
## Table of Contents
|
|
5
5
|
- [Type Reference](docs/type-reference.md) - Complete type definitions for all exported types
|
|
6
6
|
- `util` - Utilities for working with Zod schemas and errors
|
|
7
|
+
- [clone](docs/util/clone.md) - Utility for cloning Zod schemas without affecting the original
|
|
7
8
|
- [interpret](docs/util/interpret.md) - Utilities for formatting Zod errors as strings
|
|
8
9
|
- [typeGuards](docs/util/typeGuards.md) - Type guards for Zod-related values
|
|
9
10
|
- [validate](docs/util/validate.md) - Schema-wrapping factories for creating validators
|
package/dist/clone.d.ts
ADDED
package/dist/clone.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.zodClone = zodClone;
|
|
4
|
+
function zodClone(schema) {
|
|
5
|
+
// This `refine` pattern allows us to copy the schema so that
|
|
6
|
+
// the original metadata is not overwritten
|
|
7
|
+
return schema.refine(() => true);
|
|
8
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ptolemy2002/zod-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,11 +28,9 @@
|
|
|
28
28
|
"release-minor": "bash ./scripts/release.sh minor",
|
|
29
29
|
"release-major": "bash ./scripts/release.sh major"
|
|
30
30
|
},
|
|
31
|
-
|
|
32
31
|
"peerDependencies": {
|
|
33
32
|
"zod": "^4.3.6"
|
|
34
33
|
},
|
|
35
|
-
|
|
36
34
|
"devDependencies": {
|
|
37
35
|
"@types/jest": "^29.5.0",
|
|
38
36
|
"@types/node": "^25.3.5",
|
|
@@ -43,4 +41,4 @@
|
|
|
43
41
|
"typescript-transform-paths": "^3.5.3",
|
|
44
42
|
"zod": "^4.3.6"
|
|
45
43
|
}
|
|
46
|
-
}
|
|
44
|
+
}
|