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