mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Move internal modules to “internal” folder.
This commit is contained in:
15
.internal/isKeyable.js
Normal file
15
.internal/isKeyable.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* 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) {
|
||||
const type = typeof value;
|
||||
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
||||
? (value !== '__proto__')
|
||||
: (value === null);
|
||||
}
|
||||
|
||||
export default isKeyable;
|
||||
Reference in New Issue
Block a user