(Adaptive Loop) Pass 3
(Adaptive Loop) Record freeze commit hash in context manifest
This commit is contained in:
1079 files changed
+1131878
No files matched your search
+17
@@ -0,0 +1,17 @@
|
||||
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');
|
||||
}
|
||||
Reference in new issue
Block a user