main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
868 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import isObject from './isObject.js';
|
---|
| 2 | import isPrototype from './_isPrototype.js';
|
---|
| 3 | import nativeKeysIn from './_nativeKeysIn.js';
|
---|
| 4 |
|
---|
| 5 | /** Used for built-in method references. */
|
---|
| 6 | var objectProto = Object.prototype;
|
---|
| 7 |
|
---|
| 8 | /** Used to check objects for own properties. */
|
---|
| 9 | var hasOwnProperty = objectProto.hasOwnProperty;
|
---|
| 10 |
|
---|
| 11 | /**
|
---|
| 12 | * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
---|
| 13 | *
|
---|
| 14 | * @private
|
---|
| 15 | * @param {Object} object The object to query.
|
---|
| 16 | * @returns {Array} Returns the array of property names.
|
---|
| 17 | */
|
---|
| 18 | function baseKeysIn(object) {
|
---|
| 19 | if (!isObject(object)) {
|
---|
| 20 | return nativeKeysIn(object);
|
---|
| 21 | }
|
---|
| 22 | var isProto = isPrototype(object),
|
---|
| 23 | result = [];
|
---|
| 24 |
|
---|
| 25 | for (var key in object) {
|
---|
| 26 | if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
---|
| 27 | result.push(key);
|
---|
| 28 | }
|
---|
| 29 | }
|
---|
| 30 | return result;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | export default baseKeysIn;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.