Re:NPM – "is-even", 160k weekly downloads
by avinassh on Tuesday November 16, 2021 @02:43PM
(#29245458)
umm... I just randomly checked and this person also seem to have packages which are of few lines. for e.g. I checked `is-fn`:
This has 120k weekly downloads: https://www.npmjs.com/package/is-fn
[ Parent
| on HN ]
Re:NPM – "is-even", 160k weekly downloads
by beaconstudios on Tuesday November 16, 2021 @02:54PM
(#29245593)
It's a polyfill for a buggy function, so it's not just arbitrary.
Re:NPM – "is-even", 160k weekly downloads
by raverbashing on Wednesday November 17, 2021 @02:45AM
(#29250166)
The real question is why JS can't provide the answer to "isFunction" in a builtin method
Re:NPM – "is-even", 160k weekly downloads
by datagram on Wednesday November 17, 2021 @04:40PM
(#29259186)
It can: JavaScript has a `typeof` operator that can be used for this. If you read the readme for is-fn, it points out that the package is only useful for code that needs to run in certain older browsers that have a buggy implementation of `typeof`.