@sinclair/typebox 0.28.10 → 0.28.11
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 +1 -1
- package/typebox.js +8 -0
- package/value/check.js +2 -2
package/package.json
CHANGED
package/typebox.js
CHANGED
|
@@ -621,6 +621,14 @@ var ExtendsUndefined;
|
|
|
621
621
|
function Check(schema) {
|
|
622
622
|
if (schema[exports.Kind] === 'Undefined')
|
|
623
623
|
return true;
|
|
624
|
+
if (schema[exports.Kind] === 'Not') {
|
|
625
|
+
const not = schema;
|
|
626
|
+
return Check(not.allOf[1]);
|
|
627
|
+
}
|
|
628
|
+
if (schema[exports.Kind] === 'Intersect') {
|
|
629
|
+
const intersect = schema;
|
|
630
|
+
return intersect.allOf.every((schema) => Check(schema));
|
|
631
|
+
}
|
|
624
632
|
if (schema[exports.Kind] === 'Union') {
|
|
625
633
|
const union = schema;
|
|
626
634
|
return union.anyOf.some((schema) => Check(schema));
|
package/value/check.js
CHANGED
|
@@ -254,8 +254,8 @@ var ValueCheck;
|
|
|
254
254
|
if (!Visit(property, references, value[knownKey])) {
|
|
255
255
|
return false;
|
|
256
256
|
}
|
|
257
|
-
if (Types.ExtendsUndefined.Check(property)) {
|
|
258
|
-
return
|
|
257
|
+
if (Types.ExtendsUndefined.Check(property) && !(knownKey in value)) {
|
|
258
|
+
return false;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
else {
|