Files
lodash/_toKey.js
John-David Dalton 76b289fe6e Bump to v4.10.0.
2016-04-10 22:53:08 -07:00

16 lines
359 B
JavaScript

define(['./isSymbol'], function(isSymbol) {
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(key) {
return (typeof key == 'string' || isSymbol(key)) ? key : (key + '');
}
return toKey;
});