Skip to content

Commit

Permalink
fix: address linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcath committed Dec 13, 2021
1 parent 47630fd commit 7867eb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/functions/create-map.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ describe('Create Map', () => {
it('should support forEach and neighbours', () => {
const map = createMap(5, 5, 0, 2, 2)

map.forEach((x, y, v) => {
map.forEach((x, y) => {
map.set(x, y, x + y)
})

expect(map.get(2, 2)).toBe(4)

expect(map.neighbours(5, 5).length).toBe(2)
expect(map.neighbours(2, 2, true).length).toBe(3)
expect(map.neighbours(5, 5)).toHaveLength(2)
expect(map.neighbours(2, 2, true)).toHaveLength(3)
})
})
8 changes: 4 additions & 4 deletions src/functions/create-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ export const createMap = <T>(
}

return possibles
.filter(([x, y]) => {
return x >= 0 && y >= 0 && x <= maxX - minX && y <= maxY - minY
.filter(([tx, ty]) => {
return tx >= 0 && ty >= 0 && tx <= maxX - minX && ty <= maxY - minY
})
.map(([x, y]) => {
return {x: x + minX, y: y + minY}
.map(([tx, ty]) => {
return {x: tx + minX, y: ty + minY}
})
}

Expand Down

0 comments on commit 7867eb4

Please sign in to comment.