chancejs / chancejs

Chance - Random generator helper for JavaScript
http://chancejs.com
MIT License
6.45k stars 456 forks source link

feature added for #495 #515

Open ahhadian opened 3 years ago

ahhadian commented 3 years ago

Adding two features to pickset

resolved issue:

495

Description:

A Third Optional parameter options added to pickset function: options{distinct:true/false, exclude:[]} If distinct is true, the output itmes will be different, otherwise output items can be the same. Excluded items won't appear in output results. Example:

chance.pickset([1, 2, 3, 4, 5], 3, {distinct:true, exclude: [2, 4]});
//output: [1,3,5] or any possible permutations
coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.3%) to 95.26% when pulling 7fce53349ceb3b98e8fa07ed33a54e1551c31540 on IRIL-Webelopers:#495 into 93b384673074fe959c9691d02d2a0fec8cd394fa on chancejs:master.