@@ -43,10 +43,9 @@ describe('adjust-typescript-enums Babel plugin', () => {
43
43
` ,
44
44
expected : `
45
45
var ChangeDetectionStrategy = /*#__PURE__*/ (() => {
46
- (function (ChangeDetectionStrategy) {
47
- ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
48
- ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
49
- })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
46
+ ChangeDetectionStrategy = ChangeDetectionStrategy || {};
47
+ ChangeDetectionStrategy[(ChangeDetectionStrategy["OnPush"] = 0)] = "OnPush";
48
+ ChangeDetectionStrategy[(ChangeDetectionStrategy["Default"] = 1)] = "Default";
50
49
return ChangeDetectionStrategy;
51
50
})();
52
51
` ,
@@ -64,10 +63,9 @@ describe('adjust-typescript-enums Babel plugin', () => {
64
63
` ,
65
64
expected : `
66
65
export var ChangeDetectionStrategy = /*#__PURE__*/ (() => {
67
- (function (ChangeDetectionStrategy) {
68
- ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
69
- ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
70
- })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
66
+ ChangeDetectionStrategy = ChangeDetectionStrategy || {};
67
+ ChangeDetectionStrategy[(ChangeDetectionStrategy["OnPush"] = 0)] = "OnPush";
68
+ ChangeDetectionStrategy[(ChangeDetectionStrategy["Default"] = 1)] = "Default";
71
69
return ChangeDetectionStrategy;
72
70
})();
73
71
` ,
@@ -85,10 +83,9 @@ describe('adjust-typescript-enums Babel plugin', () => {
85
83
` ,
86
84
expected : `
87
85
export var ChangeDetectionStrategy = /*#__PURE__*/ (() => {
88
- (function (ChangeDetectionStrategy) {
89
- ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 5] = "OnPush";
90
- ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 8] = "Default";
91
- })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
86
+ ChangeDetectionStrategy = ChangeDetectionStrategy || {};
87
+ ChangeDetectionStrategy[(ChangeDetectionStrategy["OnPush"] = 5)] = "OnPush";
88
+ ChangeDetectionStrategy[(ChangeDetectionStrategy["Default"] = 8)] = "Default";
92
89
return ChangeDetectionStrategy;
93
90
})();
94
91
` ,
@@ -98,20 +95,19 @@ describe('adjust-typescript-enums Babel plugin', () => {
98
95
it ( 'wraps string-based TypeScript enums' , ( ) => {
99
96
testCase ( {
100
97
input : `
101
- var NotificationKind;
102
- (function (NotificationKind) {
103
- NotificationKind["NEXT"] = "N";
104
- NotificationKind["ERROR"] = "E";
105
- NotificationKind["COMPLETE"] = "C";
106
- })(NotificationKind || (NotificationKind = {}));
98
+ var NotificationKind;
99
+ (function (NotificationKind) {
100
+ NotificationKind["NEXT"] = "N";
101
+ NotificationKind["ERROR"] = "E";
102
+ NotificationKind["COMPLETE"] = "C";
103
+ })(NotificationKind || (NotificationKind = {}));
107
104
` ,
108
105
expected : `
109
106
var NotificationKind = /*#__PURE__*/ (() => {
110
- (function (NotificationKind) {
111
- NotificationKind["NEXT"] = "N";
112
- NotificationKind["ERROR"] = "E";
113
- NotificationKind["COMPLETE"] = "C";
114
- })(NotificationKind || (NotificationKind = {}));
107
+ NotificationKind = NotificationKind || {};
108
+ NotificationKind["NEXT"] = "N";
109
+ NotificationKind["ERROR"] = "E";
110
+ NotificationKind["COMPLETE"] = "C";
115
111
return NotificationKind;
116
112
})();
117
113
` ,
@@ -165,15 +161,14 @@ describe('adjust-typescript-enums Babel plugin', () => {
165
161
* @deprecated use @angular/common/http instead
166
162
*/
167
163
var RequestMethod = /*#__PURE__*/ (() => {
168
- (function (RequestMethod) {
169
- RequestMethod[RequestMethod["Get"] = 0] = "Get";
170
- RequestMethod[RequestMethod["Post"] = 1] = "Post";
171
- RequestMethod[RequestMethod["Put"] = 2] = "Put";
172
- RequestMethod[RequestMethod["Delete"] = 3] = "Delete";
173
- RequestMethod[RequestMethod["Options"] = 4] = "Options";
174
- RequestMethod[RequestMethod["Head"] = 5] = "Head";
175
- RequestMethod[RequestMethod["Patch"] = 6] = "Patch";
176
- })(RequestMethod || (RequestMethod = {}));
164
+ RequestMethod = RequestMethod || {};
165
+ RequestMethod[(RequestMethod["Get"] = 0)] = "Get";
166
+ RequestMethod[(RequestMethod["Post"] = 1)] = "Post";
167
+ RequestMethod[(RequestMethod["Put"] = 2)] = "Put";
168
+ RequestMethod[(RequestMethod["Delete"] = 3)] = "Delete";
169
+ RequestMethod[(RequestMethod["Options"] = 4)] = "Options";
170
+ RequestMethod[(RequestMethod["Head"] = 5)] = "Head";
171
+ RequestMethod[(RequestMethod["Patch"] = 6)] = "Patch";
177
172
return RequestMethod;
178
173
})();
179
174
` ,
0 commit comments