client/js/upload-handler/upload.handler.controller.js
function(originalResponse, successful) {
            var response = originalResponse;

            // The passed "response" param may not be a response at all.
            // It could be a string, detailing the error, for example.
            if (!qq.isObject(originalResponse)) {
                response = {};

                if (qq.isString(originalResponse) && !successful) {
                    response.error = originalResponse;
                }
            }

            response.success = successful;

            return response;
        }
function(originalResponse, successful) {
            var response = originalResponse;

            // The passed "response" param may not be a response at all.
            // It could be a string, detailing the error, for example.
            if (!qq.isObject(originalResponse)) {
                response = {};

                if (qq.isString(originalResponse) && !successful) {
                    response.error = originalResponse;
                }
            }

            response.success = successful;

            return response;
        }
function ( originalResponse , successful ) { var response = originalResponse ; // The passed "response" param may not be a response at all. // It could be a string, detailing the error, for example. if ( ! qq . isObject ( originalResponse ) ) { response = { } ; if ( qq . isString ( originalResponse ) && ! successful ) { response . error = originalResponse ; } } response . success = successful ; return response ; }
The response coming from handler implementations may be in various formats. Instead of hoping a promise nested 5 levels deep will always return an object as its first param, let's just normalize the response here.
The response coming from handler implementations may be in various formats . Instead of hoping a promise nested 5 levels deep will always return an object as its first param let s just normalize the response here .