Skip to content

Commit

Permalink
Remove unused as
Browse files Browse the repository at this point in the history
  • Loading branch information
alxjrvs committed Sep 20, 2024
1 parent c109907 commit a749936
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/parameterizeRollArgument/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function parameterizeRollArgument(
die,
notation: formatNotation(options),
description: formatDescription(options)
} as RandsumRollParameters
}
}

export { parameterizeRollArgument }
10 changes: 4 additions & 6 deletions src/utils/formatNotation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@ function formatModifierNotation({ modifiers }: RandsumRollOptions): string {
}

function formatCoreNotation({
quantity,
quantity = 1,
sides
}: RandsumRollOptions<string | number>) {
}: RandsumRollOptions<string | number>): RandsumNotation {
const formattedSides = Array.isArray(sides)
? `{${sides.map((s) => (s === '' ? ' ' : s)).join('')}}`
: sides
return `${quantity}d${formattedSides}`
return `${quantity}d${formattedSides}` as RandsumNotation
}

function formatNotation(options: RandsumRollOptions): RandsumNotation {
return `${formatCoreNotation(options)}${formatModifierNotation(options)}` as
| RandsumNotation<string>
| RandsumNotation<number>
return `${formatCoreNotation(options)}${formatModifierNotation(options)}` as RandsumNotation
}

export { formatNotation }
2 changes: 1 addition & 1 deletion src/utils/parseNotation/parseModifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function parseCoreNotation(
sides: sides.includes('{')
? [...sides.replaceAll(/{|}/g, '')]
: Number(sides)
} as RequiredCoreDiceParameters
}
}

function parseCapNotation(modifiersString: string): Pick<Modifiers, 'cap'> {
Expand Down

0 comments on commit a749936

Please sign in to comment.