MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / transformData

Function transformData

web/static/bower_components/angular/angular.js:9499–9509  ·  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

9497 * @returns {*} Transformed data.
9498 */
9499function transformData(data, headers, status, fns) {
9500 if (isFunction(fns)) {
9501 return fns(data, headers, status);
9502 }
9503
9504 forEach(fns, function(fn) {
9505 data = fn(data, headers, status);
9506 });
9507
9508 return data;
9509}
9510
9511
9512function isSuccess(status) {

Callers 2

serverRequestFunction · 0.85
transformResponseFunction · 0.85

Calls 2

isFunctionFunction · 0.85
forEachFunction · 0.85

Tested by

no test coverage detected