From 1d5d309a9785e64ad687ca1247fa51ed481e6766 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 31 Oct 2024 04:37:17 -0400 Subject: [PATCH] Add Missing Header --- scripts/generateEquicordPluginList.ts | 23 ++++--------------- .../fixFileExtensions/components.tsx | 8 ++++++- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/scripts/generateEquicordPluginList.ts b/scripts/generateEquicordPluginList.ts index 1805ada4..8a3c9c9e 100644 --- a/scripts/generateEquicordPluginList.ts +++ b/scripts/generateEquicordPluginList.ts @@ -170,33 +170,18 @@ async function parseFile(fileName: string) { data.hasCommands = true; if (!isArrayLiteralExpression(value)) throw fail("commands is not an array literal"); data.commands = value.elements.map((e) => { - if (!isObjectLiteralExpression(e)) { - throw fail("commands array contains non-object literals"); - } - + if (!isObjectLiteralExpression(e)) throw fail("commands array contains non-object literals"); const nameProperty = e.properties.find((p): p is PropertyAssignment => { return isPropertyAssignment(p) && isIdentifier(p.name) && p.name.escapedText === 'name'; }); - const descriptionProperty = e.properties.find((p): p is PropertyAssignment => { return isPropertyAssignment(p) && isIdentifier(p.name) && p.name.escapedText === 'description'; }); - if (!nameProperty || !descriptionProperty) throw fail("Command missing required properties"); - - const name = isStringLiteral(nameProperty.initializer) - ? nameProperty.initializer.text - : ''; - const description = isStringLiteral(descriptionProperty.initializer) - ? descriptionProperty.initializer.text - : ''; - - return { - name, - description - }; + const name = isStringLiteral(nameProperty.initializer) ? nameProperty.initializer.text : ''; + const description = isStringLiteral(descriptionProperty.initializer) ? descriptionProperty.initializer.text : ''; + return { name, description }; }); - break; case "authors": if (!isArrayLiteralExpression(value)) throw fail("authors is not an array literal"); diff --git a/src/equicordplugins/fixFileExtensions/components.tsx b/src/equicordplugins/fixFileExtensions/components.tsx index 8fe0827e..91112ba7 100644 --- a/src/equicordplugins/fixFileExtensions/components.tsx +++ b/src/equicordplugins/fixFileExtensions/components.tsx @@ -1,3 +1,9 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2024 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + const extensionMap = { "ogg": [".ogv", ".oga", ".ogx", ".ogm", ".spx", ".opus"], "jpg": [".jpg", ".jpeg", ".jfif", ".jpe", ".jif", ".jfi", ".pjpeg", ".pjp"], @@ -9,4 +15,4 @@ const extensionMap = { export const reverseExtensionMap = Object.entries(extensionMap).reduce((acc, [target, exts]) => { exts.forEach(ext => acc[ext] = `.${target}`); return acc; -}, {} as Record); \ No newline at end of file +}, {} as Record);