@sinclair/typebox 0.33.8 → 0.33.10
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.
|
@@ -251,13 +251,16 @@ function* FromInteger(schema, references, path, value) {
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
function* FromIntersect(schema, references, path, value) {
|
|
254
|
+
let hasError = false;
|
|
254
255
|
for (const inner of schema.allOf) {
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
yield
|
|
258
|
-
yield next.value;
|
|
256
|
+
for (const error of Visit(inner, references, path, value)) {
|
|
257
|
+
hasError = true;
|
|
258
|
+
yield error;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
+
if (hasError) {
|
|
262
|
+
return yield Create(ValueErrorType.Intersect, schema, path, value);
|
|
263
|
+
}
|
|
261
264
|
if (schema.unevaluatedProperties === false) {
|
|
262
265
|
const keyCheck = new RegExp((0, index_2.KeyOfPattern)(schema));
|
|
263
266
|
for (const valueKey of Object.getOwnPropertyNames(value)) {
|
|
@@ -244,13 +244,16 @@ function* FromInteger(schema, references, path, value) {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
function* FromIntersect(schema, references, path, value) {
|
|
247
|
+
let hasError = false;
|
|
247
248
|
for (const inner of schema.allOf) {
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
yield
|
|
251
|
-
yield next.value;
|
|
249
|
+
for (const error of Visit(inner, references, path, value)) {
|
|
250
|
+
hasError = true;
|
|
251
|
+
yield error;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
+
if (hasError) {
|
|
255
|
+
return yield Create(ValueErrorType.Intersect, schema, path, value);
|
|
256
|
+
}
|
|
254
257
|
if (schema.unevaluatedProperties === false) {
|
|
255
258
|
const keyCheck = new RegExp(KeyOfPattern(schema));
|
|
256
259
|
for (const valueKey of Object.getOwnPropertyNames(value)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinclair/typebox",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.10",
|
|
4
4
|
"description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -17,12 +17,20 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"test": "echo test"
|
|
19
19
|
},
|
|
20
|
-
"esm.sh": {
|
|
21
|
-
"bundle": false
|
|
22
|
-
},
|
|
23
20
|
"types": "./build/cjs/index.d.ts",
|
|
24
21
|
"main": "./build/cjs/index.js",
|
|
25
22
|
"module": "./build/esm/index.mjs",
|
|
23
|
+
"esm.sh": {
|
|
24
|
+
"bundle": false
|
|
25
|
+
},
|
|
26
|
+
"sideEffects": [
|
|
27
|
+
"./build/esm/type/registry/format.mjs",
|
|
28
|
+
"./build/esm/type/registry/type.mjs",
|
|
29
|
+
"./build/esm/type/system/policy.mjs",
|
|
30
|
+
"./build/cjs/type/registry/format.js",
|
|
31
|
+
"./build/cjs/type/registry/type.js",
|
|
32
|
+
"./build/cjs/type/system/policy.js"
|
|
33
|
+
],
|
|
26
34
|
"exports": {
|
|
27
35
|
".": {
|
|
28
36
|
"require": {
|