I am having an issue with my mock server setup. I am using npm faker to generate random data, and then trying to transfer that data to another JavaScript file. My goal is to have a JSON structure like the following:
{
0:
varOne: 'value'
1:
varTwo: 'value'
}
However, currently I am ending up with this JSON structure:
{
file1: {
0:
varOne: 'value'
1:
varTwo: 'value'
},
file2: {
0:
varOne: 'value'
1:
varTwo: 'value'
}
}
Essentially, I have two JavaScript files that I want to combine into one without nested sub-levels in the JSON structure. The code I am using right now looks like this:
const file1 = generateFakeObject(nameOfFile1, 4)
const file2 = generateFakeObject(nameOfFile2, 8)
data.jsonStructure = {file1, file2};
Any assistance with resolving this would be greatly appreciated!