-
-
Save Balastrong/14d684e75a560200cc5922ce66e82bcf to your computer and use it in GitHub Desktop.
wrand - standalone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const pick = <T>(items: WeightedItem<T>[]) => | |
new RandomPicker(items).pick(); | |
export const pickMany = <T>(items: WeightedItem<T>[], amount: number) => | |
new RandomPicker(items).pickMany(amount); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment