source:
node_modules/es-toolkit/dist/compat/_internal/toKey.mjs
| Last change on this file was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 237 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 1 | function toKey(value) { |
| 2 | if (typeof value === 'string' || typeof value === 'symbol') { | |
| 3 | return value; | |
| 4 | } | |
| 5 | if (Object.is(value?.valueOf?.(), -0)) { | |
| 6 | return '-0'; | |
| 7 | } | |
| 8 | return String(value); | |
| 9 | } | |
| 10 | ||
| 11 | export { toKey }; |
Note:
See TracBrowser
for help on using the repository browser.
