1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const is_fakeable_1 = require("./is-fakeable");
|
4 | const is_native_prototype_1 = require("./is-native-prototype");
|
5 | function gatherProps(thing) {
|
6 | const props = {};
|
7 | while (is_fakeable_1.default(thing) && !is_native_prototype_1.default(thing)) {
|
8 | Object.getOwnPropertyNames(thing).forEach((propName) => {
|
9 | if (!props[propName] && propName !== 'constructor') {
|
10 | props[propName] = Object.getOwnPropertyDescriptor(thing, propName);
|
11 | }
|
12 | });
|
13 | thing = Object.getPrototypeOf(thing);
|
14 | }
|
15 | return props;
|
16 | }
|
17 | exports.default = gatherProps;
|