Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
How to create class to overwritte JSON blueprint JS

I create jsonBlueprint to looks like :

const jsonBlueprint = {
    "header": {
            "FontSize": "2.5vw",
            "TextColor": "#000000",
        },
    "freeT":{
        "TextFontColor": "#000000",
        "TextFontSize": "2vw"
       }

So i can get that values pretty easy by freeT.TextFontColo etc.. How can i create Json function to set that values ?

I have something like that

function createJsonFile(template) {
    const Json = {};
    const inputs = [...template.querySelectorAll('.formInput')];
    inputs.map(input => {
        if (input.type != 'toggle') {
            Json[input.name] = input.value;
        } else {
           Json[input.name] = input.checked;
        }
    });
    return Json;
}

I want these values(from createJson class) ​​refer to individual elements in blueprint and overwrite them. Actually in my finally Json i have bluePrint where i can see :

- header: 
   FontSize: "2.5vw",
   TextColor: "#000000",
- FontSize:"2.5vw"
- TextColor:"#000000"
  

I want it to looks like :

- header: 
   FontSize: "2.5vw",
   TextColor: "#000000"

and this values(fontsize,textcolor) should be overwrite by createJson function.

I tryied to change input.name to be like : header.FontSize but its just create :

- header: 
       FontSize: "2.5vw",
       TextColor: "#000000",
-header.Fontsize:"2.5vw",
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!