@limetech/lime-elements
Version:
118 lines (106 loc) • 3.22 kB
JavaScript
'use strict';
const _baseIsEqual = require('./_baseIsEqual-2203758e.js');
const _getPrototype = require('./_getPrototype-de167139.js');
const isObject = require('./isObject-e28b7997.js');
const _getTag = require('./_getTag-8d76f8e1.js');
const isArrayLike = require('./isArrayLike-6c2b123b.js');
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject.isObject(object)) {
return nativeKeysIn(object);
}
var isProto = _getTag.isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @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) {
return isArrayLike.isArrayLike(object) ? _baseIsEqual.arrayLikeKeys(object, true) : baseKeysIn(object);
}
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? _baseIsEqual.stubArray : function(object) {
var result = [];
while (object) {
_baseIsEqual.arrayPush(result, _baseIsEqual.getSymbols(object));
object = _getPrototype.getPrototype(object);
}
return result;
};
/**
* Creates an array of own and inherited enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeysIn(object) {
return _baseIsEqual.baseGetAllKeys(object, keysIn, getSymbolsIn);
}
exports.getAllKeysIn = getAllKeysIn;
exports.getSymbolsIn = getSymbolsIn;
exports.keysIn = keysIn;
//# sourceMappingURL=_getAllKeysIn-6b9014ad.js.map