ShaggySnacks@lemmy.myserv.one 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-square67fedilinkarrow-up1142arrow-down120
arrow-up1122arrow-down1external-linkTIL About How 11 Lines of Code Supported Web Development and the Code Was Deleted It Broke the Internetgetpocket.comShaggySnacks@lemmy.myserv.one to Today I Learned@lemmy.worldEnglish · 10 months agomessage-square67fedilink
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.