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:
64
react-app/node_modules/lodash/object/keysIn.js
generated
vendored
Normal file
64
react-app/node_modules/lodash/object/keysIn.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
var isArguments = require('../lang/isArguments'),
|
||||
isArray = require('../lang/isArray'),
|
||||
isIndex = require('../internal/isIndex'),
|
||||
isLength = require('../internal/isLength'),
|
||||
isObject = require('../lang/isObject');
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Creates an array of the own and inherited enumerable property names of `object`.
|
||||
*
|
||||
* **Note:** Non-object values are coerced to objects.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Object
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of property names.
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
* this.a = 1;
|
||||
* this.b = 2;
|
||||
* }
|
||||
*
|
||||
* Foo.prototype.c = 3;
|
||||
*
|
||||
* _.keysIn(new Foo);
|
||||
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
|
||||
*/
|
||||
function keysIn(object) {
|
||||
if (object == null) {
|
||||
return [];
|
||||
}
|
||||
if (!isObject(object)) {
|
||||
object = Object(object);
|
||||
}
|
||||
var length = object.length;
|
||||
length = (length && isLength(length) &&
|
||||
(isArray(object) || isArguments(object)) && length) || 0;
|
||||
|
||||
var Ctor = object.constructor,
|
||||
index = -1,
|
||||
isProto = typeof Ctor == 'function' && Ctor.prototype === object,
|
||||
result = Array(length),
|
||||
skipIndexes = length > 0;
|
||||
|
||||
while (++index < length) {
|
||||
result[index] = (index + '');
|
||||
}
|
||||
for (var key in object) {
|
||||
if (!(skipIndexes && isIndex(key, length)) &&
|
||||
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
||||
result.push(key);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = keysIn;
|
Reference in New Issue
Block a user