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

Function transformData

test/angular/1.4/angular.js:9808–9818  ·  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

9806 * @returns {*} Transformed data.
9807 */
9808function transformData(data, headers, status, fns) {
9809 if (isFunction(fns)) {
9810 return fns(data, headers, status);
9811 }
9812
9813 forEach(fns, function(fn) {
9814 data = fn(data, headers, status);
9815 });
9816
9817 return data;
9818}
9819
9820
9821function 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