milesj/optimal

Use generics for method types

milesj opened this issue · 0 comments

Do this:

oneOf<T: string>(list: T[]): this;

Instead of:

oneOf(list: string[]): this;

The latter breaks when a list is passed with aliases.

OR

Add generics to the top layer.