indoqa-react-restclient
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IndoqaReactRestclient=t():e.IndoqaReactRestclient=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(3)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),u=o(r),i=function(e,t,n){var o=window[t];return o?"function"==typeof o?o(e):""+o+e:""+n+e},a=function(e,t){e||(e={}),e.headers||(e.headers={}),e.headers.Accept||(e.headers.Accept="application/json"),e.headers["Content-Type"]||(e.headers["Content-Type"]="application/json");var n=window[t];return n&&(e.headers.Authorization=n),e.mode="same-origin",e.credentials="same-origin",e};t.default=function(e,t,n){var o=t.defaultPrefix,r=t.urlProperty,s=t.credentialsProperty;return fetch(i(e,r,o),a(n,s)).then(u.default)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!e.ok)throw e;return 204===e.status||202===e.status?null:e.json()}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),u=o(r);t.default=u.default}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IndoqaReactRestclient=t():e.IndoqaReactRestclient=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(3)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),u=o(r),i=function(e,t,n){var o=window[t];return o?"function"==typeof o?o(e):""+o+e:""+n+e},a=function(e,t){e||(e={}),e.headers||(e.headers={}),e.headers.Accept||(e.headers.Accept="application/json"),e.headers["Content-Type"]||(e.headers["Content-Type"]="application/json");var n=window[t];return n&&(e.headers.Authorization=n),e.mode="same-origin",e.credentials="same-origin",e};t.default=function(e,t,n){var o=t.defaultPrefix,r=t.urlProperty,s=t.credentialsProperty;return fetch(i(e,r,o),a(n,s)).then(u.default)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!e.ok)throw e;if(204===e.status||202===e.status)return null;var t=e.headers.get("content-type");return t&&t.indexOf("application/json")!==-1?e.json():e}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),u=o(r);t.default=u.default}])}); | ||
//# sourceMappingURL=IndoqaReactRestclient.min.js.map |
{ | ||
"name": "indoqa-react-restclient", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"main": "./dist/IndoqaReactRestclient.min.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,2 +0,2 @@ | ||
# indoqa-react-restclient | ||
A simple fetch abstractions of REST APIs calls in react. | ||
# Indoqa React Restclient | ||
A simple abstraction of REST APIs calls using fetch in react. Adds common defaults and proxy URL handling. |
@@ -10,3 +10,8 @@ export default (response) => { | ||
return response.json() | ||
const contentType = response.headers.get('content-type') | ||
if (contentType && contentType.indexOf('application/json') !== -1) { | ||
return response.json() | ||
} | ||
return response | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27046
64