I have this code, I'm interested in whether it is possible to get the name of the passed object inside the useConf
function, namely "container__wrapper"
, and not "Object"
.
const conf = {
container__wrapper : {
style : {
width : '100%'
}
} as Component,
toolbar : {
ui: "default"
} as Component,
};
const useConf = (config: Object) => {
return config.constructor.name; // Return "Object"
}
console.log(
useConf(conf.container__wrapper);
);