Comparing version 0.5.3 to 0.5.4
@@ -1,1 +0,1 @@ | ||
import{merge as e,encodeParams as t,XiorTimeoutError as r,anySignal as n,isAbsoluteURL as i,joinPath as s,XiorError as a}from"xior/utils";export*from"xior/utils";import{trimUndefined as o}from"../utils/index.mjs";function u(e,t,r,n,i,s,a){try{var o=e[s](a),u=o.value}catch(e){r(e);return}o.done?t(u):Promise.resolve(u).then(n,i)}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let c="application/",h=`${c}x-www-form-urlencoded`,f=`${c}json`,d="Content-Type",p=d.toLowerCase();function y(){var r;return r=function*(r){let n=r.paramsSerializer||t,i=!1!==r.encodeURI,s=r.method?r.method.toUpperCase():"GET",a=r.url||"",u=a,c=r.data,y=c,m=(null==r?void 0:r.headers)||{},v=r.params||{},E=function(e="GET"){return["HEAD","GET","OPTIONS"].includes(e)}(s);if(c&&!(c instanceof FormData)){let t="";if(null==r?void 0:r.headers){let e=Object.keys(r.headers).find(e=>e.toLowerCase()===p);e&&(t=r.headers[e],r.headers[d]=t,e!==d&&delete r.headers[e])}t||(t=E?h:f,m[d]=t),"object"!=typeof c||(E&&r.params&&(v=e({},c||{},v)),t===f?y=JSON.stringify(o(c)):E||t!==h||(y=n(c)))}if(Object.keys(v).length>0){let e=n(v,i);a+=a.includes("?")?`&${e}`:`?${e}`}return l({},r,{_data:y,_url:a,data:c,url:u,method:s,headers:m,isGet:E})},(y=function(){var e=this,t=arguments;return new Promise(function(n,i){var s=r.apply(e,t);function a(e){u(s,n,i,a,o,"next",e)}function o(e){u(s,n,i,a,o,"throw",e)}a(void 0)})}).apply(this,arguments)}function m(e,t,r,n,i,s,a){try{var o=e[s](a),u=o.value}catch(e){r(e);return}o.done?t(u):Promise.resolve(u).then(n,i)}function v(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var s=e.apply(t,r);function a(e){m(s,n,i,a,o,"next",e)}function o(e){m(s,n,i,a,o,"throw",e)}a(void 0)})}}function E(){return(E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let P=void 0,b=typeof AbortController!=`${P}`;function g(){return(g=v(function*(e,t){let r;if(!t||!e.ok||["text","json"].includes(t)){if((r=yield e.text())&&"text"!==t)try{r=JSON.parse(r)}catch(e){}}else if("blob"===t)return e.blob();else if("arraybuffer"===t)return e.arrayBuffer();return r})).apply(this,arguments)}class O{static create(e){return new O(e)}get interceptors(){return{request:{use:(e,t,r)=>(this.REQI.push(e),e),eject:e=>{this.REQI=this.REQI.filter(t=>t!==e)},clear:()=>{this.REQI=[]}},response:{use:(e,t)=>(this.RESI.push({fn:e,onRejected:t}),e),eject:e=>{this.RESI=this.RESI.filter(t=>t.fn!==e)},clear:()=>{this.RESI=[]}}}}get plugins(){return{use:e=>(this.P.push(e),e),eject:e=>{this.P=this.P.filter(t=>t!==e)},clear:()=>{this.P=[]}}}request(r){var n=this;return v(function*(){let i=e({},n.config||{},n.defaults||{},"string"==typeof r?{url:r}:r||{},{headers:{},params:{}});for(let e of(i.withCredentials&&!i.credentials&&(i.credentials="include"),i.paramsSerializer||(i.paramsSerializer=t),n.REQI))i=yield e(i);let s=n.fetch.bind(n);return n.P.forEach(e=>{s=e(s,n)}),s(i)})()}fetch(e){var t=this;return v(function*(){let o;let u=yield function(e){return y.apply(this,arguments)}(e),{url:l,method:c,headers:h,timeout:f,signal:d,data:p,_data:m,_url:O,isGet:R}=u,w=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)t.indexOf(r=s[n])>=0||(i[r]=e[r]);return i}(u,["url","method","headers","timeout","signal","data","_data","_url","isGet"]);e._url=O;let I=[],j=P;if(f&&b){let t=new AbortController;j=setTimeout(()=>{t.abort(new r(`timeout of ${f}ms exceeded`,e))},f),I.push(t.signal)}d&&I.push(d),o=I[0],I.length>1&&(o=n(I,()=>{clearTimeout(j)}));let S=O||l||"";e.baseURL&&!i(S)&&(S=s(e.baseURL,S));let x=0,T=fetch(S,E({body:R?P:m},w,{signal:o,method:c,headers:h})).then(v(function*(t){let{responseType:r}=e,n={data:yield function(e,t){return g.apply(this,arguments)}(t,r),response:t,config:e,request:e,status:t.status,statusText:t.statusText,headers:t.headers};return t.ok?n:Promise.reject(new a(t.status?`Request failed with status code ${t.status}`:"Network error",e,n))})).finally(()=>{var e;j&&clearTimeout(j),null==o||null==(e=o.clear)||e.call(o)}),G=[];for(t.RESI.forEach(function(e){G.push(e.fn,e.onRejected)});G.length>x;)T=T.then(G[x++],G[x++]);return T})()}cG(e){return(t,r)=>this.request(r?E({},r,{method:e,url:t}):{method:e,url:t})}cP(e){return(t,r,n)=>this.request(n?E({},n,{method:e,url:t,data:r}):{method:e,url:t,data:r})}get(e,t){return this.cG("GET")(e,t)}head(e,t){return this.cG("HEAD")(e,t)}post(e,t,r){return this.cP("POST")(e,t,r)}put(e,t,r){return this.cP("PUT")(e,t,r)}patch(e,t,r){return this.cP("PATCH")(e,t,r)}delete(e,t){return this.cG("DELETE")(e,t)}options(e,t){return this.cG("OPTIONS")(e,t)}constructor(e){this.REQI=[],this.RESI=[],this.P=[],this.config=e,this.defaults={params:{},headers:{}}}}O.VERSION="0.5.3";let R=Object.assign(O.create(),{create:O.create,VERSION:O.VERSION});export{O as Xior,R as default}; | ||
import{merge as e,encodeParams as t,XiorTimeoutError as r,anySignal as n,isAbsoluteURL as i,joinPath as s,XiorError as a}from"xior/utils";export*from"xior/utils";import{trimUndefined as o}from"../utils/index.mjs";function u(e,t,r,n,i,s,a){try{var o=e[s](a),u=o.value}catch(e){r(e);return}o.done?t(u):Promise.resolve(u).then(n,i)}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let c="application/",h=`${c}x-www-form-urlencoded`,f=`${c}json`,d="Content-Type",p=d.toLowerCase(),m="undefined"!=typeof URLSearchParams;function y(){var r;return r=function*(r){let n=r.paramsSerializer||t,i=!1!==r.encodeURI,s=r.method?r.method.toUpperCase():"GET",a=r.url||"",u=a,c=m&&r.data&&r.data instanceof URLSearchParams,y=c?Object.fromEntries(r.data):r.data,E=y,v=(null==r?void 0:r.headers)||{},P=r.params||{},b=function(e="GET"){return["HEAD","GET","OPTIONS"].includes(e)}(s);if(y&&!(y instanceof FormData)){let t="";if(null==r?void 0:r.headers){let e=Object.keys(r.headers).find(e=>e.toLowerCase()===p);e&&(t=r.headers[e],r.headers[d]=t,e!==d&&delete r.headers[e])}t||(t=b||c?h:f,v[d]=t),"object"!=typeof y||(b&&r.params&&(P=e({},y||{},P)),t===f?E=JSON.stringify(o(y)):b||t!==h||(E=n(y)))}if(Object.keys(P).length>0){let e=n(P,i);a+=a.includes("?")?`&${e}`:`?${e}`}return l({},r,{_data:E,_url:a,data:y,url:u,method:s,headers:v,isGet:b})},(y=function(){var e=this,t=arguments;return new Promise(function(n,i){var s=r.apply(e,t);function a(e){u(s,n,i,a,o,"next",e)}function o(e){u(s,n,i,a,o,"throw",e)}a(void 0)})}).apply(this,arguments)}function E(e,t,r,n,i,s,a){try{var o=e[s](a),u=o.value}catch(e){r(e);return}o.done?t(u):Promise.resolve(u).then(n,i)}function v(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var s=e.apply(t,r);function a(e){E(s,n,i,a,o,"next",e)}function o(e){E(s,n,i,a,o,"throw",e)}a(void 0)})}}function P(){return(P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let b=void 0,O=typeof AbortController!=`${b}`;function R(){return(R=v(function*(e,t){let r;if(!t||!e.ok||["text","json"].includes(t)){if((r=yield e.text())&&"text"!==t)try{r=JSON.parse(r)}catch(e){}}else if("blob"===t)return e.blob();else if("arraybuffer"===t)return e.arrayBuffer();return r})).apply(this,arguments)}class g{static create(e){return new g(e)}get interceptors(){return{request:{use:(e,t,r)=>(this.REQI.push(e),e),eject:e=>{this.REQI=this.REQI.filter(t=>t!==e)},clear:()=>{this.REQI=[]}},response:{use:(e,t)=>(this.RESI.push({fn:e,onRejected:t}),e),eject:e=>{this.RESI=this.RESI.filter(t=>t.fn!==e)},clear:()=>{this.RESI=[]}}}}get plugins(){return{use:e=>(this.P.push(e),e),eject:e=>{this.P=this.P.filter(t=>t!==e)},clear:()=>{this.P=[]}}}request(r){var n=this;return v(function*(){let i=e({},n.config||{},n.defaults||{},"string"==typeof r?{url:r}:r||{},{headers:{},params:{}});for(let e of(i.withCredentials&&!i.credentials&&(i.credentials="include"),i.paramsSerializer||(i.paramsSerializer=t),n.REQI))i=yield e(i);let s=n.fetch.bind(n);return n.P.forEach(e=>{s=e(s,n)}),s(i)})()}fetch(e){var t=this;return v(function*(){let o;let u=yield function(e){return y.apply(this,arguments)}(e),{url:l,method:c,headers:h,timeout:f,signal:d,data:p,_data:m,_url:E,isGet:g}=u,S=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)t.indexOf(r=s[n])>=0||(i[r]=e[r]);return i}(u,["url","method","headers","timeout","signal","data","_data","_url","isGet"]);e._url=E;let j=[],w=b;if(f&&O){let t=new AbortController;w=setTimeout(()=>{t.abort(new r(`timeout of ${f}ms exceeded`,e))},f),j.push(t.signal)}d&&j.push(d),o=j[0],j.length>1&&(o=n(j,()=>{clearTimeout(w)}));let I=E||l||"";e.baseURL&&!i(I)&&(I=s(e.baseURL,I));let x=0,T=fetch(I,P({body:g?b:m},S,{signal:o,method:c,headers:h})).then(v(function*(t){let{responseType:r}=e,n={data:yield function(e,t){return R.apply(this,arguments)}(t,r),response:t,config:e,request:e,status:t.status,statusText:t.statusText,headers:t.headers};return t.ok?n:Promise.reject(new a(t.status?`Request failed with status code ${t.status}`:"Network error",e,n))})).finally(()=>{var e;w&&clearTimeout(w),null==o||null==(e=o.clear)||e.call(o)}),G=[];for(t.RESI.forEach(function(e){G.push(e.fn,e.onRejected)});G.length>x;)T=T.then(G[x++],G[x++]);return T})()}cG(e){return(t,r)=>this.request(r?P({},r,{method:e,url:t}):{method:e,url:t})}cP(e){return(t,r,n)=>this.request(n?P({},n,{method:e,url:t,data:r}):{method:e,url:t,data:r})}get(e,t){return this.cG("GET")(e,t)}head(e,t){return this.cG("HEAD")(e,t)}post(e,t,r){return this.cP("POST")(e,t,r)}put(e,t,r){return this.cP("PUT")(e,t,r)}patch(e,t,r){return this.cP("PATCH")(e,t,r)}delete(e,t){return this.cG("DELETE")(e,t)}options(e,t){return this.cG("OPTIONS")(e,t)}constructor(e){this.REQI=[],this.RESI=[],this.P=[],this.config=e,this.defaults={params:{},headers:{}}}}g.VERSION="0.5.4";let S=Object.assign(g.create(),{create:g.create,VERSION:g.VERSION});export{g as Xior,S as default}; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.xior=t():e.xior=t()}(this,(()=>{return e={699:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.anySignal=void 0,t.anySignal=function(e,t){const r=new globalThis.AbortController;function n(e){r.abort(e),i()}const o=[];for(const t of e){if(!0===(null==t?void 0:t.aborted)){n(t.reason);break}if(null!=(null==t?void 0:t.addEventListener)){const e=()=>{n(t.reason)};o.push((()=>{null!=(null==t?void 0:t.removeEventListener)&&t.removeEventListener("abort",e)})),t.addEventListener("abort",e)}}function i(){o.forEach((e=>{e()})),null==t||t()}const s=r.signal;return s.clear=i,s}},509:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const i=r(895);o(r(895),t),o(r(340),t),o(r(121),t);const s=Object.assign(i.Xior.create(),{create:i.Xior.create,VERSION:i.Xior.VERSION});t.default=s},393:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.likeGET=void 0;const o=r(121),i=r(976),s="application/",a=`${s}x-www-form-urlencoded`,u=`${s}json`,c="Content-Type",l=c.toLowerCase();function f(e="GET"){return["HEAD","GET","OPTIONS"].includes(e)}t.likeGET=f,t.default=function(e){return n(this,void 0,void 0,(function*(){const t=e.paramsSerializer||o.encodeParams,r=!1!==e.encodeURI,n=e.method?e.method.toUpperCase():"GET";let s=e.url||"";const d=s,h=e.data;let p=h;const b=(null==e?void 0:e.headers)||{};let m=e.params||{};const y=f(n);if(h&&!(h instanceof FormData)){let r="";if(null==e?void 0:e.headers){const t=Object.keys(e.headers).find((e=>e.toLowerCase()===l));t&&(r=e.headers[t],e.headers[c]=r,t!==c&&delete e.headers[t])}r||(r=y?a:u,b[c]=r),"object"==typeof h&&(y&&e.params&&(m=(0,o.merge)({},h||{},m)),r===u?p=JSON.stringify((0,i.trimUndefined)(h)):y||r!==a||(p=t(h)))}if(Object.keys(m).length>0){const e=t(m,r);s+=s.includes("?")?`&${e}`:`?${e}`}return Object.assign(Object.assign({},e),{_data:p,_url:s,data:h,url:d,method:n,headers:b,isGet:y})}))}},729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;const n=r(602);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return n.merge}})},629:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let n=t?r(t):"";n&&(n=e+(e.includes("?")?"&":"?")+n);const[o,i]=n.split("?");return i?`${o}?${i.split("&").sort().join("&")}`:n||e}},99:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.delay=t.buildSortedURL=void 0;const o=n(r(629));t.buildSortedURL=o.default,t.delay=function(e){return new Promise((t=>{setTimeout((()=>{t("ok")}),e)}))}},340:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},976:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isXiorError=t.XiorTimeoutError=t.XiorError=t.joinPath=t.isAbsoluteURL=t.trimUndefined=t.encodeParams=void 0,o(r(699),t),o(r(729),t),o(r(99),t);const i=void 0;t.encodeParams=function e(t,r=!0,n=null,o){if(t===i||null===t)return"";const s=[],a=r?encodeURIComponent:e=>e,u=Array.isArray(t),{arrayFormat:c,allowDots:l,serializeDate:f}=o||{},d=e=>{if(l&&!u)return`.${e}`;if(u){if("brackets"===c)return"[]";if("repeat"===c)return""}return`[${e}]`};for(const u in t)if(Object.prototype.hasOwnProperty.call(t,u)){let c=t[u];if(c!==i){const t=n?`${n}${d(u)}`:u;if(!isNaN(c)&&c instanceof Date&&(c=f?f(c):c.toISOString()),"object"==typeof c){const n=e(c,r,t,o);""!==n&&s.push(n)}else s.push(`${a(t)}=${a(c)}`)}}return s.join("&")},t.trimUndefined=function e(t){return Array.isArray(t)?t.map(e):(t&&"object"==typeof t&&Object.keys(t).forEach((r=>{const n=t[r];if(n!==i)return e(n);delete t[r]})),t)},t.isAbsoluteURL=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},t.joinPath=function(e,t){return t?(e.endsWith("/")?e:e+"/")+("/"===t[0]?t.slice(1):t):e};class s extends Error{constructor(e,t,r){super(e),this.name="XiorError",this.request=t,this.config=t,this.response=r}}t.XiorError=s,t.XiorTimeoutError=class extends s{constructor(e,t,r){super(e),this.name="XiorTimeoutError",this.request=t,this.config=t,this.response=r}},t.isXiorError=function(e){return"XiorError"===e.name||"XiorTimeoutError"===e.name}},895:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Xior=void 0;const s=r(121),a=i(r(393)),u=void 0,c="undefined"!=typeof AbortController;class l{static create(e){return new l(e)}constructor(e){this.REQI=[],this.RESI=[],this.P=[],this.config=e,this.defaults={params:{},headers:{}}}get interceptors(){return{request:{use:(e,t,r)=>(this.REQI.push(e),e),eject:e=>{this.REQI=this.REQI.filter((t=>t!==e))},clear:()=>{this.REQI=[]}},response:{use:(e,t)=>(this.RESI.push({fn:e,onRejected:t}),e),eject:e=>{this.RESI=this.RESI.filter((t=>t.fn!==e))},clear:()=>{this.RESI=[]}}}}get plugins(){return{use:e=>(this.P.push(e),e),eject:e=>{this.P=this.P.filter((t=>t!==e))},clear:()=>{this.P=[]}}}request(e){return n(this,void 0,void 0,(function*(){let t=(0,s.merge)({},this.config||{},this.defaults||{},"string"==typeof e?{url:e}:e||{},{headers:{},params:{}});t.withCredentials&&!t.credentials&&(t.credentials="include"),t.paramsSerializer||(t.paramsSerializer=s.encodeParams);for(const e of this.REQI)t=yield e(t);let r=this.fetch.bind(this);return this.P.forEach((e=>{r=e(r,this)})),r(t)}))}fetch(e){return n(this,void 0,void 0,(function*(){const t=yield(0,a.default)(e),{url:r,method:i,headers:l,timeout:f,signal:d,data:h,_data:p,_url:b,isGet:m}=t,y=o(t,["url","method","headers","timeout","signal","data","_data","_url","isGet"]);let v;e._url=b;const g=[];let O=u;if(f&&c){const t=new AbortController;O=setTimeout((()=>{t.abort(new s.XiorTimeoutError(`timeout of ${f}ms exceeded`,e))}),f),g.push(t.signal)}d&&g.push(d),v=g[0],g.length>1&&(v=(0,s.anySignal)(g,(()=>{clearTimeout(O)})));let j=b||r||"";e.baseURL&&!(0,s.isAbsoluteURL)(j)&&(j=(0,s.joinPath)(e.baseURL,j));let E=0,_=fetch(j,Object.assign(Object.assign({body:m?u:p},y),{signal:v,method:i,headers:l})).then((t=>n(this,void 0,void 0,(function*(){const{responseType:r}=e,o=yield function(e,t){return n(this,void 0,void 0,(function*(){let r;if(t&&e.ok&&!["text","json"].includes(t)){if("blob"===t)return e.blob();if("arraybuffer"===t)return e.arrayBuffer()}else if(r=yield e.text(),r&&"text"!==t)try{r=JSON.parse(r)}catch(e){}return r}))}(t,r),i={data:o,response:t,config:e,request:e,status:t.status,statusText:t.statusText,headers:t.headers};if(!t.ok){const r=new s.XiorError(t.status?`Request failed with status code ${t.status}`:"Network error",e,i);return Promise.reject(r)}return i})))).finally((()=>{var e;O&&clearTimeout(O),null===(e=null==v?void 0:v.clear)||void 0===e||e.call(v)}));const P=[];for(this.RESI.forEach((function(e){P.push(e.fn,e.onRejected)}));P.length>E;)_=_.then(P[E++],P[E++]);return _}))}cG(e){return(t,r)=>this.request(r?Object.assign(Object.assign({},r),{method:e,url:t}):{method:e,url:t})}cP(e){return(t,r,n)=>this.request(n?Object.assign(Object.assign({},n),{method:e,url:t,data:r}):{method:e,url:t,data:r})}get(e,t){return this.cG("GET")(e,t)}head(e,t){return this.cG("HEAD")(e,t)}post(e,t,r){return this.cP("POST")(e,t,r)}put(e,t,r){return this.cP("PUT")(e,t,r)}patch(e,t,r){return this.cP("PATCH")(e,t,r)}delete(e,t){return this.cG("DELETE")(e,t)}options(e,t){return this.cG("OPTIONS")(e,t)}}t.Xior=l,l.VERSION="0.5.3"},602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;const r=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1};t.merge=(...e)=>e.reduce(((e,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach((o=>{["__proto__","constructor","prototype"].includes(o)||(Array.isArray(e[o])&&Array.isArray(n[o])?e[o]=t.merge.options.mergeArrays?t.merge.options.uniqueArrayItems?Array.from(new Set(e[o].concat(n[o]))):[...e[o],...n[o]]:n[o]:r(e[o])&&r(n[o])?e[o]=(0,t.merge)(e[o],n[o]):e[o]=void 0===n[o]?t.merge.options.allowUndefinedOverrides?n[o]:e[o]:n[o])})),e}),{});const n={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};t.merge.options=n,t.merge.withOptions=(e,...r)=>{t.merge.options=Object.assign(Object.assign({},n),e);const o=(0,t.merge)(...r);return t.merge.options=n,o}},121:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(602);const o=void 0;class i extends Error{constructor(e,t,r){super(e),this.name="XiorError",this.request=t,this.config=t,this.response=r}}Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return n.merge}}),t.XiorError=i,t.XiorTimeoutError=class extends i{constructor(e,t,r){super(e),this.name="XiorTimeoutError",this.request=t,this.config=t,this.response=r}},t.anySignal=function(e,t){let r=new globalThis.AbortController;function n(e){r.abort(e),i()}let o=[];for(let t of e){if(!0===(null==t?void 0:t.aborted)){n(t.reason);break}if(null!=(null==t?void 0:t.addEventListener)){let e=()=>{n(t.reason)};o.push((()=>{null!=(null==t?void 0:t.removeEventListener)&&t.removeEventListener("abort",e)})),t.addEventListener("abort",e)}}function i(){o.forEach((e=>{e()})),null==t||t()}let s=r.signal;return s.clear=i,s},t.buildSortedURL=function(e,t,r){let n=t?r(t):"";n&&(n=e+(e.includes("?")?"&":"?")+n);let[o,i]=n.split("?");return i?`${o}?${i.split("&").sort().join("&")}`:n||e},t.delay=function(e){return new Promise((t=>{setTimeout((()=>{t("ok")}),e)}))},t.encodeParams=function e(t,r=!0,n=null,i){if(t===o||null===t)return"";let s=[],a=r?encodeURIComponent:e=>e,u=Array.isArray(t),{arrayFormat:c,allowDots:l,serializeDate:f}=i||{},d=e=>{if(l&&!u)return`.${e}`;if(u){if("brackets"===c)return"[]";if("repeat"===c)return""}return`[${e}]`};for(let u in t)if(Object.prototype.hasOwnProperty.call(t,u)){let c=t[u];if(c!==o){let t=n?`${n}${d(u)}`:u;if(!isNaN(c)&&c instanceof Date&&(c=f?f(c):c.toISOString()),"object"==typeof c){let n=e(c,r,t,i);""!==n&&s.push(n)}else s.push(`${a(t)}=${a(c)}`)}}return s.join("&")},t.isAbsoluteURL=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},t.isXiorError=function(e){return"XiorError"===e.name||"XiorTimeoutError"===e.name},t.joinPath=function(e,t){return t?(e.endsWith("/")?e:e+"/")+("/"===t[0]?t.slice(1):t):e},t.trimUndefined=function e(t){return Array.isArray(t)?t.map(e):(t&&"object"==typeof t&&Object.keys(t).forEach((r=>{let n=t[r];if(n!==o)return e(n);delete t[r]})),t)}}},t={},function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}(509).default;var e,t})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.xior=t():e.xior=t()}(this,(()=>{return e={699:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.anySignal=void 0,t.anySignal=function(e,t){const r=new globalThis.AbortController;function n(e){r.abort(e),i()}const o=[];for(const t of e){if(!0===(null==t?void 0:t.aborted)){n(t.reason);break}if(null!=(null==t?void 0:t.addEventListener)){const e=()=>{n(t.reason)};o.push((()=>{null!=(null==t?void 0:t.removeEventListener)&&t.removeEventListener("abort",e)})),t.addEventListener("abort",e)}}function i(){o.forEach((e=>{e()})),null==t||t()}const s=r.signal;return s.clear=i,s}},509:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const i=r(895);o(r(895),t),o(r(340),t),o(r(121),t);const s=Object.assign(i.Xior.create(),{create:i.Xior.create,VERSION:i.Xior.VERSION});t.default=s},393:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.likeGET=void 0;const o=r(121),i=r(976),s="application/",a=`${s}x-www-form-urlencoded`,u=`${s}json`,c="Content-Type",l=c.toLowerCase();function f(e="GET"){return["HEAD","GET","OPTIONS"].includes(e)}t.likeGET=f;const d="undefined"!=typeof URLSearchParams;t.default=function(e){return n(this,void 0,void 0,(function*(){const t=e.paramsSerializer||o.encodeParams,r=!1!==e.encodeURI,n=e.method?e.method.toUpperCase():"GET";let s=e.url||"";const h=s,p=d&&e.data&&e.data instanceof URLSearchParams,m=p?Object.fromEntries(e.data):e.data;let b=m;const y=(null==e?void 0:e.headers)||{};let v=e.params||{};const g=f(n);if(m&&!(m instanceof FormData)){let r="";if(null==e?void 0:e.headers){const t=Object.keys(e.headers).find((e=>e.toLowerCase()===l));t&&(r=e.headers[t],e.headers[c]=r,t!==c&&delete e.headers[t])}r||(r=g||p?a:u,y[c]=r),"object"==typeof m&&(g&&e.params&&(v=(0,o.merge)({},m||{},v)),r===u?b=JSON.stringify((0,i.trimUndefined)(m)):g||r!==a||(b=t(m)))}if(Object.keys(v).length>0){const e=t(v,r);s+=s.includes("?")?`&${e}`:`?${e}`}return Object.assign(Object.assign({},e),{_data:b,_url:s,data:m,url:h,method:n,headers:y,isGet:g})}))}},729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;const n=r(602);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return n.merge}})},629:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let n=t?r(t):"";n&&(n=e+(e.includes("?")?"&":"?")+n);const[o,i]=n.split("?");return i?`${o}?${i.split("&").sort().join("&")}`:n||e}},99:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.delay=t.buildSortedURL=void 0;const o=n(r(629));t.buildSortedURL=o.default,t.delay=function(e){return new Promise((t=>{setTimeout((()=>{t("ok")}),e)}))}},340:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},976:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isXiorError=t.XiorTimeoutError=t.XiorError=t.joinPath=t.isAbsoluteURL=t.trimUndefined=t.encodeParams=void 0,o(r(699),t),o(r(729),t),o(r(99),t);const i=void 0;t.encodeParams=function e(t,r=!0,n=null,o){if(t===i||null===t)return"";const s=[],a=r?encodeURIComponent:e=>e,u=Array.isArray(t),{arrayFormat:c,allowDots:l,serializeDate:f}=o||{},d=e=>{if(l&&!u)return`.${e}`;if(u){if("brackets"===c)return"[]";if("repeat"===c)return""}return`[${e}]`};for(const u in t)if(Object.prototype.hasOwnProperty.call(t,u)){let c=t[u];if(c!==i){const t=n?`${n}${d(u)}`:u;if(!isNaN(c)&&c instanceof Date&&(c=f?f(c):c.toISOString()),"object"==typeof c){const n=e(c,r,t,o);""!==n&&s.push(n)}else s.push(`${a(t)}=${a(c)}`)}}return s.join("&")},t.trimUndefined=function e(t){return Array.isArray(t)?t.map(e):(t&&"object"==typeof t&&Object.keys(t).forEach((r=>{const n=t[r];if(n!==i)return e(n);delete t[r]})),t)},t.isAbsoluteURL=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},t.joinPath=function(e,t){return t?(e.endsWith("/")?e:e+"/")+("/"===t[0]?t.slice(1):t):e};class s extends Error{constructor(e,t,r){super(e),this.name="XiorError",this.request=t,this.config=t,this.response=r}}t.XiorError=s,t.XiorTimeoutError=class extends s{constructor(e,t,r){super(e),this.name="XiorTimeoutError",this.request=t,this.config=t,this.response=r}},t.isXiorError=function(e){return"XiorError"===e.name||"XiorTimeoutError"===e.name}},895:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Xior=void 0;const s=r(121),a=i(r(393)),u=void 0,c="undefined"!=typeof AbortController;class l{static create(e){return new l(e)}constructor(e){this.REQI=[],this.RESI=[],this.P=[],this.config=e,this.defaults={params:{},headers:{}}}get interceptors(){return{request:{use:(e,t,r)=>(this.REQI.push(e),e),eject:e=>{this.REQI=this.REQI.filter((t=>t!==e))},clear:()=>{this.REQI=[]}},response:{use:(e,t)=>(this.RESI.push({fn:e,onRejected:t}),e),eject:e=>{this.RESI=this.RESI.filter((t=>t.fn!==e))},clear:()=>{this.RESI=[]}}}}get plugins(){return{use:e=>(this.P.push(e),e),eject:e=>{this.P=this.P.filter((t=>t!==e))},clear:()=>{this.P=[]}}}request(e){return n(this,void 0,void 0,(function*(){let t=(0,s.merge)({},this.config||{},this.defaults||{},"string"==typeof e?{url:e}:e||{},{headers:{},params:{}});t.withCredentials&&!t.credentials&&(t.credentials="include"),t.paramsSerializer||(t.paramsSerializer=s.encodeParams);for(const e of this.REQI)t=yield e(t);let r=this.fetch.bind(this);return this.P.forEach((e=>{r=e(r,this)})),r(t)}))}fetch(e){return n(this,void 0,void 0,(function*(){const t=yield(0,a.default)(e),{url:r,method:i,headers:l,timeout:f,signal:d,data:h,_data:p,_url:m,isGet:b}=t,y=o(t,["url","method","headers","timeout","signal","data","_data","_url","isGet"]);let v;e._url=m;const g=[];let O=u;if(f&&c){const t=new AbortController;O=setTimeout((()=>{t.abort(new s.XiorTimeoutError(`timeout of ${f}ms exceeded`,e))}),f),g.push(t.signal)}d&&g.push(d),v=g[0],g.length>1&&(v=(0,s.anySignal)(g,(()=>{clearTimeout(O)})));let j=m||r||"";e.baseURL&&!(0,s.isAbsoluteURL)(j)&&(j=(0,s.joinPath)(e.baseURL,j));let E=0,_=fetch(j,Object.assign(Object.assign({body:b?u:p},y),{signal:v,method:i,headers:l})).then((t=>n(this,void 0,void 0,(function*(){const{responseType:r}=e,o=yield function(e,t){return n(this,void 0,void 0,(function*(){let r;if(t&&e.ok&&!["text","json"].includes(t)){if("blob"===t)return e.blob();if("arraybuffer"===t)return e.arrayBuffer()}else if(r=yield e.text(),r&&"text"!==t)try{r=JSON.parse(r)}catch(e){}return r}))}(t,r),i={data:o,response:t,config:e,request:e,status:t.status,statusText:t.statusText,headers:t.headers};if(!t.ok){const r=new s.XiorError(t.status?`Request failed with status code ${t.status}`:"Network error",e,i);return Promise.reject(r)}return i})))).finally((()=>{var e;O&&clearTimeout(O),null===(e=null==v?void 0:v.clear)||void 0===e||e.call(v)}));const P=[];for(this.RESI.forEach((function(e){P.push(e.fn,e.onRejected)}));P.length>E;)_=_.then(P[E++],P[E++]);return _}))}cG(e){return(t,r)=>this.request(r?Object.assign(Object.assign({},r),{method:e,url:t}):{method:e,url:t})}cP(e){return(t,r,n)=>this.request(n?Object.assign(Object.assign({},n),{method:e,url:t,data:r}):{method:e,url:t,data:r})}get(e,t){return this.cG("GET")(e,t)}head(e,t){return this.cG("HEAD")(e,t)}post(e,t,r){return this.cP("POST")(e,t,r)}put(e,t,r){return this.cP("PUT")(e,t,r)}patch(e,t,r){return this.cP("PATCH")(e,t,r)}delete(e,t){return this.cG("DELETE")(e,t)}options(e,t){return this.cG("OPTIONS")(e,t)}}t.Xior=l,l.VERSION="0.5.4"},602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;const r=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1};t.merge=(...e)=>e.reduce(((e,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach((o=>{["__proto__","constructor","prototype"].includes(o)||(Array.isArray(e[o])&&Array.isArray(n[o])?e[o]=t.merge.options.mergeArrays?t.merge.options.uniqueArrayItems?Array.from(new Set(e[o].concat(n[o]))):[...e[o],...n[o]]:n[o]:r(e[o])&&r(n[o])?e[o]=(0,t.merge)(e[o],n[o]):e[o]=void 0===n[o]?t.merge.options.allowUndefinedOverrides?n[o]:e[o]:n[o])})),e}),{});const n={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};t.merge.options=n,t.merge.withOptions=(e,...r)=>{t.merge.options=Object.assign(Object.assign({},n),e);const o=(0,t.merge)(...r);return t.merge.options=n,o}},121:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(602);const o=void 0;class i extends Error{constructor(e,t,r){super(e),this.name="XiorError",this.request=t,this.config=t,this.response=r}}Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return n.merge}}),t.XiorError=i,t.XiorTimeoutError=class extends i{constructor(e,t,r){super(e),this.name="XiorTimeoutError",this.request=t,this.config=t,this.response=r}},t.anySignal=function(e,t){let r=new globalThis.AbortController;function n(e){r.abort(e),i()}let o=[];for(let t of e){if(!0===(null==t?void 0:t.aborted)){n(t.reason);break}if(null!=(null==t?void 0:t.addEventListener)){let e=()=>{n(t.reason)};o.push((()=>{null!=(null==t?void 0:t.removeEventListener)&&t.removeEventListener("abort",e)})),t.addEventListener("abort",e)}}function i(){o.forEach((e=>{e()})),null==t||t()}let s=r.signal;return s.clear=i,s},t.buildSortedURL=function(e,t,r){let n=t?r(t):"";n&&(n=e+(e.includes("?")?"&":"?")+n);let[o,i]=n.split("?");return i?`${o}?${i.split("&").sort().join("&")}`:n||e},t.delay=function(e){return new Promise((t=>{setTimeout((()=>{t("ok")}),e)}))},t.encodeParams=function e(t,r=!0,n=null,i){if(t===o||null===t)return"";let s=[],a=r?encodeURIComponent:e=>e,u=Array.isArray(t),{arrayFormat:c,allowDots:l,serializeDate:f}=i||{},d=e=>{if(l&&!u)return`.${e}`;if(u){if("brackets"===c)return"[]";if("repeat"===c)return""}return`[${e}]`};for(let u in t)if(Object.prototype.hasOwnProperty.call(t,u)){let c=t[u];if(c!==o){let t=n?`${n}${d(u)}`:u;if(!isNaN(c)&&c instanceof Date&&(c=f?f(c):c.toISOString()),"object"==typeof c){let n=e(c,r,t,i);""!==n&&s.push(n)}else s.push(`${a(t)}=${a(c)}`)}}return s.join("&")},t.isAbsoluteURL=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},t.isXiorError=function(e){return"XiorError"===e.name||"XiorTimeoutError"===e.name},t.joinPath=function(e,t){return t?(e.endsWith("/")?e:e+"/")+("/"===t[0]?t.slice(1):t):e},t.trimUndefined=function e(t){return Array.isArray(t)?t.map(e):(t&&"object"==typeof t&&Object.keys(t).forEach((r=>{let n=t[r];if(n!==o)return e(n);delete t[r]})),t)}}},t={},function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}(509).default;var e,t})); |
{ | ||
"name": "xior", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "A lite request lib based on fetch with plugin support and similar API to axios.", | ||
@@ -5,0 +5,0 @@ "repository": "suhaotian/xior", |
@@ -102,3 +102,3 @@ [![Build](https://github.com/suhaotian/xior/actions/workflows/check.yml/badge.svg)](https://github.com/suhaotian/xior/actions/workflows/check.yml) | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
@@ -118,3 +118,3 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
@@ -566,5 +566,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/plugins/error-retry.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/error-retry.umd.js"></script> | ||
@@ -582,6 +582,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.3/plugins/error-retry.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/error-retry.umd.js"></script> | ||
@@ -679,5 +679,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/plugins/throttle.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/throttle.umd.js"></script> | ||
@@ -695,6 +695,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.3/plugins/throttle.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/throttle.umd.js"></script> | ||
@@ -754,5 +754,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/plugins/dedupe.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/dedupe.umd.js"></script> | ||
@@ -770,6 +770,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.3/plugins/dedupe.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/dedupe.umd.js"></script> | ||
@@ -836,5 +836,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/plugins/error-cache.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/error-cache.umd.js"></script> | ||
@@ -852,6 +852,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.3/plugins/error-cache.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/error-cache.umd.js"></script> | ||
@@ -1001,5 +1001,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/plugins/progress.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/progress.umd.js"></script> | ||
@@ -1017,6 +1017,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.3/plugins/progress.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/progress.umd.js"></script> | ||
@@ -1128,5 +1128,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.3/plugins/mock.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/mock.umd.js"></script> | ||
@@ -1144,6 +1144,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.3/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.3/plugins/mock.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/mock.umd.js"></script> | ||
@@ -1150,0 +1150,0 @@ <!-- Usage --> |
Sorry, the diff of this file is not supported yet
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
254506