@quenk/wml 2.10.1 → 2.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,10 +2,14 @@
2
2
  /**
3
3
  * Typescript code generator.
4
4
  */
5
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
6
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
7
- to[j] = from[i];
8
- return to;
5
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
6
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
7
+ if (ar || !(i in from)) {
8
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
9
+ ar[i] = from[i];
10
+ }
11
+ }
12
+ return to.concat(ar || Array.prototype.slice.call(from));
9
13
  };
10
14
  Object.defineProperty(exports, "__esModule", { value: true });
11
15
  exports.forOfStatement2TS = exports.forInStatement2TS = exports.ifStatement2TS = exports.interpolation2TS = exports.groupAttrs = exports.attrs2String = exports.attributeName2TS = exports.attributeValue2TS = exports.attribute2TS = exports.node2TS = exports.widget2TS = exports.tag2TS = exports.child2TS = exports.children2TS = exports.untypedParameter2TS = exports.typedParameter2TS = exports.parameter2TS = exports.parameters2TS = exports.typeMap2TS = exports.expandTypeMap = exports.typeMapFromRecordType = exports.typeMapFromMemberDecs = exports.memberDeclarations2TS = exports.recordType2Ts = exports.tupleType2TS = exports.listType2TS = exports.functionType2TS = exports.constructorType2TS = exports.type2TS = exports.typeParameter2TS = exports.typeParameters2TS = exports.viewStatement2TS = exports.funStatement2TS = exports.letStatement2TS = exports.contextStatement2TS = exports.aliasStatement2TS = exports.export2TS = exports.exports2TS = exports.compositeMember2TS = exports.aliasedMember2TS = exports.aggregateMember2TS = exports.importMember2TS = exports.importStatement2TS = exports.importStatements2TS = exports.CodeGenerator = exports.THIS = exports.DOCUMENT = exports.WML = exports.VIEW = exports.CONTEXT = void 0;
@@ -24,12 +28,12 @@ exports.THIS = '__this';
24
28
  var MAYBE = '__Maybe';
25
29
  var FROM_NULLABLE = '__fromNullable';
26
30
  var FROM_ARRAY = '__fromArray';
27
- var NODE_PARAMS = "tag:string, attrs:" + exports.WML + ".Attrs, " +
28
- ("children: " + exports.WML + ".Content[]");
29
- var WIDGET_PARAMS = "w: " + exports.WML + ".Widget, attrs:" + exports.WML + ".Attrs";
30
- var REGISTER_VIEW_PARAMS = "v:" + exports.WML + ".View";
31
- var REGISTER_PARAMS = "e:" + exports.WML + ".WMLElement, " +
32
- ("attrs:" + exports.WML + ".Attributes<any>");
31
+ var NODE_PARAMS = "tag:string, attrs:".concat(exports.WML, ".Attrs, ") +
32
+ "children: ".concat(exports.WML, ".Content[]");
33
+ var WIDGET_PARAMS = "w: ".concat(exports.WML, ".Widget, attrs:").concat(exports.WML, ".Attrs");
34
+ var REGISTER_VIEW_PARAMS = "v:".concat(exports.WML, ".View");
35
+ var REGISTER_PARAMS = "e:".concat(exports.WML, ".WMLElement, ") +
36
+ "attrs:".concat(exports.WML, ".Attributes<any>");
33
37
  var THROW_CHILD_ERR = ' throw new TypeError(`Can not adopt ' +
34
38
  'child ${c} of type \${typeof c}`);';
35
39
  var THROW_INVALIDATE_ERR = " throw new Error('invalidate(): cannot " +
@@ -80,69 +84,69 @@ var CodeGenerator = /** @class */ (function () {
80
84
  * generate a Typescript module from an WML AST.
81
85
  */
82
86
  CodeGenerator.prototype.generate = function (tree) {
83
- var newTree = transform_1.transformTree(tree);
87
+ var newTree = (0, transform_1.transformTree)(tree);
84
88
  return [
85
- "import * as " + exports.WML + " from '" + this.options.module + "';",
86
- "import * as " + exports.DOCUMENT + " from '" + this.options.dom + "';",
89
+ "import * as ".concat(exports.WML, " from '").concat(this.options.module, "';"),
90
+ "import * as ".concat(exports.DOCUMENT, " from '").concat(this.options.dom, "';"),
87
91
  imports(this),
88
- exports.importStatements2TS(this, newTree.imports),
92
+ (0, exports.importStatements2TS)(this, newTree.imports),
89
93
  eol(this),
90
94
  typeDefinitions(this),
91
95
  eol(this),
92
96
  "// @ts-ignore 6192",
93
- "const text = " + exports.DOCUMENT + ".text;",
97
+ "const text = ".concat(exports.DOCUMENT, ".text;"),
94
98
  "// @ts-ignore 6192",
95
- "const unsafe = " + exports.DOCUMENT + ".unsafe",
99
+ "const unsafe = ".concat(exports.DOCUMENT, ".unsafe"),
96
100
  "// @ts-ignore 6192",
97
101
  "const isSet = (value:any) => value != null",
98
- exports.exports2TS(this, newTree.exports)
102
+ (0, exports.exports2TS)(this, newTree.exports)
99
103
  ].join(eol(this));
100
104
  };
101
105
  return CodeGenerator;
102
106
  }());
103
107
  exports.CodeGenerator = CodeGenerator;
104
- var eol = function (ctx) { return "" + ctx.options.EOL; };
108
+ var eol = function (ctx) { return "".concat(ctx.options.EOL); };
105
109
  var imports = function (ctx) { return [
106
110
  "//@ts-ignore: 6192",
107
111
  "import {",
108
- "Maybe as " + MAYBE + ",",
109
- "fromNullable as " + FROM_NULLABLE + ",",
110
- "fromArray as " + FROM_ARRAY,
112
+ "Maybe as ".concat(MAYBE, ","),
113
+ "fromNullable as ".concat(FROM_NULLABLE, ","),
114
+ "fromArray as ".concat(FROM_ARRAY),
111
115
  "}",
112
116
  "from '@quenk/noni/lib/data/maybe';"
113
117
  ].join(eol(ctx)); };
