7455fd889e806ffa4935f243bd9c4aec64d66733
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _baseKeysIn.js
1 var Reflect = require('./_Reflect'),
2     iteratorToArray = require('./_iteratorToArray');
3
4 /** Used for built-in method references. */
5 var objectProto = Object.prototype;
6
7 /** Built-in value references. */
8 var enumerate = Reflect ? Reflect.enumerate : undefined,
9     propertyIsEnumerable = objectProto.propertyIsEnumerable;
10
11 /**
12  * The base implementation of `_.keysIn` which doesn't skip the constructor
13  * property of prototypes or treat sparse arrays as dense.
14  *
15  * @private
16  * @param {Object} object The object to query.
17  * @returns {Array} Returns the array of property names.
18  */
19 function baseKeysIn(object) {
20   object = object == null ? object : Object(object);
21
22   var result = [];
23   for (var key in object) {
24     result.push(key);
25   }
26   return result;
27 }
28
29 // Fallback for IE < 9 with es6-shim.
30 if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
31   baseKeysIn = function(object) {
32     return iteratorToArray(enumerate(object));
33   };
34 }
35
36 module.exports = baseKeysIn;