aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-05-23 04:42:06 +0200
committerV <vendicated@riseup.net>2023-05-23 04:42:06 +0200
commitd888a0a291e6915a770fb8fffeb8fd44c2865122 (patch)
treebb4cded0ae2c4f645dfe7ec17d0a0dccfe69d60b /scripts
parenta94787a9f373653da1f116a6c1ce03c2c5111160 (diff)
downloadVencord-d888a0a291e6915a770fb8fffeb8fd44c2865122.tar.gz
Vencord-d888a0a291e6915a770fb8fffeb8fd44c2865122.tar.bz2
Vencord-d888a0a291e6915a770fb8fffeb8fd44c2865122.zip
[skip ci] Fix plugin json generation
Diffstat (limited to 'scripts')
-rw-r--r--scripts/generatePluginList.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/generatePluginList.ts b/scripts/generatePluginList.ts
index 8442e42..7c273de 100644
--- a/scripts/generatePluginList.ts
+++ b/scripts/generatePluginList.ts
@@ -19,6 +19,7 @@
import { Dirent, readdirSync, readFileSync, writeFileSync } from "fs";
import { access, readFile } from "fs/promises";
import { join } from "path";
+import { isSatisfiesExpression } from "typescript";
import { BigIntLiteral, createSourceFile, Identifier, isArrayLiteralExpression, isCallExpression, isExportAssignment, isIdentifier, isObjectLiteralExpression, isPropertyAccessExpression, isPropertyAssignment, isStringLiteral, isVariableStatement, NamedDeclaration, NodeArray, ObjectLiteralExpression, ScriptTarget, StringLiteral, SyntaxKind } from "typescript";
interface Dev {
@@ -66,9 +67,9 @@ function parseDevs() {
const value = devsDeclaration.initializer.arguments[0];
- if (!isObjectLiteralExpression(value)) return;
+ if (!isSatisfiesExpression(value) || !isObjectLiteralExpression(value.expression)) throw new Error("Failed to parse devs: not an object literal");
- for (const prop of value.properties) {
+ for (const prop of value.expression.properties) {
const name = (prop.name as Identifier).text;
const value = isPropertyAssignment(prop) ? prop.initializer : prop;