From d3a319be839915e84d609e1096ab63d09f55b872 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:53:09 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/renderer/src/stories/JSONSchemaForm.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/stories/JSONSchemaForm.js b/src/renderer/src/stories/JSONSchemaForm.js index 69435b10d..195d6cbfb 100644 --- a/src/renderer/src/stories/JSONSchemaForm.js +++ b/src/renderer/src/stories/JSONSchemaForm.js @@ -351,7 +351,7 @@ export class JSONSchemaForm extends LitElement { #get = (path, object = this.resolved, omitted = []) => { // path = path.slice(this.base.length); // Correct for base path - return path.reduce((acc, curr) => (acc = acc[curr] ?? acc?.[omitted.find(str => acc[str])]?.[curr]), object); + return path.reduce((acc, curr) => (acc = acc[curr] ?? acc?.[omitted.find((str) => acc[str])]?.[curr]), object); }; #checkRequiredAfterChange = async (localPath) => { @@ -375,7 +375,6 @@ export class JSONSchemaForm extends LitElement { if (indexOf !== -1) path = path.slice(indexOf + 1); } - const resolved = this.#get(path, schema, ["properties"]); if (resolved["$ref"]) return this.getSchema(resolved["$ref"].split("/").slice(1)); // NOTE: This assumes reference to the root of the schema @@ -620,9 +619,13 @@ export class JSONSchemaForm extends LitElement { } else { // For non-links, throw a basic requirement error if the property is required if (!errors.length && isRequired && !parent[name]) { - const schema = this.getSchema(localPath) - console.log(schema) - errors.push({ message: `${schema.title ?? header(name)} is a required property.`, type: "error", missing: true }); // Throw at least a basic error if the property is required + const schema = this.getSchema(localPath); + console.log(schema); + errors.push({ + message: `${schema.title ?? header(name)} is a required property.`, + type: "error", + missing: true, + }); // Throw at least a basic error if the property is required } }