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

1989 lines
52 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 40,
"end": 905,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 49,
"end": 51,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 55,
"end": 71,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 55,
"end": 71,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 56,
"end": 71,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 58,
"end": 71,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 58,
"end": 59,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 58,
"end": 59,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 62,
"end": 71,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 40,
"end": 107,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 73,
"end": 107,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 79,
"end": 95,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 86,
"end": 94,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 88,
"end": 91,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 91,
"end": 92,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 51,
"end": 54,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 52,
"end": 53,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 52,
"end": 53,
"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": 118,
"end": 120,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 124,
"end": 144,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 124,
"end": 144,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 125,
"end": 144,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 127,
"end": 144,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 127,
"end": 128,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 127,
"end": 128,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 131,
"end": 144,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 131,
"end": 132,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 135,
"end": 144,
"ctxt": 0
},
"kind": "undefined"
}
]
}
]
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 109,
"end": 170,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 146,
"end": 170,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 152,
"end": 168,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 159,
"end": 167,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 161,
"end": 164,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 164,
"end": 165,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 120,
"end": 123,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 121,
"end": 122,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 121,
"end": 122,
"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": 181,
"end": 183,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 205,
"end": 209,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 205,
"end": 209,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 206,
"end": 209,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 208,
"end": 209,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 172,
"end": 245,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 211,
"end": 245,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 217,
"end": 233,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 224,
"end": 232,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 226,
"end": 229,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 229,
"end": 230,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 183,
"end": 204,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 184,
"end": 203,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 184,
"end": 185,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 194,
"end": 203,
"ctxt": 0
},
"kind": "undefined"
},
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 256,
"end": 258,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 280,
"end": 293,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 280,
"end": 293,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 281,
"end": 293,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 283,
"end": 293,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 283,
"end": 289,
"ctxt": 0
},
"kind": "object"
},
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 292,
"end": 293,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 292,
"end": 293,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 247,
"end": 319,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 295,
"end": 319,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 301,
"end": 317,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 308,
"end": 316,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 310,
"end": 313,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 313,
"end": 314,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 258,
"end": 279,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 259,
"end": 278,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 259,
"end": 260,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 269,
"end": 278,
"ctxt": 0
},
"kind": "undefined"
},
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 330,
"end": 332,
"ctxt": 0
},
"value": "f5",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 357,
"end": 365,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 357,
"end": 365,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 358,
"end": 365,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 360,
"end": 365,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 360,
"end": 361,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 360,
"end": 361,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 364,
"end": 365,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 364,
"end": 365,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 321,
"end": 391,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 367,
"end": 391,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 373,
"end": 389,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 380,
"end": 388,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 382,
"end": 385,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 385,
"end": 386,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 332,
"end": 356,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 333,
"end": 334,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 333,
"end": 334,
"ctxt": 0
},
"value": "S",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 336,
"end": 355,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 336,
"end": 337,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 346,
"end": 355,
"ctxt": 0
},
"kind": "undefined"
},
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 402,
"end": 404,
"ctxt": 0
},
"value": "f6",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 435,
"end": 439,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 435,
"end": 439,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 436,
"end": 439,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 438,
"end": 439,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 438,
"end": 439,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 393,
"end": 465,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 441,
"end": 465,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 447,
"end": 463,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 454,
"end": 462,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 456,
"end": 459,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 459,
"end": 460,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 404,
"end": 434,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 405,
"end": 433,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 405,
"end": 406,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 415,
"end": 433,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 415,
"end": 421,
"ctxt": 0
},
"kind": "object"
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 424,
"end": 433,
"ctxt": 0
},
"kind": "undefined"
}
]
},
"default": null
}
]
},
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 498,
"end": 500,
"ctxt": 0
},
"value": "g1",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 553,
"end": 557,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 553,
"end": 557,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 554,
"end": 557,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 556,
"end": 557,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 556,
"end": 557,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 489,
"end": 616,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 559,
"end": 616,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 565,
"end": 581,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 571,
"end": 580,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
2022-02-04 14:17:42 +03:00
"start": 571,
"end": 576,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
2022-02-04 14:17:42 +03:00
"start": 573,
"end": 574,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 573,
"end": 574,
"ctxt": 0
},
"value": "z",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 579,
"end": 580,
"ctxt": 0
},
"value": "a",
"optional": false
},
"definite": false
}
]
},
{
"type": "ReturnStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 586,
"end": 614,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 593,
"end": 613,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 603,
"end": 606,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 606,
"end": 607,
"ctxt": 0
},
"value": "z",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 500,
"end": 552,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 501,
"end": 513,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 501,
"end": 502,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 511,
"end": 513,
"ctxt": 0
},
"members": []
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 515,
"end": 551,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 515,
"end": 516,
"ctxt": 0
},
"value": "A",
"optional": false
},
"constraint": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 525,
"end": 551,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 527,
"end": 549,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 527,
"end": 528,
"ctxt": 0
},
"value": "z",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 528,
"end": 549,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 530,
"end": 549,
"ctxt": 0
},
"types": [
{
"type": "TsParenthesizedType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 530,
"end": 545,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 531,
"end": 544,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 531,
"end": 532,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 531,
"end": 532,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 535,
"end": 544,
"ctxt": 0
},
"kind": "undefined"
}
]
}
},
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 548,
"end": 549,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 548,
"end": 549,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
},
"default": null
}
]
},
"returnType": null
},
{
"type": "TsInterfaceDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 640,
"end": 680,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 650,
"end": 660,
"ctxt": 0
},
"value": "DatafulFoo",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 660,
"end": 663,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 661,
"end": 662,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 661,
"end": 662,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
2022-02-04 14:17:42 +03:00
"start": 664,
"end": 680,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 670,
"end": 678,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 670,
"end": 674,
"ctxt": 0
},
"value": "data",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 674,
"end": 677,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 676,
"end": 677,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 676,
"end": 677,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 688,
"end": 691,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
2022-02-04 14:17:42 +03:00
"start": 682,
"end": 905,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
2022-02-04 14:17:42 +03:00
"start": 716,
"end": 736,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 716,
"end": 720,
"ctxt": 0
},
"value": "data",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 720,
"end": 735,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 722,
"end": 735,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 722,
"end": 723,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 722,
"end": 723,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 726,
"end": 735,
"ctxt": 0
},
"kind": "undefined"
}
]
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
2022-02-04 14:17:42 +03:00
"start": 741,
"end": 837,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 741,
"end": 744,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 741,
"end": 837,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 747,
"end": 837,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 757,
"end": 831,
"ctxt": 0
},
"test": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 761,
"end": 775,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 761,
"end": 773,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 761,
"end": 765,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 766,
"end": 773,
"ctxt": 0
},
"value": "hasData",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"consequent": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 777,
"end": 831,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 791,
"end": 821,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 791,
"end": 820,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 791,
"end": 818,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 791,
"end": 800,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 791,
"end": 795,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 796,
"end": 800,
"ctxt": 0
},
"value": "data",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 801,
"end": 818,
"ctxt": 0
},
"value": "toLocaleLowerCase",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"alternate": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
2022-02-04 14:17:42 +03:00
"start": 842,
"end": 903,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 842,
"end": 849,
"ctxt": 0
},
"value": "hasData",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 842,
"end": 903,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 875,
"end": 903,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 885,
"end": 897,
"ctxt": 0
},
"argument": {
"type": "BooleanLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 892,
"end": 896,
"ctxt": 0
},
"value": true
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 851,
"end": 874,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypePredicate",
"span": {
2022-02-04 14:17:42 +03:00
"start": 853,
"end": 874,
"ctxt": 0
},
"asserts": false,
"paramName": {
"type": "TsThisType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 853,
"end": 857,
"ctxt": 0
}
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 861,
"end": 874,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 861,
"end": 874,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 861,
"end": 871,
"ctxt": 0
},
"value": "DatafulFoo",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 871,
"end": 874,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 872,
"end": 873,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 872,
"end": 873,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 691,
"end": 709,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 692,
"end": 708,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 692,
"end": 693,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 702,
"end": 708,
"ctxt": 0
},
"kind": "string"
},
"default": null
}
]
},
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}