Add total-typescript's ts-reset
diff --git a/flake.nix b/flake.nix
index 2ee4b77..5687e72 100644
--- a/flake.nix
+++ b/flake.nix
@@ -8,7 +8,7 @@
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
- packages = [ pkgs.yarn pkgs.nodejs-19_x ];
+ packages = [ pkgs.yarn pkgs.nodejs-19_x pkgs.typescript ];
};
});
}
diff --git a/package.json b/package.json
index f28878f..a319086 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,9 @@
"dependencies": {
"@discordjs/rest": "^0.2.0-canary.0",
"@hokify/agenda": "^6.2.12",
+ "@total-typescript/ts-reset": "^0.3.7",
"@tsconfig/node18-strictest-esm": "^1.0.0",
+ "@types/node": "^18.14.6",
"@ungap/structured-clone": "^1.0.1",
"agenda": "^4.3.0",
"body-parser": "^1.20.0",
@@ -18,7 +20,7 @@
"node-tesseract-ocr": "^2.2.1",
"structured-clone": "^0.2.2",
"systeminformation": "^5.17.3"
- },
+ },
"resolutions": {
"discord-api-types": "0.37.23"
},
diff --git a/src/index.ts b/src/index.ts
index 12f6659..ddcd97b 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,3 +1,5 @@
+import "@total-typescript/ts-reset";
+
import runServer from "./api/index.js";
import client from "./utils/client.js";
import config from "./config/main.js";
diff --git a/src/utils/database.ts b/src/utils/database.ts
index c1728c3..a60cf74 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -263,7 +263,7 @@
}
}
if(!data) return null;
- doc = JSON.parse(Buffer.from(data).toString());
+ doc = JSON.parse(Buffer.from(data).toString()) as TranscriptSchema;
}
if(!doc) return null;
return doc;
@@ -294,7 +294,7 @@
}
}
if(!data) return null;
- doc = JSON.parse(Buffer.from(data).toString());
+ doc = JSON.parse(Buffer.from(data).toString()) as TranscriptSchema;
}
if(!doc) return null;
for(const message of doc.messages) {