mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-17 07:20:23 +00:00
This PR adds the ability for the [`random.arrayElement`][1] method to support `readonly` Arrays. Since the logic of the method is merely selecting an item at random, and not affecting the passed in Array, it is safe to add these types. The other methods that act upon a supplied Array do not guarantee the same level of immutability. [1]: https://github.com/Marak/faker.js/blob/d3ce6f1a2a9359574e7f31f14d4901648047c45a/lib/random.js#L88