From 99ee7e9400f06e8718612d8b52d15215dc620774 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Mon, 26 Sep 2022 22:29:30 +1000 Subject: Prettier --- src/util/schemas/Validator.ts | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/util/schemas/Validator.ts') diff --git a/src/util/schemas/Validator.ts b/src/util/schemas/Validator.ts index b71bf6a1..e85cdf7b 100644 --- a/src/util/schemas/Validator.ts +++ b/src/util/schemas/Validator.ts @@ -3,7 +3,14 @@ import addFormats from "ajv-formats"; import fs from "fs"; import path from "path"; -const SchemaPath = path.join(__dirname, "..", "..", "..", "assets", "schemas.json"); +const SchemaPath = path.join( + __dirname, + "..", + "..", + "..", + "assets", + "schemas.json", +); const schemas = JSON.parse(fs.readFileSync(SchemaPath, { encoding: "utf8" })); export const ajv = new Ajv({ @@ -14,7 +21,7 @@ export const ajv = new Ajv({ coerceTypes: true, messages: true, strict: true, - strictRequired: true + strictRequired: true, }); addFormats(ajv); @@ -41,7 +48,14 @@ export const normalizeBody = (body: any = {}) => { } else { for (const [key, value] of Object.entries(object)) { if (value == null) { - if (key === "icon" || key === "avatar" || key === "banner" || key === "splash" || key === "discovery_splash") continue; + if ( + key === "icon" || + key === "avatar" || + key === "banner" || + key === "splash" || + key === "discovery_splash" + ) + continue; delete object[key]; } else if (typeof value === "object") { normalizeObject(value); @@ -51,4 +65,4 @@ export const normalizeBody = (body: any = {}) => { }; normalizeObject(body); return body; -}; \ No newline at end of file +}; -- cgit 1.5.1