UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

12 lines (10 loc) 237 B
function toKey(value) { if (typeof value === 'string' || typeof value === 'symbol') { return value; } if (Object.is(value?.valueOf?.(), -0)) { return '-0'; } return String(value); } export { toKey };