source:
node_modules/es-toolkit/dist/compat/_internal/toKey.mjs@
a762898
| Last change on this file since a762898 was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 237 bytes | |
| Line | |
|---|---|
| 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.
