mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 07:33:12 +09:00
Use strict type checking
This commit is contained in:
1 parent
2ca8e69025
commit
a66e930997
36 files changed
+714
-676
No files matched your search
@@ -101,7 +101,7 @@ export default class ModInfo {
|
||||
/**
|
||||
* SHA1 hash of this mod
|
||||
*/
|
||||
sha1: string;
|
||||
sha1?: string;
|
||||
|
||||
/**
|
||||
* True if this mod has been deleted
|
||||
@@ -174,13 +174,13 @@ export default class ModInfo {
|
||||
return json;
|
||||
}
|
||||
|
||||
static async fromModFile(modPath) {
|
||||
static async fromModFile(modPath: string) {
|
||||
let modInfo: Static<typeof ModInfo.jsonSchema>;
|
||||
{
|
||||
// XXX: JSZip needs the whole archive loaded in memory to work.
|
||||
// This is clearly untenable and will be replaced later.
|
||||
let zip = await JSZip.loadAsync(await fs.readFile(modPath));
|
||||
let root = zip.folder(findRoot(zip));
|
||||
let root = zip.folder(findRoot(zip))!;
|
||||
|
||||
let infoFile = root.file("info.json");
|
||||
if (!infoFile) {
|
||||
|
||||
Reference in new issue
Block a user