From 664bdcd90b78ad8c4bbb785524da16aacb10697d Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 5 May 2020 16:36:07 -0700 Subject: [PATCH] Update helpers for TS 3.9 --- tslib.d.ts | 1 + tslib.es6.js | 20 +++++++++++++++++--- tslib.js | 26 +++++++++++++++++++++----- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/tslib.d.ts b/tslib.d.ts index 6310fbf..7c6a706 100644 --- a/tslib.d.ts +++ b/tslib.d.ts @@ -34,3 +34,4 @@ export declare function __importStar(mod: T): T; export declare function __importDefault(mod: T): T | { default: T }; export declare function __classPrivateFieldGet(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V; export declare function __classPrivateFieldSet(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V; +export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey); \ No newline at end of file diff --git a/tslib.es6.js b/tslib.es6.js index 1b8c2b3..ce26163 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -103,8 +103,16 @@ export function __generator(thisArg, body) { } } +export const __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + export function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); } export function __values(o) { @@ -185,11 +193,17 @@ export function __makeTemplateObject(cooked, raw) { return cooked; }; +const __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + export function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; } diff --git a/tslib.js b/tslib.js index 5136250..b79d531 100644 --- a/tslib.js +++ b/tslib.js @@ -35,6 +35,7 @@ var __importStar; var __importDefault; var __classPrivateFieldGet; var __classPrivateFieldSet; +var __createBinding; (function (factory) { var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; if (typeof define === "function" && define.amd) { @@ -142,9 +143,17 @@ var __classPrivateFieldSet; } }; - __exportStar = function (m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; - }; + __exportStar = function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); + } + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); __values = function (o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; @@ -224,11 +233,17 @@ var __classPrivateFieldSet; return cooked; }; + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + __importStar = function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; @@ -260,6 +275,7 @@ var __classPrivateFieldSet; exporter("__awaiter", __awaiter); exporter("__generator", __generator); exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); exporter("__values", __values); exporter("__read", __read); exporter("__spread", __spread);