Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does shape-json work in following case? #11

Open
mhdnp1234 opened this issue Apr 26, 2018 · 1 comment
Open

How does shape-json work in following case? #11

mhdnp1234 opened this issue Apr 26, 2018 · 1 comment

Comments

@mhdnp1234
Copy link

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}
     ]
    }
  ]
}
@ansteh
Copy link
Owner

ansteh commented Apr 27, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants