quikki,
<script>
var objNew = {
text: {
subText: {
value: 'value1'
},
modificator: {
name: 'name1',
params: 'params1'
}
},
attrs: {
title: 'title1'
}
};
function fn(a) {
var b = {},
c;
for (c in a) {
var d = a[c];
if ("object" == typeof d) {
var e = true;
Object.keys(d).forEach(function(a) {
b[c + "." + a] = d[a]
})
} else b[c] = d
}
return e ? fn(b) : b
};
var obj = fn(objNew);
document.write(JSON.stringify(obj, null, 4))
</script>