ShaggySnacks to Today I Learned@lemmy.worldEnglish · 10 months agoTIL About How 11 Lines of Code Supported Web Development and the Code Was Deleted It Broke the Internetgetpocket.comexternal-linkmessage-square68fedilinkarrow-up1145arrow-down120
arrow-up1125arrow-down1external-linkTIL About How 11 Lines of Code Supported Web Development and the Code Was Deleted It Broke the Internetgetpocket.comShaggySnacks to Today I Learned@lemmy.worldEnglish · 10 months agomessage-square68fedilink
minus-squareGigglyBobble@kbin.sociallinkfedilinkarrow-up11·edit-210 months agoAnd the whole implementation of is-number which is at version 7.0.0: module.exports = function(num) { if (typeof num === 'number') { return num - num === 0; } if (typeof num === 'string' && num.trim() !== '') { return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); } return false; }; The node.js ecosystem has always been madness.
And the whole implementation of is-number which is at version 7.0.0:
module.exports = function(num) { if (typeof num === 'number') { return num - num === 0; } if (typeof num === 'string' && num.trim() !== '') { return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); } return false; };
The node.js ecosystem has always been madness.