I am trying to send a javascript object to a POST API which only accepts python Booleans(True/False) and rejects javascript booleans(true/false). I want to convert all the booleans present in JS object to strings ("true"/"false").
Is there an efficient way to do this?
Input -
const a = {
b: {
c: 1,
d: true
},
e: true
}
Output -
const a = {
b: {
c: 1,
d: "true"
},
e: "true"
}