114
118
  var typeDefinitions = function (ctx) { return [
115
- "" + IGNORE_UNUSED,
116
- "type " + IFARG + " = ()=>" + exports.WML + ".Content[]",
119
+ "".concat(IGNORE_UNUSED),
120
+ "type ".concat(IFARG, " = ()=>").concat(exports.WML, ".Content[]"),
117
121
  "",
118
- "" + IGNORE_UNUSED,
119
- "type " + FOR_ALT_TYPE + " = ()=> " + exports.WML + ".Content[]",
122
+ "".concat(IGNORE_UNUSED),
123
+ "type ".concat(FOR_ALT_TYPE, " = ()=> ").concat(exports.WML, ".Content[]"),
120
124
  "",
121
- "" + IGNORE_UNUSED,
122
- "type " + FOR_IN_BODY + " =(val:A, idx:number, all:A[])=>" +
123
- (exports.WML + ".Content[]"),
125
+ "".concat(IGNORE_UNUSED),
126
+ "type ".concat(FOR_IN_BODY, " =(val:A, idx:number, all:A[])=>") +
127
+ "".concat(exports.WML, ".Content[]"),
124
128
  "",
125
- "" + IGNORE_UNUSED,
126
- "type " + FOR_OF_BODY + " = (val:A, key:string, all:object) =>" +
127
- (exports.WML + ".Content[]"),
129
+ "".concat(IGNORE_UNUSED),
130
+ "type ".concat(FOR_OF_BODY, " = (val:A, key:string, all:object) =>") +
131
+ "".concat(exports.WML, ".Content[]"),
128
132
  "",
129
- "" + IGNORE_UNUSED,
130
- "interface " + RECORD + " {",
133
+ "".concat(IGNORE_UNUSED),
134
+ "interface ".concat(RECORD, " {"),
131
135
  "",
132
136
  " [key:string]: A",
133
137
  "",
134
138
  "}",
135
139
  "",
136
- "" + IGNORE_UNUSED,
137
- "const " + IF + " = (__expr:boolean, __conseq:" + IFARG + ",__alt?:" + IFARG + ") " +
140
+ "".concat(IGNORE_UNUSED),
141
+ "const ".concat(IF, " = (__expr:boolean, __conseq:").concat(IFARG, ",__alt?:").concat(IFARG, ") ") +
138
142
  ": Content[]=>",
139
143
  "(__expr) ? __conseq() : __alt ? __alt() : [];",
140
144
  "",
141
- "" + IGNORE_UNUSED,
142
- "const " + FOR_IN + " = <A>(list:A[], f:" + FOR_IN_BODY + ", alt:" +
143
- (FOR_ALT_TYPE + ") : " + exports.WML + ".Content[] => {"),
145
+ "".concat(IGNORE_UNUSED),
146
+ "const ".concat(FOR_IN, " = <A>(list:A[], f:").concat(FOR_IN_BODY, ", alt:") +
147
+ "".concat(FOR_ALT_TYPE, ") : ").concat(exports.WML, ".Content[] => {"),
144
148
  "",
145
- " let ret:" + exports.WML + ".Content[] = [];",
149
+ " let ret:".concat(exports.WML, ".Content[] = [];"),
146
150
  "",
147
151
  " for(let i=0; i<list.length; i++)",
148
152
  " ret = ret.concat(f(list[i], i, list));",
@@ -150,11 +154,11 @@ var typeDefinitions = function (ctx) { return [
150
154
  " return ret.length === 0 ? alt() : ret;",
151
155
  "",
152
156
  "}",
153
- "" + IGNORE_UNUSED,
154
- "const " + FOR_OF + " = <A>(o:" + RECORD + ", f:" + FOR_OF_BODY + "," +
155
- ("alt:" + FOR_ALT_TYPE + ") : " + exports.WML + ".Content[] => {"),
157
+ "".concat(IGNORE_UNUSED),
158
+ "const ".concat(FOR_OF, " = <A>(o:").concat(RECORD, ", f:").concat(FOR_OF_BODY, ",") +
159
+ "alt:".concat(FOR_ALT_TYPE, ") : ").concat(exports.WML, ".Content[] => {"),
156
160
  "",
157
- " let ret:" + exports.WML + ".Content[] = [];",
161
+ " let ret:".concat(exports.WML, ".Content[] = [];"),
158
162
  "",
159
163
  " for(let key in o)",
160
164
  " \t if(o.hasOwnProperty(key)) ",
@@ -168,14 +172,14 @@ var typeDefinitions = function (ctx) { return [
168
172
  * importStatements2TS converts a list of ImportStatements into typescript.
169
173
  */
170
174
  var importStatements2TS = function (ctx, list) {
171
- return list.map(exports.importStatement2TS).join(";" + eol(ctx));
175
+ return list.map(exports.importStatement2TS).join(";".concat(eol(ctx)));
172
176
  };
173
177
  exports.importStatements2TS = importStatements2TS;
174
178
  /**
175
179
  * importStatement2TS
176
180
  */
177
181
  var importStatement2TS = function (n) {
178
- return "import " + exports.importMember2TS(n.member) + " from '" + n.module.value + "'; ";
182
+ return "import ".concat((0, exports.importMember2TS)(n.member), " from '").concat(n.module.value, "'; ");
179
183
  };
180
184
  exports.importStatement2TS = importStatement2TS;
181
185
  /**
@@ -183,11 +187,11 @@ exports.importStatement2TS = importStatement2TS;
183
187
  */
184
188
  var importMember2TS = function (n) {
185
189
  if (n instanceof ast.AggregateMember)
186
- return exports.aggregateMember2TS(n);
190
+ return (0, exports.aggregateMember2TS)(n);
187
191
  else if (n instanceof ast.AliasedMember)
188
- return exports.aliasedMember2TS(n);
192
+ return (0, exports.aliasedMember2TS)(n);
189
193
  else if (n instanceof ast.CompositeMember)
190
- return exports.compositeMember2TS(n);
194
+ return (0, exports.compositeMember2TS)(n);
191
195
  else
192
196
  return '';
193
197
  };
@@ -196,15 +200,15 @@ exports.importMember2TS = importMember2TS;
196
200
  * aggregateMember2TS
197
201
  */
198
202
  var aggregateMember2TS = function (n) {
199
- return "* as " + exports.identifierOrConstructor2TS(n.id) + " ";
203
+ return "* as ".concat((0, exports.identifierOrConstructor2TS)(n.id), " ");
200
204
  };
201
205
  exports.aggregateMember2TS = aggregateMember2TS;
202
206
  /**
203
207
  * aliasedMember2TS
204
208
  */
205
209
  var aliasedMember2TS = function (n) {
206
- return exports.identifierOrConstructor2TS(n.member) + " " +
207
- ("as " + exports.identifierOrConstructor2TS(n.alias) + " ");
210
+ return "".concat((0, exports.identifierOrConstructor2TS)(n.member), " ") +
211
+ "as ".concat((0, exports.identifierOrConstructor2TS)(n.alias), " ");
208
212
  };
209
213
  exports.aliasedMember2TS = aliasedMember2TS;
210
214
  /**
@@ -212,15 +216,15 @@ exports.aliasedMember2TS = aliasedMember2TS;
212
216
  */
213
217
  var compositeMember2TS = function (n) {
214
218
  return '{' + (n.members.map(function (m) { return (m instanceof ast.AliasedMember) ?
215
- exports.aliasedMember2TS(m) :
216
- exports.identifierOrConstructor2TS(m); }).join(',')) + '}';
219
+ (0, exports.aliasedMember2TS)(m) :
220
+ (0, exports.identifierOrConstructor2TS)(m); }).join(',')) + '}';
217
221
  };
218
222
  exports.compositeMember2TS = compositeMember2TS;
219
223
  /**
220
224
  * exports2TS converts a list of exports to typescript.
221
225
  */
222
226
  var exports2TS = function (ctx, list) {
223
- return list.map(function (e) { return exports.export2TS(ctx, e); }).join(';' + eol(ctx));
227
+ return list.map(function (e) { return (0, exports.export2TS)(ctx, e); }).join(';' + eol(ctx));
224
228
  };
225
229
  exports.exports2TS = exports2TS;
226
230
  /**
@@ -228,17 +232,17 @@ exports.exports2TS = exports2TS;
228
232
  */
229
233
  var export2TS = function (ctx, n) {
230
234
  if (n instanceof ast.AliasStatement)
231
- return exports.aliasStatement2TS(n);
235
+ return (0, exports.aliasStatement2TS)(n);
232
236
  else if (n instanceof ast.ContextStatement)
233
- return exports.contextStatement2TS(n);
237
+ return (0, exports.contextStatement2TS)(n);
234
238
  else if (n instanceof ast.LetStatement)
235
- return exports.letStatement2TS(ctx, n);
239
+ return (0, exports.letStatement2TS)(ctx, n);
236
240
  else if (n instanceof ast.FunStatement)
237
- return exports.funStatement2TS(ctx, n);
241
+ return (0, exports.funStatement2TS)(ctx, n);
238
242
  else if (n instanceof ast.ViewStatement)
239
- return exports.viewStatement2TS(ctx, n);
243
+ return (0, exports.viewStatement2TS)(ctx, n);
240
244
  else if ((n instanceof ast.Widget) || (n instanceof ast.Node))
241
- return exports.tag2TS(ctx, n);
245
+ return (0, exports.tag2TS)(ctx, n);
242
246
  else
243
247
  return '';
244
248
  };
@@ -248,31 +252,31 @@ exports.export2TS = export2TS;
248
252
  */
249
253
  var aliasStatement2TS = function (n) {
250
254
  var typeArgs = (n.typeParameters.length > 0) ?
251
- exports.typeParameters2TS(n.typeParameters) : '';
252
- var preamble = "export type " + n.id.value + typeArgs;
253
- var members = n.members.map(function (m) { return exports.type2TS(m); }).join('|');
254
- return preamble + " = " + members + ";";
255
+ (0, exports.typeParameters2TS)(n.typeParameters) : '';
256
+ var preamble = "export type ".concat(n.id.value).concat(typeArgs);
257
+ var members = n.members.map(function (m) { return (0, exports.type2TS)(m); }).join('|');
258
+ return "".concat(preamble, " = ").concat(members, ";");
255
259
  };
256
260
  exports.aliasStatement2TS = aliasStatement2TS;
257
261
  /**
258
262
  * contextStatement2TS
259
263
  */
260
264
  var contextStatement2TS = function (n) {
261
- var preamble = "export interface " + n.id.value;
265
+ var preamble = "export interface ".concat(n.id.value);
262
266
  var typeArgs = (n.typeParameters.length > 0) ?
263
- exports.typeParameters2TS(n.typeParameters) : '';
264
- var _a = array_1.partition(n.members, function (member) {
267
+ (0, exports.typeParameters2TS)(n.typeParameters) : '';
268
+ var _a = (0, array_1.partition)(n.members, function (member) {
265
269
  return member instanceof ast.ConstructorType;
266
270
  }), parents = _a[0], members = _a[1];
267
271
  var parentList = parents
268
272
  .map(exports.constructorType2TS).join(',');
269
- parentList = (parentList !== '') ? " extends " + parentList : '';
273
+ parentList = (parentList !== '') ? " extends ".concat(parentList) : '';
270
274
  return [
271
275
  preamble,
272
276
  typeArgs,
273
277
  parentList,
274
278
  '{',
275
- exports.memberDeclarations2TS(members),
279
+ (0, exports.memberDeclarations2TS)(members),
276
280
  '}'
277
281
  ].join('');
278
282
  };
@@ -285,11 +289,11 @@ var letStatement2TS = function (ctx, n) {
285
289
  };
286
290
  exports.letStatement2TS = letStatement2TS;
287
291
  var _setStatement2TS = function (ctx, n, preamble) {
288
- var id = exports.identifier2TS(n.id);
289
- var cons = exports.constructorType2TS(n.cons);
290
- preamble = preamble + " " + id + ":" + cons;
291
- var value = exports.expression2TS(ctx, n.expression);
292
- return preamble + " = " + value;
292
+ var id = (0, exports.identifier2TS)(n.id);
293
+ var cons = (0, exports.constructorType2TS)(n.cons);
294
+ preamble = "".concat(preamble, " ").concat(id, ":").concat(cons);
295
+ var value = (0, exports.expression2TS)(ctx, n.expression);
296
+ return "".concat(preamble, " = ").concat(value);
293
297
  };
294
298
  /**
295
299
  * funStatement2TS generates Typescript output for fun statements.
@@ -298,17 +302,17 @@ var _setStatement2TS = function (ctx, n, preamble) {
298
302
  * a single Registry, finally the content.
299
303
  */
300
304
  var funStatement2TS = function (ctx, n) {
301
- var id = exports.unqualifiedIdentifier2TS(n.id);
302
- var typeParams = exports.typeParameters2TS(n.typeParameters);
303
- var params = exports.parameters2TS(n.parameters);
304
- var factory = "(" + exports.THIS + ":" + exports.WML + ".Registry) : " + exports.WML + ".Content[] =>";
305
- var body = exports.children2TS(ctx, n.body);
305
+ var id = (0, exports.unqualifiedIdentifier2TS)(n.id);
306
+ var typeParams = (0, exports.typeParameters2TS)(n.typeParameters);
307
+ var params = (0, exports.parameters2TS)(n.parameters);
308
+ var factory = "(".concat(exports.THIS, ":").concat(exports.WML, ".Registry) : ").concat(exports.WML, ".Content[] =>");
309
+ var body = (0, exports.children2TS)(ctx, n.body);
306
310
  return [
307
- "export const " + id + " = ",
311
+ "export const ".concat(id, " = "),
308
312
  "",
309
- typeParams + "(" + params + ")=>" + factory + " {",
313
+ "".concat(typeParams, "(").concat(params, ")=>").concat(factory, " {"),
310
314
  "",
311
- " return " + body + ";",
315
+ " return ".concat(body, ";"),
312
316
  "",
313
317
  "};"
314
318
  ].join(eol(ctx));
@@ -322,49 +326,49 @@ exports.funStatement2TS = funStatement2TS;
322
326
  var viewStatement2TS = function (ctx, n) {
323
327
  var instances = n.directives.map(function (i) {
324
328
  return _setStatement2TS(ctx, i, 'let');
325
- }).join(";" + ctx.options.EOL);
326
- var id = n.id ? exports.constructor2TS(n.id) : 'Main';
327
- var typeParams = exports.typeParameters2TS(n.typeParameters);
329
+ }).join(";".concat(ctx.options.EOL));
330
+ var id = n.id ? (0, exports.constructor2TS)(n.id) : 'Main';
331
+ var typeParams = (0, exports.typeParameters2TS)(n.typeParameters);
328
332
  // This should be transformed to what we expect.
329
- var c = exports.type2TS(n.context);
330
- var template = exports.tag2TS(ctx, n.root);
333
+ var c = (0, exports.type2TS)(n.context);
334
+ var template = (0, exports.tag2TS)(ctx, n.root);
331
335
  return [
332
- "export class " + id + " " + typeParams + " implements " + exports.WML + ".View {",
336
+ "export class ".concat(id, " ").concat(typeParams, " implements ").concat(exports.WML, ".View {"),
333
337
  "",
334
- " constructor(" + exports.CONTEXT + ": " + c + ") {",
338
+ " constructor(".concat(exports.CONTEXT, ": ").concat(c, ") {"),
335
339
  "",
336
- " this.template = (" + exports.THIS + ":" + exports.WML + ".Registry) => {",
340
+ " this.template = (".concat(exports.THIS, ":").concat(exports.WML, ".Registry) => {"),
337
341
  "",
338
- " " + instances,
342
+ " ".concat(instances),
339
343
  "",
340
- " return " + template + ";",
344
+ " return ".concat(template, ";"),
341
345
  "",
342
346
  " }",
343
347
  "",
344
348
  " }",
345
349
  "",
346
- " ids: { [key: string]: " + exports.WML + ".WMLElement } = {};",
350
+ " ids: { [key: string]: ".concat(exports.WML, ".WMLElement } = {};"),
347
351
  "",
348
- " groups: { [key: string]: " + exports.WML + ".WMLElement[] } = {};",
352
+ " groups: { [key: string]: ".concat(exports.WML, ".WMLElement[] } = {};"),
349
353
  "",
350
- " views: " + exports.WML + ".View[] = [];",
354
+ " views: ".concat(exports.WML, ".View[] = [];"),
351
355
  "",
352
- " widgets: " + exports.WML + ".Widget[] = [];",
356
+ " widgets: ".concat(exports.WML, ".Widget[] = [];"),
353
357
  "",
354
- " tree: Node = <Node>" + exports.DOCUMENT + ".createElement('div');",
358
+ " tree: Node = <Node>".concat(exports.DOCUMENT, ".createElement('div');"),
355
359
  "",
356
- " template: " + exports.WML + ".Template;",
360
+ " template: ".concat(exports.WML, ".Template;"),
357
361
  "",
358
- " registerView(" + REGISTER_VIEW_PARAMS + ") : " + exports.WML + ".View {",
362
+ " registerView(".concat(REGISTER_VIEW_PARAMS, ") : ").concat(exports.WML, ".View {"),
359
363
  "",
360
364
  " this.views.push(v);",
361
365
  "",
362
366
  " return v;",
363
367
  "",
364
368
  "}",
365
- " register(" + REGISTER_PARAMS + ") : " + exports.WML + ".WMLElement {",
369
+ " register(".concat(REGISTER_PARAMS, ") : ").concat(exports.WML, ".WMLElement {"),
366
370
  "",
367
- " let attrsMap = (<" + exports.WML + ".Attrs><any>attrs)",
371
+ " let attrsMap = (<".concat(exports.WML, ".Attrs><any>attrs)"),
368
372
  "",
369
373
  " if(attrsMap.wml) {",
370
374
  "",
@@ -390,9 +394,9 @@ var viewStatement2TS = function (ctx, n) {
390
394
  " return e;",
391
395
  "}",
392
396
  "",
393
- " node(" + NODE_PARAMS + "): " + exports.WML + ".Content {",
397
+ " node(".concat(NODE_PARAMS, "): ").concat(exports.WML, ".Content {"),
394
398
  "",
395
- " let e = " + exports.DOCUMENT + ".createElement(tag);",
399
+ " let e = ".concat(exports.DOCUMENT, ".createElement(tag);"),
396
400
  "",
397
401
  " Object.keys(attrs).forEach(key => {",
398
402
  "",
@@ -412,8 +416,8 @@ var viewStatement2TS = function (ctx, n) {
412
416
  "",
413
417
  " e.setAttribute(key, '');",
414
418
  "",
415
- " } else if(!" + exports.DOCUMENT + ".isBrowser && ",
416
- " value instanceof " + exports.DOCUMENT + ".WMLDOMText) {",
419
+ " } else if(!".concat(exports.DOCUMENT, ".isBrowser && "),
420
+ " value instanceof ".concat(exports.DOCUMENT, ".WMLDOMText) {"),
417
421
  "",
418
422
  " e.setAttribute(key, <any>value);",
419
423
  "",
@@ -428,13 +432,13 @@ var viewStatement2TS = function (ctx, n) {
428
432
  " case 'string':",
429
433
  " case 'number':",
430
434
  " case 'boolean':",
431
- " let tn = " + exports.DOCUMENT + ".createTextNode(''+c);",
435
+ " let tn = ".concat(exports.DOCUMENT, ".createTextNode(''+c);"),
432
436
  " e.appendChild(<Node>tn)",
433
437
  " case 'object':",
434
438
  " e.appendChild(<Node>c);",
435
439
  " break;",
436
440
  " default:",
437
- " " + THROW_CHILD_ERR,
441
+ " ".concat(THROW_CHILD_ERR),
438
442
  "",
439
443
  " }})",
440
444
  "",
@@ -445,7 +449,7 @@ var viewStatement2TS = function (ctx, n) {
445
449
  " }",
446
450
  "",
447
451
  "",
448
- " widget(" + WIDGET_PARAMS + ") : " + exports.WML + ".Content {",
452
+ " widget(".concat(WIDGET_PARAMS, ") : ").concat(exports.WML, ".Content {"),
449
453
  "",
450
454
  " this.register(w, attrs);",
451
455
  "",
@@ -455,20 +459,20 @@ var viewStatement2TS = function (ctx, n) {
455
459
  "",
456
460
  " }",
457
461
  "",
458
- " findById<E extends " + exports.WML + ".WMLElement>(id: string): " + MAYBE + "<E> {",
462
+ " findById<E extends ".concat(exports.WML, ".WMLElement>(id: string): ").concat(MAYBE, "<E> {"),
459
463
  "",
460
- " let mW:" + MAYBE + "<E> = " + FROM_NULLABLE + "<E>(<E>this.ids[id])",
464
+ " let mW:".concat(MAYBE, "<E> = ").concat(FROM_NULLABLE, "<E>(<E>this.ids[id])"),
461
465
  "",
462
466
  " return this.views.reduce((p,c)=>",
463
467
  " p.isJust() ? p : c.findById(id), mW);",
464
468
  "",
465
469
  " }",
466
470
  "",
467
- " findByGroup<E extends " + exports.WML + ".WMLElement>(name: string): " +
468
- (MAYBE + "<E[]> {"),
471
+ " findByGroup<E extends ".concat(exports.WML, ".WMLElement>(name: string): ") +
472
+ "".concat(MAYBE, "<E[]> {"),
469
473
  "",
470
- " let mGroup:" + MAYBE + "<E[]> =",
471
- " " + FROM_ARRAY + "(this.groups.hasOwnProperty(name) ?",
474
+ " let mGroup:".concat(MAYBE, "<E[]> ="),
475
+ " ".concat(FROM_ARRAY, "(this.groups.hasOwnProperty(name) ?"),
472
476
  " <any>this.groups[name] : ",
473
477
  " []);",
474
478
  "",
@@ -487,13 +491,13 @@ var viewStatement2TS = function (ctx, n) {
487
491
  " 'Missing DOM tree!');",
488
492
  "",
489
493
  " if (tree.parentNode == null)",
490
- " " + THROW_INVALIDATE_ERR,
494
+ " ".concat(THROW_INVALIDATE_ERR),
491
495
  "",
492
496
  " parent.replaceChild(<Node>this.render(), tree) ",
493
497
  "",
494
498
  " }",
495
499
  "",
496
- " render(): " + exports.WML + ".Content {",
500
+ " render(): ".concat(exports.WML, ".Content {"),
497
501
  "",
498
502
  " this.ids = {};",
499
503
  " this.widgets.forEach(w => w.removed());",
@@ -520,15 +524,15 @@ exports.viewStatement2TS = viewStatement2TS;
520
524
  * typescript typeParameters2TS.
521
525
  */
522
526
  var typeParameters2TS = function (ns) {
523
- return (ns.length === 0) ? '' : "<" + ns.map(exports.typeParameter2TS).join(',') + "> ";
527
+ return (ns.length === 0) ? '' : "<".concat(ns.map(exports.typeParameter2TS).join(','), "> ");
524
528
  };
525
529
  exports.typeParameters2TS = typeParameters2TS;
526
530
  /**
527
531
  * typeParameter2TS converts a type parameter into a typescript type parameter.
528
532
  */
529
533
  var typeParameter2TS = function (n) {
530
- return toPrim(exports.identifierOrConstructor2TS(n.id)) + " " +
531
- ((n.constraint ? 'extends ' + exports.type2TS(n.constraint) : '') + " ");
534
+ return "".concat(toPrim((0, exports.identifierOrConstructor2TS)(n.id)), " ") +
535
+ "".concat(n.constraint ? 'extends ' + (0, exports.type2TS)(n.constraint) : '', " ");
532
536
  };
533
537
  exports.typeParameter2TS = typeParameter2TS;
534
538
  /**
@@ -536,21 +540,21 @@ exports.typeParameter2TS = typeParameter2TS;
536
540
  */
537
541
  var type2TS = function (n) {
538
542
  if (n instanceof ast.ConstructorType)
539
- return exports.constructorType2TS(n);
543
+ return (0, exports.constructorType2TS)(n);
540
544
  else if (n instanceof ast.RecordType)
541
- return exports.recordType2Ts(n);
545
+ return (0, exports.recordType2Ts)(n);
542
546
  else if (n instanceof ast.ListType)
543
- return exports.listType2TS(n);
547
+ return (0, exports.listType2TS)(n);
544
548
  else if (n instanceof ast.TupleType)
545
- return exports.tupleType2TS(n);
549
+ return (0, exports.tupleType2TS)(n);
546
550
  else if (n instanceof ast.StringLiteral)
547
- return exports.string2TS(n);
551
+ return (0, exports.string2TS)(n);
548
552
  else if (n instanceof ast.NumberLiteral)
549
- return exports.number2TS(n);
553
+ return (0, exports.number2TS)(n);
550
554
  else if (n instanceof ast.BooleanLiteral)
551
- return exports.boolean2TS(n);
555
+ return (0, exports.boolean2TS)(n);
552
556
  else if (n instanceof ast.FunctionType)
553
- return exports.functionType2TS(n);
557
+ return (0, exports.functionType2TS)(n);
554
558
  return '<error>';
555
559
  };
556
560
  exports.type2TS = type2TS;
@@ -560,32 +564,32 @@ exports.type2TS = type2TS;
560
564
  * If the node is generic, the type parameters will be generated as well.
561
565
  */
562
566
  var constructorType2TS = function (n) {
563
- var id = toPrim(exports.identifierOrConstructor2TS(n.id));
567
+ var id = toPrim((0, exports.identifierOrConstructor2TS)(n.id));
564
568
  return (n.typeParameters.length > 0) ?
565
- id + exports.typeParameters2TS(n.typeParameters) : id;
569
+ id + (0, exports.typeParameters2TS)(n.typeParameters) : id;
566
570
  };
567
571
  exports.constructorType2TS = constructorType2TS;
568
572
  /**
569
573
  * functionType2TS
570
574
  */
571
575
  var functionType2TS = function (n) {
572
- var params = n.parameters.map(function (t, k) { return "$" + k + ":" + exports.type2TS(t); }).join(',');
573
- var ret = exports.type2TS(n.returnType);
574
- return "(" + params + ") => " + ret;
576
+ var params = n.parameters.map(function (t, k) { return "$".concat(k, ":").concat((0, exports.type2TS)(t)); }).join(',');
577
+ var ret = (0, exports.type2TS)(n.returnType);
578
+ return "(".concat(params, ") => ").concat(ret);
575
579
  };
576
580
  exports.functionType2TS = functionType2TS;
577
581
  /**
578
582
  * listType2TS
579
583
  */
580
584
  var listType2TS = function (n) {
581
- return "(" + exports.type2TS(n.elementType) + ")[]";
585
+ return "(".concat((0, exports.type2TS)(n.elementType), ")[]");
582
586
  };
583
587
  exports.listType2TS = listType2TS;
584
588
  /**
585
589
  * tupleType2TS
586
590
  */
587
591
  var tupleType2TS = function (n) {
588
- return "[" + n.members.map(exports.type2TS).join(',') + "]";
592
+ return "[".concat(n.members.map(exports.type2TS).join(','), "]");
589
593
  };
590
594
  exports.tupleType2TS = tupleType2TS;
591
595
  /**
@@ -593,7 +597,7 @@ exports.tupleType2TS = tupleType2TS;
593
597
  * record interface.
594
598
  */
595
599
  var recordType2Ts = function (n) {
596
- return '{' + exports.memberDeclarations2TS(n.members) + '}';
600
+ return '{' + (0, exports.memberDeclarations2TS)(n.members) + '}';
597
601
  };
598
602
  exports.recordType2Ts = recordType2Ts;
599
603
  /**
@@ -603,7 +607,7 @@ exports.recordType2Ts = recordType2Ts;
603
607
  * using the "<path1>.<path2>.<path3>" syntax occur as nested records.
604
608
  */
605
609
  var memberDeclarations2TS = function (n) {
606
- return exports.typeMap2TS(exports.expandTypeMap(exports.typeMapFromMemberDecs(n)));
610
+ return (0, exports.typeMap2TS)((0, exports.expandTypeMap)((0, exports.typeMapFromMemberDecs)(n)));
607
611
  };
608
612
  exports.memberDeclarations2TS = memberDeclarations2TS;
609
613
  /**
@@ -615,11 +619,11 @@ var typeMapFromMemberDecs = function (list) {
615
619
  return list.reduce(function (p, m) {
616
620
  var paths = m.path.map(function (p) { return p.value; });
617
621
  if (m.kind instanceof ast.RecordType) {
618
- return exports.typeMapFromRecordType(m.kind, p, paths);
622
+ return (0, exports.typeMapFromRecordType)(m.kind, p, paths);
619
623
  }
620
624
  else {
621
625
  var path = paths2String(paths);
622
- path = m.optional ? path + "?" : path;
626
+ path = m.optional ? "".concat(path, "?") : path;
623
627
  p[path] = m.kind;
624
628
  return p;
625
629
  }
@@ -634,9 +638,9 @@ exports.typeMapFromMemberDecs = typeMapFromMemberDecs;
634
638
  */
635
639
  var typeMapFromRecordType = function (n, init, prefix) {
636
640
  return n.members.reduce(function (p, m) {
637
- var path = __spreadArray(__spreadArray([], prefix), (m.path.map(function (p) { return p.value; })));
641
+ var path = __spreadArray(__spreadArray([], prefix, true), (m.path.map(function (p) { return p.value; })), true);
638
642
  if (m.kind instanceof ast.RecordType) {
639
- return exports.typeMapFromRecordType(m.kind, init, path);
643
+ return (0, exports.typeMapFromRecordType)(m.kind, init, path);
640
644
  }
641
645
  else {
642
646
  p[paths2String(path)] = m.kind;
@@ -650,8 +654,8 @@ var paths2String = function (paths) { return paths.join('.'); };
650
654
  * expandTypeMap to an ExpandedTypeMap.
651
655
  */
652
656
  var expandTypeMap = function (m) {
653
- return record_1.reduce(m, {}, function (p, c, k) {
654
- return path_1.set(k, exports.type2TS(c), p);
657
+ return (0, record_1.reduce)(m, {}, function (p, c, k) {
658
+ return (0, path_1.set)(k, (0, exports.type2TS)(c), p);
655
659
  });
656
660
  };
657
661
  exports.expandTypeMap = expandTypeMap;
@@ -659,26 +663,26 @@ exports.expandTypeMap = expandTypeMap;
659
663
  * typeMap2TS converts a map of type values to TypeScript.
660
664
  */
661
665
  var typeMap2TS = function (m) {
662
- return record_1.mapTo(m, function (t, k) {
663
- if (record_1.isRecord(t)) {
664
- var key = isOptional(t) ? k + "?" : "" + k;
665
- return key + ": {" + exports.typeMap2TS(t) + "}";
666
+ return (0, record_1.mapTo)(m, function (t, k) {
667
+ if ((0, record_1.isRecord)(t)) {
668
+ var key = isOptional(t) ? "".concat(k, "?") : "".concat(k);
669
+ return "".concat(key, ": {").concat((0, exports.typeMap2TS)(t), "}");
666
670
  }
667
671
  else {
668
- return k + " : " + t;
672
+ return "".concat(k, " : ").concat(t);
669
673
  }
670
674
  }).join(',\n');
671
675
  };
672
676
  exports.typeMap2TS = typeMap2TS;
673
677
  var isOptional = function (m) {
674
- return record_1.reduce(m, false, function (p, _, k) { return p ? p : k.indexOf('?') > -1; });
678
+ return (0, record_1.reduce)(m, false, function (p, _, k) { return p ? p : k.indexOf('?') > -1; });
675
679
  };
676
680
  /**
677
681
  * parameters2TS converts a list Parameter nodes into an parameter list
678
682
  * (without parens).
679
683
  */
680
684
  var parameters2TS = function (list) {
681
- return list.map(function (p) { return exports.parameter2TS(p); }).join(',');
685
+ return list.map(function (p) { return (0, exports.parameter2TS)(p); }).join(',');
682
686
  };
683
687
  exports.parameters2TS = parameters2TS;
684
688
  /**
@@ -686,9 +690,9 @@ exports.parameters2TS = parameters2TS;
686
690
  */
687
691
  var parameter2TS = function (n) {
688
692
  if (n instanceof ast.TypedParameter)
689
- return exports.typedParameter2TS(n);
693
+ return (0, exports.typedParameter2TS)(n);
690
694
  else if (n instanceof ast.UntypedParameter)
691
- return exports.untypedParameter2TS(n);
695
+ return (0, exports.untypedParameter2TS)(n);
692
696
  else
693
697
  return '';
694
698
  };
@@ -697,21 +701,21 @@ exports.parameter2TS = parameter2TS;
697
701
  * typedParameter2TS
698
702
  */
699
703
  var typedParameter2TS = function (n) {
700
- return exports.identifier2TS(n.id) + ": " + exports.type2TS(n.hint) + " ";
704
+ return "".concat((0, exports.identifier2TS)(n.id), ": ").concat((0, exports.type2TS)(n.hint), " ");
701
705
  };
702
706
  exports.typedParameter2TS = typedParameter2TS;
703
707
  /**
704
708
  * untypedParameter2TS
705
709
  */
706
710
  var untypedParameter2TS = function (n) {
707
- return exports.identifier2TS(n.id) + " ";
711
+ return "".concat((0, exports.identifier2TS)(n.id), " ");
708
712
  };
709
713
  exports.untypedParameter2TS = untypedParameter2TS;
710
714
  /**
711
715
  * children2TS
712
716
  */
713
717
  var children2TS = function (ctx, list) {
714
- return "[" + ctx.options.EOL + "\n " + list.map(function (l) { return exports.child2TS(ctx, l); }).join(',' + ctx.options.EOL) + "\n ]";
718
+ return "[".concat(ctx.options.EOL, "\n ").concat(list.map(function (l) { return (0, exports.child2TS)(ctx, l); }).join(',' + ctx.options.EOL), "\n ]");
715
719
  };
716
720
  exports.children2TS = children2TS;
717
721
  /**
@@ -719,27 +723,27 @@ exports.children2TS = children2TS;
719
723
  */
720
724
  var child2TS = function (ctx, n) {
721
725
  if ((n instanceof ast.Node) || (n instanceof ast.Widget))
722
- return exports.tag2TS(ctx, n);
726
+ return (0, exports.tag2TS)(ctx, n);
723
727
  else if (n instanceof ast.Interpolation)
724
- return exports.interpolation2TS(ctx, n);
728
+ return (0, exports.interpolation2TS)(ctx, n);
725
729
  else if (n instanceof ast.IfStatement)
726
- return exports.ifStatement2TS(ctx, n);
730
+ return (0, exports.ifStatement2TS)(ctx, n);
727
731
  else if (n instanceof ast.ForInStatement)
728
- return exports.forInStatement2TS(ctx, n);
732
+ return (0, exports.forInStatement2TS)(ctx, n);
729
733
  else if (n instanceof ast.ForOfStatement)
730
- return exports.forOfStatement2TS(ctx, n);
734
+ return (0, exports.forOfStatement2TS)(ctx, n);
731
735
  else if (n instanceof ast.Characters)
732
- return exports.characters2TS(n);
736
+ return (0, exports.characters2TS)(n);
733
737
  else if (n instanceof ast.ContextProperty)
734
- return exports.contextProperty2TS(n);
738
+ return (0, exports.contextProperty2TS)(n);
735
739
  else if (n instanceof ast.QualifiedConstructor)
736
- return exports.qualifiedConstructor2TS(n);
740
+ return (0, exports.qualifiedConstructor2TS)(n);
737
741
  else if (n instanceof ast.UnqualifiedConstructor)
738
- return exports.unqualifiedConstructor2TS(n);
742
+ return (0, exports.unqualifiedConstructor2TS)(n);
739
743
  else if (n instanceof ast.UnqualifiedIdentifier)
740
- return exports.unqualifiedIdentifier2TS(n);
744
+ return (0, exports.unqualifiedIdentifier2TS)(n);
741
745
  else if (n instanceof ast.QualifiedIdentifier)
742
- return exports.qualifiedIdentifier2TS(n);
746
+ return (0, exports.qualifiedIdentifier2TS)(n);
743
747
  else
744
748
  return '';
745
749
  };
@@ -748,7 +752,7 @@ exports.child2TS = child2TS;
748
752
  * tag2TS converts a tag to typescript.
749
753
  */
750
754
  var tag2TS = function (ctx, n) { return (n.type === 'widget') ?
751
- exports.widget2TS(ctx, n) : exports.node2TS(ctx, n); };
755
+ (0, exports.widget2TS)(ctx, n) : (0, exports.node2TS)(ctx, n); };
752
756
  exports.tag2TS = tag2TS;
753
757
  /**
754
758
  * widget2TS converts a Widget node into its typescript representation.
@@ -756,11 +760,11 @@ exports.tag2TS = tag2TS;
756
760
  * This is simply a call to the View's widget method.
757
761
  */
758
762
  var widget2TS = function (ctx, n) {
759
- var name = exports.constructor2TS(n.open);
760
- var attrs = exports.attrs2String(exports.groupAttrs(ctx, n.attributes));
761
- var childs = exports.children2TS(ctx, n.children);
762
- return exports.THIS + ".widget(new " + name + "(" + attrs + ", " + childs + ")," +
763
- ("<" + exports.WML + ".Attrs>" + attrs + ")");
763
+ var name = (0, exports.constructor2TS)(n.open);
764
+ var attrs = (0, exports.attrs2String)((0, exports.groupAttrs)(ctx, n.attributes));
765
+ var childs = (0, exports.children2TS)(ctx, n.children);
766
+ return "".concat(exports.THIS, ".widget(new ").concat(name, "(").concat(attrs, ", ").concat(childs, "),") +
767
+ "<".concat(exports.WML, ".Attrs>").concat(attrs, ")");
764
768
  };
765
769
  exports.widget2TS = widget2TS;
766
770
  /**
@@ -769,17 +773,17 @@ exports.widget2TS = widget2TS;
769
773
  * This is simply a call to the View's node method.
770
774
  */
771
775
  var node2TS = function (ctx, n) {
772
- var name = exports.identifier2TS(n.open);
773
- var attrs = exports.attrs2String(exports.groupAttrs(ctx, n.attributes));
774
- var childs = exports.children2TS(ctx, n.children);
775
- return exports.THIS + ".node('" + name + "', <" + exports.WML + ".Attrs>" + attrs + ", " + childs + ")";
776
+ var name = (0, exports.identifier2TS)(n.open);
777
+ var attrs = (0, exports.attrs2String)((0, exports.groupAttrs)(ctx, n.attributes));
778
+ var childs = (0, exports.children2TS)(ctx, n.children);
779
+ return "".concat(exports.THIS, ".node('").concat(name, "', <").concat(exports.WML, ".Attrs>").concat(attrs, ", ").concat(childs, ")");
776
780
  };
777
781
  exports.node2TS = node2TS;
778
782
  /**
779
783
  * attribute2Value
780
784
  */
781
785
  var attribute2TS = function (ctx, n) {
782
- return exports.attributeName2TS(ctx, n) + " : " + exports.attributeValue2TS(ctx, n) + " ";
786
+ return "".concat((0, exports.attributeName2TS)(ctx, n), " : ").concat((0, exports.attributeValue2TS)(ctx, n), " ");
783
787
  };
784
788
  exports.attribute2TS = attribute2TS;
785
789
  /**
@@ -787,15 +791,15 @@ exports.attribute2TS = attribute2TS;
787
791
  */
788
792
  var attributeValue2TS = function (ctx, n) {
789
793
  return (n.value instanceof ast.Interpolation) ?
790
- exports.interpolation2TS(ctx, n.value) :
791
- exports.literal2TS(ctx, n.value);
794
+ (0, exports.interpolation2TS)(ctx, n.value) :
795
+ (0, exports.literal2TS)(ctx, n.value);
792
796
  };
793
797
  exports.attributeValue2TS = attributeValue2TS;
794
798
  /**
795
799
  * attributeName2TS
796
800
  */
797
801
  var attributeName2TS = function (_, n) {
798
- return "'" + exports.unqualifiedIdentifier2TS(n.name) + "'";
802
+ return "'".concat((0, exports.unqualifiedIdentifier2TS)(n.name), "'");
799
803
  };
800
804
  exports.attributeName2TS = attributeName2TS;
801
805
  /**
@@ -805,8 +809,8 @@ var attrs2String = function (attrs) {
805
809
  return '{' +
806
810
  Object.keys(attrs).map(function (name) {
807
811
  return Array.isArray(attrs[name]) ?
808
- name + " : { " + attrs[name].join(',') + " }" :
809
- name + ": " + attrs[name];
812
+ "".concat(name, " : { ").concat(attrs[name].join(','), " }") :
813
+ "".concat(name, ": ").concat(attrs[name]);
810
814
  }) +
811
815
  '}';
812
816
  };
@@ -815,17 +819,17 @@ exports.attrs2String = attrs2String;
815
819
  * groupAttrs
816
820
  */
817
821
  var groupAttrs = function (ctx, attrs) {
818
- var _a = array_1.partition(attrs, function (a) { return (a.namespace.value === ''); }), nns = _a[0], ns = _a[1];
822
+ var _a = (0, array_1.partition)(attrs, function (a) { return (a.namespace.value === ''); }), nns = _a[0], ns = _a[1];
819
823
  var nso = ns.reduce(function (p, n) {
820
824
  var _a;
821
- return record_1.merge(p, (_a = {},
822
- _a[n.namespace.value] = (p[n.namespace.value] || []).concat(exports.attribute2TS(ctx, n)),
825
+ return (0, record_1.merge)(p, (_a = {},
826
+ _a[n.namespace.value] = (p[n.namespace.value] || []).concat((0, exports.attribute2TS)(ctx, n)),
823
827
  _a));
824
828
  }, {});
825
829
  return nns.reduce(function (p, n) {
826
830
  var _a;
827
- return record_1.merge(p, (_a = {},
828
- _a[exports.attributeName2TS(ctx, n)] = exports.attributeValue2TS(ctx, n),
831
+ return (0, record_1.merge)(p, (_a = {},
832
+ _a[(0, exports.attributeName2TS)(ctx, n)] = (0, exports.attributeValue2TS)(ctx, n),
829
833
  _a));
830
834
  }, nso);
831
835
  };
@@ -835,25 +839,25 @@ exports.groupAttrs = groupAttrs;
835
839
  */
836
840
  var interpolation2TS = function (ctx, n) {
837
841
  return n.filters.reduce(function (p, c) {
838
- return exports.expression2TS(ctx, c) + " (" + p + ")";
839
- }, exports.expression2TS(ctx, n.expression));
842
+ return "".concat((0, exports.expression2TS)(ctx, c), " (").concat(p, ")");
843
+ }, (0, exports.expression2TS)(ctx, n.expression));
840
844
  };
841
845
  exports.interpolation2TS = interpolation2TS;
842
846
  /**
843
847
  * ifStatementTS converts an IfStatement to its typescript representation.
844
848
  */
845
849
  var ifStatement2TS = function (ctx, n) {
846
- var condition = exports.expression2TS(ctx, n.condition);
847
- var conseq = exports.children2TS(ctx, n.then);
850
+ var condition = (0, exports.expression2TS)(ctx, n.condition);
851
+ var conseq = (0, exports.children2TS)(ctx, n.then);
848
852
  var alt = (n.elseClause instanceof ast.ElseIfClause) ?
849
- "[" + exports.ifStatement2TS(ctx, n.elseClause) + "]" :
853
+ "[".concat((0, exports.ifStatement2TS)(ctx, n.elseClause), "]") :
850
854
  (n.elseClause instanceof ast.ElseClause) ?
851
- exports.children2TS(ctx, n.elseClause.children) :
855
+ (0, exports.children2TS)(ctx, n.elseClause.children) :
852
856
  '[]';
853
857
  return [
854
- "...((" + condition + ") ?",
855
- "(()=>(" + conseq + "))() :",
856
- "(()=>(" + alt + "))())"
858
+ "...((".concat(condition, ") ?"),
859
+ "(()=>(".concat(conseq, "))() :"),
860
+ "(()=>(".concat(alt, "))())")
857
861
  ].join(ctx.options.EOL);
858
862
  };
859
863
  exports.ifStatement2TS = ifStatement2TS;
@@ -861,16 +865,16 @@ exports.ifStatement2TS = ifStatement2TS;
861
865
  * forInStatement2TS converts a ForInStatement to its typescript representation.
862
866
  */
863
867
  var forInStatement2TS = function (ctx, n) {
864
- var expr = exports.expression2TS(ctx, n.expression);
865
- var value = exports.parameter2TS(n.variables[0]);
866
- var key = n.variables.length > 1 ? exports.parameter2TS(n.variables[1]) : '_$$i';
867
- var all = n.variables.length > 2 ? exports.parameter2TS(n.variables[2]) : '_$$all';
868
- var body = exports.children2TS(ctx, n.body);
869
- var alt = n.otherwise.length > 0 ? exports.children2TS(ctx, n.otherwise) : '[]';
868
+ var expr = (0, exports.expression2TS)(ctx, n.expression);
869
+ var value = (0, exports.parameter2TS)(n.variables[0]);
870
+ var key = n.variables.length > 1 ? (0, exports.parameter2TS)(n.variables[1]) : '_$$i';
871
+ var all = n.variables.length > 2 ? (0, exports.parameter2TS)(n.variables[2]) : '_$$all';
872
+ var body = (0, exports.children2TS)(ctx, n.body);
873
+ var alt = n.otherwise.length > 0 ? (0, exports.children2TS)(ctx, n.otherwise) : '[]';
870
874
  return [
871
- "..." + FOR_IN + " (" + expr + ", (" + value + ", " + key + ", " + all + ")=> ",
872
- "(" + body + "), ",
873
- "()=> (" + alt + "))"
875
+ "...".concat(FOR_IN, " (").concat(expr, ", (").concat(value, ", ").concat(key, ", ").concat(all, ")=> "),
876
+ "(".concat(body, "), "),
877
+ "()=> (".concat(alt, "))")
874
878
  ].join(ctx.options.EOL);
875
879
  };
876
880
  exports.forInStatement2TS = forInStatement2TS;
@@ -878,16 +882,16 @@ exports.forInStatement2TS = forInStatement2TS;
878
882
  * forOfStatement2TS
879
883
  */
880
884
  var forOfStatement2TS = function (ctx, n) {
881
- var expr = exports.expression2TS(ctx, n.expression);
882
- var value = exports.parameter2TS(n.variables[0]);
883
- var key = n.variables.length > 1 ? exports.parameter2TS(n.variables[1]) : '_$$k';
884
- var all = n.variables.length > 2 ? exports.parameter2TS(n.variables[2]) : '_$$all';
885
- var body = exports.children2TS(ctx, n.body);
886
- var alt = n.otherwise.length > 0 ? exports.children2TS(ctx, n.otherwise) : '[]';
885
+ var expr = (0, exports.expression2TS)(ctx, n.expression);
886
+ var value = (0, exports.parameter2TS)(n.variables[0]);
887
+ var key = n.variables.length > 1 ? (0, exports.parameter2TS)(n.variables[1]) : '_$$k';
888
+ var all = n.variables.length > 2 ? (0, exports.parameter2TS)(n.variables[2]) : '_$$all';
889
+ var body = (0, exports.children2TS)(ctx, n.body);
890
+ var alt = n.otherwise.length > 0 ? (0, exports.children2TS)(ctx, n.otherwise) : '[]';
887
891
  return [
888
- "..." + FOR_OF + " (" + expr + ", (" + value + ", " + key + ", " + all + ") => ",
889
- " (" + body + "), ",
890
- " ()=> (" + alt + "))"
892
+ "...".concat(FOR_OF, " (").concat(expr, ", (").concat(value, ", ").concat(key, ", ").concat(all, ") => "),
893
+ " (".concat(body, "), "),
894
+ " ()=> (".concat(alt, "))")
891
895
  ].join(eol(ctx));
892
896
  };
893
897
  exports.forOfStatement2TS = forOfStatement2TS;
@@ -895,7 +899,7 @@ exports.forOfStatement2TS = forOfStatement2TS;
895
899
  * characters2TS converts character text to a typescript string.
896
900
  */
897
901
  var characters2TS = function (n) {
898
- return exports.DOCUMENT + ".createTextNode('" + breakLines(n.value) + "')";
902
+ return "".concat(exports.DOCUMENT, ".createTextNode('").concat(breakLines(n.value), "')");
899
903
  };
900
904
  exports.characters2TS = characters2TS;
901
905
  var breakLines = function (str) { return str.split('\n').join('\\u000a'); };
@@ -904,47 +908,47 @@ var breakLines = function (str) { return str.split('\n').join('\\u000a'); };
904
908
  */
905
909
  var expression2TS = function (ctx, n) {
906
910
  if (n instanceof ast.IfThenExpression)
907
- return exports.ifThenExpression2TS(ctx, n);
911
+ return (0, exports.ifThenExpression2TS)(ctx, n);
908
912
  else if (n instanceof ast.BinaryExpression)
909
- return exports.binaryExpression2TS(ctx, n);
913
+ return (0, exports.binaryExpression2TS)(ctx, n);
910
914
  else if (n instanceof ast.UnaryExpression)
911
- return exports.unaryExpression2TS(ctx, n);
915
+ return (0, exports.unaryExpression2TS)(ctx, n);
912
916
  else if (n instanceof ast.TypeAssertion)
913
- return exports.typeAssertion2TS(ctx, n);
917
+ return (0, exports.typeAssertion2TS)(ctx, n);
914
918
  else if (n instanceof ast.ViewConstruction)
915
- return exports.viewConstruction2TS(ctx, n);
919
+ return (0, exports.viewConstruction2TS)(ctx, n);
916
920
  else if (n instanceof ast.FunApplication)
917
- return exports.funApplication2TS(ctx, n);
921
+ return (0, exports.funApplication2TS)(ctx, n);
918
922
  else if (n instanceof ast.ConstructExpression)
919
- return exports.constructExpression2TS(ctx, n);
923
+ return (0, exports.constructExpression2TS)(ctx, n);
920
924
  else if (n instanceof ast.CallExpression)
921
- return exports.callExpression2TS(ctx, n);
925
+ return (0, exports.callExpression2TS)(ctx, n);
922
926
  else if (n instanceof ast.MemberExpression)
923
- return exports.memberExpression2TS(ctx, n);
927
+ return (0, exports.memberExpression2TS)(ctx, n);
924
928
  else if (n instanceof ast.FunctionExpression)
925
- return exports.functionExpression2TS(ctx, n);
929
+ return (0, exports.functionExpression2TS)(ctx, n);
926
930
  else if (n instanceof ast.Record)
927
- return exports.record2TS(ctx, n);
931
+ return (0, exports.record2TS)(ctx, n);
928
932
  else if (n instanceof ast.List)
929
- return exports.list2TS(ctx, n);
933
+ return (0, exports.list2TS)(ctx, n);
930
934
  else if (n instanceof ast.BooleanLiteral)
931
- return exports.boolean2TS(n);
935
+ return (0, exports.boolean2TS)(n);
932
936
  else if (n instanceof ast.NumberLiteral)
933
- return exports.number2TS(n);
937
+ return (0, exports.number2TS)(n);
934
938
  else if (n instanceof ast.StringLiteral)
935
- return exports.string2TS(n);
939
+ return (0, exports.string2TS)(n);
936
940
  else if (n instanceof ast.ContextProperty)
937
- return exports.contextProperty2TS(n);
941
+ return (0, exports.contextProperty2TS)(n);
938
942
  else if (n instanceof ast.QualifiedConstructor)
939
- return exports.qualifiedConstructor2TS(n);
943
+ return (0, exports.qualifiedConstructor2TS)(n);
940
944
  else if (n instanceof ast.UnqualifiedConstructor)
941
- return exports.unqualifiedConstructor2TS(n);
945
+ return (0, exports.unqualifiedConstructor2TS)(n);
942
946
  else if (n instanceof ast.UnqualifiedIdentifier)
943
- return exports.unqualifiedIdentifier2TS(n);
947
+ return (0, exports.unqualifiedIdentifier2TS)(n);
944
948
  else if (n instanceof ast.QualifiedIdentifier)
945
- return exports.qualifiedIdentifier2TS(n);
949
+ return (0, exports.qualifiedIdentifier2TS)(n);
946
950
  else if (n instanceof ast.ContextVariable)
947
- return exports.contextVariable2TS(n);
951
+ return (0, exports.contextVariable2TS)(n);
948
952
  else
949
953
  return '';
950
954
  };
@@ -953,69 +957,68 @@ exports.expression2TS = expression2TS;
953
957
  * ifThenExpression2TS
954
958
  */
955
959
  var ifThenExpression2TS = function (ctx, n) {
956
- var condition = exports.expression2TS(ctx, n.condition);
957
- var conseq = exports.expression2TS(ctx, n.iftrue);
958
- var alt = exports.expression2TS(ctx, n.iffalse);
959
- return "(" + condition + ") ? " + conseq + " : " + alt;
960
+ var condition = (0, exports.expression2TS)(ctx, n.condition);
961
+ var conseq = (0, exports.expression2TS)(ctx, n.iftrue);
962
+ var alt = (0, exports.expression2TS)(ctx, n.iffalse);
963
+ return "(".concat(condition, ") ? ").concat(conseq, " : ").concat(alt);
960
964
  };
961
965
  exports.ifThenExpression2TS = ifThenExpression2TS;
962
966
  /**
963
967
  * binaryExpression2TS
964
968
  */
965
969
  var binaryExpression2TS = function (ctx, n) {
966
- var left = exports.expression2TS(ctx, n.left);
967
- var right = exports.expression2TS(ctx, n.right);
970
+ var left = (0, exports.expression2TS)(ctx, n.left);
971
+ var right = (0, exports.expression2TS)(ctx, n.right);
968
972
  var op = operators.hasOwnProperty(n.operator) ?
969
973
  operators[n.operator] :
970
974
  n.operator;
971
- return "(" + left + " " + op + " " + right + ")";
975
+ return "(".concat(left, " ").concat(op, " ").concat(right, ")");
972
976
  };
973
977
  exports.binaryExpression2TS = binaryExpression2TS;
974
978
  /**
975
979
  * unaryExpression2TS
976
980
  */
977
981
  var unaryExpression2TS = function (ctx, n) {
978
- var expr = exports.expression2TS(ctx, n.expression);
982
+ var expr = (0, exports.expression2TS)(ctx, n.expression);
979
983
  return (n.operator === '??') ?
980
- "(" + expr + ") != null" :
981
- n.operator + "(" + expr + ")";
984
+ "(".concat(expr, ") != null") :
985
+ "".concat(n.operator, "(").concat(expr, ")");
982
986
  };
983
987
  exports.unaryExpression2TS = unaryExpression2TS;
984
988
  /**
985
989
  * typeAssertion2TS
986
990
  */
987
991
  var typeAssertion2TS = function (ctx, n) {
988
- return "<" + exports.type2TS(n.target) + ">(" + exports.expression2TS(ctx, n.expression) + ")";
992
+ return "<".concat((0, exports.type2TS)(n.target), ">(").concat((0, exports.expression2TS)(ctx, n.expression), ")");
989
993
  };
990
994
  exports.typeAssertion2TS = typeAssertion2TS;
991
995
  /**
992
996
  * viewConstruction2TS
993
997
  */
994
998
  var viewConstruction2TS = function (ctx, n) {
995
- return exports.THIS + ".registerView((new " + exports.constructor2TS(n.cons) +
996
- ("(" + exports.expression2TS(ctx, n.context) + "))).render()");
999
+ return "".concat(exports.THIS, ".registerView(").concat((0, exports.expression2TS)(ctx, n.expression), ").render()");
997
1000
  };
998
1001
  exports.viewConstruction2TS = viewConstruction2TS;
999
1002
  /**
1000
1003
  * funApplication2TS
1001
1004
  */
1002
1005
  var funApplication2TS = function (ctx, n) {
1003
- return "" + exports.expression2TS(ctx, n.target) + exports.typeArgs2TS(n.typeArgs) + " " +
1004
- ("(" + exports.args2TS(ctx, n.args) + ")(" + exports.THIS + ")");
1006
+ return "".concat((0, exports.expression2TS)(ctx, n.target)).concat((0, exports.typeArgs2TS)(n.typeArgs), " ") +
1007
+ "(".concat((0, exports.args2TS)(ctx, n.args), ")(").concat(exports.THIS, ")");
1005
1008
  };
1006
1009
  exports.funApplication2TS = funApplication2TS;
1007
1010
  /**
1008
1011
  * constructExpression2TS
1009
1012
  */
1010
1013
  var constructExpression2TS = function (ctx, n) {
1011
- var cons = exports.constructor2TS(n.cons);
1012
- var consOriginal = "" + cons[0].toUpperCase() + cons.slice(1);
1013
- var args = exports.args2TS(ctx, n.args);
1014
- if (array_1.contains(casters, consOriginal)) {
1015
- return consOriginal + "(" + args + ")";
1014
+ var cons = (0, exports.constructor2TS)(n.cons);
1015
+ var consOriginal = "".concat(cons[0].toUpperCase()).concat(cons.slice(1));
1016
+ var args = (0, exports.args2TS)(ctx, n.args);
1017
+ if ((0, array_1.contains)(casters, consOriginal)) {
1018
+ return "".concat(consOriginal, "(").concat(args, ")");
1016
1019
  }
1017
1020
  else {
1018
- return "new " + cons + "(" + args + ")";
1021
+ return "new ".concat(cons, "(").concat(args, ")");
1019
1022
  }
1020
1023
  };
1021
1024
  exports.constructExpression2TS = constructExpression2TS;
@@ -1023,31 +1026,34 @@ exports.constructExpression2TS = constructExpression2TS;
1023
1026
  * callExpression2TS
1024
1027
  */
1025
1028
  var callExpression2TS = function (ctx, n) {
1026
- var target = exports.expression2TS(ctx, n.target);
1027
- var typeArgs = exports.typeArgs2TS(n.typeArgs);
1028
- var args = exports.args2TS(ctx, n.args);
1029
- return "" + target + typeArgs + "(" + args + ")";
1029
+ var target = (0, exports.expression2TS)(ctx, n.target);
1030
+ var typeArgs = (0, exports.typeArgs2TS)(n.typeArgs);
1031
+ var args = (0, exports.args2TS)(ctx, n.args);
1032
+ return "".concat(target).concat(typeArgs, "(").concat(args, ")");
1030
1033
  };
1031
1034
  exports.callExpression2TS = callExpression2TS;
1032
1035
  /**
1033
1036
  * typeArgs2TS
1034
1037
  */
1035
1038
  var typeArgs2TS = function (ns) {
1036
- return ns.length === 0 ? '' : "<" + ns.map(exports.type2TS).join(',') + ">";
1039
+ return ns.length === 0 ? '' : "<".concat(ns.map(exports.type2TS).join(','), ">");
1037
1040
  };
1038
1041
  exports.typeArgs2TS = typeArgs2TS;
1039
1042
  /**
1040
1043
  * args2TS converts a list of arguments to a typescript argument tupple.
1041
1044
  */
1042
1045
  var args2TS = function (ctx, ns) {
1043
- return (ns.length === 0) ? '' : ns.map(function (e) { return exports.expression2TS(ctx, e); }).join(',');
1046
+ return (ns.length === 0) ? '' : ns.map(function (e) { return (0, exports.expression2TS)(ctx, e); }).join(',');
1044
1047
  };
1045
1048
  exports.args2TS = args2TS;
1046
1049
  /**
1047
1050
  * memberExpression2TS
1048
1051
  */
1049
1052
  var memberExpression2TS = function (ctx, n) {
1050
- return exports.expression2TS(ctx, n.target) + "." + exports.identifier2TS(n.member) + " ";
1053
+ var target = (0, exports.expression2TS)(ctx, n.target);
1054
+ return (n.member instanceof ast.StringLiteral) ?
1055
+ "".concat(target, "[").concat((0, exports.string2TS)(n.member), "]") :
1056
+ "".concat(target, ".").concat((0, exports.identifier2TS)(n.member));
1051
1057
  };
1052
1058
  exports.memberExpression2TS = memberExpression2TS;
1053
1059
  /**
@@ -1055,8 +1061,8 @@ exports.memberExpression2TS = memberExpression2TS;
1055
1061
  */
1056
1062
  var functionExpression2TS = function (ctx, n) {
1057
1063
  var params = n.parameters.map(exports.parameter2TS).join(',');
1058
- var body = exports.expression2TS(ctx, n.body);
1059
- return "(" + params + ") => " + body;
1064
+ var body = (0, exports.expression2TS)(ctx, n.body);
1065
+ return "(".concat(params, ") => ").concat(body);
1060
1066
  };
1061
1067
  exports.functionExpression2TS = functionExpression2TS;
1062
1068
  /**
@@ -1064,15 +1070,15 @@ exports.functionExpression2TS = functionExpression2TS;
1064
1070
  */
1065
1071
  var literal2TS = function (ctx, n) {
1066
1072
  if (n instanceof ast.BooleanLiteral)
1067
- return exports.boolean2TS(n);
1073
+ return (0, exports.boolean2TS)(n);
1068
1074
  else if (n instanceof ast.StringLiteral)
1069
- return exports.string2TS(n);
1075
+ return (0, exports.string2TS)(n);
1070
1076
  else if (n instanceof ast.NumberLiteral)
1071
- return exports.number2TS(n);
1077
+ return (0, exports.number2TS)(n);
1072
1078
  else if (n instanceof ast.Record)
1073
- return exports.record2TS(ctx, n);
1079
+ return (0, exports.record2TS)(ctx, n);
1074
1080
  else if (n instanceof ast.List)
1075
- return exports.list2TS(ctx, n);
1081
+ return (0, exports.list2TS)(ctx, n);
1076
1082
  else
1077
1083
  return '';
1078
1084
  };
@@ -1080,45 +1086,45 @@ exports.literal2TS = literal2TS;
1080
1086
  /**
1081
1087
  * boolean2TS
1082
1088
  */
1083
- var boolean2TS = function (n) { return n.value + " "; };
1089
+ var boolean2TS = function (n) { return "".concat(n.value, " "); };
1084
1090
  exports.boolean2TS = boolean2TS;
1085
1091
  /**
1086
1092
  * string2TS
1087
1093
  */
1088
- var string2TS = function (n) { return "'" + n.value + "'"; };
1094
+ var string2TS = function (n) { return "'".concat(n.value, "'"); };
1089
1095
  exports.string2TS = string2TS;
1090
1096
  /**
1091
1097
  * number2TS
1092
1098
  */
1093
- var number2TS = function (n) { return "" + parseFloat(n.value); };
1099
+ var number2TS = function (n) { return "".concat(parseFloat(n.value)); };
1094
1100
  exports.number2TS = number2TS;
1095
1101
  /**
1096
1102
  * record2TS
1097
1103
  */
1098
1104
  var record2TS = function (ctx, n) {
1099
- return "{" + ctx.options.EOL + " \n " + n.properties.map(function (p) { return exports.property2TS(ctx, p); }).join(',' + ctx.options.EOL) + "\n }";
1105
+ return "{".concat(ctx.options.EOL, " \n ").concat(n.properties.map(function (p) { return (0, exports.property2TS)(ctx, p); }).join(',' + ctx.options.EOL), "\n }");
1100
1106
  };
1101
1107
  exports.record2TS = record2TS;
1102
1108
  /**
1103
1109
  * list2TS
1104
1110
  */
1105
1111
  var list2TS = function (ctx, n) {
1106
- var mems = n.members.map(function (e) { return exports.expression2TS(ctx, e); });
1107
- return "[" + ctx.options.EOL + "\n " + mems.join(',' + ctx.options.EOL) + "\n ]";
1112
+ var mems = n.members.map(function (e) { return (0, exports.expression2TS)(ctx, e); });
1113
+ return "[".concat(ctx.options.EOL, "\n ").concat(mems.join(',' + ctx.options.EOL), "\n ]");
1108
1114
  };
1109
1115
  exports.list2TS = list2TS;
1110
1116
  /**
1111
1117
  * property2TS
1112
1118
  */
1113
1119
  var property2TS = function (ctx, n) {
1114
- return "'" + exports.key2TS(n.key) + "' : " + exports.expression2TS(ctx, n.value);
1120
+ return "'".concat((0, exports.key2TS)(n.key), "' : ").concat((0, exports.expression2TS)(ctx, n.value));
1115
1121
  };
1116
1122
  exports.property2TS = property2TS;
1117
1123
  /**
1118
1124
  * key2TS
1119
1125
  */
1120
1126
  var key2TS = function (n) {
1121
- return (n instanceof ast.StringLiteral) ? exports.string2TS(n) : exports.identifier2TS(n);
1127
+ return (n instanceof ast.StringLiteral) ? (0, exports.string2TS)(n) : (0, exports.identifier2TS)(n);
1122
1128
  };
1123
1129
  exports.key2TS = key2TS;
1124
1130
  /**
@@ -1127,14 +1133,14 @@ exports.key2TS = key2TS;
1127
1133
  var contextProperty2TS = function (n) {
1128
1134
  var member = (n.member instanceof ast.StringLiteral) ?
1129
1135
  n.member.value :
1130
- exports.identifier2TS(n.member);
1131
- return exports.CONTEXT + "." + member;
1136
+ (0, exports.identifier2TS)(n.member);
1137
+ return "".concat(exports.CONTEXT, ".").concat(member);
1132
1138
  };
1133
1139
  exports.contextProperty2TS = contextProperty2TS;
1134
1140
  /**
1135
1141
  * contextVariable2TS
1136
1142
  */
1137
- var contextVariable2TS = function (_) { return "" + exports.CONTEXT; };
1143
+ var contextVariable2TS = function (_) { return "".concat(exports.CONTEXT); };
1138
1144
  exports.contextVariable2TS = contextVariable2TS;
1139
1145
  /**
1140
1146
  * identifierOrConstructor2TS
@@ -1142,10 +1148,10 @@ exports.contextVariable2TS = contextVariable2TS;
1142
1148
  var identifierOrConstructor2TS = function (n) {
1143
1149
  if ((n instanceof ast.UnqualifiedIdentifier) ||
1144
1150
  (n instanceof ast.QualifiedIdentifier))
1145
- return exports.identifier2TS(n);
1151
+ return (0, exports.identifier2TS)(n);
1146
1152
  else if ((n instanceof ast.UnqualifiedConstructor) ||
1147
1153
  (n instanceof ast.QualifiedConstructor))
1148
- return exports.constructor2TS(n);
1154
+ return (0, exports.constructor2TS)(n);
1149
1155
  else
1150
1156
  return '';
1151
1157
  };
@@ -1155,9 +1161,9 @@ exports.identifierOrConstructor2TS = identifierOrConstructor2TS;
1155
1161
  */
1156
1162
  var constructor2TS = function (n) {
1157
1163
  if (n instanceof ast.QualifiedConstructor)
1158
- return exports.qualifiedConstructor2TS(n);
1164
+ return (0, exports.qualifiedConstructor2TS)(n);
1159
1165
  else if (n instanceof ast.UnqualifiedConstructor)
1160
- return exports.unqualifiedConstructor2TS(n);
1166
+ return (0, exports.unqualifiedConstructor2TS)(n);
1161
1167
  else
1162
1168
  return '';
1163
1169
  };
@@ -1173,7 +1179,7 @@ exports.unqualifiedConstructor2TS = unqualifiedConstructor2TS;
1173
1179
  * qualifiedConstructor
1174
1180
  */
1175
1181
  var qualifiedConstructor2TS = function (n) {
1176
- return n.qualifier + "." + n.member;
1182
+ return "".concat(n.qualifier, ".").concat(n.member);
1177
1183
  };
1178
1184
  exports.qualifiedConstructor2TS = qualifiedConstructor2TS;
1179
1185
  /**
@@ -1181,9 +1187,9 @@ exports.qualifiedConstructor2TS = qualifiedConstructor2TS;
1181
1187
  */
1182
1188
  var identifier2TS = function (n) {
1183
1189
  if (n instanceof ast.QualifiedIdentifier)
1184
- return exports.qualifiedIdentifier2TS(n);
1190
+ return (0, exports.qualifiedIdentifier2TS)(n);
1185
1191
  else if (n instanceof ast.UnqualifiedIdentifier)
1186
- return exports.unqualifiedIdentifier2TS(n);
1192
+ return (0, exports.unqualifiedIdentifier2TS)(n);
1187
1193
  else
1188
1194
  return '';
1189
1195
  };
@@ -1192,14 +1198,14 @@ exports.identifier2TS = identifier2TS;
1192
1198
  * qualifiedIdentifier2TS
1193
1199
  */
1194
1200
  var qualifiedIdentifier2TS = function (n) {
1195
- return n.qualifier + "." + n.member;
1201
+ return "".concat(n.qualifier, ".").concat(n.member);
1196
1202
  };
1197
1203
  exports.qualifiedIdentifier2TS = qualifiedIdentifier2TS;
1198
1204
  /**
1199
1205
  * unqualifiedIdentifier2TS
1200
1206
  */
1201
1207
  var unqualifiedIdentifier2TS = function (n) {
1202
- return "" + toPrim(n.value);
1208
+ return "".concat(toPrim(n.value));
1203
1209
  };
1204
1210
  exports.unqualifiedIdentifier2TS = unqualifiedIdentifier2TS;
1205
1211
  var toPrim = function (id) { return prims.indexOf(id) > -1 ? id.toLowerCase() : id; };