23 ms·
It even depends on is-odd (375K weekly downloads). The script kiddies have taken over.
by r-spaghetti 2y ago
It even depends on is-odd (375K weekly downloads). The script kiddies have taken over.
- warpech 2y agoHopefully is-odd does not depend on is-even
- joegibbs 2y agoIt actually depends on "is-number", which is a very useful package containing num => typeof num === "number" No joke.
- dagw 2y agoTo be completely fair, it does a little bit more than that. It only considers finite numbers as 'numbers' (ie NaN and Inf aren't considered numbers). It also considers strings that can be parsed as numbers as numbers. Of course reasonable people could consider both those 'features' as bugs
- jjcm 2y agoWhich in itself depends on is-number (66M weekly downloads). The beautiful journey seems to end there. https://www.npmjs.com/package/is-number https://www.npmjs.com/package/is-number
- jspash 2y agoWhich used to depend on the legendary `is-is` package. Apparently the maintainer is a certain B. Clinton.
- dagw 2y agoWow! there are almost 2500 packages on npm that depends on is-number. That's insane.
- Someone 2y agoCombining that with https://www.npmjs.com/package/is-string https://www.npmjs.com/package/is-string, you can have a JavaScript valid x for which isNumber(x) && isString(x) ⇒ isNumber is better named “can-be-used-as-a-number”. Also, I don’t know JavaScript well enough, but https://www.npmjs.com/package/isnumber https://www.npmjs.com/package/isnumber is different code from https://www.npmjs.com/package/is-number https://www.npmjs.com/package/is-number, but does it have different semantics? (https://www.npmjs.com/package/lodash.isnumber https://www.npmjs.com/package/lodash.isnumber is different, I think. It (rightfully, IMHO) thinks ∞ and NaN are numbers)