Skip to content

Commit 763381d

Browse files
Merge pull request #39 from Microsoft/makeTemplateObject
Add the '__makeTemplateObject' helper.
2 parents 664aef7 + 711ef41 commit 763381d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

tslib.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ export declare function __spread(...args: any[]): any[];
2727
export declare function __await(v: any): any;
2828
export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any;
2929
export declare function __asyncDelegator(o: any): any;
30-
export declare function __asyncValues(o: any): any;
30+
export declare function __asyncValues(o: any): any;
31+
export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;

tslib.es6.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,8 @@ export function __asyncValues(o) {
159159
var m = o[Symbol.asyncIterator];
160160
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
161161
}
162+
163+
export function __makeTemplateObject(cooked, raw) {
164+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
165+
return cooked;
166+
};

tslib.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var __await;
2929
var __asyncGenerator;
3030
var __asyncDelegator;
3131
var __asyncValues;
32+
var __makeTemplateObject;
3233
(function (factory) {
3334
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
3435
if (typeof define === "function" && define.amd) {
@@ -197,6 +198,11 @@ var __asyncValues;
197198
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
198199
};
199200

201+
__makeTemplateObject = function (cooked, raw) {
202+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
203+
return cooked;
204+
};
205+
200206
exporter("__extends", __extends);
201207
exporter("__assign", __assign);
202208
exporter("__rest", __rest);
@@ -213,4 +219,5 @@ var __asyncValues;
213219
exporter("__asyncGenerator", __asyncGenerator);
214220
exporter("__asyncDelegator", __asyncDelegator);
215221
exporter("__asyncValues", __asyncValues);
222+
exporter("__makeTemplateObject", __makeTemplateObject);
216223
});

0 commit comments

Comments
 (0)