Skip to content

Commit

Permalink
Modified __rest to check if property is enumerable. (#66)
Browse files Browse the repository at this point in the history
* Modified __rest to check if property is enumerable, as according to my TypeScript PR

* Changed propertyIsEnumerable call to be on s and not on Object.
  • Loading branch information
NicholasLYang authored and rbuckton committed May 7, 2019
1 parent ca03390 commit 57efce4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tslib.es6.js
Expand Up @@ -43,8 +43,10 @@ export function __rest(s, e) {
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}

Expand Down
6 changes: 4 additions & 2 deletions tslib.js
Expand Up @@ -79,8 +79,10 @@ var __importDefault;
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};

Expand Down

0 comments on commit 57efce4

Please sign in to comment.