Describe your changes
Prior to this change, any flag type that extended from readonly (infer A)[] would be interpreted as a variadic parameter. The variadic modifier allows the flag to be specified multiple times, each input parsed separately, and the results returned as an array. However, this did not allow for the use case that a single parsed value (i.e. --flag=a,b,c) could produce an array as output (["a", "b", "c"]).
With this change, the variadic modifier can be dropped from flags with an array-based type and the parser will then expect that exact array-based type as output.
Testing performed
Updated both formatting and scanner tests to confirm the new behavior.
Additional context
This also allows for the possibility of accepting specific array-based types as flags, such as subclasses of TypedArray (types that are not only Array).
Resolves #21
Describe your changes Prior to this change, any flag type that extended from
readonly (infer A)[]
would be interpreted as avariadic
parameter. The variadic modifier allows the flag to be specified multiple times, each input parsed separately, and the results returned as an array. However, this did not allow for the use case that a single parsed value (i.e.--flag=a,b,c
) could produce an array as output (["a", "b", "c"]
).With this change, the
variadic
modifier can be dropped from flags with an array-based type and the parser will then expect that exact array-based type as output.Testing performed Updated both formatting and scanner tests to confirm the new behavior.
Additional context This also allows for the possibility of accepting specific array-based types as flags, such as subclasses of
TypedArray
(types that are not onlyArray
).