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

120
Views
loadsh set new key to empty interface Object , how to prevent it or improve on initialization?

Hi I am trying to declare a generic interface with multiple elements and try to assign in object keys values from other JSON objects but need to assign particular key from the interface , here is the detail code

interface DbInterface {
  userName: string;
  password: string;
port: string;
}

auth = {
"userName" :"admin",
"password" : "password"
"previousPassword" : "admin"
}

let dbConfig: DbInterface = {}
for (const key in auth) {

lodash.set(dbConfig, key, value)
}


It's Returning

dbConfig: {
  "userName": "admin";
  "password": "password";
"previousPassword":"admin";
}

instead of

dbConfig: {
  "userName": "admin",
  "password": "password"
}

What is my issue?

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!