Skip to content

Commit

Permalink
Remove unused default
Browse files Browse the repository at this point in the history
  • Loading branch information
alxjrvs committed Nov 7, 2024
1 parent 93545b5 commit 9d9c3e0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/models/ArgumentsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isD, isDicePoolOptions, isDiceNotationArg } from '~guards'
import { NotationModel, OptionsModel } from '~models'
import { D } from '~src/D'

function formDicePools<Sides extends string | number = string | number>(
function formDicePools<Sides extends string | number>(
args: RollArgument<Sides>[]
): DicePools<Sides> {
return {
Expand Down Expand Up @@ -36,7 +36,7 @@ function parameterize(argument: RollArgument<string>): RollParameters<string>
function parameterize(
argument: RollArgument<string | number>
): RollParameters<string | number>
function parameterize<Sides extends string | number = string | number>(
function parameterize<Sides extends string | number>(
argument: RollArgument<Sides>
): RollParameters<Sides> {
const options = toOptions(argument)
Expand Down
8 changes: 4 additions & 4 deletions src/models/DicePoolsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function calculateType(
}
}

function calculateTotal<Sides extends string | number = string | number>(
function calculateTotal<Sides extends string | number>(
rolls: Sides[],
bonus = 0
): Sides {
Expand All @@ -35,7 +35,7 @@ function calculateTotal<Sides extends string | number = string | number>(
return rolls.flat().join(', ') as Sides
}

function generateModifiedRolls<Sides extends string | number = string | number>(
function generateModifiedRolls<Sides extends string | number>(
DicePools: DicePools<Sides>,
rawRolls: RollResult<Sides>['rawRolls']
): RollResult<Sides>['modifiedRolls'] {
Expand All @@ -52,7 +52,7 @@ function generateModifiedRolls<Sides extends string | number = string | number>(
) as RollResult<Sides>['modifiedRolls']
}

function generateRawRolls<Sides extends string | number = string | number>(
function generateRawRolls<Sides extends string | number>(
dicePools: DicePools<Sides>['dicePools']
): RollResult<Sides>['rawRolls'] {
return Object.fromEntries(
Expand All @@ -66,7 +66,7 @@ function generateRawRolls<Sides extends string | number = string | number>(
)
}

function generateRollResult<Sides extends string | number = string | number>(
function generateRollResult<Sides extends string | number>(
dicePools: DicePools<Sides>
): RollResult<Sides> {
const rawRolls = generateRawRolls(dicePools.dicePools)
Expand Down
2 changes: 1 addition & 1 deletion src/models/OptionsModel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
formatModifierDescriptions
} from './stringFormatters'

function toNotation<Sides extends string | number = string | number>(
function toNotation<Sides extends string | number>(
options: RollOptions<Sides>
): Notation<Sides> {
return `${formatCoreNotation(options)}${formatModifierNotation(options)}` as Notation<Sides>
Expand Down
4 changes: 2 additions & 2 deletions src/models/ParametersModel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
applySingleCap
} from './modifierApplicators'

type RollBonuses<Sides extends string | number = string | number> = {
type RollBonuses<Sides extends string | number> = {
rolls: Sides[]
simpleMathModifier: number
}

function applyModifiers<Sides extends string | number = string | number>(
function applyModifiers<Sides extends string | number>(
poolParameters: RollParameters<Sides>,
initialRolls: Sides[]
): RollBonuses<Sides> {
Expand Down
2 changes: 1 addition & 1 deletion src/roll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
function roll(...args: NumericalArgument[]): NumericalRollResult
function roll(...args: CustomArgument[]): CustomRollResult
function roll(...args: RollArgument<string | number>[]): MixedRollResult
function roll<Sides extends string | number = string | number>(
function roll<Sides extends string | number>(
...args: RollArgument<Sides>[]
): RollResult<Sides> {
const dicePools = ArgumentsModel.formDicePools(args)
Expand Down

0 comments on commit 9d9c3e0

Please sign in to comment.