shape-json
shape-json copied to clipboard
How does shape-json work in following case?
const input = [
employees: [
{
name:"mak",
age: "20",
companies: [ {org: "aa", tenure: 1.5} , {org: "aa2", tenure: 5}]
}
]
]
expectedOutput = {
employees: [
{
name: 'mak',
age: 20,
profession: [
{company: 'aa', experience: 1.5},
{company: 'aa1', experience: 5}
]
}
]
}
It wont work because the input json object is nested. This package was made to handle flat json object (etc. returned rows from mysql DB, or table rows). Hope this helps you.