@exodus/zod 3.24.1-rc.4 → 3.24.1-rc.5
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/LICENSE +1 -1
- package/lib/index.mjs +6 -5
- package/package.json +5 -14
package/LICENSE
CHANGED
package/lib/index.mjs
CHANGED
|
@@ -49,6 +49,7 @@ var objectUtil;
|
|
|
49
49
|
(function (objectUtil) {
|
|
50
50
|
objectUtil.mergeShapes = (first, second) => {
|
|
51
51
|
return {
|
|
52
|
+
__proto__: null,
|
|
52
53
|
...first,
|
|
53
54
|
...second, // second overwrites first
|
|
54
55
|
};
|
|
@@ -475,7 +476,7 @@ class ParseStatus {
|
|
|
475
476
|
status.dirty();
|
|
476
477
|
if (value.status === "dirty")
|
|
477
478
|
status.dirty();
|
|
478
|
-
if (key.value
|
|
479
|
+
if (!(key.value in Object.prototype) &&
|
|
479
480
|
(typeof value.value !== "undefined" || pair.alwaysSet)) {
|
|
480
481
|
finalObject[key.value] = value.value;
|
|
481
482
|
}
|
|
@@ -545,7 +546,7 @@ const handleResult = (ctx, result) => {
|
|
|
545
546
|
};
|
|
546
547
|
function processCreateParams(params) {
|
|
547
548
|
if (!params)
|
|
548
|
-
return
|
|
549
|
+
return Object.create(null);
|
|
549
550
|
const { errorMap, invalid_type_error, required_error, description } = params;
|
|
550
551
|
if (errorMap && (invalid_type_error || required_error)) {
|
|
551
552
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
@@ -2502,7 +2503,7 @@ class ZodObject extends ZodType {
|
|
|
2502
2503
|
};
|
|
2503
2504
|
},
|
|
2504
2505
|
}
|
|
2505
|
-
:
|
|
2506
|
+
: Object.create(null)),
|
|
2506
2507
|
});
|
|
2507
2508
|
}
|
|
2508
2509
|
strip() {
|
|
@@ -2638,7 +2639,7 @@ class ZodObject extends ZodType {
|
|
|
2638
2639
|
// return merged;
|
|
2639
2640
|
// }
|
|
2640
2641
|
setKey(key, schema) {
|
|
2641
|
-
return this.augment({ [key]: schema });
|
|
2642
|
+
return this.augment(Object.assign(Object.create(null), { [key]: schema }));
|
|
2642
2643
|
}
|
|
2643
2644
|
// merge<Incoming extends AnyZodObject>(
|
|
2644
2645
|
// merging: Incoming
|
|
@@ -3002,7 +3003,7 @@ function mergeValues(a, b) {
|
|
|
3002
3003
|
const sharedKeys = util
|
|
3003
3004
|
.objectKeys(a)
|
|
3004
3005
|
.filter((key) => bKeys.indexOf(key) !== -1);
|
|
3005
|
-
const newObj = { ...a, ...b };
|
|
3006
|
+
const newObj = { __proto__: null, ...a, ...b };
|
|
3006
3007
|
for (const key of sharedKeys) {
|
|
3007
3008
|
const sharedValue = mergeValues(a[key], b[key]);
|
|
3008
3009
|
if (!sharedValue.valid) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/zod",
|
|
3
|
-
"version": "3.24.1-rc.
|
|
4
|
-
"author": "
|
|
3
|
+
"version": "3.24.1-rc.5",
|
|
4
|
+
"author": "Exodus Movement, Inc.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/ExodusMovement/zod.git"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"module": "./lib/index.mjs",
|
|
@@ -23,8 +23,6 @@
|
|
|
23
23
|
"@typescript-eslint/eslint-plugin": "^5.15.0",
|
|
24
24
|
"@typescript-eslint/parser": "^5.15.0",
|
|
25
25
|
"babel-jest": "^29.5.0",
|
|
26
|
-
"benchmark": "^2.1.4",
|
|
27
|
-
"dependency-cruiser": "^9.19.0",
|
|
28
26
|
"eslint": "^8.11.0",
|
|
29
27
|
"eslint-config-prettier": "^8.5.0",
|
|
30
28
|
"eslint-plugin-ban": "^1.6.0",
|
|
@@ -55,7 +53,7 @@
|
|
|
55
53
|
"./package.json": "./package.json"
|
|
56
54
|
},
|
|
57
55
|
"bugs": {
|
|
58
|
-
"url": "https://github.com/
|
|
56
|
+
"url": "https://github.com/ExodusMovement/zod/issues"
|
|
59
57
|
},
|
|
60
58
|
"description": "TypeScript-first schema declaration and validation library with static type inference",
|
|
61
59
|
"files": [
|
|
@@ -63,8 +61,6 @@
|
|
|
63
61
|
"/index.d.ts",
|
|
64
62
|
"!/lib/benchmarks"
|
|
65
63
|
],
|
|
66
|
-
"funding": "https://github.com/sponsors/colinhacks",
|
|
67
|
-
"homepage": "https://zod.dev",
|
|
68
64
|
"keywords": [
|
|
69
65
|
"typescript",
|
|
70
66
|
"schema",
|
|
@@ -101,12 +97,7 @@
|
|
|
101
97
|
"test:vitest": "npx vitest --config ./configs/vitest.config.ts",
|
|
102
98
|
"test:ts-jest": "npx jest --config ./configs/ts-jest.config.json",
|
|
103
99
|
"test:swc": "npx jest --config ./configs/swc-jest.config.json",
|
|
104
|
-
"prepublishOnly": "npm run test && npm run build"
|
|
105
|
-
"play": "nodemon -e ts -w . -x tsx playground.ts",
|
|
106
|
-
"depcruise": "depcruise -c .dependency-cruiser.js src",
|
|
107
|
-
"benchmark": "tsx src/benchmarks/index.ts",
|
|
108
|
-
"prepare": "husky install",
|
|
109
|
-
"docs": "netlify dev"
|
|
100
|
+
"prepublishOnly": "npm run test && npm run build"
|
|
110
101
|
},
|
|
111
102
|
"sideEffects": false,
|
|
112
103
|
"support": {
|