@edirect/template 1.0.1 → 1.0.3
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.
- package/README.md +369 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/templateModule/index.d.ts +16 -0
- package/dist/templateModule/index.js +91 -0
- package/dist/templateModule/index.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
# @edirect/template
|
|
2
|
+
|
|
3
|
+
The EDirectInsure template mapper module.
|
|
4
|
+
|
|
5
|
+
### Installation
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
$ npm i --save @edirect/template
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Simple example
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import { TemplateModule } from "@edirect/template";
|
|
15
|
+
|
|
16
|
+
const template = {
|
|
17
|
+
edirect_firstname: "subscriber.firstName",
|
|
18
|
+
edirect_lastname: "subscriber.lastName",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const dataSource = {
|
|
22
|
+
subscriber: {
|
|
23
|
+
firstName: "template",
|
|
24
|
+
lastName: "service",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const templateModule = new TemplateModule();
|
|
29
|
+
templateModule.setTemplate(template);
|
|
30
|
+
|
|
31
|
+
const result = templateModule.transformPayload(dataSource);
|
|
32
|
+
|
|
33
|
+
console.log(result);
|
|
34
|
+
|
|
35
|
+
// {
|
|
36
|
+
// edirect_firstname: "template",
|
|
37
|
+
// edirect_lastname: "service",
|
|
38
|
+
// }
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Example with transformers
|
|
42
|
+
|
|
43
|
+
#### First of all, what's a transformer?
|
|
44
|
+
|
|
45
|
+
A transformer is a way to handle values with more detail and freedom.
|
|
46
|
+
|
|
47
|
+
For example:
|
|
48
|
+
|
|
49
|
+
- Mapping
|
|
50
|
+
- Validation
|
|
51
|
+
- Formatting
|
|
52
|
+
- Business rules
|
|
53
|
+
- and so on ...
|
|
54
|
+
|
|
55
|
+
Each transformer receives two parameters:
|
|
56
|
+
|
|
57
|
+
- `value`: specific value that you want to handle
|
|
58
|
+
- `context`: all context (payload) that you can use to build any logical
|
|
59
|
+
|
|
60
|
+
To map a value that you'd like to use some transformer feature, you can use these options:
|
|
61
|
+
|
|
62
|
+
- `fields`: it's an array with a data source path, and the first value that is found will be used.
|
|
63
|
+
- `transformer`: it's a JS function, where you receive value and context as parameters and have all freedom to handle and return a value
|
|
64
|
+
- `defaultValue` it's an option if the engine doesn't find any value in the fields data source array or the transformer doesn't return a value.
|
|
65
|
+
|
|
66
|
+
##### File name: baseTransformers.ts
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
import { ITransformer, ITransformerParams } from "@edirect/template";
|
|
70
|
+
|
|
71
|
+
const upperCase = ({ value }: ITransformerParams): string | null => {
|
|
72
|
+
return value ? String(value).toUpperCase() : null;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const fullName = ({ context }: ITransformerParams): string | null => {
|
|
76
|
+
try {
|
|
77
|
+
const { firstName, lastName } = context.subscriber;
|
|
78
|
+
return `${firstName} ${lastName}`;
|
|
79
|
+
} catch (error) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const transformers: ITransformer = {
|
|
85
|
+
upperCase,
|
|
86
|
+
fullName,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default transformers;
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
##### File name: index.ts
|
|
93
|
+
|
|
94
|
+
```javascript
|
|
95
|
+
import { TemplateModule } from "@edirect/template";
|
|
96
|
+
import baseTransformers from "./baseTransformers";
|
|
97
|
+
|
|
98
|
+
const template = {
|
|
99
|
+
edirect_firstname: {
|
|
100
|
+
fields: ["firstName", "subscriber.firstName"],
|
|
101
|
+
transformer: "upperCase",
|
|
102
|
+
defaultValue: "First Name - Default",
|
|
103
|
+
},
|
|
104
|
+
edirect_lastname: {
|
|
105
|
+
fields: ["lastName", "subscriber.lastName"],
|
|
106
|
+
},
|
|
107
|
+
edirect_fullname: {
|
|
108
|
+
transformer: "fullName",
|
|
109
|
+
},
|
|
110
|
+
edirect_phone: {
|
|
111
|
+
fields: ["phoneNumber", "subscriber.phoneNumber"],
|
|
112
|
+
defaultValue: "999999999",
|
|
113
|
+
},
|
|
114
|
+
timeZone: {
|
|
115
|
+
defaultValue: "Time zone in Porto (GMT+1)",
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const dataSource = {
|
|
120
|
+
subscriber: {
|
|
121
|
+
firstName: "template",
|
|
122
|
+
lastName: "service",
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const templateModule = new TemplateModule();
|
|
127
|
+
|
|
128
|
+
templateModule.setTemplate(template);
|
|
129
|
+
templateModule.setContext(dataSource);
|
|
130
|
+
templateModule.setTransformers(baseTransformers);
|
|
131
|
+
|
|
132
|
+
const result = templateModule.transformPayload(dataSource);
|
|
133
|
+
console.log(result);
|
|
134
|
+
|
|
135
|
+
// {
|
|
136
|
+
// edirect_firstname: "TEMPLATE",
|
|
137
|
+
// edirect_lastname: "service",
|
|
138
|
+
// edirect_fullname: "template service",
|
|
139
|
+
// edirect_phone: "999999999",
|
|
140
|
+
// timeZone: "Time zone in Porto (GMT+1)",
|
|
141
|
+
// }
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Example with nested object + transformers
|
|
145
|
+
|
|
146
|
+
`Note`: the transformer notation uses three keys to identify an object as being a transformer: fields, transformer, and defaultValue, if there are at least 1 of these keys, the engine will consider the object as being a transformer, on the other hand, if there isn't, the engine will consider as a nested object to mapper all information.
|
|
147
|
+
|
|
148
|
+
##### File name: baseTransformers.ts
|
|
149
|
+
|
|
150
|
+
```javascript
|
|
151
|
+
import { ITransformer, ITransformerParams } from "@edirect/template";
|
|
152
|
+
|
|
153
|
+
const upperCase = ({ value }: ITransformerParams): string | null => {
|
|
154
|
+
return value ? String(value).toUpperCase() : null;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const transformers: ITransformer = {
|
|
158
|
+
upperCase,
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export default transformers;
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
##### File name: index.ts
|
|
165
|
+
|
|
166
|
+
```javascript
|
|
167
|
+
import { TemplateModule } from "@edirect/template";
|
|
168
|
+
import baseTransformers from "./baseTransformers";
|
|
169
|
+
|
|
170
|
+
const template = {
|
|
171
|
+
order: {
|
|
172
|
+
date: "order.date",
|
|
173
|
+
value: "order.value",
|
|
174
|
+
subscriber: {
|
|
175
|
+
name: "sub.name",
|
|
176
|
+
phone: "sub.phone",
|
|
177
|
+
email: {
|
|
178
|
+
fields: ["email", "sub.email"],
|
|
179
|
+
},
|
|
180
|
+
address: {
|
|
181
|
+
street: "sub.add.stt",
|
|
182
|
+
number: "sub.add.num",
|
|
183
|
+
city: {
|
|
184
|
+
fields: ["sub.add.city"],
|
|
185
|
+
transformer: "upperCase",
|
|
186
|
+
},
|
|
187
|
+
state: {
|
|
188
|
+
fields: ["sub.add.stt"],
|
|
189
|
+
transformer: "upperCase",
|
|
190
|
+
},
|
|
191
|
+
zip: {
|
|
192
|
+
fields: ["sub.add.zip"],
|
|
193
|
+
defaultValue: "0000-000",
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
const dataSource = {
|
|
201
|
+
order: {
|
|
202
|
+
value: 1000.0,
|
|
203
|
+
date: "2000-01-01",
|
|
204
|
+
},
|
|
205
|
+
sub: {
|
|
206
|
+
name: "name-test",
|
|
207
|
+
phone: "999999999",
|
|
208
|
+
email: "template.service@bolltech.io",
|
|
209
|
+
add: {
|
|
210
|
+
st: "st-test",
|
|
211
|
+
num: 100,
|
|
212
|
+
city: "city-test",
|
|
213
|
+
stt: "state-test",
|
|
214
|
+
zip: "zip-test",
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const templateModule = new TemplateModule();
|
|
220
|
+
|
|
221
|
+
templateModule.setTemplate(template);
|
|
222
|
+
templateModule.setContext(dataSource);
|
|
223
|
+
templateModule.setTransformers(baseTransformers);
|
|
224
|
+
|
|
225
|
+
const result = templateModule.transformPayload(dataSource);
|
|
226
|
+
console.log(result);
|
|
227
|
+
|
|
228
|
+
// {
|
|
229
|
+
// order: {
|
|
230
|
+
// date: "2000-01-01",
|
|
231
|
+
// value: 1000,
|
|
232
|
+
// subscriber: {
|
|
233
|
+
// name: "name-test",
|
|
234
|
+
// phone: "999999999",
|
|
235
|
+
// email: "template.service@bolltech.io",
|
|
236
|
+
// address: {
|
|
237
|
+
// street: "state-test",
|
|
238
|
+
// number: 100,
|
|
239
|
+
// city: "CITY-TEST",
|
|
240
|
+
// state: "STATE-TEST",
|
|
241
|
+
// zip: "zip-test",
|
|
242
|
+
// },
|
|
243
|
+
// },
|
|
244
|
+
// },
|
|
245
|
+
// }
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Example with arrays + transformers
|
|
249
|
+
|
|
250
|
+
`Note`: When it comes to arrays mapper, we need to have in mind that is required use this two keys: arraySource and arrayTemplate.
|
|
251
|
+
|
|
252
|
+
- `arraySource`: source path where the engine will seek the information to mapper
|
|
253
|
+
- `arrayTemplate`: template that will be used for each object within the array
|
|
254
|
+
|
|
255
|
+
##### File name: baseTransformers.ts
|
|
256
|
+
|
|
257
|
+
```javascript
|
|
258
|
+
import { ITransformer, ITransformerParams } from "@edirect/template";
|
|
259
|
+
|
|
260
|
+
const upperCase = ({ value }: ITransformerParams): string | null => {
|
|
261
|
+
return value ? String(value).toUpperCase() : null;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
const transformers: ITransformer = {
|
|
265
|
+
upperCase,
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export default transformers;
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
##### File name: index.ts
|
|
272
|
+
|
|
273
|
+
```javascript
|
|
274
|
+
import { TemplateModule } from "@edirect/template";
|
|
275
|
+
import baseTransformers from "./baseTransformers";
|
|
276
|
+
|
|
277
|
+
const template = {
|
|
278
|
+
quote: {
|
|
279
|
+
orders: {
|
|
280
|
+
arraySource: "order",
|
|
281
|
+
arrayTemplate: {
|
|
282
|
+
value: "value",
|
|
283
|
+
date: "date",
|
|
284
|
+
products: {
|
|
285
|
+
arraySource: "products",
|
|
286
|
+
arrayTemplate: {
|
|
287
|
+
id: "id",
|
|
288
|
+
value: "value",
|
|
289
|
+
description: {
|
|
290
|
+
fields: ["description"],
|
|
291
|
+
transformer: "upperCase",
|
|
292
|
+
defaultValue: "Default description",
|
|
293
|
+
},
|
|
294
|
+
categories: "categories",
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
const dataSource = {
|
|
303
|
+
order: [
|
|
304
|
+
{
|
|
305
|
+
value: 1000.0,
|
|
306
|
+
date: "2000-01-01",
|
|
307
|
+
products: [
|
|
308
|
+
{
|
|
309
|
+
id: "id-test-1",
|
|
310
|
+
value: 1000,
|
|
311
|
+
description: "description-test 1",
|
|
312
|
+
categories: ["category-1"],
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
id: "id-test-2",
|
|
316
|
+
value: 2000,
|
|
317
|
+
description: "description-test 2",
|
|
318
|
+
categories: ["category-1", "category-2"],
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
id: "id-test-3",
|
|
322
|
+
value: 3000,
|
|
323
|
+
categories: ["category-1", "category-2", "category-3"],
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
const templateModule = new TemplateModule();
|
|
331
|
+
|
|
332
|
+
templateModule.setTemplate(template);
|
|
333
|
+
templateModule.setContext(dataSource);
|
|
334
|
+
templateModule.setTransformers(baseTransformers);
|
|
335
|
+
|
|
336
|
+
const result = templateModule.transformPayload(dataSource);
|
|
337
|
+
console.log(result);
|
|
338
|
+
|
|
339
|
+
//{
|
|
340
|
+
// quote: {
|
|
341
|
+
// orders: [
|
|
342
|
+
// {
|
|
343
|
+
// value: 1000,
|
|
344
|
+
// date: "2000-01-01",
|
|
345
|
+
// products: [
|
|
346
|
+
// {
|
|
347
|
+
// id: "id-test-1",
|
|
348
|
+
// value: 1000,
|
|
349
|
+
// description: "DESCRIPTION-TEST 1",
|
|
350
|
+
// categories: ["category-1"],
|
|
351
|
+
// },
|
|
352
|
+
// {
|
|
353
|
+
// id: "id-test-2",
|
|
354
|
+
// value: 2000,
|
|
355
|
+
// description: "DESCRIPTION-TEST 2",
|
|
356
|
+
// categories: ["category-1", "category-2"],
|
|
357
|
+
// },
|
|
358
|
+
// {
|
|
359
|
+
// id: "id-test-3",
|
|
360
|
+
// value: 3000,
|
|
361
|
+
// description: "Default description",
|
|
362
|
+
// categories: ["category-1", "category-2", "category-3"],
|
|
363
|
+
// },
|
|
364
|
+
// ],
|
|
365
|
+
// },
|
|
366
|
+
// ],
|
|
367
|
+
// },
|
|
368
|
+
// }
|
|
369
|
+
```
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
17
|
+
__exportStar(require("./templateModule"), exports);
|
|
18
18
|
__exportStar(require("./templateModule/interfaces"), exports);
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,8DAA4C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ITransformer } from "./interfaces";
|
|
2
|
+
export declare class TemplateModule {
|
|
3
|
+
private context;
|
|
4
|
+
private template;
|
|
5
|
+
private transformers;
|
|
6
|
+
setContext(context: Record<string, unknown>): void;
|
|
7
|
+
setTemplate(template: Record<string, unknown>): void;
|
|
8
|
+
setTransformers(transformers: ITransformer): void;
|
|
9
|
+
verifyTransformer(transformer: ITransformer, methodName: string): boolean;
|
|
10
|
+
runTransformer(transformer: string, value?: unknown): unknown | null;
|
|
11
|
+
checkValue(value: any): boolean;
|
|
12
|
+
setValueByCondition(object: Record<string, unknown>, key: string, value: unknown): Record<string, unknown>;
|
|
13
|
+
isTransformer(object: Record<string, unknown>): boolean;
|
|
14
|
+
isArrayMapper(object: Record<string, unknown>): boolean;
|
|
15
|
+
transformPayload<T extends Record<string, unknown>>(obj: T, template?: Record<string, unknown>): Record<string, unknown>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TemplateModule = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
class TemplateModule {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.context = {};
|
|
8
|
+
this.template = {};
|
|
9
|
+
this.transformers = {};
|
|
10
|
+
}
|
|
11
|
+
setContext(context) {
|
|
12
|
+
this.context = context;
|
|
13
|
+
}
|
|
14
|
+
setTemplate(template) {
|
|
15
|
+
this.template = template;
|
|
16
|
+
}
|
|
17
|
+
setTransformers(transformers) {
|
|
18
|
+
this.transformers = transformers;
|
|
19
|
+
}
|
|
20
|
+
verifyTransformer(transformer, methodName) {
|
|
21
|
+
return !!(transformer &&
|
|
22
|
+
transformer[methodName] &&
|
|
23
|
+
typeof transformer[methodName] === "function");
|
|
24
|
+
}
|
|
25
|
+
runTransformer(transformer, value) {
|
|
26
|
+
if (this.verifyTransformer(this.transformers, transformer)) {
|
|
27
|
+
return this.transformers[transformer]({ context: this.context, value });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
checkValue(value) {
|
|
31
|
+
return !!(value || typeof value === "boolean" || typeof value === "number");
|
|
32
|
+
}
|
|
33
|
+
setValueByCondition(object, key, value) {
|
|
34
|
+
return this.checkValue(value)
|
|
35
|
+
? Object.assign(Object.assign({}, object), { [key]: value })
|
|
36
|
+
: object;
|
|
37
|
+
}
|
|
38
|
+
isTransformer(object) {
|
|
39
|
+
return !!((0, lodash_1.has)(object, "transformer") ||
|
|
40
|
+
(0, lodash_1.has)(object, "fields") ||
|
|
41
|
+
(0, lodash_1.has)(object, "defaultValue"));
|
|
42
|
+
}
|
|
43
|
+
isArrayMapper(object) {
|
|
44
|
+
return !!((0, lodash_1.has)(object, "arraySource") && (0, lodash_1.has)(object, "arrayTemplate"));
|
|
45
|
+
}
|
|
46
|
+
transformPayload(obj, template = this.template) {
|
|
47
|
+
const object = Object.assign({}, obj);
|
|
48
|
+
if (!template)
|
|
49
|
+
return object;
|
|
50
|
+
return Object.keys(template).reduce((acc, key) => {
|
|
51
|
+
const target = template[key];
|
|
52
|
+
let value = (0, lodash_1.get)(object, target);
|
|
53
|
+
if (this.isArrayMapper(target)) {
|
|
54
|
+
const { arraySource, arrayTemplate } = target;
|
|
55
|
+
value = (0, lodash_1.get)(object, arraySource);
|
|
56
|
+
if ((0, lodash_1.isArray)(value)) {
|
|
57
|
+
const finalArray = [];
|
|
58
|
+
for (let i = 0; i < value.length; i++) {
|
|
59
|
+
finalArray.push(this.transformPayload(value[i], arrayTemplate));
|
|
60
|
+
}
|
|
61
|
+
return this.setValueByCondition(acc, key, finalArray);
|
|
62
|
+
}
|
|
63
|
+
return this.setValueByCondition(acc, key, []);
|
|
64
|
+
}
|
|
65
|
+
if (typeof target === "object") {
|
|
66
|
+
if (!this.isTransformer(target)) {
|
|
67
|
+
return this.setValueByCondition(acc, key, this.transformPayload(object, target));
|
|
68
|
+
}
|
|
69
|
+
const { fields, transformer, defaultValue } = target;
|
|
70
|
+
if (fields && Array.isArray(fields)) {
|
|
71
|
+
for (let i = 0; i < fields.length; i++) {
|
|
72
|
+
value = (0, lodash_1.get)(object, fields[i]);
|
|
73
|
+
if (transformer)
|
|
74
|
+
value = this.runTransformer(transformer, value);
|
|
75
|
+
if (this.checkValue(value))
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
if (transformer)
|
|
81
|
+
value = this.runTransformer(transformer);
|
|
82
|
+
}
|
|
83
|
+
value = this.checkValue(value) ? value : defaultValue;
|
|
84
|
+
return this.setValueByCondition(acc, key, value);
|
|
85
|
+
}
|
|
86
|
+
return this.setValueByCondition(acc, key, value);
|
|
87
|
+
}, {});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.TemplateModule = TemplateModule;
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templateModule/index.ts"],"names":[],"mappings":";;;AACA,mCAA2C;AAE3C,MAAa,cAAc;IAA3B;QACU,YAAO,GAA4B,EAAE,CAAC;QACtC,aAAQ,GAA4B,EAAE,CAAC;QACvC,iBAAY,GAAiB,EAAE,CAAC;IAmH1C,CAAC;IAjHC,UAAU,CAAC,OAAgC;QACzC,IAAI,CAAC,OAAO,GAAG,OA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.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2017.full.d.ts","../src/templateModule/interfaces.ts","../
|
|
1
|
+
{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2017.full.d.ts","../src/templateModule/interfaces.ts","../node_modules/@types/lodash/common/common.d.ts","../node_modules/@types/lodash/common/array.d.ts","../node_modules/@types/lodash/common/collection.d.ts","../node_modules/@types/lodash/common/date.d.ts","../node_modules/@types/lodash/common/function.d.ts","../node_modules/@types/lodash/common/lang.d.ts","../node_modules/@types/lodash/common/math.d.ts","../node_modules/@types/lodash/common/number.d.ts","../node_modules/@types/lodash/common/object.d.ts","../node_modules/@types/lodash/common/seq.d.ts","../node_modules/@types/lodash/common/string.d.ts","../node_modules/@types/lodash/common/util.d.ts","../node_modules/@types/lodash/index.d.ts","../src/templateModule/index.ts","../src/index.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"9a60b92bca4c1257db03b349d58e63e4868cfc0d1c8d0ba60c2dbc63f4e6c9f6","affectsGlobalScope":true},{"version":"c5c5565225fce2ede835725a92a28ece149f83542aa4866cfb10290bff7b8996","affectsGlobalScope":true},{"version":"7d2dbc2a0250400af0809b0ad5f84686e84c73526de931f84560e483eb16b03c","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"994c234848afc14a2586b6565777f4c0b05dc479ede0a041bfd5becf6dceb586",{"version":"0a614c10884200ac9e75264373ff6141e7045107100b134562183360e8fc01df","signature":"64e60fd91c75a7d76f552a7006ce85a8c27605bfa5c23e8ade0f96046c519f1e"},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","d70c026dd2eeaa974f430ea229230a1897fdb897dc74659deebe2afd4feeb08f","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","98f9d826db9cd99d27a01a59ee5f22863df00ccf1aaf43e1d7db80ebf716f7c3","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","dcd91d3b697cb650b95db5471189b99815af5db2a1cd28760f91e0b12ede8ed5","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3cf0d343c2276842a5b617f22ba82af6322c7cfe8bb52238ffc0c491a3c21019","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"f2eff8704452659641164876c1ef0df4174659ce7311b0665798ea3f556fa9ad","affectsGlobalScope":true},{"version":"d5c78af85e72d3e5b52c1413f6484b3de6a835a74a9451903761091fb49fcfda","signature":"f84c03773464abd60f47619127ee946ebe51d1d9ac5a98b0a0d4dc381a4ce991"},"d2e3a5e97ca0bf568106173181629e1a03b8f6905a3cf923409f9a4329a459ff"],"root":[42],"options":{"declaration":true,"module":1,"outDir":"./","removeComments":true,"sourceMap":true,"target":4},"fileIdsList":[[28,30,31,32,33,34,35,36,37,38,39,40],[28,29,31,32,33,34,35,36,37,38,39,40],[29,30,31,32,33,34,35,36,37,38,39,40],[28,29,30,32,33,34,35,36,37,38,39,40],[28,29,30,31,33,34,35,36,37,38,39,40],[28,29,30,31,32,34,35,36,37,38,39,40],[28,29,30,31,32,33,35,36,37,38,39,40],[28,29,30,31,32,33,34,36,37,38,39,40],[28,29,30,31,32,33,34,35,37,38,39,40],[28,29,30,31,32,33,34,35,36,38,39,40],[28,29,30,31,32,33,34,35,36,37,39,40],[28,29,30,31,32,33,34,35,36,37,38,40],[28,29,30,31,32,33,34,35,36,37,38,39],[27,41],[27,40],[27]],"referencedMap":[[29,1],[30,2],[28,3],[31,4],[32,5],[33,6],[34,7],[35,8],[36,9],[37,10],[38,11],[39,12],[40,13],[42,14],[41,15]],"exportedModulesMap":[[29,1],[30,2],[28,3],[31,4],[32,5],[33,6],[34,7],[35,8],[36,9],[37,10],[38,11],[39,12],[40,13],[42,14],[41,16]],"semanticDiagnosticsPerFile":[29,30,28,31,32,33,34,35,36,37,38,39,40,24,25,5,6,10,9,2,11,12,13,14,15,16,17,18,3,4,26,22,19,20,21,23,1,8,7,42,41,27]},"version":"5.0.4"}
|