MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / transformData

Function transformData

OpenReservation/wwwroot/Scripts/angular.js:10497–10508  ·  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

(data, headers, status, fns)

Source from the content-addressed store, hash-verified

10495 * @returns {*} Transformed data.
10496 */
10497 function transformData(data, headers, status, fns) {
10498 if (isFunction(fns)) {
10499 return fns(data, headers, status);
10500 }
10501
10502 forEach(fns,
10503 function (fn) {
10504 data = fn(data, headers, status);
10505 });
10506
10507 return data;
10508 }
10509
10510 function isSuccess(status) {
10511 return 200 <= status && status < 300;

Callers 2

serverRequestFunction · 0.85
transformResponseFunction · 0.85

Calls 3

isFunctionFunction · 0.85
forEachFunction · 0.85
fnFunction · 0.85

Tested by

no test coverage detected