@cabloy/zod 4.3.6 → 4.3.7
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 +3 -4
- package/src/v4/core/schemas.ts +2 -1
- package/src/v4/core/versions.ts +1 -1
- package/v4/core/schemas.cjs +1 -1
- package/v4/core/schemas.d.cts +1 -0
- package/v4/core/schemas.d.ts +1 -0
- package/v4/core/schemas.js +1 -1
- package/v4/core/versions.cjs +1 -1
- package/v4/core/versions.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabloy/zod",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colin McDonnell <zod@colinhacks.com>",
|
|
@@ -129,7 +129,6 @@
|
|
|
129
129
|
"build": "zshy --project tsconfig.build.json",
|
|
130
130
|
"postbuild": "tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .",
|
|
131
131
|
"test:watch": "pnpm vitest",
|
|
132
|
-
"test": "pnpm vitest run"
|
|
133
|
-
"prepublishOnly": "tsx ../../scripts/check-versions.ts"
|
|
132
|
+
"test": "pnpm vitest run"
|
|
134
133
|
}
|
|
135
|
-
}
|
|
134
|
+
}
|
package/src/v4/core/schemas.ts
CHANGED
|
@@ -36,6 +36,7 @@ export interface ParsePayload<T = unknown> {
|
|
|
36
36
|
issues: errors.$ZodRawIssue[];
|
|
37
37
|
/** A way to mark a whole payload as aborted. Used in codecs/pipes. */
|
|
38
38
|
aborted?: boolean;
|
|
39
|
+
parent?: unknown;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
export type CheckFn<T> = (input: ParsePayload<T>) => util.MaybeAsync<void>;
|
|
@@ -1925,7 +1926,7 @@ export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$con
|
|
|
1925
1926
|
const el = shape[key]!;
|
|
1926
1927
|
const isOptionalOut = el._zod.optout === "optional";
|
|
1927
1928
|
|
|
1928
|
-
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1929
|
+
const r = el._zod.run({ value: input[key], issues: [], parent: input }, ctx);
|
|
1929
1930
|
if (r instanceof Promise) {
|
|
1930
1931
|
proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
|
|
1931
1932
|
} else {
|
package/src/v4/core/versions.ts
CHANGED
package/v4/core/schemas.cjs
CHANGED
|
@@ -863,7 +863,7 @@ exports.$ZodObject = core.$constructor("$ZodObject", (inst, def) => {
|
|
|
863
863
|
for (const key of value.keys) {
|
|
864
864
|
const el = shape[key];
|
|
865
865
|
const isOptionalOut = el._zod.optout === "optional";
|
|
866
|
-
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
866
|
+
const r = el._zod.run({ value: input[key], issues: [], parent: input }, ctx);
|
|
867
867
|
if (r instanceof Promise) {
|
|
868
868
|
proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
|
|
869
869
|
}
|
package/v4/core/schemas.d.cts
CHANGED
|
@@ -25,6 +25,7 @@ export interface ParsePayload<T = unknown> {
|
|
|
25
25
|
issues: errors.$ZodRawIssue[];
|
|
26
26
|
/** A way to mark a whole payload as aborted. Used in codecs/pipes. */
|
|
27
27
|
aborted?: boolean;
|
|
28
|
+
parent?: unknown;
|
|
28
29
|
}
|
|
29
30
|
export type CheckFn<T> = (input: ParsePayload<T>) => util.MaybeAsync<void>;
|
|
30
31
|
export interface $ZodTypeDef {
|
package/v4/core/schemas.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface ParsePayload<T = unknown> {
|
|
|
25
25
|
issues: errors.$ZodRawIssue[];
|
|
26
26
|
/** A way to mark a whole payload as aborted. Used in codecs/pipes. */
|
|
27
27
|
aborted?: boolean;
|
|
28
|
+
parent?: unknown;
|
|
28
29
|
}
|
|
29
30
|
export type CheckFn<T> = (input: ParsePayload<T>) => util.MaybeAsync<void>;
|
|
30
31
|
export interface $ZodTypeDef {
|
package/v4/core/schemas.js
CHANGED
|
@@ -831,7 +831,7 @@ export const $ZodObject = /*@__PURE__*/ core.$constructor("$ZodObject", (inst, d
|
|
|
831
831
|
for (const key of value.keys) {
|
|
832
832
|
const el = shape[key];
|
|
833
833
|
const isOptionalOut = el._zod.optout === "optional";
|
|
834
|
-
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
834
|
+
const r = el._zod.run({ value: input[key], issues: [], parent: input }, ctx);
|
|
835
835
|
if (r instanceof Promise) {
|
|
836
836
|
proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
|
|
837
837
|
}
|
package/v4/core/versions.cjs
CHANGED
package/v4/core/versions.js
CHANGED