beameryhq / json-ditto Goto Github PK
View Code? Open in Web Editor NEWDeclarative JSON-to-JSON mapper .. shape-shift JSON files with Ditto 👻
License: MIT License
Declarative JSON-to-JSON mapper .. shape-shift JSON files with Ditto 👻
License: MIT License
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!
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"
}
]
}
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.
Tagged template literals are literals where the function parameters consist of a template literal’s strings and expressions.
Reference: https://exploringjs.com/es6/ch_template-literals.html#_examples-of-using-tagged-template-literals
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.