3 ms·
> the presented case here is that the writer of the clamp function is stupid, not the other way around So are you saying the author updated the implementation
by throwaway290 1y ago
> the presented case here is that the writer of the clamp function is stupid, not the other way around
So are you saying the author updated the implementation and added deprecation warning?))
And author is not "stupid". More like "strategic". popular npm package = money. this is why everybody falls over to write leftpads and stuff.
- goranmoomin 1y ago> So are you saying the author updated the implementation and added deprecation warning? As far as I understand, the author wrote the clamp function by themselves. There is no clamp library that the author is arguing against. In fact, it seems the library ‘clamp’ in npm is a library that does exactly what the author wants – no validation, assuming that the value is a number, and just returning a number.[0] [0]: https://github.com/hughsk/clamp/blob/master/index.js https://github.com/hughsk/clamp/blob/master/index.js
- throwaway290 1y agoI mean isnumber, isarray, that sort of stuff you were talking about. Maybe clamp is the exception if there is no builtin way to do it in js
- whatevaa 1y agoWhat money did leftpad get?