Download web/node_modules/loupe/lib/number.js from amitesh11/pose: direct link, hf CLI and curl.
- Browser
- Download file 591 Bytes
-
https://huggingface.co/spaces/amitesh11/pose/resolve/main/web/node_modules/loupe/lib/number.js
- Command line
-
hf download hf://spaces/amitesh11/pose/web/node_modules/loupe/lib/number.js
-
curl -L -o number.js https://huggingface.co/spaces/amitesh11/pose/resolve/main/web/node_modules/loupe/lib/number.js
591 Bytes
| import { truncate } from './helpers' | |
| 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(number, options.truncate), 'number') | |
| } | |