mirror of
https://github.com/actions/setup-python
synced 2024-11-30 21:22:28 +08:00
16 lines
430 B
JavaScript
16 lines
430 B
JavaScript
|
/**
|
||
|
* 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);
|
||
|
}
|
||
|
|
||
|
module.exports = isKeyable;
|