mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-30 15:07:50 +00:00
16 lines
369 B
JavaScript
16 lines
369 B
JavaScript
define(['./isSymbol'], function(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 + '');
|
|
}
|
|
|
|
return baseCastKey;
|
|
});
|