mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
337 B
15 lines
337 B
9 years ago
|
var isSymbol = require('./isSymbol');
|
||
|
|
||
|
/**
|
||
9 years ago
|
* Converts `value` to a string key if it's not a string or symbol.
|
||
9 years ago
|
*
|
||
|
* @private
|
||
|
* @param {*} value The value to inspect.
|
||
9 years ago
|
* @returns {string|symbol} Returns the key.
|
||
9 years ago
|
*/
|
||
9 years ago
|
function toKey(key) {
|
||
9 years ago
|
return (typeof key == 'string' || isSymbol(key)) ? key : (key + '');
|
||
|
}
|
||
|
|
||
9 years ago
|
module.exports = toKey;
|