source:
node_modules/es-toolkit/dist/compat/util/toNumber.mjs
| Last change on this file was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 185 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 1 | import { isSymbol } from '../predicate/isSymbol.mjs'; |
| 2 | ||
| 3 | function toNumber(value) { | |
| 4 | if (isSymbol(value)) { | |
| 5 | return NaN; | |
| 6 | } | |
| 7 | return Number(value); | |
| 8 | } | |
| 9 | ||
| 10 | export { toNumber }; |
Note:
See TracBrowser
for help on using the repository browser.
