mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
28
react-app/node_modules/lodash/internal/isKey.js
generated
vendored
Normal file
28
react-app/node_modules/lodash/internal/isKey.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
var isArray = require('../lang/isArray'),
|
||||
toObject = require('./toObject');
|
||||
|
||||
/** Used to match property names within property paths. */
|
||||
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
|
||||
reIsPlainProp = /^\w*$/;
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
*/
|
||||
function isKey(value, object) {
|
||||
var type = typeof value;
|
||||
if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
|
||||
return true;
|
||||
}
|
||||
if (isArray(value)) {
|
||||
return false;
|
||||
}
|
||||
var result = !reIsDeepProp.test(value);
|
||||
return result || (object != null && value in toObject(object));
|
||||
}
|
||||
|
||||
module.exports = isKey;
|
Reference in New Issue
Block a user