Skip to content

Commit

Permalink
better expressed
Browse files Browse the repository at this point in the history
  • Loading branch information
brontolosone authored and eyelidlessness committed Jan 28, 2025
1 parent 3717e4e commit 4974be2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class InvalidArgumentError extends Error {
}
}

export type ParameterArityType = 'optional' | 'required' | 'variadic' | 'variadic+';
export type ParameterArityType = 'optional' | 'required' | 'variadic';

export type ParameterTypeHint =
// | 'lazy' // TODO: it might be good to *explicitly* mark certain parameters
Expand Down Expand Up @@ -125,12 +125,6 @@ export class FunctionImplementation {
max: Infinity,
};

case 'variadic+':
return {
min: acc.min + 1,
max: Infinity,
};

default:
throw new UnreachableError(arityType);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/xpath/src/functions/xforms/geo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const sum = (values: readonly number[]) => {

export const distance = new NumberFunction(
'distance',
[{ arityType: 'variadic+' }],
[{ arityType: 'required' }, { arityType: 'variadic' }],
(context, args) => {
const lines = evaluateLines(context, args);

Expand Down

0 comments on commit 4974be2

Please sign in to comment.