mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
15 lines
347 B
JavaScript
15 lines
347 B
JavaScript
var isSymbol = require('./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 + '');
|
|
}
|
|
|
|
module.exports = baseCastKey;
|