source: imaps-frontend/node_modules/lodash-es/_toKey.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 521 bytes
RevLine 
[d565449]1import isSymbol from './isSymbol.js';
2
3/** Used as references for various `Number` constants. */
4var INFINITY = 1 / 0;
5
6/**
7 * Converts `value` to a string key if it's not a string or symbol.
8 *
9 * @private
10 * @param {*} value The value to inspect.
11 * @returns {string|symbol} Returns the key.
12 */
13function toKey(value) {
14 if (typeof value == 'string' || isSymbol(value)) {
15 return value;
16 }
17 var result = (value + '');
18 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
19}
20
21export default toKey;
Note: See TracBrowser for help on using the repository browser.