@express-zod-api/zod-plugin 1.1.0-beta.1 → 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/CHANGELOG.md +1 -1
- package/README.md +2 -2
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
### v1.1.0
|
|
6
6
|
|
|
7
|
-
- Added low-level helpers `pack()` and `unpack()` to handle inheritable
|
|
7
|
+
- Added low-level helpers `pack()` and `unpack()` to handle inheritable attributes that withstands refinements:
|
|
8
8
|
- `schema.brand()` is a shorthand for `pack(schema, { brand })`;
|
|
9
9
|
- `getBrand()` is a shorthand for `unpack(schema).brand`.
|
|
10
10
|
|
package/README.md
CHANGED
|
@@ -35,5 +35,5 @@ schema.meta(); // { examples: ["test", "another"] }
|
|
|
35
35
|
## Helpers
|
|
36
36
|
|
|
37
37
|
- `getBrand()` — retrieves the brand from the schema that was set by its `.brand()` method;
|
|
38
|
-
- `pack()` — returns a cloned schema having inheritable
|
|
39
|
-
- `unpack()` — retrieves the
|
|
38
|
+
- `pack()` — returns a cloned schema having inheritable attributes assigned (such as brand);
|
|
39
|
+
- `unpack()` — retrieves the attributes from the schema that was set by `pack()` helper.
|
package/dist/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ declare module "zod" {
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* @public
|
|
57
|
-
* @desc Attaches an inheritable
|
|
57
|
+
* @desc Attaches an inheritable attributes to the schema (withstands refinements).
|
|
58
58
|
*/
|
|
59
59
|
declare const pack: <T extends z.ZodType, B extends object>(subject: T, bag: B) => T & {
|
|
60
60
|
_zod: {
|
|
@@ -63,7 +63,7 @@ declare const pack: <T extends z.ZodType, B extends object>(subject: T, bag: B)
|
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
65
|
* @public
|
|
66
|
-
* @desc Retrieves the
|
|
66
|
+
* @desc Retrieves the attributes attached to the schema by pack() method.
|
|
67
67
|
*/
|
|
68
68
|
declare const unpack: <T extends z.core.$ZodType>(subject: T) => T["_zod"]["bag"];
|
|
69
69
|
|