Skip to content

Commit eb4b1bd

Browse files
committed
Test TSIntersectionType
1 parent ac22adb commit eb4b1bd

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

packages/babel-parser/test/fixtures/typescript/types/union-intersection/input.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ type F = number & string
88
type K = | number | string
99
type M = & number & string
1010
type N = | number
11+
type O = & string

packages/babel-parser/test/fixtures/typescript/types/union-intersection/output.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"type": "File",
3-
"start":0,"end":283,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":17}},
3+
"start":0,"end":301,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":17}},
44
"program": {
55
"type": "Program",
6-
"start":0,"end":283,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":17}},
6+
"start":0,"end":301,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":17}},
77
"sourceType": "module",
88
"interpreter": null,
99
"body": [
@@ -281,6 +281,25 @@
281281
}
282282
]
283283
}
284+
},
285+
{
286+
"type": "TSTypeAliasDeclaration",
287+
"start":284,"end":301,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":17}},
288+
"id": {
289+
"type": "Identifier",
290+
"start":289,"end":290,"loc":{"start":{"line":11,"column":5},"end":{"line":11,"column":6},"identifierName":"O"},
291+
"name": "O"
292+
},
293+
"typeAnnotation": {
294+
"type": "TSIntersectionType",
295+
"start":293,"end":301,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":17}},
296+
"types": [
297+
{
298+
"type": "TSStringKeyword",
299+
"start":295,"end":301,"loc":{"start":{"line":11,"column":11},"end":{"line":11,"column":17}}
300+
}
301+
]
302+
}
284303
}
285304
],
286305
"directives": []

0 commit comments

Comments
 (0)