dist/sofa.js
function (backendAddress) {

        backendAddress = backendAddress || {};

        var country = {
            value: safeUse(backendAddress.country),
            label: safeUse(backendAddress.countryname)
        };

        return {
            company:            safeUse(backendAddress.company),
            salutation:         safeUse(backendAddress.salutation),
            surname:            safeUse(backendAddress.lastname),
            name:               safeUse(backendAddress.firstname),
            street:             safeUse(backendAddress.street1),
            zip:                safeUse(backendAddress.zip),
            city:               safeUse(backendAddress.city),
            country:            !country.value ? null : country,
            email:              safeUse(backendAddress.email),
            telephone:          safeUse(backendAddress.telephone)
        };
    }
function (backendAddress) {

        backendAddress = backendAddress || {};

        var country = {
            value: safeUse(backendAddress.country),
            label: safeUse(backendAddress.countryname)
        };

        return {
            company:            safeUse(backendAddress.company),
            salutation:         safeUse(backendAddress.salutation),
            surname:            safeUse(backendAddress.lastname),
            name:               safeUse(backendAddress.firstname),
            street:             safeUse(backendAddress.street1),
            zip:                safeUse(backendAddress.zip),
            city:               safeUse(backendAddress.city),
            country:            !country.value ? null : country,
            email:              safeUse(backendAddress.email),
            telephone:          safeUse(backendAddress.telephone)
        };
    }
function ( backendAddress ) { backendAddress = backendAddress || { } ; var country = { value : safeUse ( backendAddress . country ) , label : safeUse ( backendAddress . countryname ) } ; return { company : safeUse ( backendAddress . company ) , salutation : safeUse ( backendAddress . salutation ) , surname : safeUse ( backendAddress . lastname ) , name : safeUse ( backendAddress . firstname ) , street : safeUse ( backendAddress . street1 ) , zip : safeUse ( backendAddress . zip ) , city : safeUse ( backendAddress . city ) , country : ! country . value ? null : country , email : safeUse ( backendAddress . email ) , telephone : safeUse ( backendAddress . telephone ) } ; }
unfortunately the backend uses all sorts of different address formats this one converts an address coming from a summary response to the generic app address format.
unfortunately the backend uses all sorts of different address formats this one converts an address coming from a summary response to the generic app address format .