summaryrefslogtreecommitdiff
path: root/ext/js/data
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-05-22 18:01:16 -0400
committerGitHub <noreply@github.com>2021-05-22 18:01:16 -0400
commitd182e55527ddb764c6eaa2de8da006cd7beaba24 (patch)
treedb1f406ba873101183095a2fa6700a9d6cccd18d /ext/js/data
parentd7cf019b4a8266e8022d82d8d5433c4605921a98 (diff)
Rename internal JSON schema functions to match new return type (#1699)
Diffstat (limited to 'ext/js/data')
-rw-r--r--ext/js/data/json-schema.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/js/data/json-schema.js b/ext/js/data/json-schema.js
index 470348d5..bd6d9022 100644
--- a/ext/js/data/json-schema.js
+++ b/ext/js/data/json-schema.js
@@ -75,7 +75,7 @@ class JsonSchema {
getObjectPropertySchema(property) {
this._schemaPush(this._startSchema, null);
try {
- const schemaInfo = this._getObjectPropertySchemaPath(property);
+ const schemaInfo = this._getObjectPropertySchemaInfo(property);
return schemaInfo !== null ? new JsonSchema(schemaInfo.schema, this._rootSchema) : null;
} finally {
this._schemaPop();
@@ -85,7 +85,7 @@ class JsonSchema {
getArrayItemSchema(index) {
this._schemaPush(this._startSchema, null);
try {
- const schemaInfo = this._getArrayItemSchemaPath(index);
+ const schemaInfo = this._getArrayItemSchemaInfo(index);
return schemaInfo !== null ? new JsonSchema(schemaInfo.schema, this._rootSchema) : null;
} finally {
this._schemaPop();
@@ -162,7 +162,7 @@ class JsonSchema {
return {};
}
- _getObjectPropertySchemaPath(property) {
+ _getObjectPropertySchemaInfo(property) {
const {properties} = this._schema;
if (this._isObject(properties)) {
const propertySchema = properties[property];
@@ -182,7 +182,7 @@ class JsonSchema {
}
}
- _getArrayItemSchemaPath(index) {
+ _getArrayItemSchemaInfo(index) {
const {items} = this._schema;
if (this._isObject(items)) {
return {schema: items, path: 'items'};
@@ -521,7 +521,7 @@ class JsonSchema {
this._validateArrayContains(value);
for (let i = 0; i < length; ++i) {
- const schemaInfo = this._getArrayItemSchemaPath(i);
+ const schemaInfo = this._getArrayItemSchemaInfo(i);
if (schemaInfo === null) {
throw this._createError(`No schema found for array[${i}]`);
}
@@ -586,7 +586,7 @@ class JsonSchema {
}
for (const property of properties) {
- const schemaInfo = this._getObjectPropertySchemaPath(property);
+ const schemaInfo = this._getObjectPropertySchemaInfo(property);
if (schemaInfo === null) {
throw this._createError(`No schema found for ${property}`);
}
@@ -682,7 +682,7 @@ class JsonSchema {
if (Array.isArray(required)) {
for (const property of required) {
properties.delete(property);
- const schemaInfo = this._getObjectPropertySchemaPath(property);
+ const schemaInfo = this._getObjectPropertySchemaInfo(property);
if (schemaInfo === null) { continue; }
const propertyValue = Object.prototype.hasOwnProperty.call(value, property) ? value[property] : void 0;
value[property] = this._getValidValueOrDefault(property, propertyValue, schemaInfo);
@@ -690,7 +690,7 @@ class JsonSchema {
}
for (const property of properties) {
- const schemaInfo = this._getObjectPropertySchemaPath(property);
+ const schemaInfo = this._getObjectPropertySchemaInfo(property);
if (schemaInfo === null) {
Reflect.deleteProperty(value, property);
} else {
@@ -703,7 +703,7 @@ class JsonSchema {
_populateArrayDefaults(value) {
for (let i = 0, ii = value.length; i < ii; ++i) {
- const schemaInfo = this._getArrayItemSchemaPath(i);
+ const schemaInfo = this._getArrayItemSchemaInfo(i);
if (schemaInfo === null) { continue; }
const propertyValue = value[i];
value[i] = this._getValidValueOrDefault(i, propertyValue, schemaInfo);
@@ -712,7 +712,7 @@ class JsonSchema {
const {minItems, maxItems} = this._schema;
if (typeof minItems === 'number' && value.length < minItems) {
for (let i = value.length; i < minItems; ++i) {
- const schemaInfo = this._getArrayItemSchemaPath(i);
+ const schemaInfo = this._getArrayItemSchemaInfo(i);
if (schemaInfo === null) { break; }
const item = this._getValidValueOrDefault(i, void 0, schemaInfo);
value.push(item);