Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uplodash/fp `mergeAll` and `mergeAllWith` does not have fixed arities and can miss customizer #4492
Comments
martingronlund
commented
Oct 1, 2019
|
Hi @martingronlund! The |
@jdalton hi! I think wrapping in const customizer = console.log
const mergeAll2 = fp.ary(1, fp.mergeAll)
const mergeAllWith2 = fp.ary(2, fp.mergeAllWith)
mergeAll2({}, { a: 1 }, { b: 2 }) // undefined
mergeAll2({ a: 1 }, { b: 2 }) // undefined
mergeAllWith2(customizer, {}, { a: 1 }, { b: 2 }) // {}, nothing logged
mergeAllWith2(customizer, { a: 1 }, { b: 2 }) // {}, nothing logged It would make the actual output be much further from the expected output, thereby better alerting users that they're doing something wrong. I guess this could be considered either a patch or a major upgrade. SemVer is a bit broken in that regards. Systems out there which seem to work correctly 90% of the time might actually be faulty and end up working 0% of the time with this change, so IMO it should be a major upgrade, but I'm not even certain we have reached consensus here so maybe I'm getting ahead of myself. I looked at the docs on https://github.com/lodash/lodash/wiki/FP-Guide and I'm confused by this:
I parse that as what I did above with What do you think? I'm feeling ¯\(ツ)/¯ at this point |