babel-schmooze-sprockets 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +14 -0
- data/bin/export-external-helpers +3 -0
- data/bin/setup +6 -0
- data/bin/update-npm-deps +8 -0
- data/examples/myapp/Gemfile +4 -5
- data/examples/myapp/Gemfile.lock +69 -93
- data/examples/myapp/app/assets/javascripts/code/hello.es6 +5 -1
- data/examples/myapp/app/views/layouts/application.html.erb +1 -0
- data/examples/myapp/app/views/site/home.html.erb +0 -1
- data/lib/babel-schmooze-sprockets/babel_processor.rb +6 -4
- data/lib/babel-schmooze-sprockets/engine.rb +1 -4
- data/lib/babel-schmooze-sprockets/version.rb +1 -1
- data/node_modules/amdefine/package.json +8 -1
- data/node_modules/babel-core/node_modules/babel-runtime/package.json +9 -5
- data/node_modules/babel-core/node_modules/babel-traverse/.npmignore +3 -0
- data/node_modules/babel-core/node_modules/babel-traverse/README.md +1 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/cache.js +20 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/context.js +219 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/hub.js +19 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/index.js +250 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/ancestry.js +317 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/comments.js +55 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js +297 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/conversion.js +48 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/evaluation.js +406 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/family.js +168 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/index.js +245 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/inference/index.js +151 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/inference/inferer-reference.js +225 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/inference/inferers.js +198 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/introspection.js +518 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/lib/hoister.js +166 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/lib/removal-hooks.js +64 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/lib/virtual-types.js +141 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/modification.js +293 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/removal.js +72 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/replacement.js +302 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/scope/binding.js +105 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/scope/index.js +1222 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/scope/lib/renamer.js +154 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js +360 -0
- data/node_modules/babel-core/node_modules/babel-traverse/package.json +107 -0
- data/node_modules/babel-core/node_modules/core-js/package.json +20 -2
- data/node_modules/babel-core/package.json +31 -24
- data/node_modules/babel-generator/lib/buffer.js +69 -70
- data/node_modules/babel-generator/lib/generators/base.js +16 -12
- data/node_modules/babel-generator/lib/generators/classes.js +28 -19
- data/node_modules/babel-generator/lib/generators/expressions.js +76 -99
- data/node_modules/babel-generator/lib/generators/flow.js +178 -119
- data/node_modules/babel-generator/lib/generators/jsx.js +38 -29
- data/node_modules/babel-generator/lib/generators/methods.js +34 -25
- data/node_modules/babel-generator/lib/generators/modules.js +67 -40
- data/node_modules/babel-generator/lib/generators/statements.js +93 -76
- data/node_modules/babel-generator/lib/generators/template-literals.js +12 -11
- data/node_modules/babel-generator/lib/generators/types.js +56 -49
- data/node_modules/babel-generator/lib/index.js +52 -39
- data/node_modules/babel-generator/lib/node/index.js +12 -18
- data/node_modules/babel-generator/lib/node/parentheses.js +23 -27
- data/node_modules/babel-generator/lib/node/whitespace.js +20 -26
- data/node_modules/babel-generator/lib/position.js +5 -5
- data/node_modules/babel-generator/lib/printer.js +52 -81
- data/node_modules/babel-generator/lib/source-map.js +9 -11
- data/node_modules/babel-generator/lib/whitespace.js +13 -13
- data/node_modules/babel-generator/node_modules/babel-runtime/package.json +19 -6
- data/node_modules/babel-generator/node_modules/babel-types/.npmignore +3 -0
- data/node_modules/babel-generator/node_modules/babel-types/README.md +1141 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/constants.js +40 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/converters.js +378 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/core.js +704 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/es2015.js +354 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/experimental.js +85 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/flow.js +319 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/index.js +247 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/init.js +15 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/jsx.js +137 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/misc.js +21 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/flow.js +129 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/index.js +848 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/react.js +83 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/retrievers.js +123 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/validators.js +276 -0
- data/node_modules/babel-generator/node_modules/babel-types/package.json +103 -0
- data/node_modules/babel-generator/node_modules/core-js/package.json +10 -5
- data/node_modules/babel-generator/package.json +19 -16
- data/node_modules/babel-helpers/node_modules/babel-runtime/package.json +19 -3
- data/node_modules/babel-helpers/node_modules/core-js/package.json +20 -4
- data/node_modules/babel-helpers/package.json +8 -1
- data/node_modules/babel-register/node_modules/babel-runtime/package.json +19 -3
- data/node_modules/babel-register/node_modules/core-js/package.json +20 -4
- data/node_modules/babel-register/package.json +8 -1
- data/node_modules/balanced-match/package.json +8 -1
- data/node_modules/brace-expansion/package.json +19 -12
- data/node_modules/concat-map/package.json +9 -2
- data/node_modules/convert-source-map/package.json +8 -1
- data/node_modules/detect-indent/package.json +8 -1
- data/node_modules/get-stdin/package.json +8 -1
- data/node_modules/home-or-tmp/package.json +9 -2
- data/node_modules/is-finite/package.json +8 -2
- data/node_modules/json5/package.json +8 -1
- data/node_modules/minimatch/README.md +2 -9
- data/node_modules/minimatch/minimatch.js +15 -3
- data/node_modules/minimatch/package.json +29 -21
- data/node_modules/minimist/package.json +8 -1
- data/node_modules/mkdirp/node_modules/minimist/package.json +8 -1
- data/node_modules/mkdirp/package.json +8 -1
- data/node_modules/number-is-nan/package.json +8 -1
- data/node_modules/os-tmpdir/package.json +8 -1
- data/node_modules/path-exists/package.json +8 -1
- data/node_modules/path-is-absolute/package.json +8 -1
- data/node_modules/repeating/package.json +15 -11
- data/node_modules/shebang-regex/package.json +8 -1
- data/node_modules/slash/package.json +8 -1
- data/node_modules/source-map-support/node_modules/source-map/package.json +8 -1
- data/node_modules/source-map-support/package.json +8 -1
- data/node_modules/source-map/package.json +8 -1
- data/node_modules/user-home/package.json +8 -1
- data/package.json +1 -1
- metadata +54 -6
- data/node_modules/brace-expansion/.npmignore +0 -3
- data/node_modules/brace-expansion/example.js +0 -8
- data/node_modules/minimatch/browser.js +0 -1159
@@ -1,28 +1,28 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
-
exports.TypeParameterDeclaration = exports.NumericLiteralTypeAnnotation = exports.GenericTypeAnnotation = exports.ClassImplements = undefined;
|
4
|
+
exports.TypeParameterDeclaration = exports.StringLiteralTypeAnnotation = exports.NumericLiteralTypeAnnotation = exports.GenericTypeAnnotation = exports.ClassImplements = undefined;
|
5
5
|
exports.AnyTypeAnnotation = AnyTypeAnnotation;
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
6
|
+
exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
|
7
|
+
exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
|
8
|
+
exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
|
9
|
+
exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
|
10
|
+
exports.DeclareClass = DeclareClass;
|
11
|
+
exports.DeclareFunction = DeclareFunction;
|
12
|
+
exports.DeclareInterface = DeclareInterface;
|
13
|
+
exports.DeclareModule = DeclareModule;
|
14
|
+
exports.DeclareTypeAlias = DeclareTypeAlias;
|
15
|
+
exports.DeclareVariable = DeclareVariable;
|
16
|
+
exports.ExistentialTypeParam = ExistentialTypeParam;
|
17
|
+
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
18
|
+
exports.FunctionTypeParam = FunctionTypeParam;
|
19
|
+
exports.InterfaceExtends = InterfaceExtends;
|
20
|
+
exports._interfaceish = _interfaceish;
|
21
|
+
exports.InterfaceDeclaration = InterfaceDeclaration;
|
22
|
+
exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
|
23
|
+
exports.MixedTypeAnnotation = MixedTypeAnnotation;
|
24
|
+
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
25
|
+
|
26
26
|
var _types = require("./types");
|
27
27
|
|
28
28
|
Object.defineProperty(exports, "NumericLiteralTypeAnnotation", {
|
@@ -31,116 +31,134 @@ Object.defineProperty(exports, "NumericLiteralTypeAnnotation", {
|
|
31
31
|
return _types.NumericLiteral;
|
32
32
|
}
|
33
33
|
});
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
34
|
+
Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
|
35
|
+
enumerable: true,
|
36
|
+
get: function get() {
|
37
|
+
return _types.StringLiteral;
|
38
|
+
}
|
39
|
+
});
|
40
|
+
exports.NumberTypeAnnotation = NumberTypeAnnotation;
|
41
|
+
exports.StringTypeAnnotation = StringTypeAnnotation;
|
42
|
+
exports.ThisTypeAnnotation = ThisTypeAnnotation;
|
43
|
+
exports.TupleTypeAnnotation = TupleTypeAnnotation;
|
44
|
+
exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
|
45
|
+
exports.TypeAlias = TypeAlias;
|
46
|
+
exports.TypeAnnotation = TypeAnnotation;
|
47
|
+
exports.TypeParameter = TypeParameter;
|
48
|
+
exports.TypeParameterInstantiation = TypeParameterInstantiation;
|
49
|
+
exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
|
50
|
+
exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
|
51
|
+
exports.ObjectTypeIndexer = ObjectTypeIndexer;
|
52
|
+
exports.ObjectTypeProperty = ObjectTypeProperty;
|
53
|
+
exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
|
54
|
+
exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
55
|
+
exports.TypeCastExpression = TypeCastExpression;
|
56
|
+
exports.VoidTypeAnnotation = VoidTypeAnnotation;
|
57
|
+
|
58
|
+
var _babelTypes = require("babel-types");
|
59
|
+
|
55
60
|
var t = _interopRequireWildcard(_babelTypes);
|
56
61
|
|
57
|
-
/*istanbul ignore next*/
|
58
62
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
59
63
|
|
60
64
|
function AnyTypeAnnotation() {
|
61
|
-
this.
|
65
|
+
this.word("any");
|
62
66
|
} /* eslint max-len: 0 */
|
63
67
|
|
64
68
|
function ArrayTypeAnnotation(node) {
|
65
69
|
this.print(node.elementType, node);
|
66
|
-
this.
|
67
|
-
this.
|
70
|
+
this.token("[");
|
71
|
+
this.token("]");
|
68
72
|
}
|
69
73
|
|
70
74
|
function BooleanTypeAnnotation() {
|
71
|
-
this.
|
75
|
+
this.word("bool");
|
72
76
|
}
|
73
77
|
|
74
78
|
function BooleanLiteralTypeAnnotation(node) {
|
75
|
-
this.
|
79
|
+
this.word(node.value ? "true" : "false");
|
76
80
|
}
|
77
81
|
|
78
82
|
function NullLiteralTypeAnnotation() {
|
79
|
-
this.
|
83
|
+
this.word("null");
|
80
84
|
}
|
81
85
|
|
82
86
|
function DeclareClass(node) {
|
83
|
-
this.
|
87
|
+
this.word("declare");
|
88
|
+
this.space();
|
89
|
+
this.word("class");
|
90
|
+
this.space();
|
84
91
|
this._interfaceish(node);
|
85
92
|
}
|
86
93
|
|
87
94
|
function DeclareFunction(node) {
|
88
|
-
this.
|
95
|
+
this.word("declare");
|
96
|
+
this.space();
|
97
|
+
this.word("function");
|
98
|
+
this.space();
|
89
99
|
this.print(node.id, node);
|
90
100
|
this.print(node.id.typeAnnotation.typeAnnotation, node);
|
91
101
|
this.semicolon();
|
92
102
|
}
|
93
103
|
|
94
104
|
function DeclareInterface(node) {
|
95
|
-
this.
|
105
|
+
this.word("declare");
|
106
|
+
this.space();
|
96
107
|
this.InterfaceDeclaration(node);
|
97
108
|
}
|
98
109
|
|
99
110
|
function DeclareModule(node) {
|
100
|
-
this.
|
111
|
+
this.word("declare");
|
112
|
+
this.space();
|
113
|
+
this.word("module");
|
114
|
+
this.space();
|
101
115
|
this.print(node.id, node);
|
102
116
|
this.space();
|
103
117
|
this.print(node.body, node);
|
104
118
|
}
|
105
119
|
|
106
120
|
function DeclareTypeAlias(node) {
|
107
|
-
this.
|
121
|
+
this.word("declare");
|
122
|
+
this.space();
|
108
123
|
this.TypeAlias(node);
|
109
124
|
}
|
110
125
|
|
111
126
|
function DeclareVariable(node) {
|
112
|
-
this.
|
127
|
+
this.word("declare");
|
128
|
+
this.space();
|
129
|
+
this.word("var");
|
130
|
+
this.space();
|
113
131
|
this.print(node.id, node);
|
114
132
|
this.print(node.id.typeAnnotation, node);
|
115
133
|
this.semicolon();
|
116
134
|
}
|
117
135
|
|
118
136
|
function ExistentialTypeParam() {
|
119
|
-
this.
|
137
|
+
this.token("*");
|
120
138
|
}
|
121
139
|
|
122
140
|
function FunctionTypeAnnotation(node, parent) {
|
123
141
|
this.print(node.typeParameters, node);
|
124
|
-
this.
|
142
|
+
this.token("(");
|
125
143
|
this.printList(node.params, node);
|
126
144
|
|
127
145
|
if (node.rest) {
|
128
146
|
if (node.params.length) {
|
129
|
-
this.
|
147
|
+
this.token(",");
|
130
148
|
this.space();
|
131
149
|
}
|
132
|
-
this.
|
150
|
+
this.token("...");
|
133
151
|
this.print(node.rest, node);
|
134
152
|
}
|
135
153
|
|
136
|
-
this.
|
154
|
+
this.token(")");
|
137
155
|
|
138
156
|
// this node type is overloaded, not sure why but it makes it EXTREMELY annoying
|
139
157
|
if (parent.type === "ObjectTypeProperty" || parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction") {
|
140
|
-
this.
|
158
|
+
this.token(":");
|
141
159
|
} else {
|
142
160
|
this.space();
|
143
|
-
this.
|
161
|
+
this.token("=>");
|
144
162
|
}
|
145
163
|
|
146
164
|
this.space();
|
@@ -149,8 +167,8 @@ function FunctionTypeAnnotation(node, parent) {
|
|
149
167
|
|
150
168
|
function FunctionTypeParam(node) {
|
151
169
|
this.print(node.name, node);
|
152
|
-
if (node.optional) this.
|
153
|
-
this.
|
170
|
+
if (node.optional) this.token("?");
|
171
|
+
this.token(":");
|
154
172
|
this.space();
|
155
173
|
this.print(node.typeAnnotation, node);
|
156
174
|
}
|
@@ -160,118 +178,144 @@ function InterfaceExtends(node) {
|
|
160
178
|
this.print(node.typeParameters, node);
|
161
179
|
}
|
162
180
|
|
163
|
-
|
164
|
-
|
181
|
+
exports.ClassImplements = InterfaceExtends;
|
182
|
+
exports.GenericTypeAnnotation = InterfaceExtends;
|
165
183
|
function _interfaceish(node) {
|
166
184
|
this.print(node.id, node);
|
167
185
|
this.print(node.typeParameters, node);
|
168
186
|
if (node.extends.length) {
|
169
|
-
this.
|
170
|
-
this.
|
187
|
+
this.space();
|
188
|
+
this.word("extends");
|
189
|
+
this.space();
|
190
|
+
this.printList(node.extends, node);
|
171
191
|
}
|
172
192
|
if (node.mixins && node.mixins.length) {
|
173
|
-
this.
|
174
|
-
this.
|
193
|
+
this.space();
|
194
|
+
this.word("mixins");
|
195
|
+
this.space();
|
196
|
+
this.printList(node.mixins, node);
|
175
197
|
}
|
176
198
|
this.space();
|
177
199
|
this.print(node.body, node);
|
178
200
|
}
|
179
201
|
|
180
202
|
function InterfaceDeclaration(node) {
|
181
|
-
this.
|
203
|
+
this.word("interface");
|
204
|
+
this.space();
|
182
205
|
this._interfaceish(node);
|
183
206
|
}
|
184
207
|
|
208
|
+
function andSeparator() {
|
209
|
+
this.space();
|
210
|
+
this.token("&");
|
211
|
+
this.space();
|
212
|
+
}
|
213
|
+
|
185
214
|
function IntersectionTypeAnnotation(node) {
|
186
|
-
this.printJoin(node.types, node, { separator:
|
215
|
+
this.printJoin(node.types, node, { separator: andSeparator });
|
187
216
|
}
|
188
217
|
|
189
218
|
function MixedTypeAnnotation() {
|
190
|
-
this.
|
219
|
+
this.word("mixed");
|
191
220
|
}
|
192
221
|
|
193
222
|
function NullableTypeAnnotation(node) {
|
194
|
-
this.
|
223
|
+
this.token("?");
|
195
224
|
this.print(node.typeAnnotation, node);
|
196
225
|
}
|
197
226
|
|
198
227
|
function NumberTypeAnnotation() {
|
199
|
-
this.
|
200
|
-
}
|
201
|
-
|
202
|
-
function StringLiteralTypeAnnotation(node) {
|
203
|
-
this.push(this._stringLiteral(node.value));
|
228
|
+
this.word("number");
|
204
229
|
}
|
205
230
|
|
206
231
|
function StringTypeAnnotation() {
|
207
|
-
this.
|
232
|
+
this.word("string");
|
208
233
|
}
|
209
234
|
|
210
235
|
function ThisTypeAnnotation() {
|
211
|
-
this.
|
236
|
+
this.word("this");
|
212
237
|
}
|
213
238
|
|
214
239
|
function TupleTypeAnnotation(node) {
|
215
|
-
this.
|
216
|
-
this.
|
217
|
-
this.
|
240
|
+
this.token("[");
|
241
|
+
this.printList(node.types, node);
|
242
|
+
this.token("]");
|
218
243
|
}
|
219
244
|
|
220
245
|
function TypeofTypeAnnotation(node) {
|
221
|
-
this.
|
246
|
+
this.word("typeof");
|
247
|
+
this.space();
|
222
248
|
this.print(node.argument, node);
|
223
249
|
}
|
224
250
|
|
225
251
|
function TypeAlias(node) {
|
226
|
-
this.
|
252
|
+
this.word("type");
|
253
|
+
this.space();
|
227
254
|
this.print(node.id, node);
|
228
255
|
this.print(node.typeParameters, node);
|
229
256
|
this.space();
|
230
|
-
this.
|
257
|
+
this.token("=");
|
231
258
|
this.space();
|
232
259
|
this.print(node.right, node);
|
233
260
|
this.semicolon();
|
234
261
|
}
|
235
262
|
|
236
263
|
function TypeAnnotation(node) {
|
237
|
-
this.
|
264
|
+
this.token(":");
|
238
265
|
this.space();
|
239
|
-
if (node.optional) this.
|
266
|
+
if (node.optional) this.token("?");
|
240
267
|
this.print(node.typeAnnotation, node);
|
241
268
|
}
|
242
269
|
|
270
|
+
function TypeParameter(node) {
|
271
|
+
if (node.variance === "plus") {
|
272
|
+
this.token("+");
|
273
|
+
} else if (node.variance === "minus") {
|
274
|
+
this.token("-");
|
275
|
+
}
|
276
|
+
|
277
|
+
this.word(node.name);
|
278
|
+
|
279
|
+
if (node.bound) {
|
280
|
+
this.print(node.bound, node);
|
281
|
+
}
|
282
|
+
|
283
|
+
if (node.default) {
|
284
|
+
this.space();
|
285
|
+
this.token("=");
|
286
|
+
this.space();
|
287
|
+
this.print(node.default, node);
|
288
|
+
}
|
289
|
+
}
|
290
|
+
|
243
291
|
function TypeParameterInstantiation(node) {
|
244
|
-
/*istanbul ignore next*/
|
245
292
|
var _this = this;
|
246
293
|
|
247
|
-
this.
|
248
|
-
this.
|
249
|
-
|
250
|
-
|
251
|
-
/*istanbul ignore next*/_this.print(node.typeAnnotation, node);
|
294
|
+
this.token("<");
|
295
|
+
this.printList(node.params, node, {
|
296
|
+
iterator: function iterator(node) {
|
297
|
+
_this.print(node.typeAnnotation, node);
|
252
298
|
}
|
253
299
|
});
|
254
|
-
this.
|
300
|
+
this.token(">");
|
255
301
|
}
|
256
302
|
|
257
|
-
|
303
|
+
exports.TypeParameterDeclaration = TypeParameterInstantiation;
|
258
304
|
function ObjectTypeAnnotation(node) {
|
259
|
-
/*istanbul ignore next*/
|
260
305
|
var _this2 = this;
|
261
306
|
|
262
|
-
this.
|
307
|
+
this.token("{");
|
263
308
|
var props = node.properties.concat(node.callProperties, node.indexers);
|
264
309
|
|
265
310
|
if (props.length) {
|
266
311
|
this.space();
|
267
312
|
|
268
313
|
this.printJoin(props, node, {
|
269
|
-
separator: false,
|
270
314
|
indent: true,
|
271
|
-
iterator: function
|
315
|
+
iterator: function iterator() {
|
272
316
|
if (props.length !== 1) {
|
273
|
-
|
274
|
-
|
317
|
+
_this2.semicolon();
|
318
|
+
_this2.space();
|
275
319
|
}
|
276
320
|
}
|
277
321
|
});
|
@@ -279,33 +323,42 @@ function ObjectTypeAnnotation(node) {
|
|
279
323
|
this.space();
|
280
324
|
}
|
281
325
|
|
282
|
-
this.
|
326
|
+
this.token("}");
|
283
327
|
}
|
284
328
|
|
285
329
|
function ObjectTypeCallProperty(node) {
|
286
|
-
if (node.static)
|
330
|
+
if (node.static) {
|
331
|
+
this.word("static");
|
332
|
+
this.space();
|
333
|
+
}
|
287
334
|
this.print(node.value, node);
|
288
335
|
}
|
289
336
|
|
290
337
|
function ObjectTypeIndexer(node) {
|
291
|
-
if (node.static)
|
292
|
-
|
338
|
+
if (node.static) {
|
339
|
+
this.word("static");
|
340
|
+
this.space();
|
341
|
+
}
|
342
|
+
this.token("[");
|
293
343
|
this.print(node.id, node);
|
294
|
-
this.
|
344
|
+
this.token(":");
|
295
345
|
this.space();
|
296
346
|
this.print(node.key, node);
|
297
|
-
this.
|
298
|
-
this.
|
347
|
+
this.token("]");
|
348
|
+
this.token(":");
|
299
349
|
this.space();
|
300
350
|
this.print(node.value, node);
|
301
351
|
}
|
302
352
|
|
303
353
|
function ObjectTypeProperty(node) {
|
304
|
-
if (node.static)
|
354
|
+
if (node.static) {
|
355
|
+
this.word("static");
|
356
|
+
this.space();
|
357
|
+
}
|
305
358
|
this.print(node.key, node);
|
306
|
-
if (node.optional) this.
|
359
|
+
if (node.optional) this.token("?");
|
307
360
|
if (!t.isFunctionTypeAnnotation(node.value)) {
|
308
|
-
this.
|
361
|
+
this.token(":");
|
309
362
|
this.space();
|
310
363
|
}
|
311
364
|
this.print(node.value, node);
|
@@ -313,21 +366,27 @@ function ObjectTypeProperty(node) {
|
|
313
366
|
|
314
367
|
function QualifiedTypeIdentifier(node) {
|
315
368
|
this.print(node.qualification, node);
|
316
|
-
this.
|
369
|
+
this.token(".");
|
317
370
|
this.print(node.id, node);
|
318
371
|
}
|
319
372
|
|
373
|
+
function orSeparator() {
|
374
|
+
this.space();
|
375
|
+
this.token("|");
|
376
|
+
this.space();
|
377
|
+
}
|
378
|
+
|
320
379
|
function UnionTypeAnnotation(node) {
|
321
|
-
this.printJoin(node.types, node, { separator:
|
380
|
+
this.printJoin(node.types, node, { separator: orSeparator });
|
322
381
|
}
|
323
382
|
|
324
383
|
function TypeCastExpression(node) {
|
325
|
-
this.
|
384
|
+
this.token("(");
|
326
385
|
this.print(node.expression, node);
|
327
386
|
this.print(node.typeAnnotation, node);
|
328
|
-
this.
|
387
|
+
this.token(")");
|
329
388
|
}
|
330
389
|
|
331
390
|
function VoidTypeAnnotation() {
|
332
|
-
this.
|
391
|
+
this.word("void");
|
333
392
|
}
|