Skip to content

Commit

Permalink
resources: fix Directions types
Browse files Browse the repository at this point in the history
The OutputStrings type itself is already a dictionary.
This ~mostly worked before, but prevented you from saying
something like `outputStrings: Directions.outputStrings8Dir`
directly as the types would no longer match up.
  • Loading branch information
quisquous committed Dec 6, 2023
1 parent f0bfa22 commit 1a87f8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ const output16Dir: DirectionOutput16[] = [
const outputCardinalDir: DirectionOutputCardinal[] = ['dirN', 'dirE', 'dirS', 'dirW'];
const outputIntercardDir: DirectionOutputIntercard[] = ['dirNE', 'dirSE', 'dirSW', 'dirNW'];

const outputStrings16Dir: { [outputString: string]: OutputStrings } = {
const outputStrings16Dir: OutputStrings = {
dirN: Outputs.dirN,
dirNNE: Outputs.dirNNE,
dirNE: Outputs.dirNE,
Expand All @@ -281,7 +281,7 @@ const outputStrings16Dir: { [outputString: string]: OutputStrings } = {
unknown: Outputs.unknown,
};

const outputStrings8Dir: { [outputString: string]: OutputStrings } = {
const outputStrings8Dir: OutputStrings = {
dirN: Outputs.dirN,
dirNE: Outputs.dirNE,
dirE: Outputs.dirE,
Expand All @@ -293,15 +293,15 @@ const outputStrings8Dir: { [outputString: string]: OutputStrings } = {
unknown: Outputs.unknown,
};

const outputStringsCardinalDir: { [outputString: string]: OutputStrings } = {
const outputStringsCardinalDir: OutputStrings = {
dirN: Outputs.dirN,
dirE: Outputs.dirE,
dirS: Outputs.dirS,
dirW: Outputs.dirW,
unknown: Outputs.unknown,
};

const outputStringsIntercardDir: { [outputString: string]: OutputStrings } = {
const outputStringsIntercardDir: OutputStrings = {
dirNE: Outputs.dirNE,
dirSE: Outputs.dirSE,
dirSW: Outputs.dirSW,
Expand Down

0 comments on commit 1a87f8f

Please sign in to comment.