lib/namedroutes.js
function update(app, target, source) {
    for (var prop in source) {
        if (!source.hasOwnProperty(prop)) continue;
        var def = expandDefinition(app, prop, source[prop]);
        if (prop in target) {
            if (!def) {
              delete target[prop];
            } else if (def.route) {
              debugger; //XXX
            } else if (def.pathonly) {
              target[prop].path = def.path;
            } else {
              //use defaults() instead of extends() so undefined are skipped
              target[prop] = _.defaults({}, def, target[prop]);
            }
        } else if (!def.pathonly) {
          if (typeof def.path === 'undefined')
            def.path = prop; //use name as path
          target[prop] = def;
        }
    }
    return target;
}
function update(app, target, source) {
    for (var prop in source) {
        if (!source.hasOwnProperty(prop)) continue;
        var def = expandDefinition(app, prop, source[prop]);
        if (prop in target) {
            if (!def) {
              delete target[prop];
            } else if (def.route) {
              debugger; //XXX
            } else if (def.pathonly) {
              target[prop].path = def.path;
            } else {
              //use defaults() instead of extends() so undefined are skipped
              target[prop] = _.defaults({}, def, target[prop]);
            }
        } else if (!def.pathonly) {
          if (typeof def.path === 'undefined')
            def.path = prop; //use name as path
          target[prop] = def;
        }
    }
    return target;
}
function update ( app , target , source ) { for ( var prop in source ) { if ( ! source . hasOwnProperty ( prop ) ) continue ; var def = expandDefinition ( app , prop , source [ prop ] ) ; if ( prop in target ) { if ( ! def ) { delete target [ prop ] ; } else if ( def . route ) { debugger ; //XXX } else if ( def . pathonly ) { target [ prop ] . path = def . path ; } else { //use defaults() instead of extends() so undefined are skipped target [ prop ] = _ . defaults ( { } , def , target [ prop ] ) ; } } else if ( ! def . pathonly ) { if ( typeof def . path === 'undefined' ) def . path = prop ; //use name as path target [ prop ] = def ; } } return target ; }
expand source and target then merge, if source and target are both have route recurse XXX if one or the the have route replace target with source otherwise merge source keys into target, if source key has falsy value, remove the key if handle is being added assume its the current app unless app is specified?
expand source and target then merge if source and target are both have route recurse XXX if one or the the have route replace target with source otherwise merge source keys into target if source key has falsy value remove the key if handle is being added assume its the current app unless app is specified?