MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / defaultHttpResponseTransform

Function defaultHttpResponseTransform

lib/test/angular/1.5.0/angular.js:10125–10139  ·  view source on GitHub ↗
(data, headers)

Source from the content-addressed store, hash-verified

10123}
10124
10125function defaultHttpResponseTransform(data, headers) {
10126 if (isString(data)) {
10127 // Strip json vulnerability protection prefix and trim whitespace
10128 var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();
10129
10130 if (tempData) {
10131 var contentType = headers('Content-Type');
10132 if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {
10133 data = fromJson(tempData);
10134 }
10135 }
10136 }
10137
10138 return data;
10139}
10140
10141function isJsonLike(str) {
10142 var jsonStart = str.match(JSON_START);

Callers

nothing calls this directly

Calls 3

isStringFunction · 0.70
isJsonLikeFunction · 0.70
fromJsonFunction · 0.70

Tested by

no test coverage detected