medikoo / es5-ext

ECMAScript extensions (with respect to upcoming ECMAScript features)
ISC License
168 stars 81 forks source link

feat: bring up Array.shuffle #102

Closed SukkaW closed 11 months ago

SukkaW commented 3 years ago

The PR closes #100, bringing up a side-effect-free, and O(n) array shuffle function.

The unit test is not finished since tad is not powerful enough to write a unit test for shuffle (Help is wanted).

P.S. I want to adopt the unit test from https://github.com/philihp/fast-shuffle/blob/master/src/__tests__/index.test.js

SukkaW commented 3 years ago

@medikoo

Well, should I bring up Array.shuffle under _es5_ext after switch base to ext branch?

medikoo commented 3 years ago

Well, should I bring up Array.shuffle under _es5_ext after switch base to ext branch?

@SukkaW No, it should be implemented in array/shuffle.js file (_es5_ext contains items that are to be adapted in ext but where not yet)

SukkaW commented 3 years ago

@medikoo The PR is ready for review now.

Unit test cases and the docs are completed.

SukkaW commented 3 years ago

It appears that the newest mocha (which utilises destructuring assignment syntax) is not compatible with Node.js 4 causes CI to fail.