Sha256: 6b118098dc135e3b9e2c5a5be52255162678969b879c85dc5ee7dcbfecf2d3c9
Contents?: true
Size: 642 Bytes
Versions: 26
Compression:
Stored size: 642 Bytes
Contents
import { truncate } from './helpers.js'; const isNaN = Number.isNaN || (i => i !== i); // eslint-disable-line no-self-compare export default function inspectNumber(number, options) { if (isNaN(number)) { return options.stylize('NaN', 'number'); } if (number === Infinity) { return options.stylize('Infinity', 'number'); } if (number === -Infinity) { return options.stylize('-Infinity', 'number'); } if (number === 0) { return options.stylize(1 / number === Infinity ? '+0' : '-0', 'number'); } return options.stylize(truncate(String(number), options.truncate), 'number'); }
Version data entries
26 entries across 26 versions & 1 rubygems