I have a scenario where I have two files organized in a tree structure that defines an object.
The first file is called common.js
.
export default {
table: {
actions: {
save: 'Save',
delete: 'Delete',
update: 'Update'
}
}
};
In another file, I am referencing the common.js
file mentioned above.
var common = require('common.js');
When I access the object, what I currently receive is;
console.log(common);
{
common:{
default: {
table: {
actions: {
save: 'Save',
delete: 'Delete',
update: 'Update'
}
}
}
}
}
However, I am aiming to receive the following format instead;
{
common: {
table: {
actions: {
save: 'Save',
delete: 'Delete',
update: 'Update'
}
}
}
}
I want to export the table object and retrieve it without the key named default
. Is there a method to achieve this?