tasks/lib/writer.js
function addToJSONRecursively(contextNames, data, obj) {
        var currentContexName = contextNames.shift();

        // last name
        if (!contextNames.length) {
            obj[currentContexName] = data;
            return;
        }

        if (!obj[currentContexName]) {
            obj[currentContexName] = {};
        }

        addToJSONRecursively(contextNames, data, obj[currentContexName]);
    }
function addToJSONRecursively(contextNames, data, obj) {
        var currentContexName = contextNames.shift();

        // last name
        if (!contextNames.length) {
            obj[currentContexName] = data;
            return;
        }

        if (!obj[currentContexName]) {
            obj[currentContexName] = {};
        }

        addToJSONRecursively(contextNames, data, obj[currentContexName]);
    }
function addToJSONRecursively ( contextNames , data , obj ) { var currentContexName = contextNames . shift ( ) ; // last name if ( ! contextNames . length ) { obj [ currentContexName ] = data ; return ; } if ( ! obj [ currentContexName ] ) { obj [ currentContexName ] = { } ; } addToJSONRecursively ( contextNames , data , obj [ currentContexName ] ) ; }
Add data to object at specified context
obj.a.b.c = data;
@param contextNames [{String}] f.e. ['a', 'b', 'c'..]
@param data {String} data to set
@param obj {Object} changable
Add data to object at specified context obj . a . b . c = data ;