const tree = (obj, path) => {
let keys = path.split('.'),
key;
while (key = keys.shift()) {
typeof obj[key] === 'undefined' && (obj[key] = {});
obj = obj[key];
}
return obj;
};
let data = {};
tree(data, '010.000.000.000.000.000');
tree(data, '010.010.000.000.000.000');
tree(data, '010.010.000.000.000.010');
tree(data, '010.010.010.000.000.000');
tree(data, '010.010.010.010.000.000');
tree(data, '010.010.010.010.000.010');
tree(data, '010.010.010.010.000.020');
tree(data, '010.010.010.020.000.000');
tree(data, '010.010.010.020.000.010');
tree(data, '010.010.010.020.000.020');
console.dir(data);
Вариант