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
@@ -0,0 +1,354 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _index = require("./index");
|
4
|
+
|
5
|
+
var _index2 = _interopRequireDefault(_index);
|
6
|
+
|
7
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
+
|
9
|
+
(0, _index2.default)("AssignmentPattern", {
|
10
|
+
visitor: ["left", "right"],
|
11
|
+
aliases: ["Pattern", "LVal"],
|
12
|
+
fields: {
|
13
|
+
left: {
|
14
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
15
|
+
},
|
16
|
+
right: {
|
17
|
+
validate: (0, _index.assertNodeType)("Expression")
|
18
|
+
},
|
19
|
+
decorators: {
|
20
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}); /* eslint max-len: 0 */
|
24
|
+
|
25
|
+
(0, _index2.default)("ArrayPattern", {
|
26
|
+
visitor: ["elements", "typeAnnotation"],
|
27
|
+
aliases: ["Pattern", "LVal"],
|
28
|
+
fields: {
|
29
|
+
elements: {
|
30
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression")))
|
31
|
+
},
|
32
|
+
decorators: {
|
33
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
|
34
|
+
}
|
35
|
+
}
|
36
|
+
});
|
37
|
+
|
38
|
+
(0, _index2.default)("ArrowFunctionExpression", {
|
39
|
+
builder: ["params", "body", "async"],
|
40
|
+
visitor: ["params", "body", "returnType"],
|
41
|
+
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
|
42
|
+
fields: {
|
43
|
+
params: {
|
44
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal")))
|
45
|
+
},
|
46
|
+
body: {
|
47
|
+
validate: (0, _index.assertNodeType)("BlockStatement", "Expression")
|
48
|
+
},
|
49
|
+
async: {
|
50
|
+
validate: (0, _index.assertValueType)("boolean"),
|
51
|
+
default: false
|
52
|
+
}
|
53
|
+
}
|
54
|
+
});
|
55
|
+
|
56
|
+
(0, _index2.default)("ClassBody", {
|
57
|
+
visitor: ["body"],
|
58
|
+
fields: {
|
59
|
+
body: {
|
60
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ClassMethod", "ClassProperty")))
|
61
|
+
}
|
62
|
+
}
|
63
|
+
});
|
64
|
+
|
65
|
+
(0, _index2.default)("ClassDeclaration", {
|
66
|
+
builder: ["id", "superClass", "body", "decorators"],
|
67
|
+
visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
|
68
|
+
aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"],
|
69
|
+
fields: {
|
70
|
+
id: {
|
71
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
72
|
+
},
|
73
|
+
body: {
|
74
|
+
validate: (0, _index.assertNodeType)("ClassBody")
|
75
|
+
},
|
76
|
+
superClass: {
|
77
|
+
optional: true,
|
78
|
+
validate: (0, _index.assertNodeType)("Expression")
|
79
|
+
},
|
80
|
+
decorators: {
|
81
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
|
82
|
+
}
|
83
|
+
}
|
84
|
+
});
|
85
|
+
|
86
|
+
(0, _index2.default)("ClassExpression", {
|
87
|
+
inherits: "ClassDeclaration",
|
88
|
+
aliases: ["Scopable", "Class", "Expression", "Pureish"],
|
89
|
+
fields: {
|
90
|
+
id: {
|
91
|
+
optional: true,
|
92
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
93
|
+
},
|
94
|
+
body: {
|
95
|
+
validate: (0, _index.assertNodeType)("ClassBody")
|
96
|
+
},
|
97
|
+
superClass: {
|
98
|
+
optional: true,
|
99
|
+
validate: (0, _index.assertNodeType)("Expression")
|
100
|
+
},
|
101
|
+
decorators: {
|
102
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
|
103
|
+
}
|
104
|
+
}
|
105
|
+
});
|
106
|
+
|
107
|
+
(0, _index2.default)("ExportAllDeclaration", {
|
108
|
+
visitor: ["source"],
|
109
|
+
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
|
110
|
+
fields: {
|
111
|
+
source: {
|
112
|
+
validate: (0, _index.assertNodeType)("StringLiteral")
|
113
|
+
}
|
114
|
+
}
|
115
|
+
});
|
116
|
+
|
117
|
+
(0, _index2.default)("ExportDefaultDeclaration", {
|
118
|
+
visitor: ["declaration"],
|
119
|
+
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
|
120
|
+
fields: {
|
121
|
+
declaration: {
|
122
|
+
validate: (0, _index.assertNodeType)("FunctionDeclaration", "ClassDeclaration", "Expression")
|
123
|
+
}
|
124
|
+
}
|
125
|
+
});
|
126
|
+
|
127
|
+
(0, _index2.default)("ExportNamedDeclaration", {
|
128
|
+
visitor: ["declaration", "specifiers", "source"],
|
129
|
+
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
|
130
|
+
fields: {
|
131
|
+
declaration: {
|
132
|
+
validate: (0, _index.assertNodeType)("Declaration"),
|
133
|
+
optional: true
|
134
|
+
},
|
135
|
+
specifiers: {
|
136
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ExportSpecifier")))
|
137
|
+
},
|
138
|
+
source: {
|
139
|
+
validate: (0, _index.assertNodeType)("StringLiteral"),
|
140
|
+
optional: true
|
141
|
+
}
|
142
|
+
}
|
143
|
+
});
|
144
|
+
|
145
|
+
(0, _index2.default)("ExportSpecifier", {
|
146
|
+
visitor: ["local", "exported"],
|
147
|
+
aliases: ["ModuleSpecifier"],
|
148
|
+
fields: {
|
149
|
+
local: {
|
150
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
151
|
+
},
|
152
|
+
exported: {
|
153
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
154
|
+
}
|
155
|
+
}
|
156
|
+
});
|
157
|
+
|
158
|
+
(0, _index2.default)("ForOfStatement", {
|
159
|
+
visitor: ["left", "right", "body"],
|
160
|
+
aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
|
161
|
+
fields: {
|
162
|
+
left: {
|
163
|
+
validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal")
|
164
|
+
},
|
165
|
+
right: {
|
166
|
+
validate: (0, _index.assertNodeType)("Expression")
|
167
|
+
},
|
168
|
+
body: {
|
169
|
+
validate: (0, _index.assertNodeType)("Statement")
|
170
|
+
}
|
171
|
+
}
|
172
|
+
});
|
173
|
+
|
174
|
+
(0, _index2.default)("ImportDeclaration", {
|
175
|
+
visitor: ["specifiers", "source"],
|
176
|
+
aliases: ["Statement", "Declaration", "ModuleDeclaration"],
|
177
|
+
fields: {
|
178
|
+
specifiers: {
|
179
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
|
180
|
+
},
|
181
|
+
source: {
|
182
|
+
validate: (0, _index.assertNodeType)("StringLiteral")
|
183
|
+
}
|
184
|
+
}
|
185
|
+
});
|
186
|
+
|
187
|
+
(0, _index2.default)("ImportDefaultSpecifier", {
|
188
|
+
visitor: ["local"],
|
189
|
+
aliases: ["ModuleSpecifier"],
|
190
|
+
fields: {
|
191
|
+
local: {
|
192
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
193
|
+
}
|
194
|
+
}
|
195
|
+
});
|
196
|
+
|
197
|
+
(0, _index2.default)("ImportNamespaceSpecifier", {
|
198
|
+
visitor: ["local"],
|
199
|
+
aliases: ["ModuleSpecifier"],
|
200
|
+
fields: {
|
201
|
+
local: {
|
202
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
203
|
+
}
|
204
|
+
}
|
205
|
+
});
|
206
|
+
|
207
|
+
(0, _index2.default)("ImportSpecifier", {
|
208
|
+
visitor: ["local", "imported"],
|
209
|
+
aliases: ["ModuleSpecifier"],
|
210
|
+
fields: {
|
211
|
+
local: {
|
212
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
213
|
+
},
|
214
|
+
imported: {
|
215
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
216
|
+
}
|
217
|
+
}
|
218
|
+
});
|
219
|
+
|
220
|
+
(0, _index2.default)("MetaProperty", {
|
221
|
+
visitor: ["meta", "property"],
|
222
|
+
aliases: ["Expression"],
|
223
|
+
fields: {
|
224
|
+
// todo: limit to new.target
|
225
|
+
meta: {
|
226
|
+
validate: (0, _index.assertValueType)("string")
|
227
|
+
},
|
228
|
+
property: {
|
229
|
+
validate: (0, _index.assertValueType)("string")
|
230
|
+
}
|
231
|
+
}
|
232
|
+
});
|
233
|
+
|
234
|
+
(0, _index2.default)("ClassMethod", {
|
235
|
+
aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
|
236
|
+
builder: ["kind", "key", "params", "body", "computed", "static"],
|
237
|
+
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
|
238
|
+
fields: {
|
239
|
+
kind: {
|
240
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("string"), (0, _index.assertOneOf)("get", "set", "method", "constructor")),
|
241
|
+
default: "method"
|
242
|
+
},
|
243
|
+
computed: {
|
244
|
+
default: false,
|
245
|
+
validate: (0, _index.assertValueType)("boolean")
|
246
|
+
},
|
247
|
+
static: {
|
248
|
+
default: false,
|
249
|
+
validate: (0, _index.assertValueType)("boolean")
|
250
|
+
},
|
251
|
+
key: {
|
252
|
+
validate: function validate(node, key, val) {
|
253
|
+
var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
|
254
|
+
_index.assertNodeType.apply(undefined, expectedTypes)(node, key, val);
|
255
|
+
}
|
256
|
+
},
|
257
|
+
params: {
|
258
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal")))
|
259
|
+
},
|
260
|
+
body: {
|
261
|
+
validate: (0, _index.assertNodeType)("BlockStatement")
|
262
|
+
},
|
263
|
+
generator: {
|
264
|
+
default: false,
|
265
|
+
validate: (0, _index.assertValueType)("boolean")
|
266
|
+
},
|
267
|
+
async: {
|
268
|
+
default: false,
|
269
|
+
validate: (0, _index.assertValueType)("boolean")
|
270
|
+
}
|
271
|
+
}
|
272
|
+
});
|
273
|
+
|
274
|
+
(0, _index2.default)("ObjectPattern", {
|
275
|
+
visitor: ["properties", "typeAnnotation"],
|
276
|
+
aliases: ["Pattern", "LVal"],
|
277
|
+
fields: {
|
278
|
+
properties: {
|
279
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("RestProperty", "Property")))
|
280
|
+
},
|
281
|
+
decorators: {
|
282
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
|
283
|
+
}
|
284
|
+
}
|
285
|
+
});
|
286
|
+
|
287
|
+
(0, _index2.default)("SpreadElement", {
|
288
|
+
visitor: ["argument"],
|
289
|
+
aliases: ["UnaryLike"],
|
290
|
+
fields: {
|
291
|
+
argument: {
|
292
|
+
validate: (0, _index.assertNodeType)("Expression")
|
293
|
+
}
|
294
|
+
}
|
295
|
+
});
|
296
|
+
|
297
|
+
(0, _index2.default)("Super", {
|
298
|
+
aliases: ["Expression"]
|
299
|
+
});
|
300
|
+
|
301
|
+
(0, _index2.default)("TaggedTemplateExpression", {
|
302
|
+
visitor: ["tag", "quasi"],
|
303
|
+
aliases: ["Expression"],
|
304
|
+
fields: {
|
305
|
+
tag: {
|
306
|
+
validate: (0, _index.assertNodeType)("Expression")
|
307
|
+
},
|
308
|
+
quasi: {
|
309
|
+
validate: (0, _index.assertNodeType)("TemplateLiteral")
|
310
|
+
}
|
311
|
+
}
|
312
|
+
});
|
313
|
+
|
314
|
+
(0, _index2.default)("TemplateElement", {
|
315
|
+
builder: ["value", "tail"],
|
316
|
+
fields: {
|
317
|
+
value: {
|
318
|
+
// todo: flatten `raw` into main node
|
319
|
+
},
|
320
|
+
tail: {
|
321
|
+
validate: (0, _index.assertValueType)("boolean"),
|
322
|
+
default: false
|
323
|
+
}
|
324
|
+
}
|
325
|
+
});
|
326
|
+
|
327
|
+
(0, _index2.default)("TemplateLiteral", {
|
328
|
+
visitor: ["quasis", "expressions"],
|
329
|
+
aliases: ["Expression", "Literal"],
|
330
|
+
fields: {
|
331
|
+
quasis: {
|
332
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("TemplateElement")))
|
333
|
+
},
|
334
|
+
expressions: {
|
335
|
+
validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression")))
|
336
|
+
}
|
337
|
+
}
|
338
|
+
});
|
339
|
+
|
340
|
+
(0, _index2.default)("YieldExpression", {
|
341
|
+
builder: ["argument", "delegate"],
|
342
|
+
visitor: ["argument"],
|
343
|
+
aliases: ["Expression", "Terminatorless"],
|
344
|
+
fields: {
|
345
|
+
delegate: {
|
346
|
+
validate: (0, _index.assertValueType)("boolean"),
|
347
|
+
default: false
|
348
|
+
},
|
349
|
+
argument: {
|
350
|
+
optional: true,
|
351
|
+
validate: (0, _index.assertNodeType)("Expression")
|
352
|
+
}
|
353
|
+
}
|
354
|
+
});
|
@@ -0,0 +1,85 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _index = require("./index");
|
4
|
+
|
5
|
+
var _index2 = _interopRequireDefault(_index);
|
6
|
+
|
7
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
+
|
9
|
+
(0, _index2.default)("AwaitExpression", {
|
10
|
+
builder: ["argument"],
|
11
|
+
visitor: ["argument"],
|
12
|
+
aliases: ["Expression", "Terminatorless"],
|
13
|
+
fields: {
|
14
|
+
argument: {
|
15
|
+
validate: (0, _index.assertNodeType)("Expression")
|
16
|
+
}
|
17
|
+
}
|
18
|
+
});
|
19
|
+
|
20
|
+
(0, _index2.default)("BindExpression", {
|
21
|
+
visitor: ["object", "callee"],
|
22
|
+
aliases: ["Expression"],
|
23
|
+
fields: {
|
24
|
+
// todo
|
25
|
+
}
|
26
|
+
});
|
27
|
+
|
28
|
+
(0, _index2.default)("Decorator", {
|
29
|
+
visitor: ["expression"],
|
30
|
+
fields: {
|
31
|
+
expression: {
|
32
|
+
validate: (0, _index.assertNodeType)("Expression")
|
33
|
+
}
|
34
|
+
}
|
35
|
+
});
|
36
|
+
|
37
|
+
(0, _index2.default)("DoExpression", {
|
38
|
+
visitor: ["body"],
|
39
|
+
aliases: ["Expression"],
|
40
|
+
fields: {
|
41
|
+
body: {
|
42
|
+
validate: (0, _index.assertNodeType)("BlockStatement")
|
43
|
+
}
|
44
|
+
}
|
45
|
+
});
|
46
|
+
|
47
|
+
(0, _index2.default)("ExportDefaultSpecifier", {
|
48
|
+
visitor: ["exported"],
|
49
|
+
aliases: ["ModuleSpecifier"],
|
50
|
+
fields: {
|
51
|
+
exported: {
|
52
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
53
|
+
}
|
54
|
+
}
|
55
|
+
});
|
56
|
+
|
57
|
+
(0, _index2.default)("ExportNamespaceSpecifier", {
|
58
|
+
visitor: ["exported"],
|
59
|
+
aliases: ["ModuleSpecifier"],
|
60
|
+
fields: {
|
61
|
+
exported: {
|
62
|
+
validate: (0, _index.assertNodeType)("Identifier")
|
63
|
+
}
|
64
|
+
}
|
65
|
+
});
|
66
|
+
|
67
|
+
(0, _index2.default)("RestProperty", {
|
68
|
+
visitor: ["argument"],
|
69
|
+
aliases: ["UnaryLike"],
|
70
|
+
fields: {
|
71
|
+
argument: {
|
72
|
+
validate: (0, _index.assertNodeType)("LVal")
|
73
|
+
}
|
74
|
+
}
|
75
|
+
});
|
76
|
+
|
77
|
+
(0, _index2.default)("SpreadProperty", {
|
78
|
+
visitor: ["argument"],
|
79
|
+
aliases: ["UnaryLike"],
|
80
|
+
fields: {
|
81
|
+
argument: {
|
82
|
+
validate: (0, _index.assertNodeType)("Expression")
|
83
|
+
}
|
84
|
+
}
|
85
|
+
});
|
@@ -0,0 +1,319 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _index = require("./index");
|
4
|
+
|
5
|
+
var _index2 = _interopRequireDefault(_index);
|
6
|
+
|
7
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
+
|
9
|
+
(0, _index2.default)("AnyTypeAnnotation", {
|
10
|
+
aliases: ["Flow", "FlowBaseAnnotation"],
|
11
|
+
fields: {
|
12
|
+
// todo
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
(0, _index2.default)("ArrayTypeAnnotation", {
|
17
|
+
visitor: ["elementType"],
|
18
|
+
aliases: ["Flow"],
|
19
|
+
fields: {
|
20
|
+
// todo
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
(0, _index2.default)("BooleanTypeAnnotation", {
|
25
|
+
aliases: ["Flow", "FlowBaseAnnotation"],
|
26
|
+
fields: {
|
27
|
+
// todo
|
28
|
+
}
|
29
|
+
});
|
30
|
+
|
31
|
+
(0, _index2.default)("BooleanLiteralTypeAnnotation", {
|
32
|
+
aliases: ["Flow"],
|
33
|
+
fields: {}
|
34
|
+
});
|
35
|
+
|
36
|
+
(0, _index2.default)("NullLiteralTypeAnnotation", {
|
37
|
+
aliases: ["Flow", "FlowBaseAnnotation"],
|
38
|
+
fields: {}
|
39
|
+
});
|
40
|
+
|
41
|
+
(0, _index2.default)("ClassImplements", {
|
42
|
+
visitor: ["id", "typeParameters"],
|
43
|
+
aliases: ["Flow"],
|
44
|
+
fields: {
|
45
|
+
// todo
|
46
|
+
}
|
47
|
+
});
|
48
|
+
|
49
|
+
(0, _index2.default)("ClassProperty", {
|
50
|
+
visitor: ["key", "value", "typeAnnotation", "decorators"],
|
51
|
+
aliases: ["Flow", "Property"],
|
52
|
+
fields: {
|
53
|
+
// todo
|
54
|
+
}
|
55
|
+
});
|
56
|
+
|
57
|
+
(0, _index2.default)("DeclareClass", {
|
58
|
+
visitor: ["id", "typeParameters", "extends", "body"],
|
59
|
+
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
60
|
+
fields: {
|
61
|
+
// todo
|
62
|
+
}
|
63
|
+
});
|
64
|
+
|
65
|
+
(0, _index2.default)("DeclareFunction", {
|
66
|
+
visitor: ["id"],
|
67
|
+
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
68
|
+
fields: {
|
69
|
+
// todo
|
70
|
+
}
|
71
|
+
});
|
72
|
+
|
73
|
+
(0, _index2.default)("DeclareInterface", {
|
74
|
+
visitor: ["id", "typeParameters", "extends", "body"],
|
75
|
+
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
76
|
+
fields: {
|
77
|
+
// todo
|
78
|
+
}
|
79
|
+
});
|
80
|
+
|
81
|
+
(0, _index2.default)("DeclareModule", {
|
82
|
+
visitor: ["id", "body"],
|
83
|
+
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
84
|
+
fields: {
|
85
|
+
// todo
|
86
|
+
}
|
87
|
+
});
|
88
|
+
|
89
|
+
(0, _index2.default)("DeclareTypeAlias", {
|
90
|
+
visitor: ["id", "typeParameters", "right"],
|
91
|
+
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
92
|
+
fields: {
|
93
|
+
// todo
|
94
|
+
}
|
95
|
+
});
|
96
|
+
|
97
|
+
(0, _index2.default)("DeclareVariable", {
|
98
|
+
visitor: ["id"],
|
99
|
+
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
100
|
+
fields: {
|
101
|
+
// todo
|
102
|
+
}
|
103
|
+
});
|
104
|
+
|
105
|
+
(0, _index2.default)("ExistentialTypeParam", {
|
106
|
+
aliases: ["Flow"]
|
107
|
+
});
|
108
|
+
|
109
|
+
(0, _index2.default)("FunctionTypeAnnotation", {
|
110
|
+
visitor: ["typeParameters", "params", "rest", "returnType"],
|
111
|
+
aliases: ["Flow"],
|
112
|
+
fields: {
|
113
|
+
// todo
|
114
|
+
}
|
115
|
+
});
|
116
|
+
|
117
|
+
(0, _index2.default)("FunctionTypeParam", {
|
118
|
+
visitor: ["name", "typeAnnotation"],
|
119
|
+
aliases: ["Flow"],
|
120
|
+
fields: {
|
121
|
+
// todo
|
122
|
+
}
|
123
|
+
});
|
124
|
+
|
125
|
+
(0, _index2.default)("GenericTypeAnnotation", {
|
126
|
+
visitor: ["id", "typeParameters"],
|
127
|
+
aliases: ["Flow"],
|
128
|
+
fields: {
|
129
|
+
// todo
|
130
|
+
}
|
131
|
+
});
|
132
|
+
|
133
|
+
(0, _index2.default)("InterfaceExtends", {
|
134
|
+
visitor: ["id", "typeParameters"],
|
135
|
+
aliases: ["Flow"],
|
136
|
+
fields: {
|
137
|
+
// todo
|
138
|
+
}
|
139
|
+
});
|
140
|
+
|
141
|
+
(0, _index2.default)("InterfaceDeclaration", {
|
142
|
+
visitor: ["id", "typeParameters", "extends", "body"],
|
143
|
+
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
144
|
+
fields: {
|
145
|
+
// todo
|
146
|
+
}
|
147
|
+
});
|
148
|
+
|
149
|
+
(0, _index2.default)("IntersectionTypeAnnotation", {
|
150
|
+
visitor: ["types"],
|
151
|
+
aliases: ["Flow"],
|
152
|
+
fields: {
|
153
|
+
// todo
|
154
|
+
}
|
155
|
+
});
|
156
|
+
|
157
|
+
(0, _index2.default)("MixedTypeAnnotation", {
|
158
|
+
aliases: ["Flow", "FlowBaseAnnotation"]
|
159
|
+
});
|
160
|
+
|
161
|
+
(0, _index2.default)("NullableTypeAnnotation", {
|
162
|
+
visitor: ["typeAnnotation"],
|
163
|
+
aliases: ["Flow"],
|
164
|
+
fields: {
|
165
|
+
// todo
|
166
|
+
}
|
167
|
+
});
|
168
|
+
|
169
|
+
(0, _index2.default)("NumericLiteralTypeAnnotation", {
|
170
|
+
aliases: ["Flow"],
|
171
|
+
fields: {
|
172
|
+
// todo
|
173
|
+
}
|
174
|
+
});
|
175
|
+
|
176
|
+
(0, _index2.default)("NumberTypeAnnotation", {
|
177
|
+
aliases: ["Flow", "FlowBaseAnnotation"],
|
178
|
+
fields: {
|
179
|
+
// todo
|
180
|
+
}
|
181
|
+
});
|
182
|
+
|
183
|
+
(0, _index2.default)("StringLiteralTypeAnnotation", {
|
184
|
+
aliases: ["Flow"],
|
185
|
+
fields: {
|
186
|
+
// todo
|
187
|
+
}
|
188
|
+
});
|
189
|
+
|
190
|
+
(0, _index2.default)("StringTypeAnnotation", {
|
191
|
+
aliases: ["Flow", "FlowBaseAnnotation"],
|
192
|
+
fields: {
|
193
|
+
// todo
|
194
|
+
}
|
195
|
+
});
|
196
|
+
|
197
|
+
(0, _index2.default)("ThisTypeAnnotation", {
|
198
|
+
aliases: ["Flow", "FlowBaseAnnotation"],
|
199
|
+
fields: {}
|
200
|
+
});
|
201
|
+
|
202
|
+
(0, _index2.default)("TupleTypeAnnotation", {
|
203
|
+
visitor: ["types"],
|
204
|
+
aliases: ["Flow"],
|
205
|
+
fields: {
|
206
|
+
// todo
|
207
|
+
}
|
208
|
+
});
|
209
|
+
|
210
|
+
(0, _index2.default)("TypeofTypeAnnotation", {
|
211
|
+
visitor: ["argument"],
|
212
|
+
aliases: ["Flow"],
|
213
|
+
fields: {
|
214
|
+
// todo
|
215
|
+
}
|
216
|
+
});
|
217
|
+
|
218
|
+
(0, _index2.default)("TypeAlias", {
|
219
|
+
visitor: ["id", "typeParameters", "right"],
|
220
|
+
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
|
221
|
+
fields: {
|
222
|
+
// todo
|
223
|
+
}
|
224
|
+
});
|
225
|
+
|
226
|
+
(0, _index2.default)("TypeAnnotation", {
|
227
|
+
visitor: ["typeAnnotation"],
|
228
|
+
aliases: ["Flow"],
|
229
|
+
fields: {
|
230
|
+
// todo
|
231
|
+
}
|
232
|
+
});
|
233
|
+
|
234
|
+
(0, _index2.default)("TypeCastExpression", {
|
235
|
+
visitor: ["expression", "typeAnnotation"],
|
236
|
+
aliases: ["Flow", "ExpressionWrapper", "Expression"],
|
237
|
+
fields: {
|
238
|
+
// todo
|
239
|
+
}
|
240
|
+
});
|
241
|
+
|
242
|
+
(0, _index2.default)("TypeParameter", {
|
243
|
+
visitor: ["bound"],
|
244
|
+
aliases: ["Flow"],
|
245
|
+
fields: {
|
246
|
+
// todo
|
247
|
+
}
|
248
|
+
});
|
249
|
+
|
250
|
+
(0, _index2.default)("TypeParameterDeclaration", {
|
251
|
+
visitor: ["params"],
|
252
|
+
aliases: ["Flow"],
|
253
|
+
fields: {
|
254
|
+
// todo
|
255
|
+
}
|
256
|
+
});
|
257
|
+
|
258
|
+
(0, _index2.default)("TypeParameterInstantiation", {
|
259
|
+
visitor: ["params"],
|
260
|
+
aliases: ["Flow"],
|
261
|
+
fields: {
|
262
|
+
// todo
|
263
|
+
}
|
264
|
+
});
|
265
|
+
|
266
|
+
(0, _index2.default)("ObjectTypeAnnotation", {
|
267
|
+
visitor: ["properties", "indexers", "callProperties"],
|
268
|
+
aliases: ["Flow"],
|
269
|
+
fields: {
|
270
|
+
// todo
|
271
|
+
}
|
272
|
+
});
|
273
|
+
|
274
|
+
(0, _index2.default)("ObjectTypeCallProperty", {
|
275
|
+
visitor: ["value"],
|
276
|
+
aliases: ["Flow", "UserWhitespacable"],
|
277
|
+
fields: {
|
278
|
+
// todo
|
279
|
+
}
|
280
|
+
});
|
281
|
+
|
282
|
+
(0, _index2.default)("ObjectTypeIndexer", {
|
283
|
+
visitor: ["id", "key", "value"],
|
284
|
+
aliases: ["Flow", "UserWhitespacable"],
|
285
|
+
fields: {
|
286
|
+
// todo
|
287
|
+
}
|
288
|
+
});
|
289
|
+
|
290
|
+
(0, _index2.default)("ObjectTypeProperty", {
|
291
|
+
visitor: ["key", "value"],
|
292
|
+
aliases: ["Flow", "UserWhitespacable"],
|
293
|
+
fields: {
|
294
|
+
// todo
|
295
|
+
}
|
296
|
+
});
|
297
|
+
|
298
|
+
(0, _index2.default)("QualifiedTypeIdentifier", {
|
299
|
+
visitor: ["id", "qualification"],
|
300
|
+
aliases: ["Flow"],
|
301
|
+
fields: {
|
302
|
+
// todo
|
303
|
+
}
|
304
|
+
});
|
305
|
+
|
306
|
+
(0, _index2.default)("UnionTypeAnnotation", {
|
307
|
+
visitor: ["types"],
|
308
|
+
aliases: ["Flow"],
|
309
|
+
fields: {
|
310
|
+
// todo
|
311
|
+
}
|
312
|
+
});
|
313
|
+
|
314
|
+
(0, _index2.default)("VoidTypeAnnotation", {
|
315
|
+
aliases: ["Flow", "FlowBaseAnnotation"],
|
316
|
+
fields: {
|
317
|
+
// todo
|
318
|
+
}
|
319
|
+
});
|