toss / es-toolkit

A modern JavaScript utility library that's 2-3 times faster and up to 97% smaller—a major upgrade to lodash.
https://es-toolkit.slash.page
Other
6.17k stars 255 forks source link

Support for compat/faltten, flatten{Depth, Deep} #262

Closed dayongkr closed 1 month ago

dayongkr commented 1 month ago

In lodash, They wrote test cases for three methods in one file.

describe('flatten methods', () => {
    const array = [1, [2, [3, [4]], 5]];
    const methodNames = ['flatten', 'flattenDeep', 'flattenDepth'];

...

Do we write them separately, or do we follow the same approach?

raon0211 commented 1 month ago

While modernizing the test code, we try to keep them separate.

It's a little bit of work, but I think in the long run it will keep our readability of the code.

dayongkr commented 1 month ago

While modernizing the test code, we try to keep them separate.

It's a little bit of work, but I think in the long run it will keep our readability of the code.

Ok, then i am going to add test codes separately.