index.js
function flat(current, name, object, separator) {
    var data = {}
    // iterate object
    for (var x in object) {
        var key = [name, x].join(separator)
        data[key] = object[x]
    }

    // iterate through data
    for (var i in data) {
        if (typeof data[i] !== "object") {
            current[i] = data[i]
        } else {
            current = flat(current, i, data[i], separator)
        }
    }

    // returning current value
    return current
}
function flat(current, name, object, separator) {
    var data = {}
    // iterate object
    for (var x in object) {
        var key = [name, x].join(separator)
        data[key] = object[x]
    }

    // iterate through data
    for (var i in data) {
        if (typeof data[i] !== "object") {
            current[i] = data[i]
        } else {
            current = flat(current, i, data[i], separator)
        }
    }

    // returning current value
    return current
}
function flat ( current , name , object , separator ) { var data = { } // iterate object for ( var x in object ) { var key = [ name , x ] . join ( separator ) data [ key ] = object [ x ] } // iterate through data for ( var i in data ) { if ( typeof data [ i ] !== "object" ) { current [ i ] = data [ i ] } else { current = flat ( current , i , data [ i ] , separator ) } } // returning current value return current }
flat an object to be more save use
flat an object to be more save use