angus-c/just

flatten with depth=1 is not properly applied to the first element

bd82 opened this issue · 1 comments

bd82 commented

image

Expected result would be [1, 2, 3]
But the actual is [[1], 2, 3]

Code snippet:

const flatten = require('just-flatten-it')

flatten([[1], [2], 3], 1);

@angus-c I opened a PR for the fix, please let me know your thoughts on this - #577