Skip to content

Commit

Permalink
remove dep enum
Browse files Browse the repository at this point in the history
  • Loading branch information
laffed committed Aug 30, 2023
1 parent f052300 commit 3bede5b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import compass, { CardinalSubset } from 'cardinal-direction';
import compass from 'cardinal-direction';

const PadPosition = {
N: "L",
Expand All @@ -16,7 +16,7 @@ class WestPad {

constructor(direction: Direction | number) {
if (typeof direction === 'number') {
this.direction = compass.cardinalFromDegree(direction % 360, CardinalSubset.Basic) as Direction;
this.direction = compass.cardinalFromDegree(direction % 360, 8) as Direction;
} else {
this.direction = direction;
}
Expand All @@ -26,7 +26,7 @@ class WestPad {

updateDirection(direction: Direction | number) {
if (typeof direction === 'number') {
this.direction = compass.cardinalFromDegree(direction % 360, CardinalSubset.Basic) as Direction;
this.direction = compass.cardinalFromDegree(direction % 360, 8) as Direction;
} else {
this.direction = direction;
}
Expand Down Expand Up @@ -57,7 +57,7 @@ class WestPad {

const westPad = (direction: Direction | number, s: string, multiplicand: number = 1, p: string = " "): string => {
const padpos = typeof direction === 'number'
? PadPosition[compass.cardinalFromDegree(direction % 360, CardinalSubset.Basic) as Direction]
? PadPosition[compass.cardinalFromDegree(direction % 360, 8) as Direction]
: PadPosition[direction];

switch (padpos) {
Expand All @@ -71,7 +71,7 @@ const westPad = (direction: Direction | number, s: string, multiplicand: number

const notWestPad = (direction: Direction | number, s: string, multiplicand: number = 1, p: string = " "): string => {
const padpos = typeof direction === 'number'
? PadPosition[compass.cardinalFromDegree(direction % 360, CardinalSubset.Basic) as Direction]
? PadPosition[compass.cardinalFromDegree(direction % 360, 8) as Direction]
: PadPosition[direction];

switch (padpos) {
Expand Down

0 comments on commit 3bede5b

Please sign in to comment.