plugins/routers/joint.routers.manhattan.js
function resolveOptions(opt) {

        opt.directions = util.result(opt, 'directions');
        opt.penalties = util.result(opt, 'penalties');
        opt.paddingBox = util.result(opt, 'paddingBox');
        opt.padding = util.result(opt, 'padding');

        if (opt.padding) {
            // if both provided, opt.padding wins over opt.paddingBox
            var sides = util.normalizeSides(opt.padding);
            opt.paddingBox = {
                x: -sides.left,
                y: -sides.top,
                width: sides.left + sides.right,
                height: sides.top + sides.bottom
            };
        }

        util.toArray(opt.directions).forEach(function(direction) {

            var point1 = new g.Point(0, 0);
            var point2 = new g.Point(direction.offsetX, direction.offsetY);

            direction.angle = g.normalizeAngle(point1.theta(point2));
        });
    }
function resolveOptions(opt) {

        opt.directions = util.result(opt, 'directions');
        opt.penalties = util.result(opt, 'penalties');
        opt.paddingBox = util.result(opt, 'paddingBox');
        opt.padding = util.result(opt, 'padding');

        if (opt.padding) {
            // if both provided, opt.padding wins over opt.paddingBox
            var sides = util.normalizeSides(opt.padding);
            opt.paddingBox = {
                x: -sides.left,
                y: -sides.top,
                width: sides.left + sides.right,
                height: sides.top + sides.bottom
            };
        }

        util.toArray(opt.directions).forEach(function(direction) {

            var point1 = new g.Point(0, 0);
            var point2 = new g.Point(direction.offsetX, direction.offsetY);

            direction.angle = g.normalizeAngle(point1.theta(point2));
        });
    }
function resolveOptions ( opt ) { opt . directions = util . result ( opt , 'directions' ) ; opt . penalties = util . result ( opt , 'penalties' ) ; opt . paddingBox = util . result ( opt , 'paddingBox' ) ; opt . padding = util . result ( opt , 'padding' ) ; if ( opt . padding ) { // if both provided, opt.padding wins over opt.paddingBox var sides = util . normalizeSides ( opt . padding ) ; opt . paddingBox = { x : - sides . left , y : - sides . top , width : sides . left + sides . right , height : sides . top + sides . bottom } ; } util . toArray ( opt . directions ) . forEach ( function ( direction ) { var point1 = new g . Point ( 0 , 0 ) ; var point2 = new g . Point ( direction . offsetX , direction . offsetY ) ; direction . angle = g . normalizeAngle ( point1 . theta ( point2 ) ) ; } ) ; }
resolve some of the options
resolve some of the options