mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 15: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
@@ -54,7 +54,7 @@ export async function loadJsonAsMap(filePath: string): Promise<Map<string, unkno
|
||||
|
||||
return new Map(Object.entries(parsed));
|
||||
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
if (err.code === "ENOENT") {
|
||||
// File does not exist, return empty map
|
||||
return new Map();
|
||||
@@ -115,7 +115,7 @@ export async function loadJsonArrayAsMap(filePath: string): Promise<Map<unknown,
|
||||
}
|
||||
return map;
|
||||
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
if (err.code === "ENOENT") {
|
||||
// File does not exist, return empty map
|
||||
return new Map();
|
||||
@@ -247,7 +247,7 @@ export class ItemDatabase {
|
||||
checkCount(count);
|
||||
|
||||
if (this._items.has(name)) {
|
||||
count += this._items.get(name);
|
||||
count += this._items.get(name)!;
|
||||
}
|
||||
|
||||
this._items.set(name, count);
|
||||
@@ -269,7 +269,7 @@ export class ItemDatabase {
|
||||
|
||||
count = -count;
|
||||
if (this._items.has(name)) {
|
||||
count += this._items.get(name);
|
||||
count += this._items.get(name)!;
|
||||
}
|
||||
|
||||
this._items.set(name, count);
|
||||
|
||||
Reference in new issue
Block a user