I knew some apis were bad... but this is truly awful. The more experienced I get with programming TS/JS, the more reluctant I am to add dependencies to even the most maintained packages.
Have you ever really looked at some of the library code we use every day (or used to)?
Let's look at underscore's "sample" method, which produces some amazing surprises if you poke at it a little.