MCPcopy
hub / github.com/angular-ui/ui-router / transformData

Function transformData

test/angular/1.7/angular.js:12113–12123  ·  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

12111 * @returns {*} Transformed data.
12112 */
12113function transformData(data, headers, status, fns) {
12114 if (isFunction(fns)) {
12115 return fns(data, headers, status);
12116 }
12117
12118 forEach(fns, function(fn) {
12119 data = fn(data, headers, status);
12120 });
12121
12122 return data;
12123}
12124
12125
12126function 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