I have the following jsondata.json
file:
{
"name": "John",
"age": 30,
"car": "ferrari"
}
In the same directory, I have a typescript file main.ts
where I simply congole.log
the json from the jsondata.json
import * as j from './jsondata.json';
console.log(j);
The result is surprising:
{
name: 'John',
age: 30,
car: 'ferrari',
default: { name: 'John', age: 30, car: 'ferrari' }
}
What is that default
field? Why does it appear, and how can I get rid of it?
For reference, this is my tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"outDir": "./out",
"strict": true,
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true
}
}