▲ | goranmoomin 12 hours ago | ||||||||||||||||
The post is complaining about a library for a problem that javascript had 12 years ago, was not a thing for 7 years, and the ecosystem moved on. Typescript was not a thing back then. (or more exactly, it was a small thing out of the all too many transpile-to-js languages, at least) Yes, having a library named is-number looks very stupid until you look at the state of javascript in 2014. Look at issue is-number#1[0] if you’re interested. The library is-arrayish exists because array-like objects are actually a thing in javascript. About is-regexp: the author mentions that their library supports cross-realm values because it’s useful, but then says that it’s an edge case that most libraries don’t need to care about? The whole reason that the library exists is to cover the edge cases. If not needed, yes the consumers of the library would have just been using the simple instanceof RegExp check. If you’re arguing that there are consumers of those libraries that are wrong, the post might at least make sense – the presented case here is that the writer of the clamp function is stupid, not the other way around. Having a function that determines if a string is a number is not stupid; it’s importing that function and creating a clamp function with the wrong type signature part that’s stupid. Especially when it’s 2025 and typescript is universal. All of the libraries that are mentioned are like 10 years old at this point. I don’t think we have to beat the dead horse one more time. | |||||||||||||||||
▲ | throwaway290 12 hours ago | parent [-] | ||||||||||||||||
> 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. | |||||||||||||||||
|