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

1856 lines
53 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 45,
"end": 701,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 54,
"end": 56,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 78,
"end": 98,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 78,
"end": 98,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 81,
"end": 98,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsMappedType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 83,
"end": 98,
"ctxt": 0
},
"readonly": null,
"typeParam": {
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 86,
"end": 92,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "P",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 91,
"end": 92,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 91,
"end": 92,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
},
"default": null
},
"nameType": null,
"optional": null,
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 95,
"end": 96,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 95,
"end": 96,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
},
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 100,
"end": 104,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 100,
"end": 104,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 101,
"end": 104,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 103,
"end": 104,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 103,
"end": 104,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 45,
"end": 260,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 106,
"end": 260,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 112,
"end": 131,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 118,
"end": 130,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 122,
"end": 130,
"ctxt": 0
},
"operator": "in",
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "k",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 127,
"end": 130,
"ctxt": 0
},
"value": "obj",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 136,
"end": 146,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 140,
"end": 145,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 140,
"end": 142,
"ctxt": 0
},
"value": "k1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 142,
"end": 145,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 144,
"end": 145,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 144,
"end": 145,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForInStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 151,
"end": 200,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 156,
"end": 158,
"ctxt": 0
},
"value": "k1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 162,
"end": 165,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 167,
"end": 200,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 177,
"end": 194,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 181,
"end": 193,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 181,
"end": 183,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 186,
"end": 193,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 186,
"end": 189,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Computed",
"span": {
2022-02-04 14:17:42 +03:00
"start": 189,
"end": 193,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 190,
"end": 192,
"ctxt": 0
},
"value": "k1",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
},
{
"type": "ForInStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 205,
"end": 258,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 210,
"end": 216,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 214,
"end": 216,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 214,
"end": 216,
"ctxt": 0
},
"value": "k2",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 220,
"end": 223,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 225,
"end": 258,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 235,
"end": 252,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 239,
"end": 251,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 239,
"end": 241,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 244,
"end": 251,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 244,
"end": 247,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Computed",
"span": {
2022-02-04 14:17:42 +03:00
"start": 247,
"end": 251,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 248,
"end": 250,
"ctxt": 0
},
"value": "k2",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 56,
"end": 77,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 57,
"end": 73,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 57,
"end": 58,
"ctxt": 0
},
"value": "K",
"optional": false
},
"constraint": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 67,
"end": 73,
"ctxt": 0
},
"kind": "string"
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 75,
"end": 76,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 75,
"end": 76,
"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": 271,
"end": 273,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 277,
"end": 306,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 277,
"end": 306,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 280,
"end": 306,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsMappedType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 282,
"end": 306,
"ctxt": 0
},
"readonly": null,
"typeParam": {
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 285,
"end": 297,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "P",
"optional": false
},
"constraint": {
"type": "TsTypeOperator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 290,
"end": 297,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 296,
"end": 297,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 296,
"end": 297,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"default": null
},
"nameType": null,
"optional": null,
"typeAnnotation": {
"type": "TsIndexedAccessType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 300,
"end": 304,
"ctxt": 0
},
"readonly": false,
"objectType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 300,
"end": 301,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 300,
"end": 301,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
"indexType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 302,
"end": 303,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 302,
"end": 303,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
}
}
}
}
},
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 308,
"end": 318,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 308,
"end": 318,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 309,
"end": 318,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 311,
"end": 318,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 317,
"end": 318,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 317,
"end": 318,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 262,
"end": 480,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 320,
"end": 480,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 326,
"end": 345,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 332,
"end": 344,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 332,
"end": 333,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 336,
"end": 344,
"ctxt": 0
},
"operator": "in",
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 336,
"end": 337,
"ctxt": 0
},
"value": "k",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 341,
"end": 344,
"ctxt": 0
},
"value": "obj",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 350,
"end": 366,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 354,
"end": 365,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 354,
"end": 356,
"ctxt": 0
},
"value": "k1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 356,
"end": 365,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 358,
"end": 365,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"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
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForInStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 371,
"end": 420,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 376,
"end": 378,
"ctxt": 0
},
"value": "k1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 382,
"end": 385,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 387,
"end": 420,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 397,
"end": 414,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 401,
"end": 413,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 401,
"end": 403,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 406,
"end": 413,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 406,
"end": 409,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Computed",
"span": {
2022-02-04 14:17:42 +03:00
"start": 409,
"end": 413,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 410,
"end": 412,
"ctxt": 0
},
"value": "k1",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
},
{
"type": "ForInStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 425,
"end": 478,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 430,
"end": 436,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 434,
"end": 436,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 434,
"end": 436,
"ctxt": 0
},
"value": "k2",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 440,
"end": 443,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 445,
"end": 478,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 455,
"end": 472,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 459,
"end": 471,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 459,
"end": 461,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 464,
"end": 471,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 464,
"end": 467,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Computed",
"span": {
2022-02-04 14:17:42 +03:00
"start": 467,
"end": 471,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 468,
"end": 470,
"ctxt": 0
},
"value": "k2",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 273,
"end": 276,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 274,
"end": 275,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 274,
"end": 275,
"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": 491,
"end": 493,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 516,
"end": 539,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 516,
"end": 539,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 519,
"end": 539,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsMappedType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 521,
"end": 539,
"ctxt": 0
},
"readonly": null,
"typeParam": {
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 524,
"end": 530,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 524,
"end": 525,
"ctxt": 0
},
"value": "P",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 529,
"end": 530,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 529,
"end": 530,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
},
"default": null
},
"nameType": null,
"optional": null,
"typeAnnotation": {
"type": "TsIndexedAccessType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 533,
"end": 537,
"ctxt": 0
},
"readonly": false,
"objectType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 533,
"end": 534,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 533,
"end": 534,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
"indexType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 535,
"end": 536,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 535,
"end": 536,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
}
}
}
}
},
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 541,
"end": 545,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 541,
"end": 545,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 542,
"end": 545,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 544,
"end": 545,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 544,
"end": 545,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 482,
"end": 701,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 547,
"end": 701,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 553,
"end": 572,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 559,
"end": 571,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 559,
"end": 560,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 563,
"end": 571,
"ctxt": 0
},
"operator": "in",
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 563,
"end": 564,
"ctxt": 0
},
"value": "k",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 568,
"end": 571,
"ctxt": 0
},
"value": "obj",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 577,
"end": 587,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 581,
"end": 586,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 581,
"end": 583,
"ctxt": 0
},
"value": "k1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 583,
"end": 586,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 585,
"end": 586,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 585,
"end": 586,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForInStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 592,
"end": 641,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 597,
"end": 599,
"ctxt": 0
},
"value": "k1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 603,
"end": 606,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 608,
"end": 641,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 618,
"end": 635,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 622,
"end": 634,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 622,
"end": 624,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 627,
"end": 634,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 627,
"end": 630,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Computed",
"span": {
2022-02-04 14:17:42 +03:00
"start": 630,
"end": 634,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 631,
"end": 633,
"ctxt": 0
},
"value": "k1",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
},
{
"type": "ForInStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 646,
"end": 699,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 651,
"end": 657,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 655,
"end": 657,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 655,
"end": 657,
"ctxt": 0
},
"value": "k2",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 661,
"end": 664,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 666,
"end": 699,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 676,
"end": 693,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 680,
"end": 692,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 680,
"end": 682,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 685,
"end": 692,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 685,
"end": 688,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Computed",
"span": {
2022-02-04 14:17:42 +03:00
"start": 688,
"end": 692,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 689,
"end": 691,
"ctxt": 0
},
"value": "k2",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 493,
"end": 515,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 494,
"end": 495,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 494,
"end": 495,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 497,
"end": 514,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 497,
"end": 498,
"ctxt": 0
},
"value": "K",
"optional": false
},
"constraint": {
"type": "TsTypeOperator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 507,
"end": 514,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 513,
"end": 514,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 513,
"end": 514,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"default": null
}
]
},
"returnType": null
}
],
"interpreter": null
}