Comparing version 0.5.4 to 0.5.5
@@ -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(),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}; | ||
import{merge as t,encodeParams as e,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(t,e,r,n,i,s,a){try{var o=t[s](a),u=o.value}catch(t){r(t);return}o.done?e(u):Promise.resolve(u).then(n,i)}function l(){return(l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}let c="application/",f=`${c}x-www-form-urlencoded`,h=`${c}json`,d="undefined"!=typeof URLSearchParams;function p(){var r;return r=function*(r){let n=r.paramsSerializer||e,i=!1!==r.encodeURI,s=r.method?r.method.toUpperCase():"GET",a=r.url||"",u=a,c=d&&r.data&&r.data instanceof URLSearchParams,p=c?Object.fromEntries(r.data):r.data,m=p,y=(null==r?void 0:r.headers)||{},E=r.params||{},v=function(t="GET"){return["HEAD","GET","OPTIONS"].includes(t)}(s);if(p&&!(p instanceof FormData)){let e="",i="content-type";if(null==r?void 0:r.headers){let t=Object.keys(r.headers).find(t=>t.toLowerCase()===i);t&&(i=t,e=r.headers[t])}(!e||c)&&(e=v||c?f:h,y[i]=e),"object"!=typeof p||(v&&r.params&&(E=t({},p||{},E)),e===h?m=JSON.stringify(o(p)):v||e!==f||(m=n(p)))}if(Object.keys(E).length>0){let t=n(E,i);a+=a.includes("?")?`&${t}`:`?${t}`}return l({},r,{_data:m,_url:a,data:p,url:u,method:s,headers:y,isGet:v})},(p=function(){var t=this,e=arguments;return new Promise(function(n,i){var s=r.apply(t,e);function a(t){u(s,n,i,a,o,"next",t)}function o(t){u(s,n,i,a,o,"throw",t)}a(void 0)})}).apply(this,arguments)}function m(t,e,r,n,i,s,a){try{var o=t[s](a),u=o.value}catch(t){r(t);return}o.done?e(u):Promise.resolve(u).then(n,i)}function y(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function a(t){m(s,n,i,a,o,"next",t)}function o(t){m(s,n,i,a,o,"throw",t)}a(void 0)})}}function E(){return(E=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}let v=void 0,P=typeof AbortController!=`${v}`;function b(){return(b=y(function*(t,e){let r;if(!e||!t.ok||["text","json"].includes(e)){if((r=yield t.text())&&"text"!==e)try{r=JSON.parse(r)}catch(t){}}else if("blob"===e)return t.blob();else if("arraybuffer"===e)return t.arrayBuffer();return r})).apply(this,arguments)}class O{static create(t){return new O(t)}get interceptors(){return{request:{use:(t,e,r)=>(this.REQI.push(t),t),eject:t=>{this.REQI=this.REQI.filter(e=>e!==t)},clear:()=>{this.REQI=[]}},response:{use:(t,e)=>(this.RESI.push({fn:t,onRejected:e}),t),eject:t=>{this.RESI=this.RESI.filter(e=>e.fn!==t)},clear:()=>{this.RESI=[]}}}}get plugins(){return{use:t=>(this.P.push(t),t),eject:t=>{this.P=this.P.filter(e=>e!==t)},clear:()=>{this.P=[]}}}request(r){var n=this;return y(function*(){let i=t({},n.config||{},n.defaults||{},"string"==typeof r?{url:r}:r||{},{headers:{},params:{}});for(let t of(i.withCredentials&&!i.credentials&&(i.credentials="include"),i.paramsSerializer||(i.paramsSerializer=e),n.REQI))i=yield t(i);let s=n.fetch.bind(n);return n.P.forEach(t=>{s=t(s,n)}),s(i)})()}fetch(t){var e=this;return y(function*(){let o;let u=yield function(t){return p.apply(this,arguments)}(t),{url:l,method:c,headers:f,timeout:h,signal:d,data:m,_data:O,_url:R,isGet:g}=u,S=function(t,e){if(null==t)return{};var r,n,i={},s=Object.keys(t);for(n=0;n<s.length;n++)e.indexOf(r=s[n])>=0||(i[r]=t[r]);return i}(u,["url","method","headers","timeout","signal","data","_data","_url","isGet"]);t._url=R;let j=[],I=v;if(h&&P){let e=new AbortController;I=setTimeout(()=>{e.abort(new r(`timeout of ${h}ms exceeded`,t))},h),j.push(e.signal)}d&&j.push(d),o=j[0],j.length>1&&(o=n(j,()=>{clearTimeout(I)}));let w=R||l||"";t.baseURL&&!i(w)&&(w=s(t.baseURL,w));let x=0,T=fetch(w,E({body:g?v:O},S,{signal:o,method:c,headers:f})).then(y(function*(e){let{responseType:r}=t,n={data:yield function(t,e){return b.apply(this,arguments)}(e,r),response:e,config:t,request:t,status:e.status,statusText:e.statusText,headers:e.headers};return e.ok?n:Promise.reject(new a(e.status?`Request failed with status code ${e.status}`:"Network error",t,n))})).finally(()=>{var t;I&&clearTimeout(I),null==o||null==(t=o.clear)||t.call(o)}),G=[];for(e.RESI.forEach(function(t){G.push(t.fn,t.onRejected)});G.length>x;)T=T.then(G[x++],G[x++]);return T})()}cG(t){return(e,r)=>this.request(r?E({},r,{method:t,url:e}):{method:t,url:e})}cP(t){return(e,r,n)=>this.request(n?E({},n,{method:t,url:e,data:r}):{method:t,url:e,data:r})}get(t,e){return this.cG("GET")(t,e)}head(t,e){return this.cG("HEAD")(t,e)}post(t,e,r){return this.cP("POST")(t,e,r)}put(t,e,r){return this.cP("PUT")(t,e,r)}patch(t,e,r){return this.cP("PATCH")(t,e,r)}delete(t,e){return this.cG("DELETE")(t,e)}options(t,e){return this.cG("OPTIONS")(t,e)}constructor(t){this.REQI=[],this.RESI=[],this.P=[],this.config=t,this.defaults={params:{},headers:{}}}}O.VERSION="0.5.5";let R=Object.assign(O.create(),{create:O.create,VERSION:O.VERSION});export{O as Xior,R 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;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})); | ||
!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`;function c(e="GET"){return["HEAD","GET","OPTIONS"].includes(e)}t.likeGET=c;const l="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 f=s,d=l&&e.data&&e.data instanceof URLSearchParams,h=d?Object.fromEntries(e.data):e.data;let p=h;const m=(null==e?void 0:e.headers)||{};let b=e.params||{};const y=c(n);if(h&&!(h instanceof FormData)){let r="",n="content-type";if(null==e?void 0:e.headers){const t=Object.keys(e.headers).find((e=>e.toLowerCase()===n));t&&(n=t,r=e.headers[t])}r&&!d||(r=y||d?a:u,m[n]=r),"object"==typeof h&&(y&&e.params&&(b=(0,o.merge)({},h||{},b)),r===u?p=JSON.stringify((0,i.trimUndefined)(h)):y||r!==a||(p=t(h)))}if(Object.keys(b).length>0){const e=t(b,r);s+=s.includes("?")?`&${e}`:`?${e}`}return Object.assign(Object.assign({},e),{_data:p,_url:s,data:h,url:f,method:n,headers:m,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: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.5"},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.4", | ||
"version": "0.5.5", | ||
"description": "A lite request lib based on fetch with plugin support and similar API to axios.", | ||
@@ -5,0 +5,0 @@ "repository": "suhaotian/xior", |
[![Build](https://github.com/suhaotian/xior/actions/workflows/check.yml/badge.svg)](https://github.com/suhaotian/xior/actions/workflows/check.yml) | ||
[![minzipped size](https://badgen.net/badge/gzip/4kb/green)](https://bundlephobia.com/package/xior) | ||
[![Size](https://deno.bundlejs.com/badge?q=xior@0.5.5&badge=detailed)](https://bundlejs.com/?q=xior%400.5.5) | ||
[![npm version](https://badgen.net/npm/v/xior?color=green)](https://www.npmjs.com/package/xior) | ||
![Downloads](https://img.shields.io/npm/dm/xior.svg?style=flat) | ||
![typescript](https://badgen.net/badge/icon/typescript?icon=typescript&label&color=blue) | ||
![license](https://badgen.net/npm/license/xior?color=blue) | ||
@@ -18,3 +17,3 @@ ## Intro | ||
- 🥷 Plugin support: error retry, cache, throttling, dedupe, error cache, mock and easily create custom plugins | ||
- 🚀 Lightweight (~12KB, Gzip ~4kb) | ||
- 🚀 Lightweight (~8KB, Gzip ~3kb) | ||
- 👊 Unit tested and strongly typed 💪 | ||
@@ -103,3 +102,3 @@ | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/dist/xior.umd.js"></script> | ||
@@ -119,3 +118,3 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/dist/xior.umd.js"></script> | ||
@@ -567,5 +566,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/error-retry.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/plugins/error-retry.umd.js"></script> | ||
@@ -583,6 +582,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/error-retry.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/plugins/error-retry.umd.js"></script> | ||
@@ -680,5 +679,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/throttle.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/plugins/throttle.umd.js"></script> | ||
@@ -696,6 +695,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/throttle.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/plugins/throttle.umd.js"></script> | ||
@@ -755,5 +754,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/dedupe.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/plugins/dedupe.umd.js"></script> | ||
@@ -771,6 +770,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/dedupe.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/plugins/dedupe.umd.js"></script> | ||
@@ -837,5 +836,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/error-cache.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/plugins/error-cache.umd.js"></script> | ||
@@ -853,6 +852,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/error-cache.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/plugins/error-cache.umd.js"></script> | ||
@@ -1002,5 +1001,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/progress.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/plugins/progress.umd.js"></script> | ||
@@ -1018,6 +1017,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/progress.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/plugins/progress.umd.js"></script> | ||
@@ -1129,5 +1128,5 @@ <!-- Usage --> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.4/plugins/mock.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/xior@0.5.5/plugins/mock.umd.js"></script> | ||
@@ -1145,6 +1144,6 @@ <!-- Usage --> | ||
```html | ||
<script src="https://unpkg.com/xior@0.5.4/dist/xior.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/dist/xior.umd.js"></script> | ||
<!-- Load plugin --> | ||
<script src="https://unpkg.com/xior@0.5.4/plugins/mock.umd.js"></script> | ||
<script src="https://unpkg.com/xior@0.5.5/plugins/mock.umd.js"></script> | ||
@@ -1151,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
254253
2048