mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Bump to v4.10.0.
This commit is contained in:
15
_toKey.js
Normal file
15
_toKey.js
Normal file
@@ -0,0 +1,15 @@
|
||||
define(['./isSymbol'], function(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 + '');
|
||||
}
|
||||
|
||||
return toKey;
|
||||
});
|
||||
Reference in New Issue
Block a user