http-request-promise
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -1,1 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babel-polyfill"),require("jquery")):"function"==typeof define&&define.amd?define(["babel-polyfill","jquery"],t):"object"==typeof exports?exports.HttpRequestPromise=t(require("babel-polyfill"),require("jquery")):e.HttpRequestPromise=t(e["babel-polyfill"],e.jquery)}(this,function(e,t){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";function o(e){return e+="",encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}function n(e,t,r){var n,u,i=[];r||(r="&");for(u in e){n=e[u],t&&!isNaN(u)&&(u=String(t)+u);var f=function e(t,r,n){var u,i=[];if(!0===r?r="1":!1===r&&(r="0"),null!==r){if("object"===(void 0===r?"undefined":a(r))){for(u in r)null!==r[u]&&i.push(e(t+"["+u+"]",r[u],n));return i.join(n)}if("function"!=typeof r)return o(t)+"="+o(r);throw new Error("There was an error processing for http_build_query().")}return""}(u,n,r);""!==f&&i.push(f)}return i.join(r)}var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r(2);var i=r(3),f=function(e){return e&&e.__esModule?e:{default:e}}(i),s=function(e,t){return new Promise(function(r,o){var i=e,s=u({},t);s&&"object"==a(s.params)&&(i=e+"&"+n(s.params,null,"&"),delete s.params),f.default.ajax(i,s).fail(function(e,t,r){try{var n=f.default.trim(e.responseText);!n&&e.statusText&&(n=f.default.trim("Network Error: "+e.statusText)),n||(n="Network Error");var u=new Error(n);u.statusCode=e.status,u.statusText=e.statusText,u.responseText=e.responseText,o(u)}catch(u){o(u)}}).done(function(e,t,n){try{r(e)}catch(e){o(e)}})})};s.post=function(e,t,r){var o={method:"POST",processData:!1,dataType:"text"};return void 0!==t&&(o.data=JSON.stringify(t)),void 0!==r&&(o.params=r),s(e,o)},s.get=function(e,t){var r={method:"GET",dataType:"text"};return void 0!==t&&(r.data=t),s(e,r)},e.exports=s},function(t,r){t.exports=e},function(e,r){e.exports=t}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery"),require("babel-polyfill")):"function"==typeof define&&define.amd?define(["jquery","babel-polyfill"],t):"object"==typeof exports?exports.HttpRequestPromise=t(require("jquery"),require("babel-polyfill")):e.HttpRequestPromise=t(e.jquery,e["babel-polyfill"])}(this,function(e,t){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(t,r){t.exports=e},function(e,t,r){e.exports=r(2)},function(e,t,r){"use strict";(function(t){function o(e){return e+="",encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}function n(e,t,r){var n,u,a=[];r||(r="&");for(u in e){n=e[u],t&&!isNaN(u)&&(u=String(t)+u);var f=function e(t,r,n){var u,a=[];if(!0===r?r="1":!1===r&&(r="0"),null!==r){if("object"===(void 0===r?"undefined":i(r))){for(u in r)null!==r[u]&&a.push(e(t+"["+u+"]",r[u],n));return a.join(n)}if("function"!=typeof r)return o(t)+"="+o(r);throw new Error("There was an error processing for http_build_query().")}return""}(u,n,r);""!==f&&a.push(f)}return a.join(r)}var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r(3),r(0);var a=function(e,r){return new Promise(function(o,a){var f=e,s=u({},r);s&&"object"==i(s.params)&&(f=e+"&"+n(s.params,null,"&"),delete s.params),t.ajax(f,s).fail(function(e,r,o){try{var n=t.trim(e.responseText);!n&&e.statusText&&(n=t.trim("Network Error: "+e.statusText)),n||(n="Network Error");var u=new Error(n);u.statusCode=e.status,u.statusText=e.statusText,u.responseText=e.responseText,a(u)}catch(u){a(u)}}).done(function(e,t,r){try{o(e)}catch(e){a(e)}})})};a.post=function(e,t,r){var o={method:"POST",processData:!1,dataType:"text"};return void 0!==t&&(o.data=JSON.stringify(t)),void 0!==r&&(o.params=r),a(e,o)},a.get=function(e,t){var r={method:"GET",dataType:"text"};return void 0!==t&&(r.data=t),a(e,r)},e.exports=a}).call(t,r(0))},function(e,r){e.exports=t}])}); | ||
//# sourceMappingURL=index.bundle.min.js.map |
import "babel-polyfill"; | ||
import $ from "jquery"; | ||
import "jquery"; | ||
@@ -71,7 +71,7 @@ function urlencode (str) | ||
} | ||
$.ajax(requestUrl,requestOptions) | ||
jQuery.ajax(requestUrl,requestOptions) | ||
.fail((jqXHR, textStatus, errorThrown)=>{ | ||
try{ | ||
let errMsg=$.trim(jqXHR.responseText); | ||
if(!errMsg && jqXHR.statusText) errMsg=$.trim(`Network Error: ${jqXHR.statusText}`); | ||
let errMsg=jQuery.trim(jqXHR.responseText); | ||
if(!errMsg && jqXHR.statusText) errMsg=jQuery.trim(`Network Error: ${jqXHR.statusText}`); | ||
if(!errMsg) errMsg="Network Error"; | ||
@@ -78,0 +78,0 @@ |
{ | ||
"name": "http-request-promise", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Yet another promise-based HTTP request library built on jQuery.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.bundle.min.js", |
@@ -14,2 +14,3 @@ const path = require("path"); | ||
compress: { warnings: false }, | ||
sourceMap: true | ||
})); | ||
@@ -16,0 +17,0 @@ } |
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
29487
174