MCPcopy Create free account
hub / github.com/angular-ui/ui-router / transformData

Function transformData

test/angular/1.5/angular.js:10963–10973  ·  view source on GitHub ↗

* Chain all given functions * * This function is used for both request and response transforming * * @param {*} data Data to transform. * @param {function(string=)} headers HTTP headers getter fn. * @param {number} status HTTP status code of the response. * @param {(Function|Array. )

(data, headers, status, fns)

Source from the content-addressed store, hash-verified

10961 * @returns {*} Transformed data.
10962 */
10963function transformData(data, headers, status, fns) {
10964 if (isFunction(fns)) {
10965 return fns(data, headers, status);
10966 }
10967
10968 forEach(fns, function(fn) {
10969 data = fn(data, headers, status);
10970 });
10971
10972 return data;
10973}
10974
10975
10976function isSuccess(status) {

Callers 2

serverRequestFunction · 0.70
transformResponseFunction · 0.70

Calls 3

fnFunction · 0.85
isFunctionFunction · 0.70
forEachFunction · 0.70

Tested by

no test coverage detected