Debian Codegraph @

packages/babel-parser/test/fixtures/flow/predicates/3/output.json

raw
1 {
2 "type": "File",
3 "start":0,"end":66,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":66,"index":66}},
4 "program": {
5 "type": "Program",
6 "start":0,"end":66,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":66,"index":66}},
7 "sourceType": "module",
8 "interpreter": null,
9 "body": [
10 {
11 "type": "FunctionDeclaration",
12 "start":0,"end":65,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":65,"index":65}},
13 "id": {
14 "type": "Identifier",
15 "start":9,"end":12,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":12,"index":12},"identifierName":"foo"},
16 "name": "foo"
17 },
18 "generator": false,
19 "async": false,
20 "params": [
21 {
22 "type": "Identifier",
23 "start":13,"end":21,"loc":{"start":{"line":1,"column":13,"index":13},"end":{"line":1,"column":21,"index":21},"identifierName":"x"},
24 "name": "x",
25 "typeAnnotation": {
26 "type": "TypeAnnotation",
27 "start":14,"end":21,"loc":{"start":{"line":1,"column":14,"index":14},"end":{"line":1,"column":21,"index":21}},
28 "typeAnnotation": {
29 "type": "MixedTypeAnnotation",
30 "start":16,"end":21,"loc":{"start":{"line":1,"column":16,"index":16},"end":{"line":1,"column":21,"index":21}}
31 }
32 }
33 }
34 ],
35 "predicate": {
36 "type": "InferredPredicate",
37 "start":24,"end":31,"loc":{"start":{"line":1,"column":24,"index":24},"end":{"line":1,"column":31,"index":31}}
38 },
39 "returnType": null,
40 "body": {
41 "type": "BlockStatement",
42 "start":32,"end":65,"loc":{"start":{"line":1,"column":32,"index":32},"end":{"line":1,"column":65,"index":65}},
43 "body": [
44 {
45 "type": "ReturnStatement",
46 "start":34,"end":63,"loc":{"start":{"line":1,"column":34,"index":34},"end":{"line":1,"column":63,"index":63}},
47 "argument": {
48 "type": "BinaryExpression",
49 "start":41,"end":62,"loc":{"start":{"line":1,"column":41,"index":41},"end":{"line":1,"column":62,"index":62}},
50 "left": {
51 "type": "UnaryExpression",
52 "start":41,"end":49,"loc":{"start":{"line":1,"column":41,"index":41},"end":{"line":1,"column":49,"index":49}},
53 "operator": "typeof",
54 "prefix": true,
55 "argument": {
56 "type": "Identifier",
57 "start":48,"end":49,"loc":{"start":{"line":1,"column":48,"index":48},"end":{"line":1,"column":49,"index":49},"identifierName":"x"},
58 "name": "x"
59 }
60 },
61 "operator": "===",
62 "right": {
63 "type": "StringLiteral",
64 "start":54,"end":62,"loc":{"start":{"line":1,"column":54,"index":54},"end":{"line":1,"column":62,"index":62}},
65 "extra": {
66 "rawValue": "string",
67 "raw": "\"string\""
68 },
69 "value": "string"
70 }
71 }
72 }
73 ],
74 "directives": []
75 }
76 },
77 {
78 "type": "EmptyStatement",
79 "start":65,"end":66,"loc":{"start":{"line":1,"column":65,"index":65},"end":{"line":1,"column":66,"index":66}}
80 }
81 ],
82 "directives": []
83 }
84 }