Skip to content

Commit

Permalink
Include non-enumerable keys in __importStar helper
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Oct 17, 2024
1 parent 7c11588 commit 6bf8114
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
11 changes: 10 additions & 1 deletion tslib.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,19 @@ var __setModuleDefault = Object.create ? (function(o, v) {
o["default"] = v;
};

var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};

export function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
}
Expand Down
11 changes: 10 additions & 1 deletion tslib.es6.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,19 @@ var __setModuleDefault = Object.create ? (function(o, v) {
o["default"] = v;
};

var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};

export function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
}
Expand Down
11 changes: 10 additions & 1 deletion tslib.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,19 @@ var __rewriteRelativeImportExtension;
o["default"] = v;
};

var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};

__importStar = function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
Expand Down

0 comments on commit 6bf8114

Please sign in to comment.