zod 4.1.12 → 4.1.13-beta.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/index.cjs +10 -17
- package/index.d.cts +3 -4
- package/index.d.ts +3 -4
- package/index.js +7 -4
- package/package.json +1 -1
- package/src/index.ts +9 -4
- package/src/v4/core/core.ts +7 -0
- package/src/v4/core/schemas.ts +1 -1
- package/v4/core/core.cjs +7 -0
- package/v4/core/core.js +7 -0
- package/v4/core/schemas.cjs +1 -1
- package/v4/core/schemas.js +1 -1
package/index.cjs
CHANGED
|
@@ -10,24 +10,17 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
15
|
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
28
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
const index_js_1 = __importDefault(require("./v4/classic/index.cjs"));
|
|
21
|
+
__exportStar(require("./v4/classic/index.cjs"), exports);
|
|
22
|
+
// export { z };
|
|
23
|
+
exports.default = index_js_1.default;
|
|
24
|
+
// import z4 from "./classic/index.js";
|
|
25
|
+
// export * from "./classic/index.js";
|
|
26
|
+
// export default z4;
|
package/index.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export * from "./v4/classic/
|
|
3
|
-
export
|
|
4
|
-
export default z;
|
|
1
|
+
import z4 from "./v4/classic/index.cjs";
|
|
2
|
+
export * from "./v4/classic/index.cjs";
|
|
3
|
+
export default z4;
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export * from "./v4/classic/
|
|
3
|
-
export
|
|
4
|
-
export default z;
|
|
1
|
+
import z4 from "./v4/classic/index.js";
|
|
2
|
+
export * from "./v4/classic/index.js";
|
|
3
|
+
export default z4;
|
package/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
export * from "./v4/classic/
|
|
3
|
-
export { z };
|
|
4
|
-
export default
|
|
1
|
+
import z4 from "./v4/classic/index.js";
|
|
2
|
+
export * from "./v4/classic/index.js";
|
|
3
|
+
// export { z };
|
|
4
|
+
export default z4;
|
|
5
|
+
// import z4 from "./classic/index.js";
|
|
6
|
+
// export * from "./classic/index.js";
|
|
7
|
+
// export default z4;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
export * from "./v4/classic/
|
|
3
|
-
export { z };
|
|
4
|
-
export default
|
|
1
|
+
import z4 from "./v4/classic/index.js";
|
|
2
|
+
export * from "./v4/classic/index.js";
|
|
3
|
+
// export { z };
|
|
4
|
+
export default z4;
|
|
5
|
+
|
|
6
|
+
// import z4 from "./classic/index.js";
|
|
7
|
+
// export * from "./classic/index.js";
|
|
8
|
+
|
|
9
|
+
// export default z4;
|
package/src/v4/core/core.ts
CHANGED
|
@@ -19,7 +19,14 @@ export /*@__NO_SIDE_EFFECTS__*/ function $constructor<T extends ZodTrait, D = T[
|
|
|
19
19
|
initializer: (inst: T, def: D) => void,
|
|
20
20
|
params?: { Parent?: typeof Class }
|
|
21
21
|
): $constructor<T, D> {
|
|
22
|
+
// const initCache = new WeakMap<any, boolean>();
|
|
22
23
|
function init(inst: T, def: D) {
|
|
24
|
+
// if (initCache.get(def)) {
|
|
25
|
+
// console.log("skipping init", name);
|
|
26
|
+
// return;
|
|
27
|
+
// }
|
|
28
|
+
// console.log("init", name);
|
|
29
|
+
// initCache.set(def, true);
|
|
23
30
|
Object.defineProperty(inst, "_zod", {
|
|
24
31
|
value: inst._zod ?? {},
|
|
25
32
|
enumerable: false,
|
package/src/v4/core/schemas.ts
CHANGED
|
@@ -489,7 +489,7 @@ export const $ZodURL: core.$constructor<$ZodURL> = /*@__PURE__*/ core.$construct
|
|
|
489
489
|
code: "invalid_format",
|
|
490
490
|
format: "url",
|
|
491
491
|
note: "Invalid hostname",
|
|
492
|
-
pattern:
|
|
492
|
+
pattern: def.hostname.source,
|
|
493
493
|
input: payload.value,
|
|
494
494
|
inst,
|
|
495
495
|
continue: !def.abort,
|
package/v4/core/core.cjs
CHANGED
|
@@ -8,8 +8,15 @@ exports.NEVER = Object.freeze({
|
|
|
8
8
|
status: "aborted",
|
|
9
9
|
});
|
|
10
10
|
function $constructor(name, initializer, params) {
|
|
11
|
+
// const initCache = new WeakMap<any, boolean>();
|
|
11
12
|
function init(inst, def) {
|
|
12
13
|
var _a;
|
|
14
|
+
// if (initCache.get(def)) {
|
|
15
|
+
// console.log("skipping init", name);
|
|
16
|
+
// return;
|
|
17
|
+
// }
|
|
18
|
+
// console.log("init", name);
|
|
19
|
+
// initCache.set(def, true);
|
|
13
20
|
Object.defineProperty(inst, "_zod", {
|
|
14
21
|
value: inst._zod ?? {},
|
|
15
22
|
enumerable: false,
|
package/v4/core/core.js
CHANGED
|
@@ -3,8 +3,15 @@ export const NEVER = Object.freeze({
|
|
|
3
3
|
status: "aborted",
|
|
4
4
|
});
|
|
5
5
|
export /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {
|
|
6
|
+
// const initCache = new WeakMap<any, boolean>();
|
|
6
7
|
function init(inst, def) {
|
|
7
8
|
var _a;
|
|
9
|
+
// if (initCache.get(def)) {
|
|
10
|
+
// console.log("skipping init", name);
|
|
11
|
+
// return;
|
|
12
|
+
// }
|
|
13
|
+
// console.log("init", name);
|
|
14
|
+
// initCache.set(def, true);
|
|
8
15
|
Object.defineProperty(inst, "_zod", {
|
|
9
16
|
value: inst._zod ?? {},
|
|
10
17
|
enumerable: false,
|
package/v4/core/schemas.cjs
CHANGED
|
@@ -237,7 +237,7 @@ exports.$ZodURL = core.$constructor("$ZodURL", (inst, def) => {
|
|
|
237
237
|
code: "invalid_format",
|
|
238
238
|
format: "url",
|
|
239
239
|
note: "Invalid hostname",
|
|
240
|
-
pattern:
|
|
240
|
+
pattern: def.hostname.source,
|
|
241
241
|
input: payload.value,
|
|
242
242
|
inst,
|
|
243
243
|
continue: !def.abort,
|
package/v4/core/schemas.js
CHANGED
|
@@ -206,7 +206,7 @@ export const $ZodURL = /*@__PURE__*/ core.$constructor("$ZodURL", (inst, def) =>
|
|
|
206
206
|
code: "invalid_format",
|
|
207
207
|
format: "url",
|
|
208
208
|
note: "Invalid hostname",
|
|
209
|
-
pattern:
|
|
209
|
+
pattern: def.hostname.source,
|
|
210
210
|
input: payload.value,
|
|
211
211
|
inst,
|
|
212
212
|
continue: !def.abort,
|