@unction/shuffle

Takes an Ordered Functor and returns an Ordered Functor with the same content, but in a random order

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@unction/shuffle
0913.15.02 years ago5 years agoMinified + gzip package size for @unction/shuffle in KB

Readme

@unction/shuffle
!TestsBADGETRAVIS !StabilityBADGESTABILITY !DependenciesBADGEDEPENDENCY
OrderedArray | Set | Record | Map | string => OrderedArray | Set | Record | Map | string

Takes an Ordered Functor and returns an Ordered Functor with the same content, but in a random order.
users()

Would return:
[{"id": 1, "name": "Kurtis Rainbolt-Greene"}, {"id": 2, "name": "Angela Englund"}, {"id": 3, "name": "Joshua Benitez"}]

shuffle(users())

Would return:
[{"id": 1, "name": "Kurtis Rainbolt-Greene"}, {"id": 3, "name": "Joshua Benitez"}, {"id": 2, "name": "Angela Englund"}]

shuffle(users())

Would return:
[{"id": 3, "name": "Joshua Benitez"}, {"id": 1, "name": "Kurtis Rainbolt-Greene"}, {"id": 2, "name": "Angela Englund"}]

shuffle(users())

Would return:
[{"id": 2, "name": "Angela Englund"}, {"id": 3, "name": "Joshua Benitez"}, {"id": 1, "name": "Kurtis Rainbolt-Greene"}]