core/controller/controller.js
function (arr){
        var tmp = null,
            curObj = {},
            obj = {},
            count = 0,
            data = {},
            last = null;
        for (var r in arr) {
            tmp = r.split(".");
            //Creating structure - Adding sub levels
            for (var o in tmp) {
                count++;
                if (last && typeof(obj[last]) == "undefined") {
                    curObj[last] = {};
                    if (count >= tmp.length) {
                        // assigning.
                        // !!! if null or undefined, it will be ignored while extending.
                        curObj[last][tmp[o]] = (arr[r]) ? arr[r] : "undefined";
                        last = null;
                        count = 0;
                        break
                    } else {
                        curObj[last][tmp[o]] = {}
                    }
                } else if (tmp.length === 1) { //Just one root var
                    curObj[tmp[o]] = (arr[r]) ? arr[r] : "undefined";
                    obj = curObj;
                    break
                }
                obj = curObj;
                last = tmp[o]
            }
            //data = merge(data, obj, true);
            data = merge(obj, data);
            obj = {};
            curObj = {}
        }
        return data
    }
function (arr){
        var tmp = null,
            curObj = {},
            obj = {},
            count = 0,
            data = {},
            last = null;
        for (var r in arr) {
            tmp = r.split(".");
            //Creating structure - Adding sub levels
            for (var o in tmp) {
                count++;
                if (last && typeof(obj[last]) == "undefined") {
                    curObj[last] = {};
                    if (count >= tmp.length) {
                        // assigning.
                        // !!! if null or undefined, it will be ignored while extending.
                        curObj[last][tmp[o]] = (arr[r]) ? arr[r] : "undefined";
                        last = null;
                        count = 0;
                        break
                    } else {
                        curObj[last][tmp[o]] = {}
                    }
                } else if (tmp.length === 1) { //Just one root var
                    curObj[tmp[o]] = (arr[r]) ? arr[r] : "undefined";
                    obj = curObj;
                    break
                }
                obj = curObj;
                last = tmp[o]
            }
            //data = merge(data, obj, true);
            data = merge(obj, data);
            obj = {};
            curObj = {}
        }
        return data
    }
function ( arr ) { var tmp = null , curObj = { } , obj = { } , count = 0 , data = { } , last = null ; for ( var r in arr ) { tmp = r . split ( "." ) ; //Creating structure - Adding sub levels for ( var o in tmp ) { count ++ ; if ( last && typeof ( obj [ last ] ) == "undefined" ) { curObj [ last ] = { } ; if ( count >= tmp . length ) { // assigning. // !!! if null or undefined, it will be ignored while extending. curObj [ last ] [ tmp [ o ] ] = ( arr [ r ] ) ? arr [ r ] : "undefined" ; last = null ; count = 0 ; break } else { curObj [ last ] [ tmp [ o ] ] = { } } } else if ( tmp . length === 1 ) { //Just one root var curObj [ tmp [ o ] ] = ( arr [ r ] ) ? arr [ r ] : "undefined" ; obj = curObj ; break } obj = curObj ; last = tmp [ o ] } //data = merge(data, obj, true); data = merge ( obj , data ) ; obj = { } ; curObj = { } } return data }
converting references to objects
converting references to objects