* Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
(value, object)
| 21950 | * @returns {boolean} Returns `true` if `value` is a property name, else `false`. |
| 21951 | */ |
| 21952 | function isKey(value, object) { |
| 21953 | if (isArray(value)) { |
| 21954 | return false; |
| 21955 | } |
| 21956 | var type = typeof value === 'undefined' ? 'undefined' : _typeof(value); |
| 21957 | if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { |
| 21958 | return true; |
| 21959 | } |
| 21960 | return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); |
| 21961 | } |
| 21962 | |
| 21963 | module.exports = isKey; |
| 21964 |
no test coverage detected