@sinclair/typebox 0.33.8 → 0.33.9

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 next = Visit(inner, references, path, value).next();
256
- if (!next.done) {
257
- yield Create(ValueErrorType.Intersect, schema, path, value);
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 next = Visit(inner, references, path, value).next();
249
- if (!next.done) {
250
- yield Create(ValueErrorType.Intersect, schema, path, value);
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.8",
3
+ "version": "0.33.9",
4
4
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",