@@ -90,13 +90,15 @@ describe('scrub-file', () => {
90
90
describe ( '__decorate' , ( ) => {
91
91
it ( 'removes Angular decorators calls in __decorate' , ( ) => {
92
92
const output = tags . stripIndent `
93
- import { Component, Injectable } from '@angular/core';
93
+ import { __decorate } from "tslib";
94
+ import { Component, Injectable } from '@angular/core';
94
95
var Clazz = (function () {
95
96
function Clazz() { }
96
97
return Clazz;
97
98
}());
98
99
` ;
99
100
const input = tags . stripIndent `
101
+ import { __decorate } from "tslib";
100
102
import { Component, Injectable } from '@angular/core';
101
103
var Clazz = (function () {
102
104
function Clazz() { }
@@ -118,6 +120,7 @@ describe('scrub-file', () => {
118
120
119
121
it ( 'removes constructor parameter metadata in __decorate' , ( ) => {
120
122
const output = tags . stripIndent `
123
+ import { __decorate, __metadata } from "tslib";
121
124
import { Component, ElementRef } from '@angular/core';
122
125
import { LibService } from 'another-lib';
123
126
var Clazz = (function () {
@@ -126,6 +129,7 @@ describe('scrub-file', () => {
126
129
}());
127
130
` ;
128
131
const input = tags . stripIndent `
132
+ import { __decorate, __metadata } from "tslib";
129
133
import { Component, ElementRef } from '@angular/core';
130
134
import { LibService } from 'another-lib';
131
135
var Clazz = (function () {
@@ -148,6 +152,7 @@ describe('scrub-file', () => {
148
152
149
153
it ( 'removes constructor parameter metadata when static properties are present' , ( ) => {
150
154
const output = tags . stripIndent `
155
+ import { __decorate, __metadata } from "tslib";
151
156
import { Injectable } from '@angular/core';
152
157
import { Logger } from 'another-lib';
153
158
var GaService = (function () {
@@ -164,6 +169,7 @@ describe('scrub-file', () => {
164
169
}());
165
170
` ;
166
171
const input = tags . stripIndent `
172
+ import { __decorate, __metadata } from "tslib";
167
173
import { Injectable } from '@angular/core';
168
174
import { Logger } from 'another-lib';
169
175
var GaService = (function () {
@@ -190,6 +196,7 @@ describe('scrub-file', () => {
190
196
191
197
it ( 'removes only Angular decorators calls in __decorate' , ( ) => {
192
198
const output = tags . stripIndent `
199
+ import { __decorate } from "tslib";
193
200
import { Component } from '@angular/core';
194
201
import { NotComponent } from 'another-lib';
195
202
var Clazz = (function () {
@@ -201,6 +208,7 @@ describe('scrub-file', () => {
201
208
}());
202
209
` ;
203
210
const input = tags . stripIndent `
211
+ import { __decorate } from "tslib";
204
212
import { Component } from '@angular/core';
205
213
import { NotComponent } from 'another-lib';
206
214
var Clazz = (function () {
@@ -223,13 +231,12 @@ describe('scrub-file', () => {
223
231
224
232
it ( 'recognizes tslib as well' , ( ) => {
225
233
const input = tags . stripIndent `
226
- import * as tslib from "tslib";
227
- import * as tslib_2 from "tslib";
234
+ import { __decorate } from "tslib";
228
235
import { Component } from '@angular/core';
229
236
import { NotComponent } from 'another-lib';
230
237
var Clazz = (function () {
231
238
function Clazz() { }
232
- Clazz = tslib. __decorate([
239
+ Clazz = __decorate([
233
240
NotComponent(),
234
241
Component({
235
242
selector: 'app-root',
@@ -242,7 +249,7 @@ describe('scrub-file', () => {
242
249
243
250
var Clazz2 = (function () {
244
251
function Clazz2() { }
245
- Clazz2 = tslib_2. __decorate([
252
+ Clazz2 = __decorate([
246
253
NotComponent(),
247
254
Component({
248
255
selector: 'app-root',
@@ -254,21 +261,20 @@ describe('scrub-file', () => {
254
261
}());
255
262
` ;
256
263
const output = tags . stripIndent `
257
- import * as tslib from "tslib";
258
- import * as tslib_2 from "tslib";
264
+ import { __decorate } from "tslib";
259
265
import { Component } from '@angular/core';
260
266
import { NotComponent } from 'another-lib';
261
267
var Clazz = (function () {
262
268
function Clazz() { }
263
- Clazz = tslib. __decorate([
269
+ Clazz = __decorate([
264
270
NotComponent()
265
271
], Clazz);
266
272
return Clazz;
267
273
}());
268
274
269
275
var Clazz2 = (function () {
270
276
function Clazz2() { }
271
- Clazz2 = tslib_2. __decorate([
277
+ Clazz2 = __decorate([
272
278
NotComponent()
273
279
], Clazz2);
274
280
return Clazz2;
@@ -281,7 +287,7 @@ describe('scrub-file', () => {
281
287
282
288
it ( 'recognizes decorator imports in Angular core' , ( ) => {
283
289
const input = tags . stripIndent `
284
- import * as tslib_1 from "tslib";
290
+ import { __decorate } from "tslib";
285
291
import { Injectable } from './di';
286
292
var Console = /** @class */ (function () {
287
293
function Console() {
@@ -292,15 +298,15 @@ describe('scrub-file', () => {
292
298
Console.prototype.warn = function (message) {
293
299
console.warn(message);
294
300
};
295
- Console = tslib_1. __decorate([
301
+ Console = __decorate([
296
302
Injectable()
297
303
], Console);
298
304
return Console;
299
305
}());
300
306
export { Console };
301
307
` ;
302
308
const output = tags . stripIndent `
303
- import * as tslib_1 from "tslib";
309
+ import { __decorate } from "tslib";
304
310
import { Injectable } from './di';
305
311
var Console = /** @class */ (function () {
306
312
function Console() {
@@ -425,6 +431,7 @@ describe('scrub-file', () => {
425
431
describe ( '__metadata' , ( ) => {
426
432
it ( 'removes Angular decorators metadata' , ( ) => {
427
433
const output = tags . stripIndent `
434
+ import { __decorate, __metadata } from "tslib";
428
435
import { Input, Output, EventEmitter, HostListener } from '@angular/core';
429
436
var Clazz = (function () {
430
437
function Clazz() {
@@ -434,6 +441,7 @@ describe('scrub-file', () => {
434
441
}());
435
442
` ;
436
443
const input = tags . stripIndent `
444
+ import { __decorate, __metadata } from "tslib";
437
445
import { Input, Output, EventEmitter, HostListener } from '@angular/core';
438
446
import { NotInput } from 'another-lib';
439
447
var Clazz = (function () {
@@ -464,6 +472,7 @@ describe('scrub-file', () => {
464
472
465
473
it ( 'removes only Angular decorator metadata' , ( ) => {
466
474
const output = tags . stripIndent `
475
+ import { __decorate, __metadata } from "tslib";
467
476
import { Input } from '@angular/core';
468
477
import { NotInput } from 'another-lib';
469
478
var Clazz = (function () {
@@ -483,6 +492,7 @@ describe('scrub-file', () => {
483
492
}());
484
493
` ;
485
494
const input = tags . stripIndent `
495
+ import { __decorate, __metadata } from "tslib";
486
496
import { Input } from '@angular/core';
487
497
import { NotInput } from 'another-lib';
488
498
var Clazz = (function () {
@@ -512,30 +522,28 @@ describe('scrub-file', () => {
512
522
513
523
it ( 'recognizes tslib as well' , ( ) => {
514
524
const input = tags . stripIndent `
515
- import * as tslib from "tslib";
516
- import * as tslib_2 from "tslib";
525
+ import { __decorate, __metadata } from "tslib";
517
526
import { Input } from '@angular/core';
518
527
var Clazz = (function () {
519
528
function Clazz() { }
520
- tslib. __decorate([
529
+ __decorate([
521
530
Input(),
522
- tslib. __metadata("design:type", Object)
531
+ __metadata("design:type", Object)
523
532
], Clazz.prototype, "selected", void 0);
524
533
return Clazz;
525
534
}());
526
535
527
536
var Clazz2 = (function () {
528
537
function Clazz2() { }
529
- tslib_2. __decorate([
538
+ __decorate([
530
539
Input(),
531
- tslib_2. __metadata("design:type", Object)
540
+ __metadata("design:type", Object)
532
541
], Clazz.prototype, "selected", void 0);
533
542
return Clazz2;
534
543
}());
535
544
` ;
536
545
const output = tags . stripIndent `
537
- import * as tslib from "tslib";
538
- import * as tslib_2 from "tslib";
546
+ import { __decorate, __metadata } from "tslib";
539
547
import { Input } from '@angular/core';
540
548
var Clazz = (function () {
541
549
function Clazz() { }
@@ -556,6 +564,7 @@ describe('scrub-file', () => {
556
564
describe ( '__param' , ( ) => {
557
565
it ( 'removes all constructor parameters and their type metadata' , ( ) => {
558
566
const output = tags . stripIndent `
567
+ import { __decorate, __param, __metadata } from "tslib";
559
568
var MyClass = /** @class */ (function () {
560
569
function MyClass(myParam) {
561
570
this.myProp = 'foo';
@@ -567,6 +576,7 @@ describe('scrub-file', () => {
567
576
}());
568
577
` ;
569
578
const input = tags . stripIndent `
579
+ import { __decorate, __param, __metadata } from "tslib";
570
580
var MyClass = /** @class */ (function () {
571
581
function MyClass(myParam) {
572
582
this.myProp = 'foo';
0 commit comments