var obj2 = {
'text.subText.value': 'value1',
'text.modificator.name': 'name1',
'text.modificator.params': 'params1',
'attrs.title': 'title1'
};
function expand(object) {
var result = {};
for(var key in object) {
var context = result;
var keys = key.split(".");
var property = keys.pop();
context = keys.reduce((m,v) => {
return v in m ? m[v] : m[v] = {};
}, context);
context[property] = object[key];
}
return result;
}
alert(JSON.stringify(expand(obj2), null, "\t"));