mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-05 05:26:50 +00:00
Enable @total-typescript/ts-reset (#1761)
## Description: Enable `@total-typescript/ts-reset` Fixes #1760 ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [ ] I have read and accepted the CLA agreement (only required once).
This commit is contained in:
@@ -144,7 +144,12 @@ export class UnitGrid {
|
||||
searchRange,
|
||||
);
|
||||
const rangeSquared = searchRange * searchRange;
|
||||
const typeSet = Array.isArray(types) ? new Set(types) : new Set([types]);
|
||||
const typeSet = new Set(
|
||||
// Using typeof check instead of Array.isArray due to a typescript
|
||||
// narrowing limitation. For more information, see the full issue
|
||||
// discussion at https://github.com/mattpocock/ts-reset/issues/48
|
||||
typeof types === "object" ? types : [types],
|
||||
);
|
||||
for (let cy = startGridY; cy <= endGridY; cy++) {
|
||||
for (let cx = startGridX; cx <= endGridX; cx++) {
|
||||
for (const type of typeSet) {
|
||||
|
||||
Reference in New Issue
Block a user