Skip to content

Commit

Permalink
🔥 remove redundant toString() function
Browse files Browse the repository at this point in the history
  • Loading branch information
flauwekeul committed Aug 2, 2022
1 parent 0db7e22 commit 9472a14
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
3 changes: 1 addition & 2 deletions src/hex/functions/createHexPrototype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { hexToPoint } from './hexToPoint'
import { isFlat } from './isFlat'
import { isPointy } from './isPointy'
import { offsetToCube } from './offsetToCube'
import { toString } from './toString'
import { width } from './width'

export const defaultHexSettings: HexSettings = {
Expand All @@ -35,7 +34,7 @@ export const createHexPrototype = <T extends Hex>(
return equals(this, isOffset(coordinates) ? offsetToCube(this, coordinates) : coordinates)
},
toString() {
return toString(this)
return `${this.q},${this.r}`
},
// todo: add to docs that any of the above methods will be overwritten when present in customPrototype
...options,
Expand Down
1 change: 0 additions & 1 deletion src/hex/functions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ export * from './isPointy'
export * from './offsetToCube'
export * from './pointToCube'
export * from './round'
export * from './toString'
export * from './translate'
export * from './width'
7 changes: 0 additions & 7 deletions src/hex/functions/toString.test.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/hex/functions/toString.ts

This file was deleted.

0 comments on commit 9472a14

Please sign in to comment.