GoScrobble/web/node_modules/lodash-es/_isKeyable.js

16 lines
428 B
JavaScript
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
/**
* 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 == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
export default isKeyable;