swc/crates/swc_ecma_parser/tests/tsc/intersectionNarrowing.json

1349 lines
36 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 41,
"end": 824,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 50,
"end": 52,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 56,
"end": 85,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 56,
"end": 85,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 57,
"end": 85,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 59,
"end": 85,
"ctxt": 0
},
"types": [
{
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 59,
"end": 69,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 59,
"end": 60,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 59,
"end": 60,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 63,
"end": 69,
"ctxt": 0
},
"kind": "string"
}
]
},
{
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 72,
"end": 85,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 72,
"end": 73,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 72,
"end": 73,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 76,
"end": 85,
"ctxt": 0
},
"kind": "undefined"
}
]
}
]
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 41,
"end": 152,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 87,
"end": 152,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 93,
"end": 150,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "x",
"optional": false
},
"consequent": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 100,
"end": 150,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 110,
"end": 112,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 110,
"end": 111,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": null
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 52,
"end": 55,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 53,
"end": 54,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 163,
"end": 165,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 169,
"end": 198,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 169,
"end": 198,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 170,
"end": 198,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 172,
"end": 198,
"ctxt": 0
},
"types": [
{
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 172,
"end": 182,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 172,
"end": 173,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 176,
"end": 182,
"ctxt": 0
},
"kind": "string"
}
]
},
{
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 185,
"end": 198,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 185,
"end": 186,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 185,
"end": 186,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 189,
"end": 198,
"ctxt": 0
},
"kind": "undefined"
}
]
}
]
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 154,
"end": 342,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 200,
"end": 342,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 206,
"end": 340,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 210,
"end": 225,
"ctxt": 0
},
"operator": "!==",
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 210,
"end": 211,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 216,
"end": 225,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"consequent": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 227,
"end": 277,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 237,
"end": 239,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 237,
"end": 238,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 287,
"end": 340,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 297,
"end": 299,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 165,
"end": 168,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 166,
"end": 167,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 166,
"end": 167,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 353,
"end": 355,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 359,
"end": 385,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 359,
"end": 385,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 360,
"end": 385,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 362,
"end": 385,
"ctxt": 0
},
"types": [
{
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 362,
"end": 372,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 362,
"end": 363,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 362,
"end": 363,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 366,
"end": 372,
"ctxt": 0
},
"kind": "string"
}
]
},
{
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 375,
"end": 385,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 375,
"end": 376,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 375,
"end": 376,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 379,
"end": 385,
"ctxt": 0
},
"kind": "number"
}
]
}
]
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 344,
"end": 532,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 387,
"end": 532,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 393,
"end": 530,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 397,
"end": 418,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "UnaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 397,
"end": 405,
"ctxt": 0
},
"operator": "typeof",
"argument": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 404,
"end": 405,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 410,
"end": 418,
"ctxt": 0
},
"value": "string",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 420,
"end": 470,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 430,
"end": 432,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 430,
"end": 431,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 480,
"end": 530,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 490,
"end": 492,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 490,
"end": 491,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 355,
"end": 358,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 356,
"end": 357,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 356,
"end": 357,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 543,
"end": 545,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 549,
"end": 565,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 549,
"end": 565,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 550,
"end": 565,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 552,
"end": 565,
"ctxt": 0
},
"types": [
{
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 552,
"end": 557,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 552,
"end": 553,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 552,
"end": 553,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsLiteralType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 556,
"end": 557,
"ctxt": 0
},
"literal": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 556,
"end": 557,
"ctxt": 0
},
"value": 1.0
}
}
]
},
{
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 560,
"end": 565,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 560,
"end": 561,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 560,
"end": 561,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsLiteralType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 564,
"end": 565,
"ctxt": 0
},
"literal": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 564,
"end": 565,
"ctxt": 0
},
"value": 2.0
}
}
]
}
]
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 534,
"end": 712,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 567,
"end": 712,
"ctxt": 0
},
"stmts": [
{
"type": "SwitchStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 573,
"end": 710,
"ctxt": 0
},
"discriminant": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 581,
"end": 582,
"ctxt": 0
},
"value": "x",
"optional": false
},
"cases": [
{
"type": "SwitchCase",
"span": {
2022-02-04 14:17:42 +03:00
"start": 594,
"end": 611,
"ctxt": 0
},
"test": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 599,
"end": 600,
"ctxt": 0
},
"value": 1.0
},
"consequent": [
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 602,
"end": 604,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 602,
"end": 603,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "BreakStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 605,
"end": 611,
"ctxt": 0
},
"label": null
}
]
},
{
"type": "SwitchCase",
"span": {
2022-02-04 14:17:42 +03:00
"start": 630,
"end": 647,
"ctxt": 0
},
"test": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 635,
"end": 636,
"ctxt": 0
},
"value": 2.0
},
"consequent": [
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 638,
"end": 640,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 638,
"end": 639,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "BreakStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 641,
"end": 647,
"ctxt": 0
},
"label": null
}
]
},
{
"type": "SwitchCase",
"span": {
2022-02-04 14:17:42 +03:00
"start": 666,
"end": 677,
"ctxt": 0
},
"test": null,
"consequent": [
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 675,
"end": 677,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 675,
"end": 676,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 545,
"end": 548,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 546,
"end": 547,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 546,
"end": 547,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 723,
"end": 725,
"ctxt": 0
},
"value": "f5",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 753,
"end": 766,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 753,
"end": 766,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 754,
"end": 766,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 756,
"end": 766,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 756,
"end": 757,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 756,
"end": 757,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 760,
"end": 766,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 714,
"end": 824,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 768,
"end": 824,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 774,
"end": 799,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 780,
"end": 798,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 780,
"end": 782,
"ctxt": 0
},
"value": "t1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 785,
"end": 798,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 785,
"end": 786,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 791,
"end": 798,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 725,
"end": 752,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 726,
"end": 751,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 726,
"end": 727,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 736,
"end": 751,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 736,
"end": 742,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 745,
"end": 751,
"ctxt": 0
},
"kind": "number"
}
]
},
"default": null
}
]
},
"returnType": null
}
],
"interpreter": null
}