swc/crates/swc_ecma_parser/tests/tsc/inferFromBindingPattern.json
2022-02-04 17:08:38 +09:00

2139 lines
52 KiB
JSON

{
"type": "Script",
"span": {
"start": 18,
"end": 998,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 35,
"end": 37,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 18,
"end": 61,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 37,
"end": 55,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 38,
"end": 54,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsKeywordType",
"span": {
"start": 48,
"end": 54,
"ctxt": 0
},
"kind": "string"
},
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 57,
"end": 60,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 79,
"end": 81,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 62,
"end": 107,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 81,
"end": 99,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 82,
"end": 98,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 82,
"end": 83,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsKeywordType",
"span": {
"start": 92,
"end": 98,
"ctxt": 0
},
"kind": "string"
},
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 101,
"end": 106,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 103,
"end": 106,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
]
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 125,
"end": 127,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 108,
"end": 158,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 127,
"end": 145,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 128,
"end": 144,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsKeywordType",
"span": {
"start": 138,
"end": 144,
"ctxt": 0
},
"kind": "string"
},
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 147,
"end": 157,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 149,
"end": 157,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 151,
"end": 155,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 155,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 160,
"end": 174,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 164,
"end": 173,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 164,
"end": 166,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 169,
"end": 173,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 169,
"end": 171,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 193,
"end": 209,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 197,
"end": 208,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 197,
"end": 201,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 198,
"end": 200,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 204,
"end": 208,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 204,
"end": 206,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 226,
"end": 247,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 230,
"end": 246,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 230,
"end": 239,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 235,
"end": 237,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 242,
"end": 246,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 242,
"end": 244,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 291,
"end": 294,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 282,
"end": 337,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 314,
"end": 337,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 317,
"end": 335,
"ctxt": 0
},
"argument": {
"type": "ArrayExpression",
"span": {
"start": 324,
"end": 335,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "TsAsExpression",
"span": {
"start": 325,
"end": 334,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 325,
"end": 327,
"ctxt": 0
},
"value": 42.0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 331,
"end": 334,
"ctxt": 0
},
"kind": "any"
}
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 294,
"end": 306,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 295,
"end": 305,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 295,
"end": 296,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": {
"type": "TsKeywordType",
"span": {
"start": 299,
"end": 305,
"ctxt": 0
},
"kind": "number"
}
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 308,
"end": 313,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 310,
"end": 313,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 311,
"end": 312,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 311,
"end": 312,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 311,
"end": 312,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 338,
"end": 356,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 344,
"end": 355,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 344,
"end": 347,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 350,
"end": 355,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 350,
"end": 353,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 393,
"end": 452,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 403,
"end": 414,
"ctxt": 0
},
"value": "SelectProps",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 414,
"end": 420,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 415,
"end": 416,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 415,
"end": 416,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 418,
"end": 419,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 418,
"end": 419,
"ctxt": 0
},
"value": "K",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 421,
"end": 452,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 425,
"end": 450,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 425,
"end": 433,
"ctxt": 0
},
"value": "selector",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 434,
"end": 449,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 436,
"end": 449,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 437,
"end": 443,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 440,
"end": 443,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 442,
"end": 443,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 442,
"end": 443,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 445,
"end": 449,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 448,
"end": 449,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 448,
"end": 449,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
}
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 454,
"end": 487,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 459,
"end": 471,
"ctxt": 0
},
"value": "SelectResult",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 471,
"end": 477,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 472,
"end": 473,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 472,
"end": 473,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"value": "K",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 480,
"end": 486,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 481,
"end": 482,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 481,
"end": 482,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 481,
"end": 482,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
},
{
"type": "TsTupleElement",
"span": {
"start": 484,
"end": 485,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 484,
"end": 485,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 484,
"end": 485,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 489,
"end": 544,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 499,
"end": 505,
"ctxt": 0
},
"value": "Person",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 506,
"end": 544,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 510,
"end": 523,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 510,
"end": 514,
"ctxt": 0
},
"value": "name",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 514,
"end": 522,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 516,
"end": 522,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 526,
"end": 542,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 526,
"end": 533,
"ctxt": 0
},
"value": "surname",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 533,
"end": 541,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 535,
"end": 541,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 563,
"end": 573,
"ctxt": 0
},
"value": "selectJohn",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 586,
"end": 616,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 586,
"end": 616,
"ctxt": 0
},
"value": "props",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 592,
"end": 616,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 594,
"end": 616,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 594,
"end": 605,
"ctxt": 0
},
"value": "SelectProps",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 605,
"end": 616,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 606,
"end": 612,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 606,
"end": 612,
"ctxt": 0
},
"value": "Person",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 614,
"end": 615,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 614,
"end": 615,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 546,
"end": 643,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 573,
"end": 585,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 574,
"end": 584,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 574,
"end": 575,
"ctxt": 0
},
"value": "K",
"optional": false
},
"constraint": null,
"default": {
"type": "TsTypeReference",
"span": {
"start": 578,
"end": 584,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 578,
"end": 584,
"ctxt": 0
},
"value": "Person",
"optional": false
},
"typeParams": null
}
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 617,
"end": 642,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 619,
"end": 642,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 619,
"end": 631,
"ctxt": 0
},
"value": "SelectResult",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 631,
"end": 642,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 632,
"end": 638,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 632,
"end": 638,
"ctxt": 0
},
"value": "Person",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 640,
"end": 641,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 640,
"end": 641,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 645,
"end": 675,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 651,
"end": 674,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 651,
"end": 659,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 652,
"end": 658,
"ctxt": 0
},
"value": "person",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 662,
"end": 674,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 662,
"end": 672,
"ctxt": 0
},
"value": "selectJohn",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 676,
"end": 713,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 682,
"end": 712,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 682,
"end": 697,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 683,
"end": 686,
"ctxt": 0
},
"value": "any",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 688,
"end": 696,
"ctxt": 0
},
"value": "whatever",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 700,
"end": 712,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 700,
"end": 710,
"ctxt": 0
},
"value": "selectJohn",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 714,
"end": 740,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 720,
"end": 739,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 720,
"end": 724,
"ctxt": 0
},
"value": "john",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 727,
"end": 739,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 727,
"end": 737,
"ctxt": 0
},
"value": "selectJohn",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 741,
"end": 782,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 747,
"end": 781,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 747,
"end": 774,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 748,
"end": 759,
"ctxt": 0
},
"value": "personAgain",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 761,
"end": 773,
"ctxt": 0
},
"value": "nufinspecial",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 777,
"end": 781,
"ctxt": 0
},
"value": "john",
"optional": false
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 823,
"end": 832,
"ctxt": 0
},
"value": "makeTuple",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 837,
"end": 844,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 837,
"end": 844,
"ctxt": 0
},
"value": "arg",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 840,
"end": 844,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 842,
"end": 844,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 842,
"end": 844,
"ctxt": 0
},
"value": "T1",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 806,
"end": 852,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 832,
"end": 836,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 833,
"end": 835,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 833,
"end": 835,
"ctxt": 0
},
"value": "T1",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 845,
"end": 851,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 847,
"end": 851,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 848,
"end": 850,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 848,
"end": 850,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 848,
"end": 850,
"ctxt": 0
},
"value": "T1",
"optional": false
},
"typeParams": null
}
}
]
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 870,
"end": 877,
"ctxt": 0
},
"value": "stringy",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 890,
"end": 897,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 890,
"end": 897,
"ctxt": 0
},
"value": "arg",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 894,
"end": 897,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 896,
"end": 897,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 896,
"end": 897,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 853,
"end": 902,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 877,
"end": 889,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 878,
"end": 888,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 878,
"end": 879,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": {
"type": "TsKeywordType",
"span": {
"start": 882,
"end": 888,
"ctxt": 0
},
"kind": "string"
}
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 898,
"end": 901,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 900,
"end": 901,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 900,
"end": 901,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 904,
"end": 947,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 910,
"end": 946,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 910,
"end": 923,
"ctxt": 0
},
"value": "isStringTuple",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 926,
"end": 946,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 926,
"end": 935,
"ctxt": 0
},
"value": "makeTuple",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 936,
"end": 945,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 936,
"end": 943,
"ctxt": 0
},
"value": "stringy",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 961,
"end": 998,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 967,
"end": 997,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 967,
"end": 974,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 968,
"end": 973,
"ctxt": 0
},
"value": "isAny",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 977,
"end": 997,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 977,
"end": 986,
"ctxt": 0
},
"value": "makeTuple",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 987,
"end": 996,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 987,
"end": 994,
"ctxt": 0
},
"value": "stringy",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}