Files
lodash/_baseCastKey.js
John-David Dalton ce0b51888c Bump to v4.7.0.
2016-03-31 00:36:47 -07:00

15 lines
342 B
JavaScript

import isSymbol from './isSymbol';
/**
* Casts `value` to a string if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the cast key.
*/
function baseCastKey(key) {
return (typeof key == 'string' || isSymbol(key)) ? key : (key + '');
}
export default baseCastKey;