toPositive.js 92 Bytes Raw Blame History Permalink 1 2 3 module.exports = function toPositive(number) { return number < 0 ? 0 : (+number || 0); };