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

143 lines
2.8 KiB
JSON

{
"type": "Module",
"span": {
"start": 86,
"end": 163,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 86,
"end": 105,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 86,
"end": 105,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 86,
"end": 97,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 86,
"end": 93,
"ctxt": 0
},
"value": "exports",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 94,
"end": 97,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 100,
"end": 105,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 127,
"end": 154,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 143,
"end": 154,
"ctxt": 0
},
"value": "./foo.cjs",
"raw": "\"./foo.cjs\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 155,
"end": 163,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 155,
"end": 162,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 155,
"end": 158,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 159,
"end": 162,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
}
],
"interpreter": null
}