Comparing version 1.2.0 to 1.2.1
@@ -1,2 +0,2 @@ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var o in r)("object"==typeof exports?exports:t)[o]=r[o]}}(this,function(){return function(t){function e(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";var o=r(1),n=r(3),i=n.fetchDecorator;t.exports={fetch:i(o)}},function(t,e,r){r(2),t.exports=self.fetch.bind(self)},function(t,e){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function o(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return h.iterable&&(e[Symbol.iterator]=function(){return e}),e}function n(t){this.map={},t instanceof n?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function i(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function a(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader;return e.readAsArrayBuffer(t),a(e)}function f(t){var e=new FileReader;return e.readAsText(t),a(e)}function c(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(h.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(h.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(h.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(t){if(!h.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):h.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},h.blob?(this.blob=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return f(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=i(this);return t?t:Promise.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function u(t){var e=t.toUpperCase();return b.indexOf(e)>-1?e:t}function l(t,e){e=e||{};var r=e.body;if(l.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new n(t.headers)),this.method=t.method,this.mode=t.mode,r||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new n(e.headers)),this.method=u(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}}),e}function d(t){var e=new n,r=(t.getAllResponseHeaders()||"").trim().split("\n");return r.forEach(function(t){var r=t.trim().split(":"),o=r.shift().trim(),n=r.join(":").trim();e.append(o,n)}),e}function y(t,e){e||(e={}),this.type="default",this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof n?e.headers:new n(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var h={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};n.prototype.append=function(t,o){t=e(t),o=r(o);var n=this.map[t];n||(n=[],this.map[t]=n),n.push(o)},n.prototype.delete=function(t){delete this.map[e(t)]},n.prototype.get=function(t){var r=this.map[e(t)];return r?r[0]:null},n.prototype.getAll=function(t){return this.map[e(t)]||[]},n.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},n.prototype.set=function(t,o){this.map[e(t)]=[r(o)]},n.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(o){t.call(e,o,r,this)},this)},this)},n.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),o(t)},n.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},n.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),o(t)},h.iterable&&(n.prototype[Symbol.iterator]=n.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this)},c.call(l.prototype),c.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new n(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];y.redirect=function(t,e){if(m.indexOf(e)===-1)throw new RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},t.Headers=n,t.Request=l,t.Response=y,t.fetch=function(t,e){return new Promise(function(r,o){function n(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0}var i;i=l.prototype.isPrototypeOf(t)&&!e?t:new l(t,e);var a=new XMLHttpRequest;a.onload=function(){var t={status:a.status,statusText:a.statusText,headers:d(a),url:n()},e="response"in a?a.response:a.responseText;r(new y(e,t))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.open(i.method,i.url,!0),"include"===i.credentials&&(a.withCredentials=!0),"responseType"in a&&h.blob&&(a.responseType="blob"),i.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),a.send("undefined"==typeof i._bodyInit?null:i._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(t,e,r){"use strict";function o(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}function n(t,e){var r={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r}var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=r(4),f=r(9),c=r(10),u=function(t){return t},p={},d="",y=function(t){return t},h=function(t,e,r){var o=e.ssl,n=(e.method,e.query);return"function"==typeof r?r(t,e):("string"==typeof r&&(t=t.replace(/^\/\//,r)),/^\/\//.test(t)&&(t=(o?"https":"http")+":"+t),n&&(t+=""+(t.match(/\?/)?"&":"?")+s.stringify(n)),t)},b=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.method,o=void 0===r?"GET":r,u=e.query,y=void 0===u?{}:u,b=e.data,m=void 0===b?{}:b,v=e.body,w=void 0===v?{}:v,g=e.headers,O=void 0===g?{}:g,j=(e.json,n(e,["method","query","data","body","headers","json"])),x="GET"===o||"HEAD"===o;if(x?y="object"===("undefined"==typeof y?"undefined":a(y))?i({},y,m,w):0===Object.keys(y).length?m:y:w="object"!==("undefined"==typeof w?"undefined":a(w))||w instanceof FormData?0!==Object.keys(w).length||w instanceof FormData?w:m:i({},m,w),O=new Headers(i({},O,p instanceof Headers?function(){var t={};return p.keys().forEach(function(e){t[l]=p.get(e)}),t}():p)),x?"":O.set("Content-Type",O.get("Content-Type")||f(w)),"object"===("undefined"==typeof w?"undefined":a(w)))switch(O.get("Content-Type")){case c.form:w=s.stringify(w);break;case c.formData:var E=function(){var t=new FormData;return Object.keys(w).forEach(function(e){t.set(e,w[e])}),w=t,"break"}();if("break"===E)break}var T=i({method:o,query:y,headers:O},j);return x||(T.body=w),[h(t,T,d),T]},m=function(t){var e=function(){return t.call.apply(t,[void 0].concat(o(b.apply(void 0,arguments)))).then(y).then(u)};return e.callback=function(t){"function"==typeof t&&(u=t),delete e.callback},e.baseHost=function(t){d=t},e.headers=function(t){if("object"!==("undefined"==typeof t?"undefined":a(t))||"function"!=typeof t)throw new Error("global headers must be object or function");p=t,delete e.headers},e};t.exports={fetchDecorator:m}},function(t,e,r){"use strict";var o=r(5),n=r(8),i=r(7);t.exports={formats:i,parse:n,stringify:o}},function(t,e,r){"use strict";var o=r(6),n=r(7),i={brackets:function(t){return t+"[]"},indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},a=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:o.encode,serializeDate:function(t){return a.call(t)},skipNulls:!1,strictNullHandling:!1},f=function t(e,r,n,i,a,s,f,c,u,l,p){var d=e;if("function"==typeof f)d=f(r,d);else if(d instanceof Date)d=l(d);else if(null===d){if(i)return s?s(r):r;d=""}if("string"==typeof d||"number"==typeof d||"boolean"==typeof d||o.isBuffer(d))return s?[p(s(r))+"="+p(s(d))]:[p(r)+"="+p(String(d))];var y=[];if("undefined"==typeof d)return y;var h;if(Array.isArray(f))h=f;else{var b=Object.keys(d);h=c?b.sort(c):b}for(var m=0;m<h.length;++m){var v=h[m];a&&null===d[v]||(y=Array.isArray(d)?y.concat(t(d[v],n(r,v),n,i,a,s,f,c,u,l,p)):y.concat(t(d[v],r+(u?"."+v:"["+v+"]"),n,i,a,s,f,c,u,l,p)))}return y};t.exports=function(t,e){var r=t,o=e||{},a="undefined"==typeof o.delimiter?s.delimiter:o.delimiter,c="boolean"==typeof o.strictNullHandling?o.strictNullHandling:s.strictNullHandling,u="boolean"==typeof o.skipNulls?o.skipNulls:s.skipNulls,l="boolean"==typeof o.encode?o.encode:s.encode,p=l?"function"==typeof o.encoder?o.encoder:s.encoder:null,d="function"==typeof o.sort?o.sort:null,y="undefined"!=typeof o.allowDots&&o.allowDots,h="function"==typeof o.serializeDate?o.serializeDate:s.serializeDate;if("undefined"==typeof o.format)o.format=n.default;else if(!Object.prototype.hasOwnProperty.call(n.formatters,o.format))throw new TypeError("Unknown format option provided.");var b,m,v=n.formatters[o.format];if(null!==o.encoder&&void 0!==o.encoder&&"function"!=typeof o.encoder)throw new TypeError("Encoder has to be a function.");"function"==typeof o.filter?(m=o.filter,r=m("",r)):Array.isArray(o.filter)&&(m=o.filter,b=m);var w=[];if("object"!=typeof r||null===r)return"";var g;g=o.arrayFormat in i?o.arrayFormat:"indices"in o?o.indices?"indices":"repeat":"indices";var O=i[g];b||(b=Object.keys(r)),d&&b.sort(d);for(var j=0;j<b.length;++j){var x=b[j];u&&null===r[x]||(w=w.concat(f(r[x],x,O,c,u,p,m,d,y,h,v)))}return w.join(a)}},function(t,e){"use strict";var r=Object.prototype.hasOwnProperty,o=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}();e.arrayToObject=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},o=0;o<t.length;++o)"undefined"!=typeof t[o]&&(r[o]=t[o]);return r},e.merge=function(t,o,n){if(!o)return t;if("object"!=typeof o){if(Array.isArray(t))t.push(o);else{if("object"!=typeof t)return[t,o];t[o]=!0}return t}if("object"!=typeof t)return[t].concat(o);var i=t;return Array.isArray(t)&&!Array.isArray(o)&&(i=e.arrayToObject(t,n)),Array.isArray(t)&&Array.isArray(o)?(o.forEach(function(o,i){r.call(t,i)?t[i]&&"object"==typeof t[i]?t[i]=e.merge(t[i],o,n):t.push(o):t[i]=o}),t):Object.keys(o).reduce(function(t,r){var i=o[r];return Object.prototype.hasOwnProperty.call(t,r)?t[r]=e.merge(t[r],i,n):t[r]=i,t},i)},e.decode=function(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}},e.encode=function(t){if(0===t.length)return t;for(var e="string"==typeof t?t:String(t),r="",n=0;n<e.length;++n){var i=e.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=e.charAt(n):i<128?r+=o[i]:i<2048?r+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?r+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&e.charCodeAt(n)),r+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return r},e.compact=function(t,r){if("object"!=typeof t||null===t)return t;var o=r||[],n=o.indexOf(t);if(n!==-1)return o[n];if(o.push(t),Array.isArray(t)){for(var i=[],a=0;a<t.length;++a)t[a]&&"object"==typeof t[a]?i.push(e.compact(t[a],o)):"undefined"!=typeof t[a]&&i.push(t[a]);return i}var s=Object.keys(t);return s.forEach(function(r){t[r]=e.compact(t[r],o)}),t},e.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},e.isBuffer=function(t){return null!==t&&"undefined"!=typeof t&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}},function(t,e){"use strict";var r=String.prototype.replace,o=/%20/g;t.exports={default:"RFC3986",formatters:{RFC1738:function(t){return r.call(t,o,"+")},RFC3986:function(t){return t}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(t,e,r){"use strict";var o=r(6),n=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:o.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(t,e){for(var r={},o=t.split(e.delimiter,e.parameterLimit===1/0?void 0:e.parameterLimit),i=0;i<o.length;++i){var a,s,f=o[i],c=f.indexOf("]=")===-1?f.indexOf("="):f.indexOf("]=")+1;c===-1?(a=e.decoder(f),s=e.strictNullHandling?null:""):(a=e.decoder(f.slice(0,c)),s=e.decoder(f.slice(c+1))),n.call(r,a)?r[a]=[].concat(r[a]).concat(s):r[a]=s}return r},s=function t(e,r,o){if(!e.length)return r;var n,i=e.shift();if("[]"===i)n=[],n=n.concat(t(e,r,o));else{n=o.plainObjects?Object.create(null):{};var a="["===i[0]&&"]"===i[i.length-1]?i.slice(1,i.length-1):i,s=parseInt(a,10);!isNaN(s)&&i!==a&&String(s)===a&&s>=0&&o.parseArrays&&s<=o.arrayLimit?(n=[],n[s]=t(e,r,o)):n[a]=t(e,r,o)}return n},f=function(t,e,r){if(t){var o=r.allowDots?t.replace(/\.([^\.\[]+)/g,"[$1]"):t,i=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,f=i.exec(o),c=[];if(f[1]){if(!r.plainObjects&&n.call(Object.prototype,f[1])&&!r.allowPrototypes)return;c.push(f[1])}for(var u=0;null!==(f=a.exec(o))&&u<r.depth;)u+=1,(r.plainObjects||!n.call(Object.prototype,f[1].replace(/\[|\]/g,""))||r.allowPrototypes)&&c.push(f[1]);return f&&c.push("["+o.slice(f.index)+"]"),s(c,e,r)}};t.exports=function(t,e){var r=e||{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.delimiter="string"==typeof r.delimiter||o.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"==typeof r.depth?r.depth:i.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=r.parseArrays!==!1,r.decoder="function"==typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===t||null===t||"undefined"==typeof t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?a(t,r):t,s=r.plainObjects?Object.create(null):{},c=Object.keys(n),u=0;u<c.length;++u){var l=c[u],p=f(l,n[l],r);s=o.merge(s,p,r)}return o.compact(s)}},function(t,e,r){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=r(10),i=function(t,e){if(t instanceof FormData)return n.formData;if("string"==typeof t)try{if(JSON.parse(t))return n.json}catch(t){return n.text}return"object"===("undefined"==typeof t?"undefined":o(t))?e?n.json:n.form:n.text};t.exports=i},function(t,e){"use strict";t.exports={formData:"multipart/form-data",form:"application/x-www-form-urlencoded",json:"application/json",text:"text/plain"}}])}); | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var o in r)("object"==typeof exports?exports:t)[o]=r[o]}}(this,function(){return function(t){function e(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";var o=r(1),n=r(3),i=n.fetchDecorator;t.exports={fetch:i(o)}},function(t,e,r){r(2),t.exports=self.fetch.bind(self)},function(t,e){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function o(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return h.iterable&&(e[Symbol.iterator]=function(){return e}),e}function n(t){this.map={},t instanceof n?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function i(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function a(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader;return e.readAsArrayBuffer(t),a(e)}function f(t){var e=new FileReader;return e.readAsText(t),a(e)}function c(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(h.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(h.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(h.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(t){if(!h.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):h.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},h.blob?(this.blob=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return f(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=i(this);return t?t:Promise.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function u(t){var e=t.toUpperCase();return b.indexOf(e)>-1?e:t}function l(t,e){e=e||{};var r=e.body;if(l.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new n(t.headers)),this.method=t.method,this.mode=t.mode,r||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new n(e.headers)),this.method=u(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}}),e}function d(t){var e=new n,r=(t.getAllResponseHeaders()||"").trim().split("\n");return r.forEach(function(t){var r=t.trim().split(":"),o=r.shift().trim(),n=r.join(":").trim();e.append(o,n)}),e}function y(t,e){e||(e={}),this.type="default",this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof n?e.headers:new n(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var h={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};n.prototype.append=function(t,o){t=e(t),o=r(o);var n=this.map[t];n||(n=[],this.map[t]=n),n.push(o)},n.prototype.delete=function(t){delete this.map[e(t)]},n.prototype.get=function(t){var r=this.map[e(t)];return r?r[0]:null},n.prototype.getAll=function(t){return this.map[e(t)]||[]},n.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},n.prototype.set=function(t,o){this.map[e(t)]=[r(o)]},n.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(o){t.call(e,o,r,this)},this)},this)},n.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),o(t)},n.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},n.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),o(t)},h.iterable&&(n.prototype[Symbol.iterator]=n.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this)},c.call(l.prototype),c.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new n(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];y.redirect=function(t,e){if(m.indexOf(e)===-1)throw new RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},t.Headers=n,t.Request=l,t.Response=y,t.fetch=function(t,e){return new Promise(function(r,o){function n(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0}var i;i=l.prototype.isPrototypeOf(t)&&!e?t:new l(t,e);var a=new XMLHttpRequest;a.onload=function(){var t={status:a.status,statusText:a.statusText,headers:d(a),url:n()},e="response"in a?a.response:a.responseText;r(new y(e,t))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.open(i.method,i.url,!0),"include"===i.credentials&&(a.withCredentials=!0),"responseType"in a&&h.blob&&(a.responseType="blob"),i.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),a.send("undefined"==typeof i._bodyInit?null:i._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(t,e,r){"use strict";function o(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}function n(t,e){var r={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r}var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=r(4),f=r(9),c=r(10),u=function(t){return t},p={},d="",y=function(t){return t},h=function(t,e,r){var o=e.ssl,n=(e.method,e.query);return"function"==typeof r?r(t,e):("string"==typeof r&&(t=t.replace(/^\/\//,r)),/^\/\//.test(t)&&(t=(o?"https":"http")+":"+t),n&&(t+=""+(t.match(/\?/)?"&":"?")+s.stringify(n)),t)},b=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.method,o=void 0===r?"GET":r,u=e.query,y=void 0===u?{}:u,b=e.data,m=void 0===b?{}:b,v=e.body,w=void 0===v?{}:v,g=e.headers,O=void 0===g?{}:g,j=(e.json,n(e,["method","query","data","body","headers","json"])),x="GET"===o||"HEAD"===o;if(x?y="object"===("undefined"==typeof y?"undefined":a(y))?i({},y,m,w):0===Object.keys(y).length?m:y:w="object"!==("undefined"==typeof w?"undefined":a(w))||w instanceof FormData?0!==Object.keys(w).length||w instanceof FormData?w:m:i({},m,w),O=new Headers(i({},O,p instanceof Headers?function(){var t={};return p.keys().forEach(function(e){t[l]=p.get(e)}),t}():p)),x?"":O.set("Content-Type",O.get("Content-Type")||f(w)),"object"===("undefined"==typeof w?"undefined":a(w)))switch(O.get("Content-Type")){case c.form:w=s.stringify(w);break;case c.formData:var E=function(){var t=new FormData;return Object.keys(w).forEach(function(e){t.set(e,w[e])}),w=t,"break"}();if("break"===E)break}var T=i({method:o,query:y,headers:O},j);return x||(T.body=w),[h(t,T,d),T]},m=function(t){var e=function(){return t.call.apply(t,[void 0].concat(o(b.apply(void 0,arguments)))).then(y).then(u)};return e.callback=function(t){"function"==typeof t&&(u=t),delete e.callback},e.baseHost=function(t){d=t},e.headers=function(t){if("object"!==("undefined"==typeof t?"undefined":a(t))&&"function"!=typeof t)throw new Error("global headers must be object or function");p=t,delete e.headers},e};t.exports={fetchDecorator:m}},function(t,e,r){"use strict";var o=r(5),n=r(8),i=r(7);t.exports={formats:i,parse:n,stringify:o}},function(t,e,r){"use strict";var o=r(6),n=r(7),i={brackets:function(t){return t+"[]"},indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},a=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:o.encode,serializeDate:function(t){return a.call(t)},skipNulls:!1,strictNullHandling:!1},f=function t(e,r,n,i,a,s,f,c,u,l,p){var d=e;if("function"==typeof f)d=f(r,d);else if(d instanceof Date)d=l(d);else if(null===d){if(i)return s?s(r):r;d=""}if("string"==typeof d||"number"==typeof d||"boolean"==typeof d||o.isBuffer(d))return s?[p(s(r))+"="+p(s(d))]:[p(r)+"="+p(String(d))];var y=[];if("undefined"==typeof d)return y;var h;if(Array.isArray(f))h=f;else{var b=Object.keys(d);h=c?b.sort(c):b}for(var m=0;m<h.length;++m){var v=h[m];a&&null===d[v]||(y=Array.isArray(d)?y.concat(t(d[v],n(r,v),n,i,a,s,f,c,u,l,p)):y.concat(t(d[v],r+(u?"."+v:"["+v+"]"),n,i,a,s,f,c,u,l,p)))}return y};t.exports=function(t,e){var r=t,o=e||{},a="undefined"==typeof o.delimiter?s.delimiter:o.delimiter,c="boolean"==typeof o.strictNullHandling?o.strictNullHandling:s.strictNullHandling,u="boolean"==typeof o.skipNulls?o.skipNulls:s.skipNulls,l="boolean"==typeof o.encode?o.encode:s.encode,p=l?"function"==typeof o.encoder?o.encoder:s.encoder:null,d="function"==typeof o.sort?o.sort:null,y="undefined"!=typeof o.allowDots&&o.allowDots,h="function"==typeof o.serializeDate?o.serializeDate:s.serializeDate;if("undefined"==typeof o.format)o.format=n.default;else if(!Object.prototype.hasOwnProperty.call(n.formatters,o.format))throw new TypeError("Unknown format option provided.");var b,m,v=n.formatters[o.format];if(null!==o.encoder&&void 0!==o.encoder&&"function"!=typeof o.encoder)throw new TypeError("Encoder has to be a function.");"function"==typeof o.filter?(m=o.filter,r=m("",r)):Array.isArray(o.filter)&&(m=o.filter,b=m);var w=[];if("object"!=typeof r||null===r)return"";var g;g=o.arrayFormat in i?o.arrayFormat:"indices"in o?o.indices?"indices":"repeat":"indices";var O=i[g];b||(b=Object.keys(r)),d&&b.sort(d);for(var j=0;j<b.length;++j){var x=b[j];u&&null===r[x]||(w=w.concat(f(r[x],x,O,c,u,p,m,d,y,h,v)))}return w.join(a)}},function(t,e){"use strict";var r=Object.prototype.hasOwnProperty,o=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}();e.arrayToObject=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},o=0;o<t.length;++o)"undefined"!=typeof t[o]&&(r[o]=t[o]);return r},e.merge=function(t,o,n){if(!o)return t;if("object"!=typeof o){if(Array.isArray(t))t.push(o);else{if("object"!=typeof t)return[t,o];t[o]=!0}return t}if("object"!=typeof t)return[t].concat(o);var i=t;return Array.isArray(t)&&!Array.isArray(o)&&(i=e.arrayToObject(t,n)),Array.isArray(t)&&Array.isArray(o)?(o.forEach(function(o,i){r.call(t,i)?t[i]&&"object"==typeof t[i]?t[i]=e.merge(t[i],o,n):t.push(o):t[i]=o}),t):Object.keys(o).reduce(function(t,r){var i=o[r];return Object.prototype.hasOwnProperty.call(t,r)?t[r]=e.merge(t[r],i,n):t[r]=i,t},i)},e.decode=function(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}},e.encode=function(t){if(0===t.length)return t;for(var e="string"==typeof t?t:String(t),r="",n=0;n<e.length;++n){var i=e.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=e.charAt(n):i<128?r+=o[i]:i<2048?r+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?r+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&e.charCodeAt(n)),r+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return r},e.compact=function(t,r){if("object"!=typeof t||null===t)return t;var o=r||[],n=o.indexOf(t);if(n!==-1)return o[n];if(o.push(t),Array.isArray(t)){for(var i=[],a=0;a<t.length;++a)t[a]&&"object"==typeof t[a]?i.push(e.compact(t[a],o)):"undefined"!=typeof t[a]&&i.push(t[a]);return i}var s=Object.keys(t);return s.forEach(function(r){t[r]=e.compact(t[r],o)}),t},e.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},e.isBuffer=function(t){return null!==t&&"undefined"!=typeof t&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}},function(t,e){"use strict";var r=String.prototype.replace,o=/%20/g;t.exports={default:"RFC3986",formatters:{RFC1738:function(t){return r.call(t,o,"+")},RFC3986:function(t){return t}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(t,e,r){"use strict";var o=r(6),n=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:o.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(t,e){for(var r={},o=t.split(e.delimiter,e.parameterLimit===1/0?void 0:e.parameterLimit),i=0;i<o.length;++i){var a,s,f=o[i],c=f.indexOf("]=")===-1?f.indexOf("="):f.indexOf("]=")+1;c===-1?(a=e.decoder(f),s=e.strictNullHandling?null:""):(a=e.decoder(f.slice(0,c)),s=e.decoder(f.slice(c+1))),n.call(r,a)?r[a]=[].concat(r[a]).concat(s):r[a]=s}return r},s=function t(e,r,o){if(!e.length)return r;var n,i=e.shift();if("[]"===i)n=[],n=n.concat(t(e,r,o));else{n=o.plainObjects?Object.create(null):{};var a="["===i[0]&&"]"===i[i.length-1]?i.slice(1,i.length-1):i,s=parseInt(a,10);!isNaN(s)&&i!==a&&String(s)===a&&s>=0&&o.parseArrays&&s<=o.arrayLimit?(n=[],n[s]=t(e,r,o)):n[a]=t(e,r,o)}return n},f=function(t,e,r){if(t){var o=r.allowDots?t.replace(/\.([^\.\[]+)/g,"[$1]"):t,i=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,f=i.exec(o),c=[];if(f[1]){if(!r.plainObjects&&n.call(Object.prototype,f[1])&&!r.allowPrototypes)return;c.push(f[1])}for(var u=0;null!==(f=a.exec(o))&&u<r.depth;)u+=1,(r.plainObjects||!n.call(Object.prototype,f[1].replace(/\[|\]/g,""))||r.allowPrototypes)&&c.push(f[1]);return f&&c.push("["+o.slice(f.index)+"]"),s(c,e,r)}};t.exports=function(t,e){var r=e||{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.delimiter="string"==typeof r.delimiter||o.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"==typeof r.depth?r.depth:i.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=r.parseArrays!==!1,r.decoder="function"==typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===t||null===t||"undefined"==typeof t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?a(t,r):t,s=r.plainObjects?Object.create(null):{},c=Object.keys(n),u=0;u<c.length;++u){var l=c[u],p=f(l,n[l],r);s=o.merge(s,p,r)}return o.compact(s)}},function(t,e,r){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=r(10),i=function(t,e){if(t instanceof FormData)return n.formData;if("string"==typeof t)try{if(JSON.parse(t))return n.json}catch(t){return n.text}return"object"===("undefined"==typeof t?"undefined":o(t))?e?n.json:n.form:n.text};t.exports=i},function(t,e){"use strict";t.exports={formData:"multipart/form-data",form:"application/x-www-form-urlencoded",json:"application/json",text:"text/plain"}}])}); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguYnJvd3Nlci5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9pbmRleC5icm93c2VyLmpzIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ== |
@@ -1,2 +0,2 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,function(){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function n(e,t){var r={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}var i=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},c=r(1),f=r(6),u=r(7),s=function(e){return e},p={},d="",y=function(e){return e},b=function(e,t,r){var o=t.ssl,n=(t.method,t.query);return"function"==typeof r?r(e,t):("string"==typeof r&&(e=e.replace(/^\/\//,r)),/^\/\//.test(e)&&(e=(o?"https":"http")+":"+e),n&&(e+=""+(e.match(/\?/)?"&":"?")+c.stringify(n)),e)},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.method,o=void 0===r?"GET":r,s=t.query,y=void 0===s?{}:s,m=t.data,h=void 0===m?{}:m,v=t.body,g=void 0===v?{}:v,j=t.headers,O=void 0===j?{}:j,w=(t.json,n(t,["method","query","data","body","headers","json"])),x="GET"===o||"HEAD"===o;if(x?y="object"===("undefined"==typeof y?"undefined":a(y))?i({},y,h,g):0===Object.keys(y).length?h:y:g="object"!==("undefined"==typeof g?"undefined":a(g))||g instanceof FormData?0!==Object.keys(g).length||g instanceof FormData?g:h:i({},h,g),O=new Headers(i({},O,p instanceof Headers?function(){var e={};return p.keys().forEach(function(t){e[l]=p.get(t)}),e}():p)),x?"":O.set("Content-Type",O.get("Content-Type")||f(g)),"object"===("undefined"==typeof g?"undefined":a(g)))switch(O.get("Content-Type")){case u.form:g=c.stringify(g);break;case u.formData:var A=function(){var e=new FormData;return Object.keys(g).forEach(function(t){e.set(t,g[t])}),g=e,"break"}();if("break"===A)break}var D=i({method:o,query:y,headers:O},w);return x||(D.body=g),[b(e,D,d),D]},h=function(e){var t=function(){return e.call.apply(e,[void 0].concat(o(m.apply(void 0,arguments)))).then(y).then(s)};return t.callback=function(e){"function"==typeof e&&(s=e),delete t.callback},t.baseHost=function(e){d=e},t.headers=function(e){if("object"!==("undefined"==typeof e?"undefined":a(e))||"function"!=typeof e)throw new Error("global headers must be object or function");p=e,delete t.headers},t};e.exports={fetchDecorator:h}},function(e,t,r){"use strict";var o=r(2),n=r(5),i=r(4);e.exports={formats:i,parse:n,stringify:o}},function(e,t,r){"use strict";var o=r(3),n=r(4),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,c={delimiter:"&",encode:!0,encoder:o.encode,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},f=function e(t,r,n,i,a,c,f,l,u,s,p){var d=t;if("function"==typeof f)d=f(r,d);else if(d instanceof Date)d=s(d);else if(null===d){if(i)return c?c(r):r;d=""}if("string"==typeof d||"number"==typeof d||"boolean"==typeof d||o.isBuffer(d))return c?[p(c(r))+"="+p(c(d))]:[p(r)+"="+p(String(d))];var y=[];if("undefined"==typeof d)return y;var b;if(Array.isArray(f))b=f;else{var m=Object.keys(d);b=l?m.sort(l):m}for(var h=0;h<b.length;++h){var v=b[h];a&&null===d[v]||(y=Array.isArray(d)?y.concat(e(d[v],n(r,v),n,i,a,c,f,l,u,s,p)):y.concat(e(d[v],r+(u?"."+v:"["+v+"]"),n,i,a,c,f,l,u,s,p)))}return y};e.exports=function(e,t){var r=e,o=t||{},a="undefined"==typeof o.delimiter?c.delimiter:o.delimiter,l="boolean"==typeof o.strictNullHandling?o.strictNullHandling:c.strictNullHandling,u="boolean"==typeof o.skipNulls?o.skipNulls:c.skipNulls,s="boolean"==typeof o.encode?o.encode:c.encode,p=s?"function"==typeof o.encoder?o.encoder:c.encoder:null,d="function"==typeof o.sort?o.sort:null,y="undefined"!=typeof o.allowDots&&o.allowDots,b="function"==typeof o.serializeDate?o.serializeDate:c.serializeDate;if("undefined"==typeof o.format)o.format=n.default;else if(!Object.prototype.hasOwnProperty.call(n.formatters,o.format))throw new TypeError("Unknown format option provided.");var m,h,v=n.formatters[o.format];if(null!==o.encoder&&void 0!==o.encoder&&"function"!=typeof o.encoder)throw new TypeError("Encoder has to be a function.");"function"==typeof o.filter?(h=o.filter,r=h("",r)):Array.isArray(o.filter)&&(h=o.filter,m=h);var g=[];if("object"!=typeof r||null===r)return"";var j;j=o.arrayFormat in i?o.arrayFormat:"indices"in o?o.indices?"indices":"repeat":"indices";var O=i[j];m||(m=Object.keys(r)),d&&m.sort(d);for(var w=0;w<m.length;++w){var x=m[w];u&&null===r[x]||(g=g.concat(f(r[x],x,O,l,u,p,h,d,y,b,v)))}return g.join(a)}},function(e,t){"use strict";var r=Object.prototype.hasOwnProperty,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},o=0;o<e.length;++o)"undefined"!=typeof e[o]&&(r[o]=e[o]);return r},t.merge=function(e,o,n){if(!o)return e;if("object"!=typeof o){if(Array.isArray(e))e.push(o);else{if("object"!=typeof e)return[e,o];e[o]=!0}return e}if("object"!=typeof e)return[e].concat(o);var i=e;return Array.isArray(e)&&!Array.isArray(o)&&(i=t.arrayToObject(e,n)),Array.isArray(e)&&Array.isArray(o)?(o.forEach(function(o,i){r.call(e,i)?e[i]&&"object"==typeof e[i]?e[i]=t.merge(e[i],o,n):e.push(o):e[i]=o}),e):Object.keys(o).reduce(function(e,r){var i=o[r];return Object.prototype.hasOwnProperty.call(e,r)?e[r]=t.merge(e[r],i,n):e[r]=i,e},i)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),r="",n=0;n<t.length;++n){var i=t.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=t.charAt(n):i<128?r+=o[i]:i<2048?r+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?r+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return r},t.compact=function(e,r){if("object"!=typeof e||null===e)return e;var o=r||[],n=o.indexOf(e);if(n!==-1)return o[n];if(o.push(e),Array.isArray(e)){for(var i=[],a=0;a<e.length;++a)e[a]&&"object"==typeof e[a]?i.push(t.compact(e[a],o)):"undefined"!=typeof e[a]&&i.push(e[a]);return i}var c=Object.keys(e);return c.forEach(function(r){e[r]=t.compact(e[r],o)}),e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!==e&&"undefined"!=typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t){"use strict";var r=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,r){"use strict";var o=r(3),n=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:o.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t){for(var r={},o=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),i=0;i<o.length;++i){var a,c,f=o[i],l=f.indexOf("]=")===-1?f.indexOf("="):f.indexOf("]=")+1;l===-1?(a=t.decoder(f),c=t.strictNullHandling?null:""):(a=t.decoder(f.slice(0,l)),c=t.decoder(f.slice(l+1))),n.call(r,a)?r[a]=[].concat(r[a]).concat(c):r[a]=c}return r},c=function e(t,r,o){if(!t.length)return r;var n,i=t.shift();if("[]"===i)n=[],n=n.concat(e(t,r,o));else{n=o.plainObjects?Object.create(null):{};var a="["===i[0]&&"]"===i[i.length-1]?i.slice(1,i.length-1):i,c=parseInt(a,10);!isNaN(c)&&i!==a&&String(c)===a&&c>=0&&o.parseArrays&&c<=o.arrayLimit?(n=[],n[c]=e(t,r,o)):n[a]=e(t,r,o)}return n},f=function(e,t,r){if(e){var o=r.allowDots?e.replace(/\.([^\.\[]+)/g,"[$1]"):e,i=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,f=i.exec(o),l=[];if(f[1]){if(!r.plainObjects&&n.call(Object.prototype,f[1])&&!r.allowPrototypes)return;l.push(f[1])}for(var u=0;null!==(f=a.exec(o))&&u<r.depth;)u+=1,(r.plainObjects||!n.call(Object.prototype,f[1].replace(/\[|\]/g,""))||r.allowPrototypes)&&l.push(f[1]);return f&&l.push("["+o.slice(f.index)+"]"),c(l,t,r)}};e.exports=function(e,t){var r=t||{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.delimiter="string"==typeof r.delimiter||o.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"==typeof r.depth?r.depth:i.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=r.parseArrays!==!1,r.decoder="function"==typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===e||null===e||"undefined"==typeof e)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof e?a(e,r):e,c=r.plainObjects?Object.create(null):{},l=Object.keys(n),u=0;u<l.length;++u){var s=l[u],p=f(s,n[s],r);c=o.merge(c,p,r)}return o.compact(c)}},function(e,t,r){"use strict";var o="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},n=r(7),i=function(e,t){if(e instanceof FormData)return n.formData;if("string"==typeof e)try{if(JSON.parse(e))return n.json}catch(e){return n.text}return"object"===("undefined"==typeof e?"undefined":o(e))?t?n.json:n.form:n.text};e.exports=i},function(e,t){"use strict";e.exports={formData:"multipart/form-data",form:"application/x-www-form-urlencoded",json:"application/json",text:"text/plain"}}])}); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,function(){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function n(e,t){var r={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}var i=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},c=r(1),f=r(6),u=r(7),s=function(e){return e},p={},d="",y=function(e){return e},b=function(e,t,r){var o=t.ssl,n=(t.method,t.query);return"function"==typeof r?r(e,t):("string"==typeof r&&(e=e.replace(/^\/\//,r)),/^\/\//.test(e)&&(e=(o?"https":"http")+":"+e),n&&(e+=""+(e.match(/\?/)?"&":"?")+c.stringify(n)),e)},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.method,o=void 0===r?"GET":r,s=t.query,y=void 0===s?{}:s,m=t.data,h=void 0===m?{}:m,v=t.body,g=void 0===v?{}:v,j=t.headers,O=void 0===j?{}:j,w=(t.json,n(t,["method","query","data","body","headers","json"])),x="GET"===o||"HEAD"===o;if(x?y="object"===("undefined"==typeof y?"undefined":a(y))?i({},y,h,g):0===Object.keys(y).length?h:y:g="object"!==("undefined"==typeof g?"undefined":a(g))||g instanceof FormData?0!==Object.keys(g).length||g instanceof FormData?g:h:i({},h,g),O=new Headers(i({},O,p instanceof Headers?function(){var e={};return p.keys().forEach(function(t){e[l]=p.get(t)}),e}():p)),x?"":O.set("Content-Type",O.get("Content-Type")||f(g)),"object"===("undefined"==typeof g?"undefined":a(g)))switch(O.get("Content-Type")){case u.form:g=c.stringify(g);break;case u.formData:var A=function(){var e=new FormData;return Object.keys(g).forEach(function(t){e.set(t,g[t])}),g=e,"break"}();if("break"===A)break}var D=i({method:o,query:y,headers:O},w);return x||(D.body=g),[b(e,D,d),D]},h=function(e){var t=function(){return e.call.apply(e,[void 0].concat(o(m.apply(void 0,arguments)))).then(y).then(s)};return t.callback=function(e){"function"==typeof e&&(s=e),delete t.callback},t.baseHost=function(e){d=e},t.headers=function(e){if("object"!==("undefined"==typeof e?"undefined":a(e))&&"function"!=typeof e)throw new Error("global headers must be object or function");p=e,delete t.headers},t};e.exports={fetchDecorator:h}},function(e,t,r){"use strict";var o=r(2),n=r(5),i=r(4);e.exports={formats:i,parse:n,stringify:o}},function(e,t,r){"use strict";var o=r(3),n=r(4),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,c={delimiter:"&",encode:!0,encoder:o.encode,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},f=function e(t,r,n,i,a,c,f,l,u,s,p){var d=t;if("function"==typeof f)d=f(r,d);else if(d instanceof Date)d=s(d);else if(null===d){if(i)return c?c(r):r;d=""}if("string"==typeof d||"number"==typeof d||"boolean"==typeof d||o.isBuffer(d))return c?[p(c(r))+"="+p(c(d))]:[p(r)+"="+p(String(d))];var y=[];if("undefined"==typeof d)return y;var b;if(Array.isArray(f))b=f;else{var m=Object.keys(d);b=l?m.sort(l):m}for(var h=0;h<b.length;++h){var v=b[h];a&&null===d[v]||(y=Array.isArray(d)?y.concat(e(d[v],n(r,v),n,i,a,c,f,l,u,s,p)):y.concat(e(d[v],r+(u?"."+v:"["+v+"]"),n,i,a,c,f,l,u,s,p)))}return y};e.exports=function(e,t){var r=e,o=t||{},a="undefined"==typeof o.delimiter?c.delimiter:o.delimiter,l="boolean"==typeof o.strictNullHandling?o.strictNullHandling:c.strictNullHandling,u="boolean"==typeof o.skipNulls?o.skipNulls:c.skipNulls,s="boolean"==typeof o.encode?o.encode:c.encode,p=s?"function"==typeof o.encoder?o.encoder:c.encoder:null,d="function"==typeof o.sort?o.sort:null,y="undefined"!=typeof o.allowDots&&o.allowDots,b="function"==typeof o.serializeDate?o.serializeDate:c.serializeDate;if("undefined"==typeof o.format)o.format=n.default;else if(!Object.prototype.hasOwnProperty.call(n.formatters,o.format))throw new TypeError("Unknown format option provided.");var m,h,v=n.formatters[o.format];if(null!==o.encoder&&void 0!==o.encoder&&"function"!=typeof o.encoder)throw new TypeError("Encoder has to be a function.");"function"==typeof o.filter?(h=o.filter,r=h("",r)):Array.isArray(o.filter)&&(h=o.filter,m=h);var g=[];if("object"!=typeof r||null===r)return"";var j;j=o.arrayFormat in i?o.arrayFormat:"indices"in o?o.indices?"indices":"repeat":"indices";var O=i[j];m||(m=Object.keys(r)),d&&m.sort(d);for(var w=0;w<m.length;++w){var x=m[w];u&&null===r[x]||(g=g.concat(f(r[x],x,O,l,u,p,h,d,y,b,v)))}return g.join(a)}},function(e,t){"use strict";var r=Object.prototype.hasOwnProperty,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},o=0;o<e.length;++o)"undefined"!=typeof e[o]&&(r[o]=e[o]);return r},t.merge=function(e,o,n){if(!o)return e;if("object"!=typeof o){if(Array.isArray(e))e.push(o);else{if("object"!=typeof e)return[e,o];e[o]=!0}return e}if("object"!=typeof e)return[e].concat(o);var i=e;return Array.isArray(e)&&!Array.isArray(o)&&(i=t.arrayToObject(e,n)),Array.isArray(e)&&Array.isArray(o)?(o.forEach(function(o,i){r.call(e,i)?e[i]&&"object"==typeof e[i]?e[i]=t.merge(e[i],o,n):e.push(o):e[i]=o}),e):Object.keys(o).reduce(function(e,r){var i=o[r];return Object.prototype.hasOwnProperty.call(e,r)?e[r]=t.merge(e[r],i,n):e[r]=i,e},i)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),r="",n=0;n<t.length;++n){var i=t.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=t.charAt(n):i<128?r+=o[i]:i<2048?r+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?r+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return r},t.compact=function(e,r){if("object"!=typeof e||null===e)return e;var o=r||[],n=o.indexOf(e);if(n!==-1)return o[n];if(o.push(e),Array.isArray(e)){for(var i=[],a=0;a<e.length;++a)e[a]&&"object"==typeof e[a]?i.push(t.compact(e[a],o)):"undefined"!=typeof e[a]&&i.push(e[a]);return i}var c=Object.keys(e);return c.forEach(function(r){e[r]=t.compact(e[r],o)}),e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!==e&&"undefined"!=typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t){"use strict";var r=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,r){"use strict";var o=r(3),n=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:o.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t){for(var r={},o=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),i=0;i<o.length;++i){var a,c,f=o[i],l=f.indexOf("]=")===-1?f.indexOf("="):f.indexOf("]=")+1;l===-1?(a=t.decoder(f),c=t.strictNullHandling?null:""):(a=t.decoder(f.slice(0,l)),c=t.decoder(f.slice(l+1))),n.call(r,a)?r[a]=[].concat(r[a]).concat(c):r[a]=c}return r},c=function e(t,r,o){if(!t.length)return r;var n,i=t.shift();if("[]"===i)n=[],n=n.concat(e(t,r,o));else{n=o.plainObjects?Object.create(null):{};var a="["===i[0]&&"]"===i[i.length-1]?i.slice(1,i.length-1):i,c=parseInt(a,10);!isNaN(c)&&i!==a&&String(c)===a&&c>=0&&o.parseArrays&&c<=o.arrayLimit?(n=[],n[c]=e(t,r,o)):n[a]=e(t,r,o)}return n},f=function(e,t,r){if(e){var o=r.allowDots?e.replace(/\.([^\.\[]+)/g,"[$1]"):e,i=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,f=i.exec(o),l=[];if(f[1]){if(!r.plainObjects&&n.call(Object.prototype,f[1])&&!r.allowPrototypes)return;l.push(f[1])}for(var u=0;null!==(f=a.exec(o))&&u<r.depth;)u+=1,(r.plainObjects||!n.call(Object.prototype,f[1].replace(/\[|\]/g,""))||r.allowPrototypes)&&l.push(f[1]);return f&&l.push("["+o.slice(f.index)+"]"),c(l,t,r)}};e.exports=function(e,t){var r=t||{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.delimiter="string"==typeof r.delimiter||o.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"==typeof r.depth?r.depth:i.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=r.parseArrays!==!1,r.decoder="function"==typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===e||null===e||"undefined"==typeof e)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof e?a(e,r):e,c=r.plainObjects?Object.create(null):{},l=Object.keys(n),u=0;u<l.length;++u){var s=l[u],p=f(s,n[s],r);c=o.merge(c,p,r)}return o.compact(c)}},function(e,t,r){"use strict";var o="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},n=r(7),i=function(e,t){if(e instanceof FormData)return n.formData;if("string"==typeof e)try{if(JSON.parse(e))return n.json}catch(e){return n.text}return"object"===("undefined"==typeof e?"undefined":o(e))?t?n.json:n.form:n.text};e.exports=i},function(e,t){"use strict";e.exports={formData:"multipart/form-data",form:"application/x-www-form-urlencoded",json:"application/json",text:"text/plain"}}])}); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vdXRpbHMuanMiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9 |
@@ -112,3 +112,3 @@ const qs = require('qs'); | ||
fetchRequest.headers = (header) => { | ||
if (typeof header !== 'object' || typeof header !== 'function') { | ||
if (typeof header !== 'object' && typeof header !== 'function') { | ||
throw new Error('global headers must be object or function'); | ||
@@ -115,0 +115,0 @@ } |
{ | ||
"name": "autofetch", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "fetch for node", | ||
@@ -5,0 +5,0 @@ "main": "src/index.node.js", |
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