aimless.js icon indicating copy to clipboard operation
aimless.js copied to clipboard

Make `weighted`'s TypeScript signature generic

Open egilll opened this issue 2 years ago • 1 comments

This pull request updates weighted's TypeScript signature to accept other types of arrays.

Weighted just returns a random item from the given array and does not require it to be an array of numbers. I've found this function to be quite useful when selecting from non-numerical arrays.

(This change is too minor to be copyrightable, but to alleviate any concerns, I assign all copyright to ChrisCavs)

egilll avatar Aug 11 '23 13:08 egilll

+1 would like to see this merged!

vegeta897 avatar Jan 27 '24 07:01 vegeta897