Files
lodash/_toKey.js
John-David Dalton be0bf2681b Bump to v4.10.0.
2016-04-10 23:01:56 -07:00

15 lines
337 B
JavaScript

var isSymbol = require('./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 + '');
}
module.exports = toKey;