mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
18 lines
447 B
JavaScript
18 lines
447 B
JavaScript
define([], function() {
|
|
|
|
/**
|
|
* Checks if `value` is suitable for use as unique object key.
|
|
*
|
|
* @private
|
|
* @param {*} value The value to check.
|
|
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
*/
|
|
function isKeyable(value) {
|
|
var type = typeof value;
|
|
return type == 'number' || type == 'boolean' ||
|
|
(type == 'string' && value != '__proto__') || value == null;
|
|
}
|
|
|
|
return isKeyable;
|
|
});
|