4 ms·
Let me balance the chi by linking to a prolific open source contributor who makes actually-good repos: https://github.com/sindresorhus?tab=repositories&q=&type=
by beaconstudios 5y ago
Let me balance the chi by linking to a prolific open source contributor who makes actually-good repos: https://github.com/sindresorhus?tab=repositories&q=&type=&language=&sort=stargazers https://github.com/sindresorhus?tab=repositories&q=&type=&la...
- avinassh 5y agoumm... I just randomly checked and this person also seem to have packages which are of few lines. for e.g. I checked `is-fn`: export default function isFunction(value) { const type = Object.prototype.toString.call(value); return type === '[object Function]' || type === '[object GeneratorFunction]' || type === '[object AsyncFunction]'; } This has 120k weekly downloads: https://www.npmjs.com/package/is-fn https://www.npmjs.com/package/is-fn
- beaconstudios 5y agoIt's a polyfill for a buggy function, so it's not just arbitrary.
- raverbashing 5y agoThe real question is why JS can't provide the answer to "isFunction" in a builtin method
- datagram 5y agoIt 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`.