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?