Make JsonSchemaProxyHandler.unconstrainedSchema public and non-configurable (#636)
This commit is contained in:
parent
0279d00274
commit
1d02013642
@ -139,7 +139,7 @@ class JsonSchemaProxyHandler {
|
|||||||
if (path !== null) { path.push(['additionalProperties', additionalProperties]); }
|
if (path !== null) { path.push(['additionalProperties', additionalProperties]); }
|
||||||
return additionalProperties;
|
return additionalProperties;
|
||||||
} else {
|
} else {
|
||||||
const result = JsonSchemaProxyHandler._unconstrainedSchema;
|
const result = JsonSchemaProxyHandler.unconstrainedSchema;
|
||||||
if (path !== null) { path.push([null, result]); }
|
if (path !== null) { path.push([null, result]); }
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ class JsonSchemaProxyHandler {
|
|||||||
if (path !== null) { path.push(['additionalItems', additionalItems]); }
|
if (path !== null) { path.push(['additionalItems', additionalItems]); }
|
||||||
return additionalItems;
|
return additionalItems;
|
||||||
} else {
|
} else {
|
||||||
const result = JsonSchemaProxyHandler._unconstrainedSchema;
|
const result = JsonSchemaProxyHandler.unconstrainedSchema;
|
||||||
if (path !== null) { path.push([null, result]); }
|
if (path !== null) { path.push([null, result]); }
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -579,7 +579,12 @@ class JsonSchemaProxyHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonSchemaProxyHandler._unconstrainedSchema = {};
|
Object.defineProperty(JsonSchemaProxyHandler, 'unconstrainedSchema', {
|
||||||
|
value: Object.freeze({}),
|
||||||
|
configurable: false,
|
||||||
|
enumerable: true,
|
||||||
|
writable: false
|
||||||
|
});
|
||||||
|
|
||||||
class JsonSchemaTraversalInfo {
|
class JsonSchemaTraversalInfo {
|
||||||
constructor(value, schema) {
|
constructor(value, schema) {
|
||||||
|
Loading…
Reference in New Issue
Block a user