shape-json icon indicating copy to clipboard operation
shape-json copied to clipboard

How does shape-json work in following case?

Open mhdnp1234 opened this issue 7 years ago • 1 comments

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}
     ]
    }
  ]
}

mhdnp1234 avatar Apr 26 '18 01:04 mhdnp1234

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.

ansteh avatar Apr 27 '18 13:04 ansteh