Giter VIP home page Giter VIP logo

json-ditto's Issues

unable to create nested array

Want to convert/unflatten from

const jsonData = {
    "description": "SARS-CoV-2 (COVID-19) IgM Ab [Units/volume] in Serum or Plasma by Immunoassay"
};

to result

{
   "category":[
      {
         "coding":[
            {
               "display":"SARS-CoV-2 (COVID-19) IgM Ab [Units/volume] in Serum or Plasma by Immunoassay"
            }
         ]
      }
   ]
}

How do i write mapping logic for such case?
@ahmadassaf I am eagerly seeking for your kind help! And thank you for the library!

How to place values from different keys to an array?

const data = {
  "display1": "Hello",
  "value1": "Greetings1",
  "display2": "There",
  "value2": "Greetings2"
}
const expectedResult = {
  "customData": [
    {
      "display": "Hello",
      "value": "Greetings1"
    },
    {
      "display": "There",
      "value": "Greetings2"
    }
  ]
}

Similarly, we need,

const data = {
  "weight": [{
  "value": 75,
  "unit": "kg"
}],
"height": [{
"value":70,
"unit":"inch"
}]
}
const expectedResult = {
  "bmi": [
    {
      "code": "weight",
      "value": "75",
      "unit":"kg"
    },
    {
      "code": "height",
      "value": "70",
      "unit":"inch"
    }
  ]
}

@ahmadassaf

Implement switch case scenario

Hello @ahmadassaf,
I need to implement switch case scenario.

I have following set of input json data with corresponding expected json output.
1st sample of input data:
{
status:'requested'
}

expected output:
{
status:'proposed'
}

2nd sample of input data
{
status:'pending'
}

expected output:
{
status:'scheduled'
}

3rd sample of input data
{
status:'completed'
}

expected output:
{
status:'fulfilled'
}

Please help implement it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.