Open ameliabradley opened 7 years ago
The Lodash 4.0 _.sum implementation no longer casts elements to Number.
_.sum
Implications: Lodash 3.0 _.sum([20, 3, "10"]) = 33 Lodash 4.0 _.sum([20, 3, "10"]) = "20310"
_.sum([20, 3, "10"])
In my case, this change led to some very wrong graphs 😅
lodash-codemods should play it safe, and make this translation: _.sum([0, 3, "10"]) -> _.sumBy([0, 3, "10"], Number)
_.sum([0, 3, "10"])
_.sumBy([0, 3, "10"], Number)
The Lodash 4.0
_.sum
implementation no longer casts elements to Number.Implications: Lodash 3.0
_.sum([20, 3, "10"])
= 33 Lodash 4.0_.sum([20, 3, "10"])
= "20310"In my case, this change led to some very wrong graphs 😅
lodash-codemods should play it safe, and make this translation:
_.sum([0, 3, "10"])
->_.sumBy([0, 3, "10"], Number)