I have a postmanenv.json file with this structure:
{
"id": "bar",
"name": "foo",
"values": [
{
"key": "Scope",
"value": "A string with spaces",
"enabled": true
}
]
}
When I try to print it
const postmanEnv = require('./postman_env.json');
console.log(postmanEnv.values[0]);
Javascript transforms "value": "A string with spaces" to an array:
{
key: 'Scope',
value: [
'A',
'string',
'with',
'spaces'
],
enabled: true
}
How to read the values without converting space seperated strings to arrays? Already tried console.log(String(postmanEnv.values[5].value)); but it prints the words with commas.