I have a problem in a mock server i am doing. I use npm faker to have some random data, and i go get that data to another js file. Now i want to have a json structure like this:
{
0:
varOne: 'value'
1:
varTwo: 'value
}
and at the moment i am getting this json structure:
{
file1: {
0:
varOne: 'value'
1:
varTwo: 'value
},
file2: {
0:
varOne: 'value'
1:
varTwo: 'value
}
}
Basically i have two js files who i want to merge in one but resulting with no sub-levels in the Json structure. At the moment my code is this:
const file1 = generateFakeObject(nameOfFile1, 4)
const file2 = generateFakeObject(nameOfFile2, 8)
data.jsonStructure = {file1, file2};
Can anyone help me please???