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

Function defaultHttpResponseTransform

lib/test/angular/1.4.3/angular.js:9240–9254  ·  view source on GitHub ↗
(data, headers)

Source from the content-addressed store, hash-verified

9238}
9239
9240function defaultHttpResponseTransform(data, headers) {
9241 if (isString(data)) {
9242 // Strip json vulnerability protection prefix and trim whitespace
9243 var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();
9244
9245 if (tempData) {
9246 var contentType = headers('Content-Type');
9247 if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {
9248 data = fromJson(tempData);
9249 }
9250 }
9251 }
9252
9253 return data;
9254}
9255
9256function isJsonLike(str) {
9257 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