Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

get-it

Package Overview
Dependencies
Maintainers
1
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-it - npm Package Compare versions

Comparing version 4.1.4 to 5.0.0

lib-node/middleware/keepAlive.js

2

lib-node/index.js

@@ -10,3 +10,3 @@ 'use strict';

const channelNames = ['request', 'response', 'progress', 'error', 'abort'];
const middlehooks = ['processOptions', 'validateOptions', 'interceptRequest', 'onRequest', 'onResponse', 'onError', 'onReturn', 'onHeaders'];
const middlehooks = ['processOptions', 'validateOptions', 'interceptRequest', 'finalizeOptions', 'onRequest', 'onResponse', 'onError', 'onReturn', 'onHeaders'];

@@ -13,0 +13,0 @@ module.exports = function createRequester() {

@@ -6,3 +6,6 @@ 'use strict';

const HttpError = createErrorClass('HttpError', function (res, ctx) {
this.message = `${res.method}-request to ${res.url} resulted in HTTP ${res.statusCode} ${res.statusMessage}`.trim();
let msg = `${res.method}-request to ${res.url} resulted in`;
msg += `HTTP ${res.statusCode} ${res.statusMessage}`;
this.message = msg.trim();
this.response = res;

@@ -9,0 +12,0 @@ this.request = ctx.options;

@@ -16,2 +16,3 @@ 'use strict';

exports.proxy = require('./proxy');
exports.keepAlive = require('./keepAlive');
//# sourceMappingURL=index.js.map

@@ -6,3 +6,5 @@ 'use strict';

const parseHeaders = require('parse-headers');
const noop = function noop() {/* intentional noop */};
const noop = function noop() {
/* intentional noop */
};

@@ -16,3 +18,4 @@ const win = window;

module.exports = (context, callback) => {
const options = context.options;
const opts = context.options;
const options = context.applyMiddleware('finalizeOptions', opts);
const timers = {};

@@ -56,3 +59,5 @@

// IE9 must have onprogress be set to a unique function
xhr.onprogress = () => {/* intentional noop */};
xhr.onprogress = () => {
/* intentional noop */
};

@@ -59,0 +64,0 @@ const loadEvent = isXdr ? 'onload' : 'onreadystatechange';

@@ -119,3 +119,4 @@ 'use strict';

const request = transport.request(reqOpts, response => {
const finalOptions = context.applyMiddleware('finalizeOptions', reqOpts);
const request = transport.request(finalOptions, response => {
// See if we should try to decompress the response

@@ -122,0 +123,0 @@ const tryDecompress = reqOpts.method !== 'HEAD';

@@ -10,3 +10,3 @@ 'use strict';

var channelNames = ['request', 'response', 'progress', 'error', 'abort'];
var middlehooks = ['processOptions', 'validateOptions', 'interceptRequest', 'onRequest', 'onResponse', 'onError', 'onReturn', 'onHeaders'];
var middlehooks = ['processOptions', 'validateOptions', 'interceptRequest', 'finalizeOptions', 'onRequest', 'onResponse', 'onError', 'onReturn', 'onHeaders'];

@@ -13,0 +13,0 @@ module.exports = function createRequester() {

@@ -6,3 +6,6 @@ 'use strict';

var HttpError = createErrorClass('HttpError', function (res, ctx) {
this.message = (res.method + '-request to ' + res.url + ' resulted in HTTP ' + res.statusCode + ' ' + res.statusMessage).trim();
var msg = res.method + '-request to ' + res.url + ' resulted in';
msg += 'HTTP ' + res.statusCode + ' ' + res.statusMessage;
this.message = msg.trim();
this.response = res;

@@ -9,0 +12,0 @@ this.request = ctx.options;

@@ -16,2 +16,3 @@ 'use strict';

exports.proxy = require('./proxy');
exports.keepAlive = require('./keepAlive');
//# sourceMappingURL=index.js.map

@@ -6,3 +6,5 @@ 'use strict';

var parseHeaders = require('parse-headers');
var noop = function noop() {/* intentional noop */};
var noop = function noop() {
/* intentional noop */
};

@@ -16,3 +18,4 @@ var win = window;

module.exports = function (context, callback) {
var options = context.options;
var opts = context.options;
var options = context.applyMiddleware('finalizeOptions', opts);
var timers = {};

@@ -58,3 +61,5 @@

// IE9 must have onprogress be set to a unique function
xhr.onprogress = function () {/* intentional noop */};
xhr.onprogress = function () {
/* intentional noop */
};

@@ -61,0 +66,0 @@ var loadEvent = isXdr ? 'onload' : 'onreadystatechange';

@@ -126,3 +126,4 @@ 'use strict';

var request = transport.request(reqOpts, function (response) {
var finalOptions = context.applyMiddleware('finalizeOptions', reqOpts);
var request = transport.request(finalOptions, function (response) {
// See if we should try to decompress the response

@@ -129,0 +130,0 @@ var tryDecompress = reqOpts.method !== 'HEAD';

{
"name": "get-it",
"version": "4.1.4",
"version": "5.0.0",
"description": "Generic HTTP request library for node and browsers",
"main": "index.js",
"engines": {
"node": ">=4.0.0"
"node": ">=8.0.0"
},

@@ -9,0 +9,0 @@ "browser": {

# get-it
[![npm version](http://img.shields.io/npm/v/get-it.svg?style=flat-square)](http://browsenpm.org/package/get-it)[![Build Status](http://img.shields.io/travis/sanity-io/get-it/master.svg?style=flat-square)](https://travis-ci.org/sanity-io/get-it)
[![npm version](http://img.shields.io/npm/v/get-it.svg?style=flat-square)](https://www.npmjs.com/package/get-it)[![Build Status](http://img.shields.io/travis/sanity-io/get-it/master.svg?style=flat-square)](https://travis-ci.org/sanity-io/get-it)
Generic HTTP request library for node (>= 4) and browsers (IE9 and newer)
Generic HTTP request library for node.js (>= 8) and browsers (IE9 and newer)

@@ -17,14 +17,14 @@ ## Motivation

* Promise, observable and low-level event-emitter patterns
* Automatic retrying with customizable number of attempts and filtering functionality
* Cancellation of requests
* Configurable connect/socket timeouts
* Automatic parsing of JSON responses
* Automatic stringifying of JSON request bodies
* Automatic gzip unwrapping in Node
* Automatically prepend base URL
* Automatically follow redirects (configurable number of retries)
* Upload/download progress events
* Treat HTTP status codes >=400 as errors
* Debug requests with environment variables/localStorage setting
- Promise, observable and low-level event-emitter patterns
- Automatic retrying with customizable number of attempts and filtering functionality
- Cancellation of requests
- Configurable connect/socket timeouts
- Automatic parsing of JSON responses
- Automatic stringifying of JSON request bodies
- Automatic gzip unwrapping in Node
- Automatically prepend base URL
- Automatically follow redirects (configurable number of retries)
- Upload/download progress events
- Treat HTTP status codes >=400 as errors
- Debug requests with environment variables/localStorage setting

@@ -45,6 +45,3 @@ ## Usage

// Now compose the middleware you want to use
const request = getIt([
base('https://api.your.service/v1'),
jsonResponse()
])
const request = getIt([base('https://api.your.service/v1'), jsonResponse()])

@@ -64,14 +61,14 @@ // You can also register middleware using `.use(middleware)`

* `url` - URL to the resource you want to reach.
* `method` - HTTP method to use for request. Default: `GET`, unless a body is provided, in which case the default is `POST`.
* `headers` - Object of HTTP headers to send. Note that cross-origin requests in IE9 will not be able to set these headers.
* `body` - The request body. If the `jsonRequest` middleware is used, it will serialize to a JSON string before sending. Otherwise, it tries to send whatever is passed to it using the underlying adapter. Supported types:
* *Browser*: `string`, `ArrayBufferView`, `Blob`, `Document`, `FormData` (deprecated: `ArrayBuffer`)
* *Node*: `string`, `buffer`, `ReadStream`
* `bodySize` - Size of body, in bytes. Only used in Node when passing a `ReadStream` as body, in order for progress events to emit status on upload progress.
* `timeout` - Timeout in millisecond for the request. Takes an object with `connect` and `socket` properties.
* `maxRedirects` - Maximum number of redirects to follow before giving up. Note that this is only used in Node, as browsers have built-in redirect handling which cannot be adjusted. Default: `5`
* `rawBody` - Set to `true` to return the raw value of the response body, instead of a string. The type returned differs based on the underlying adapter:
* *Browser*: `ArrayBuffer`
* *Node*: `Buffer`
- `url` - URL to the resource you want to reach.
- `method` - HTTP method to use for request. Default: `GET`, unless a body is provided, in which case the default is `POST`.
- `headers` - Object of HTTP headers to send. Note that cross-origin requests in IE9 will not be able to set these headers.
- `body` - The request body. If the `jsonRequest` middleware is used, it will serialize to a JSON string before sending. Otherwise, it tries to send whatever is passed to it using the underlying adapter. Supported types:
- _Browser_: `string`, `ArrayBufferView`, `Blob`, `Document`, `FormData` (deprecated: `ArrayBuffer`)
- _Node_: `string`, `buffer`, `ReadStream`
- `bodySize` - Size of body, in bytes. Only used in Node when passing a `ReadStream` as body, in order for progress events to emit status on upload progress.
- `timeout` - Timeout in millisecond for the request. Takes an object with `connect` and `socket` properties.
- `maxRedirects` - Maximum number of redirects to follow before giving up. Note that this is only used in Node, as browsers have built-in redirect handling which cannot be adjusted. Default: `5`
- `rawBody` - Set to `true` to return the raw value of the response body, instead of a string. The type returned differs based on the underlying adapter:
- _Browser_: `ArrayBuffer`
- _Node_: `Buffer`

@@ -136,12 +133,14 @@ ## Return values

request.get({
url: 'http://foo.bar/baz',
cancelToken: source.token
}).catch(err => {
if (promise.isCancel(err)) {
console.log('Request canceled', err.message)
} else {
// handle error
}
})
request
.get({
url: 'http://foo.bar/baz',
cancelToken: source.token
})
.catch(err => {
if (promise.isCancel(err)) {
console.log('Request canceled', err.message)
} else {
// handle error
}
})

@@ -161,5 +160,7 @@ // Cancel the request (the message parameter is optional)

request.use(observable({
implementation: require('zen-observable')}
))
request.use(
observable({
implementation: require('zen-observable')
})
)

@@ -181,5 +182,5 @@ const observer = request({url: 'http://foo.bar/baz'})

* Developer-friendly assertions that are stripped in production to reduce bundle size and performance
* Authentication (basic)
* Stream response middleware?
- Developer-friendly assertions that are stripped in production to reduce bundle size and performance
- Authentication (basic)
- Stream response middleware?

@@ -190,8 +191,8 @@ ## Prior art

* [got](https://github.com/sindresorhus/got)
* [simple-get](https://github.com/feross/simple-get)
* [xhr](https://github.com/naugtur/xhr)
* [Axios](https://github.com/mzabriskie/axios/)
* [http-client](https://github.com/mjackson/http-client)
* [request](https://github.com/request/request)
- [got](https://github.com/sindresorhus/got)
- [simple-get](https://github.com/feross/simple-get)
- [xhr](https://github.com/naugtur/xhr)
- [Axios](https://github.com/mzabriskie/axios/)
- [http-client](https://github.com/mjackson/http-client)
- [request](https://github.com/request/request)

@@ -198,0 +199,0 @@ ## License

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.getIt = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";var pubsub=require("nano-pubsub"),middlewareReducer=require("./util/middlewareReducer"),processOptions=require("./middleware/defaultOptionsProcessor"),validateOptions=require("./middleware/defaultOptionsValidator"),httpRequest=require("./request"),channelNames=["request","response","progress","error","abort"],middlehooks=["processOptions","validateOptions","interceptRequest","onRequest","onResponse","onError","onReturn","onHeaders"];module.exports=function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],o=middlehooks.reduce(function(e,r){return e[r]=e[r]||[],e},{processOptions:[processOptions],validateOptions:[validateOptions]});function n(e){var r=channelNames.reduce(function(e,r){return e[r]=pubsub(),e},{}),t=middlewareReducer(o),n=t("processOptions",e);t("validateOptions",n);var s={options:n,channels:r,applyMiddleware:t},i=null,u=r.request.subscribe(function(e){i=httpRequest(e,function(o,n){return function(e,o,n){var s=e,i=o;if(!s)try{i=t("onResponse",o,n)}catch(e){i=null,s=e}(s=s&&t("onError",s,n))?r.error.publish(s):i&&r.response.publish(i)}(o,n,e)})});r.abort.subscribe(function(){u(),i&&i.abort()});var a=t("onReturn",r,s);return a===r&&r.request.publish(s),a}return n.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&o.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return middlehooks.forEach(function(r){e[r]&&o[r].push(e[r])}),t.push(e),n},n.clone=function(){return e(t)},r.forEach(n.use),n};
"use strict";var pubsub=require("nano-pubsub"),middlewareReducer=require("./util/middlewareReducer"),processOptions=require("./middleware/defaultOptionsProcessor"),validateOptions=require("./middleware/defaultOptionsValidator"),httpRequest=require("./request"),channelNames=["request","response","progress","error","abort"],middlehooks=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];module.exports=function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=middlehooks.reduce(function(e,r){return e[r]=e[r]||[],e},{processOptions:[processOptions],validateOptions:[validateOptions]});function o(e){var r=channelNames.reduce(function(e,r){return e[r]=pubsub(),e},{}),t=middlewareReducer(n),o=t("processOptions",e);t("validateOptions",o);var s={options:o,channels:r,applyMiddleware:t},i=null,u=r.request.subscribe(function(e){i=httpRequest(e,function(n,o){return function(e,n,o){var s=e,i=n;if(!s)try{i=t("onResponse",n,o)}catch(e){i=null,s=e}(s=s&&t("onError",s,o))?r.error.publish(s):i&&r.response.publish(i)}(n,o,e)})});r.abort.subscribe(function(){u(),i&&i.abort()});var a=t("onReturn",r,s);return a===r&&r.request.publish(s),a}return o.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&n.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return middlehooks.forEach(function(r){e[r]&&n[r].push(e[r])}),t.push(e),o},o.clone=function(){return e(t)},r.forEach(o.use),o};

@@ -11,3 +11,3 @@ },{"./middleware/defaultOptionsProcessor":2,"./middleware/defaultOptionsValidator":3,"./request":5,"./util/middlewareReducer":6,"nano-pubsub":9}],2:[function(require,module,exports){

},{}],4:[function(require,module,exports){
"use strict";var sameOrigin=require("same-origin"),parseHeaders=require("parse-headers"),noop=function(){},win=window,XmlHttpRequest=win.XMLHttpRequest||noop,hasXhr2="withCredentials"in new XmlHttpRequest,XDomainRequest=hasXhr2?XmlHttpRequest:win.XDomainRequest,adapter="xhr";module.exports=function(e,t){var r=e.options,n={},o=win&&win.location&&!sameOrigin(win.location.href,r.url),s=e.applyMiddleware("interceptRequest",void 0,{adapter:adapter,context:e});if(s){var a=setTimeout(t,0,null,s);return{abort:function(){return clearTimeout(a)}}}var i=o?new XDomainRequest:new XmlHttpRequest,u=win.XDomainRequest&&i instanceof win.XDomainRequest,c=r.headers,d=!1,l=!1,p=!1;if(i.onerror=q,i.ontimeout=q,i.onabort=function(){d=!0},i.onprogress=function(){},i[u?"onload":"onreadystatechange"]=function(){!function(){if(!w)return;h(),n.socket=setTimeout(function(){return m("ESOCKETTIMEDOUT")},w.socket)}(),d||4!==i.readyState&&!u||0!==i.status&&function(){if(d||l||p)return;if(0===i.status)return void q(new Error("Unknown XHR error"));h(),l=!0,t(null,function(){var e=i.status,t=i.statusText;if(u&&void 0===e)e=200;else{if(e>12e3&&e<12156)return q();e=1223===i.status?204:i.status,t=1223===i.status?"No Content":t}return{body:i.response||i.responseText,url:r.url,method:r.method,headers:u?{}:parseHeaders(i.getAllResponseHeaders()),statusCode:e,statusMessage:t}}())}()},i.open(r.method,r.url,!0),i.withCredentials=!!r.withCredentials,c&&i.setRequestHeader)for(var f in c)c.hasOwnProperty(f)&&i.setRequestHeader(f,c[f]);else if(c&&u)throw new Error("Headers cannot be set on an XDomainRequest object");r.rawBody&&(i.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:r,adapter:adapter,request:i,context:e}),i.send(r.body||null);var w=r.timeout;return w&&(n.connect=setTimeout(function(){return m("ETIMEDOUT")},w.connect)),{abort:function(){d=!0,i&&i.abort()}};function m(t){p=!0,i.abort();var n=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+r.url:"Connection timed out on request to "+r.url);n.code=t,e.channels.error.publish(n)}function h(){(d||i.readyState>=2&&n.connect)&&clearTimeout(n.connect),n.socket&&clearTimeout(n.socket)}function q(){if(!l){h(),l=!0,i=null;var e=new Error("Network error while attempting to reach "+r.url);e.isNetworkError=!0,e.request=r,t(e)}}};
"use strict";var sameOrigin=require("same-origin"),parseHeaders=require("parse-headers"),noop=function(){},win=window,XmlHttpRequest=win.XMLHttpRequest||noop,hasXhr2="withCredentials"in new XmlHttpRequest,XDomainRequest=hasXhr2?XmlHttpRequest:win.XDomainRequest,adapter="xhr";module.exports=function(e,t){var r=e.options,n=e.applyMiddleware("finalizeOptions",r),o={},s=win&&win.location&&!sameOrigin(win.location.href,n.url),a=e.applyMiddleware("interceptRequest",void 0,{adapter:adapter,context:e});if(a){var i=setTimeout(t,0,null,a);return{abort:function(){return clearTimeout(i)}}}var u=s?new XDomainRequest:new XmlHttpRequest,c=win.XDomainRequest&&u instanceof win.XDomainRequest,d=n.headers,l=!1,p=!1,f=!1;if(u.onerror=R,u.ontimeout=R,u.onabort=function(){l=!0},u.onprogress=function(){},u[c?"onload":"onreadystatechange"]=function(){!function(){if(!m)return;q(),o.socket=setTimeout(function(){return h("ESOCKETTIMEDOUT")},m.socket)}(),l||4!==u.readyState&&!c||0!==u.status&&function(){if(l||p||f)return;if(0===u.status)return void R(new Error("Unknown XHR error"));q(),p=!0,t(null,function(){var e=u.status,t=u.statusText;if(c&&void 0===e)e=200;else{if(e>12e3&&e<12156)return R();e=1223===u.status?204:u.status,t=1223===u.status?"No Content":t}return{body:u.response||u.responseText,url:n.url,method:n.method,headers:c?{}:parseHeaders(u.getAllResponseHeaders()),statusCode:e,statusMessage:t}}())}()},u.open(n.method,n.url,!0),u.withCredentials=!!n.withCredentials,d&&u.setRequestHeader)for(var w in d)d.hasOwnProperty(w)&&u.setRequestHeader(w,d[w]);else if(d&&c)throw new Error("Headers cannot be set on an XDomainRequest object");n.rawBody&&(u.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:n,adapter:adapter,request:u,context:e}),u.send(n.body||null);var m=n.timeout;return m&&(o.connect=setTimeout(function(){return h("ETIMEDOUT")},m.connect)),{abort:function(){l=!0,u&&u.abort()}};function h(t){f=!0,u.abort();var r=new Error("ESOCKETTIMEDOUT"===t?"Socket timed out on request to "+n.url:"Connection timed out on request to "+n.url);r.code=t,e.channels.error.publish(r)}function q(){(l||u.readyState>=2&&o.connect)&&clearTimeout(o.connect),o.socket&&clearTimeout(o.socket)}function R(){if(!p){q(),p=!0,u=null;var e=new Error("Network error while attempting to reach "+n.url);e.isNetworkError=!0,e.request=n,t(e)}}};

@@ -14,0 +14,0 @@ },{"parse-headers":11,"same-origin":14}],5:[function(require,module,exports){

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).getIt=e()}}(function(){return function s(i,a,u){function c(t,e){if(!a[t]){if(!i[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var n=a[t]={exports:{}};i[t][0].call(n.exports,function(e){return c(i[t][1][e]||e)},n,n.exports,s,i,a,u)}return a[t].exports}for(var l="function"==typeof require&&require,e=0;e<u.length;e++)c(u[e]);return c}({1:[function(e,t,r){"use strict";var c=e("nano-pubsub"),l=e("./util/middlewareReducer"),n=e("./middleware/defaultOptionsProcessor"),s=e("./middleware/defaultOptionsValidator"),p=e("./request"),f=["request","response","progress","error","abort"],i=["processOptions","validateOptions","interceptRequest","onRequest","onResponse","onError","onReturn","onHeaders"];t.exports=function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],r=[],u=i.reduce(function(e,t){return e[t]=e[t]||[],e},{processOptions:[n],validateOptions:[s]});function o(e){var i=f.reduce(function(e,t){return e[t]=c(),e},{}),a=l(u),t=a("processOptions",e);a("validateOptions",t);var r={options:t,channels:i,applyMiddleware:a},o=null,n=i.request.subscribe(function(t){o=p(t,function(s,e){return function(e,t,r){var o=s,n=t;if(!o)try{n=a("onResponse",t,r)}catch(e){n=null,o=e}(o=o&&a("onError",o,r))?i.error.publish(o):n&&i.response.publish(n)}(0,e,t)})});i.abort.subscribe(function(){n(),o&&o.abort()});var s=a("onReturn",i,r);return s===i&&i.request.publish(r),s}return o.use=function(t){if(!t)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof t)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(t.onReturn&&0<u.onReturn.length)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return i.forEach(function(e){t[e]&&u[e].push(t[e])}),r.push(t),o},o.clone=function(){return e(r)},t.forEach(o.use),o}},{"./middleware/defaultOptionsProcessor":2,"./middleware/defaultOptionsValidator":3,"./request":5,"./util/middlewareReducer":6,"nano-pubsub":9}],2:[function(e,t,r){"use strict";var o=e("object-assign"),n=e("url-parse"),s="undefined"!=typeof navigator&&"ReactNative"===navigator.product,i=Object.prototype.hasOwnProperty,a={timeout:s?6e4:12e4};function u(e){var r=[];for(var t in e)i.call(e,t)&&o(t,e[t]);return r.length?r.join("&"):"";function o(t,e){Array.isArray(e)?e.forEach(function(e){return o(t,e)}):r.push([t,e].map(encodeURIComponent).join("="))}}t.exports=function(e){var t="string"==typeof e?o({url:e},a):o({},a,e),r=n(t.url,{},!0);return t.timeout=function e(t){if(!1===t||0===t)return!1;if(t.connect||t.socket)return t;var r=Number(t);return isNaN(r)?e(a.timeout):{connect:r,socket:r}}(t.timeout),t.query&&(r.query=o({},r.query,function(e){var t={};for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}(t.query))),t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t.url=r.toString(u),t}},{"object-assign":10,"url-parse":17}],3:[function(e,t,r){"use strict";var o=/^https?:\/\//i;t.exports=function(e){if(!o.test(e.url))throw new Error('"'+e.url+'" is not a valid URL')}},{}],4:[function(e,t,r){"use strict";var m=e("same-origin"),w=e("parse-headers"),g=window,O=g.XMLHttpRequest||function(){},q="withCredentials"in new O?O:g.XDomainRequest;t.exports=function(r,t){var o=r.options,e={},n=g&&g.location&&!m(g.location.href,o.url),s=r.applyMiddleware("interceptRequest",void 0,{adapter:"xhr",context:r});if(s){var i=setTimeout(t,0,null,s);return{abort:function(){return clearTimeout(i)}}}var a=n?new q:new O,u=g.XDomainRequest&&a instanceof g.XDomainRequest,c=o.headers,l=!1,p=!1,f=!1;if(a.onerror=b,a.ontimeout=b,a.onabort=function(){l=!0},a.onprogress=function(){},a[u?"onload":"onreadystatechange"]=function(){d&&(v(),e.socket=setTimeout(function(){return y("ESOCKETTIMEDOUT")},d.socket)),l||4!==a.readyState&&!u||0!==a.status&&(l||p||f||(0!==a.status?(v(),p=!0,t(null,function(){var e=a.status,t=a.statusText;if(u&&void 0===e)e=200;else{if(12e3<e&&e<12156)return b();e=1223===a.status?204:a.status,t=1223===a.status?"No Content":t}return{body:a.response||a.responseText,url:o.url,method:o.method,headers:u?{}:w(a.getAllResponseHeaders()),statusCode:e,statusMessage:t}}())):b(new Error("Unknown XHR error"))))},a.open(o.method,o.url,!0),a.withCredentials=!!o.withCredentials,c&&a.setRequestHeader)for(var h in c)c.hasOwnProperty(h)&&a.setRequestHeader(h,c[h]);else if(c&&u)throw new Error("Headers cannot be set on an XDomainRequest object");o.rawBody&&(a.responseType="arraybuffer"),r.applyMiddleware("onRequest",{options:o,adapter:"xhr",request:a,context:r}),a.send(o.body||null);var d=o.timeout;return d&&(e.connect=setTimeout(function(){return y("ETIMEDOUT")},d.connect)),{abort:function(){l=!0,a&&a.abort()}};function y(e){f=!0,a.abort();var t=new Error("ESOCKETTIMEDOUT"===e?"Socket timed out on request to "+o.url:"Connection timed out on request to "+o.url);t.code=e,r.channels.error.publish(t)}function v(){(l||2<=a.readyState&&e.connect)&&clearTimeout(e.connect),e.socket&&clearTimeout(e.socket)}function b(){if(!p){v(),p=!0,a=null;var e=new Error("Network error while attempting to reach "+o.url);e.isNetworkError=!0,e.request=o,t(e)}}}},{"parse-headers":11,"same-origin":14}],5:[function(e,t,r){"use strict";t.exports=e("./node-request")},{"./node-request":4}],6:[function(e,t,r){"use strict";t.exports=function(s){return function(e,t){for(var r=arguments.length,o=Array(2<r?r-2:0),n=2;n<r;n++)o[n-2]=arguments[n];return s[e].reduce(function(e,t){return t.apply(void 0,[e].concat(o))},t)}}},{}],7:[function(e,t,r){"use strict";var n=e("is-callable"),s=Object.prototype.toString,i=Object.prototype.hasOwnProperty;t.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;3<=arguments.length&&(o=r),"[object Array]"===s.call(e)?function(e,t,r){for(var o=0,n=e.length;o<n;o++)i.call(e,o)&&(null==r?t(e[o],o,e):t.call(r,e[o],o,e))}(e,t,o):"string"==typeof e?function(e,t,r){for(var o=0,n=e.length;o<n;o++)null==r?t(e.charAt(o),o,e):t.call(r,e.charAt(o),o,e)}(e,t,o):function(e,t,r){for(var o in e)i.call(e,o)&&(null==r?t(e[o],o,e):t.call(r,e[o],o,e))}(e,t,o)}},{"is-callable":8}],8:[function(e,t,r){"use strict";var o=Function.prototype.toString,n=/^\s*class\b/,s=function(e){try{var t=o.call(e);return n.test(t)}catch(e){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(a)return function(e){try{return!s(e)&&(o.call(e),!0)}catch(e){return!1}}(e);if(s(e))return!1;var t=i.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},{}],9:[function(e,t,r){t.exports=function(){var r=[];return{subscribe:function(t){return r.push(t),function(){var e=r.indexOf(t);-1<e&&r.splice(e,1)}},publish:function(){for(var e=0;e<r.length;e++)r[e].apply(null,arguments)}}}},{}],10:[function(e,t,r){"use strict";var u=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,o,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var i in r=Object(arguments[s]))c.call(r,i)&&(n[i]=r[i]);if(u){o=u(r);for(var a=0;a<o.length;a++)l.call(r,o[a])&&(n[o[a]]=r[o[a]])}}return n}},{}],11:[function(e,t,r){var i=e("trim"),o=e("for-each");t.exports=function(e){if(!e)return{};var s={};return o(i(e).split("\n"),function(e){var t,r=e.indexOf(":"),o=i(e.slice(0,r)).toLowerCase(),n=i(e.slice(r+1));void 0===s[o]?s[o]=n:(t=s[o],"[object Array]"===Object.prototype.toString.call(t)?s[o].push(n):s[o]=[s[o],n])}),s}},{"for-each":7,trim:16}],12:[function(e,t,r){"use strict";var s=Object.prototype.hasOwnProperty;function i(e){return decodeURIComponent(e.replace(/\+/g," "))}r.stringify=function(e,t){t=t||"";var r,o,n=[];for(o in"string"!=typeof t&&(t="?"),e)s.call(e,o)&&((r=e[o])||null!=r&&!isNaN(r)||(r=""),n.push(encodeURIComponent(o)+"="+encodeURIComponent(r)));return n.length?t+n.join("&"):""},r.parse=function(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,o={};t=r.exec(e);){var n=i(t[1]),s=i(t[2]);n in o||(o[n]=s)}return o}},{}],13:[function(e,t,r){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],14:[function(e,t,r){"use strict";var u=e("url");t.exports=function(e,t,r){if(e===t)return!0;var o=u.parse(e,!1,!0),n=u.parse(t,!1,!0),s=0|o.port||("https"===o.protocol?443:80),i=0|n.port||("https"===n.protocol?443:80),a={proto:o.protocol===n.protocol,hostname:o.hostname===n.hostname,port:s===i};return a.proto&&a.hostname&&(a.port||r)}},{url:15}],15:[function(e,t,r){"use strict";var o=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;t.exports={regex:o,parse:function(e){var t=o.exec(e);return t?{protocol:(t[1]||"").toLowerCase()||void 0,hostname:(t[5]||"").toLowerCase()||void 0,port:t[6]||void 0}:{}}}},{}],16:[function(e,t,r){(r=t.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}},{}],17:[function(e,t,r){(function(s){"use strict";var h=e("requires-port"),d=e("querystringify"),r=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,i=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,y=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],a={hash:1,query:1};function v(e){var t,r=("undefined"!=typeof window?window:void 0!==s?s:"undefined"!=typeof self?self:{}).location||{},o={},n=typeof(e=e||r);if("blob:"===e.protocol)o=new m(unescape(e.pathname),{});else if("string"===n)for(t in o=new m(e,{}),a)delete o[t];else if("object"===n){for(t in e)t in a||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=i.test(e.href))}return o}function b(e){var t=r.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function m(e,t,r){if(!(this instanceof m))return new m(e,t,r);var o,n,s,i,a,u,c=y.slice(),l=typeof t,p=this,f=0;for("object"!==l&&"string"!==l&&(r=t,t=null),r&&"function"!=typeof r&&(r=d.parse),t=v(t),o=!(n=b(e||"")).protocol&&!n.slashes,p.slashes=n.slashes||o&&t.slashes,p.protocol=n.protocol||t.protocol||"",e=n.rest,n.slashes||(c[3]=[/(.*)/,"pathname"]);f<c.length;f++)"function"!=typeof(i=c[f])?(s=i[0],u=i[1],s!=s?p[u]=e:"string"==typeof s?~(a=e.indexOf(s))&&(e="number"==typeof i[2]?(p[u]=e.slice(0,a),e.slice(a+i[2])):(p[u]=e.slice(a),e.slice(0,a))):(a=s.exec(e))&&(p[u]=a[1],e=e.slice(0,a.index)),p[u]=p[u]||o&&i[3]&&t[u]||"",i[4]&&(p[u]=p[u].toLowerCase())):e=i(e);r&&(p.query=r(p.query)),o&&t.slashes&&"/"!==p.pathname.charAt(0)&&(""!==p.pathname||""!==t.pathname)&&(p.pathname=function(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=r.length,n=r[o-1],s=!1,i=0;o--;)"."===r[o]?r.splice(o,1):".."===r[o]?(r.splice(o,1),i++):i&&(0===o&&(s=!0),r.splice(o,1),i--);return s&&r.unshift(""),"."!==n&&".."!==n||r.push(""),r.join("/")}(p.pathname,t.pathname)),h(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(i=p.auth.split(":"),p.username=i[0]||"",p.password=i[1]||""),p.origin=p.protocol&&p.host&&"file:"!==p.protocol?p.protocol+"//"+p.host:"null",p.href=p.toString()}m.prototype={set:function(e,t,r){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||d.parse)(t)),o[e]=t;break;case"port":o[e]=t,h(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,/:\d+$/.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!r;break;case"pathname":case"hash":if(t){var n="pathname"===e?"/":"#";o[e]=t.charAt(0)!==n?n+t:t}else o[e]=t;break;default:o[e]=t}for(var s=0;s<y.length;s++){var i=y[s];i[4]&&(o[i[1]]=o[i[1]].toLowerCase())}return o.origin=o.protocol&&o.host&&"file:"!==o.protocol?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=d.stringify);var t,r=this,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var n=o+(r.slashes?"//":"");return r.username&&(n+=r.username,r.password&&(n+=":"+r.password),n+="@"),n+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(n+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(n+=r.hash),n}},m.extractProtocol=b,m.location=v,m.qs=d,t.exports=m}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{querystringify:12,"requires-port":13}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).getIt=e()}}(function(){return function s(i,a,u){function c(t,e){if(!a[t]){if(!i[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var n=a[t]={exports:{}};i[t][0].call(n.exports,function(e){return c(i[t][1][e]||e)},n,n.exports,s,i,a,u)}return a[t].exports}for(var l="function"==typeof require&&require,e=0;e<u.length;e++)c(u[e]);return c}({1:[function(e,t,r){"use strict";var c=e("nano-pubsub"),l=e("./util/middlewareReducer"),n=e("./middleware/defaultOptionsProcessor"),s=e("./middleware/defaultOptionsValidator"),p=e("./request"),f=["request","response","progress","error","abort"],i=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];t.exports=function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],r=[],u=i.reduce(function(e,t){return e[t]=e[t]||[],e},{processOptions:[n],validateOptions:[s]});function o(e){var i=f.reduce(function(e,t){return e[t]=c(),e},{}),a=l(u),t=a("processOptions",e);a("validateOptions",t);var r={options:t,channels:i,applyMiddleware:a},o=null,n=i.request.subscribe(function(t){o=p(t,function(s,e){return function(e,t,r){var o=s,n=t;if(!o)try{n=a("onResponse",t,r)}catch(e){n=null,o=e}(o=o&&a("onError",o,r))?i.error.publish(o):n&&i.response.publish(n)}(0,e,t)})});i.abort.subscribe(function(){n(),o&&o.abort()});var s=a("onReturn",i,r);return s===i&&i.request.publish(r),s}return o.use=function(t){if(!t)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof t)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(t.onReturn&&0<u.onReturn.length)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return i.forEach(function(e){t[e]&&u[e].push(t[e])}),r.push(t),o},o.clone=function(){return e(r)},t.forEach(o.use),o}},{"./middleware/defaultOptionsProcessor":2,"./middleware/defaultOptionsValidator":3,"./request":5,"./util/middlewareReducer":6,"nano-pubsub":9}],2:[function(e,t,r){"use strict";var o=e("object-assign"),n=e("url-parse"),s="undefined"!=typeof navigator&&"ReactNative"===navigator.product,i=Object.prototype.hasOwnProperty,a={timeout:s?6e4:12e4};function u(e){var r=[];for(var t in e)i.call(e,t)&&o(t,e[t]);return r.length?r.join("&"):"";function o(t,e){Array.isArray(e)?e.forEach(function(e){return o(t,e)}):r.push([t,e].map(encodeURIComponent).join("="))}}t.exports=function(e){var t="string"==typeof e?o({url:e},a):o({},a,e),r=n(t.url,{},!0);return t.timeout=function e(t){if(!1===t||0===t)return!1;if(t.connect||t.socket)return t;var r=Number(t);return isNaN(r)?e(a.timeout):{connect:r,socket:r}}(t.timeout),t.query&&(r.query=o({},r.query,function(e){var t={};for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}(t.query))),t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t.url=r.toString(u),t}},{"object-assign":10,"url-parse":17}],3:[function(e,t,r){"use strict";var o=/^https?:\/\//i;t.exports=function(e){if(!o.test(e.url))throw new Error('"'+e.url+'" is not a valid URL')}},{}],4:[function(e,t,r){"use strict";var w=e("same-origin"),g=e("parse-headers"),O=window,q=O.XMLHttpRequest||function(){},j="withCredentials"in new q?q:O.XDomainRequest;t.exports=function(r,t){var e=r.options,o=r.applyMiddleware("finalizeOptions",e),n={},s=O&&O.location&&!w(O.location.href,o.url),i=r.applyMiddleware("interceptRequest",void 0,{adapter:"xhr",context:r});if(i){var a=setTimeout(t,0,null,i);return{abort:function(){return clearTimeout(a)}}}var u=s?new j:new q,c=O.XDomainRequest&&u instanceof O.XDomainRequest,l=o.headers,p=!1,f=!1,h=!1;if(u.onerror=m,u.ontimeout=m,u.onabort=function(){p=!0},u.onprogress=function(){},u[c?"onload":"onreadystatechange"]=function(){y&&(b(),n.socket=setTimeout(function(){return v("ESOCKETTIMEDOUT")},y.socket)),p||4!==u.readyState&&!c||0!==u.status&&(p||f||h||(0!==u.status?(b(),f=!0,t(null,function(){var e=u.status,t=u.statusText;if(c&&void 0===e)e=200;else{if(12e3<e&&e<12156)return m();e=1223===u.status?204:u.status,t=1223===u.status?"No Content":t}return{body:u.response||u.responseText,url:o.url,method:o.method,headers:c?{}:g(u.getAllResponseHeaders()),statusCode:e,statusMessage:t}}())):m(new Error("Unknown XHR error"))))},u.open(o.method,o.url,!0),u.withCredentials=!!o.withCredentials,l&&u.setRequestHeader)for(var d in l)l.hasOwnProperty(d)&&u.setRequestHeader(d,l[d]);else if(l&&c)throw new Error("Headers cannot be set on an XDomainRequest object");o.rawBody&&(u.responseType="arraybuffer"),r.applyMiddleware("onRequest",{options:o,adapter:"xhr",request:u,context:r}),u.send(o.body||null);var y=o.timeout;return y&&(n.connect=setTimeout(function(){return v("ETIMEDOUT")},y.connect)),{abort:function(){p=!0,u&&u.abort()}};function v(e){h=!0,u.abort();var t=new Error("ESOCKETTIMEDOUT"===e?"Socket timed out on request to "+o.url:"Connection timed out on request to "+o.url);t.code=e,r.channels.error.publish(t)}function b(){(p||2<=u.readyState&&n.connect)&&clearTimeout(n.connect),n.socket&&clearTimeout(n.socket)}function m(){if(!f){b(),f=!0,u=null;var e=new Error("Network error while attempting to reach "+o.url);e.isNetworkError=!0,e.request=o,t(e)}}}},{"parse-headers":11,"same-origin":14}],5:[function(e,t,r){"use strict";t.exports=e("./node-request")},{"./node-request":4}],6:[function(e,t,r){"use strict";t.exports=function(s){return function(e,t){for(var r=arguments.length,o=Array(2<r?r-2:0),n=2;n<r;n++)o[n-2]=arguments[n];return s[e].reduce(function(e,t){return t.apply(void 0,[e].concat(o))},t)}}},{}],7:[function(e,t,r){"use strict";var n=e("is-callable"),s=Object.prototype.toString,i=Object.prototype.hasOwnProperty;t.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;3<=arguments.length&&(o=r),"[object Array]"===s.call(e)?function(e,t,r){for(var o=0,n=e.length;o<n;o++)i.call(e,o)&&(null==r?t(e[o],o,e):t.call(r,e[o],o,e))}(e,t,o):"string"==typeof e?function(e,t,r){for(var o=0,n=e.length;o<n;o++)null==r?t(e.charAt(o),o,e):t.call(r,e.charAt(o),o,e)}(e,t,o):function(e,t,r){for(var o in e)i.call(e,o)&&(null==r?t(e[o],o,e):t.call(r,e[o],o,e))}(e,t,o)}},{"is-callable":8}],8:[function(e,t,r){"use strict";var o=Function.prototype.toString,n=/^\s*class\b/,s=function(e){try{var t=o.call(e);return n.test(t)}catch(e){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(a)return function(e){try{return!s(e)&&(o.call(e),!0)}catch(e){return!1}}(e);if(s(e))return!1;var t=i.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},{}],9:[function(e,t,r){t.exports=function(){var r=[];return{subscribe:function(t){return r.push(t),function(){var e=r.indexOf(t);-1<e&&r.splice(e,1)}},publish:function(){for(var e=0;e<r.length;e++)r[e].apply(null,arguments)}}}},{}],10:[function(e,t,r){"use strict";var u=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,o,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var i in r=Object(arguments[s]))c.call(r,i)&&(n[i]=r[i]);if(u){o=u(r);for(var a=0;a<o.length;a++)l.call(r,o[a])&&(n[o[a]]=r[o[a]])}}return n}},{}],11:[function(e,t,r){var i=e("trim"),o=e("for-each");t.exports=function(e){if(!e)return{};var s={};return o(i(e).split("\n"),function(e){var t,r=e.indexOf(":"),o=i(e.slice(0,r)).toLowerCase(),n=i(e.slice(r+1));void 0===s[o]?s[o]=n:(t=s[o],"[object Array]"===Object.prototype.toString.call(t)?s[o].push(n):s[o]=[s[o],n])}),s}},{"for-each":7,trim:16}],12:[function(e,t,r){"use strict";var s=Object.prototype.hasOwnProperty;function i(e){return decodeURIComponent(e.replace(/\+/g," "))}r.stringify=function(e,t){t=t||"";var r,o,n=[];for(o in"string"!=typeof t&&(t="?"),e)s.call(e,o)&&((r=e[o])||null!=r&&!isNaN(r)||(r=""),n.push(encodeURIComponent(o)+"="+encodeURIComponent(r)));return n.length?t+n.join("&"):""},r.parse=function(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,o={};t=r.exec(e);){var n=i(t[1]),s=i(t[2]);n in o||(o[n]=s)}return o}},{}],13:[function(e,t,r){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],14:[function(e,t,r){"use strict";var u=e("url");t.exports=function(e,t,r){if(e===t)return!0;var o=u.parse(e,!1,!0),n=u.parse(t,!1,!0),s=0|o.port||("https"===o.protocol?443:80),i=0|n.port||("https"===n.protocol?443:80),a={proto:o.protocol===n.protocol,hostname:o.hostname===n.hostname,port:s===i};return a.proto&&a.hostname&&(a.port||r)}},{url:15}],15:[function(e,t,r){"use strict";var o=/^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/;t.exports={regex:o,parse:function(e){var t=o.exec(e);return t?{protocol:(t[1]||"").toLowerCase()||void 0,hostname:(t[5]||"").toLowerCase()||void 0,port:t[6]||void 0}:{}}}},{}],16:[function(e,t,r){(r=t.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}},{}],17:[function(e,t,r){(function(s){"use strict";var h=e("requires-port"),d=e("querystringify"),r=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,i=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,y=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],a={hash:1,query:1};function v(e){var t,r=("undefined"!=typeof window?window:void 0!==s?s:"undefined"!=typeof self?self:{}).location||{},o={},n=typeof(e=e||r);if("blob:"===e.protocol)o=new m(unescape(e.pathname),{});else if("string"===n)for(t in o=new m(e,{}),a)delete o[t];else if("object"===n){for(t in e)t in a||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=i.test(e.href))}return o}function b(e){var t=r.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function m(e,t,r){if(!(this instanceof m))return new m(e,t,r);var o,n,s,i,a,u,c=y.slice(),l=typeof t,p=this,f=0;for("object"!==l&&"string"!==l&&(r=t,t=null),r&&"function"!=typeof r&&(r=d.parse),t=v(t),o=!(n=b(e||"")).protocol&&!n.slashes,p.slashes=n.slashes||o&&t.slashes,p.protocol=n.protocol||t.protocol||"",e=n.rest,n.slashes||(c[3]=[/(.*)/,"pathname"]);f<c.length;f++)"function"!=typeof(i=c[f])?(s=i[0],u=i[1],s!=s?p[u]=e:"string"==typeof s?~(a=e.indexOf(s))&&(e="number"==typeof i[2]?(p[u]=e.slice(0,a),e.slice(a+i[2])):(p[u]=e.slice(a),e.slice(0,a))):(a=s.exec(e))&&(p[u]=a[1],e=e.slice(0,a.index)),p[u]=p[u]||o&&i[3]&&t[u]||"",i[4]&&(p[u]=p[u].toLowerCase())):e=i(e);r&&(p.query=r(p.query)),o&&t.slashes&&"/"!==p.pathname.charAt(0)&&(""!==p.pathname||""!==t.pathname)&&(p.pathname=function(e,t){for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=r.length,n=r[o-1],s=!1,i=0;o--;)"."===r[o]?r.splice(o,1):".."===r[o]?(r.splice(o,1),i++):i&&(0===o&&(s=!0),r.splice(o,1),i--);return s&&r.unshift(""),"."!==n&&".."!==n||r.push(""),r.join("/")}(p.pathname,t.pathname)),h(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(i=p.auth.split(":"),p.username=i[0]||"",p.password=i[1]||""),p.origin=p.protocol&&p.host&&"file:"!==p.protocol?p.protocol+"//"+p.host:"null",p.href=p.toString()}m.prototype={set:function(e,t,r){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||d.parse)(t)),o[e]=t;break;case"port":o[e]=t,h(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,/:\d+$/.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!r;break;case"pathname":case"hash":if(t){var n="pathname"===e?"/":"#";o[e]=t.charAt(0)!==n?n+t:t}else o[e]=t;break;default:o[e]=t}for(var s=0;s<y.length;s++){var i=y[s];i[4]&&(o[i[1]]=o[i[1]].toLowerCase())}return o.origin=o.protocol&&o.host&&"file:"!==o.protocol?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=d.stringify);var t,r=this,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var n=o+(r.slashes?"//":"");return r.username&&(n+=r.username,r.password&&(n+=":"+r.password),n+="@"),n+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(n+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(n+=r.hash),n}},m.extractProtocol=b,m.location=v,m.qs=d,t.exports=m}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{querystringify:12,"requires-port":13}]},{},[1])(1)});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc