From a1237ae623c859afe8c4f1915fbc46e78638ec9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Quixada=CC=81?= Date: Fri, 15 Jun 2018 22:39:46 -0300 Subject: [PATCH] updated dev dependencies. --- package.json | 14 +- test/webpack-node/bundle.js | 4 +- yarn.lock | 276 +++++++++++++++++++----------------- 3 files changed, 155 insertions(+), 139 deletions(-) diff --git a/package.json b/package.json index 113cb1e0..ad5154d3 100644 --- a/package.json +++ b/package.json @@ -47,20 +47,20 @@ "codecov": "3.0.2", "eslint": "4.19.1", "husky": "0.14.3", - "lint-staged": "7.1.3", + "lint-staged": "7.2.0", "mocha": "5.2.0", "mocha-headless-chrome": "2.0.0", - "nock": "9.3.0", + "nock": "9.3.3", "nyc": "12.0.2", "opn-cli": "3.1.0", "ora": "2.1.0", - "rollup": "0.60.0", + "rollup": "0.60.7", "rollup-plugin-copy": "0.2.3", "rollup-plugin-uglify": "4.0.0", - "sinon": "5.1.0", - "snyk": "1.82.1", - "webpack": "4.11.1", - "webpack-cli": "3.0.3" + "sinon": "6.0.0", + "snyk": "1.83.0", + "webpack": "4.12.0", + "webpack-cli": "3.0.7" }, "files": [ "dist", diff --git a/test/webpack-node/bundle.js b/test/webpack-node/bundle.js index d0604828..adfdd992 100644 --- a/test/webpack-node/bundle.js +++ b/test/webpack-node/bundle.js @@ -698,7 +698,7 @@ eval("\n\n/**\n * @module nock/intercepts\n */\n\nvar RequestOverrider = __webpa /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar mixin = __webpack_require__(/*! ./mixin */ \"./node_modules/nock/lib/mixin.js\")\n , matchBody = __webpack_require__(/*! ./match_body */ \"./node_modules/nock/lib/match_body.js\")\n , common = __webpack_require__(/*! ./common */ \"./node_modules/nock/lib/common.js\")\n , _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\")\n , debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/index.js\")('nock.interceptor')\n , stringify = __webpack_require__(/*! json-stringify-safe */ \"./node_modules/json-stringify-safe/stringify.js\")\n , qs = __webpack_require__(/*! qs */ \"./node_modules/qs/lib/index.js\");\n\nvar fs;\n\ntry {\n fs = __webpack_require__(/*! fs */ \"fs\");\n} catch (err) {\n // do nothing, we're in the browser\n}\n\nmodule.exports = Interceptor;\n\nfunction Interceptor(scope, uri, method, requestBody, interceptorOptions) {\n this.scope = scope;\n this.interceptorMatchHeaders = [];\n this.method = method.toUpperCase();\n this.uri = uri;\n this._key = this.method + ' ' + scope.basePath + scope.basePathname + (typeof uri === 'string' ? '' : '/') + uri;\n this.basePath = this.scope.basePath;\n this.path = (typeof uri === 'string') ? scope.basePathname + uri : uri;\n\n this.baseUri = this.method + ' ' + scope.basePath + scope.basePathname;\n this.options = interceptorOptions || {};\n this.counter = 1;\n this._requestBody = requestBody;\n\n // We use lower-case header field names throughout Nock.\n this.reqheaders = common.headersFieldNamesToLowerCase((scope.scopeOptions && scope.scopeOptions.reqheaders) || {});\n this.badheaders = common.headersFieldsArrayToLowerCase((scope.scopeOptions && scope.scopeOptions.badheaders) || []);\n\n\n this.delayInMs = 0;\n this.delayConnectionInMs = 0;\n\n this.optional = false;\n}\n\nInterceptor.prototype.optionally = function optionally() {\n this.optional = true;\n return this;\n}\n\nInterceptor.prototype.replyWithError = function replyWithError(errorMessage) {\n this.errorMessage = errorMessage;\n\n _.defaults(this.options, this.scope.scopeOptions);\n\n this.scope.add(this._key, this, this.scope, this.scopeOptions);\n return this.scope;\n};\n\nInterceptor.prototype.reply = function reply(statusCode, body, rawHeaders) {\n if (arguments.length <= 2 && _.isFunction(statusCode)) {\n body = statusCode;\n statusCode = 200;\n }\n\n this.statusCode = statusCode;\n\n _.defaults(this.options, this.scope.scopeOptions);\n\n // convert rawHeaders from Array to Object\n var headers = common.headersArrayToObject(rawHeaders);\n\n if (this.scope._defaultReplyHeaders) {\n headers = headers || {};\n headers = common.headersFieldNamesToLowerCase(headers);\n headers = mixin(this.scope._defaultReplyHeaders, headers);\n }\n\n if (this.scope.date) {\n headers = headers || {};\n headers['date'] = this.scope.date.toUTCString();\n }\n\n if (headers !== undefined) {\n this.rawHeaders = [];\n\n // makes sure all keys in headers are in lower case\n for (var key in headers) {\n if (headers.hasOwnProperty(key)) {\n this.rawHeaders.push(key);\n this.rawHeaders.push(headers[key]);\n }\n }\n\n // We use lower-case headers throughout Nock.\n this.headers = common.headersFieldNamesToLowerCase(headers);\n\n debug('reply.headers:', this.headers);\n debug('reply.rawHeaders:', this.rawHeaders);\n }\n\n // If the content is not encoded we may need to transform the response body.\n // Otherwise we leave it as it is.\n if (!common.isContentEncoded(this.headers)) {\n if (body && typeof (body) !== 'string' &&\n typeof (body) !== 'function' &&\n !Buffer.isBuffer(body) &&\n !common.isStream(body)) {\n try {\n body = stringify(body);\n if (!this.headers) {\n this.headers = {};\n }\n if (!this.headers['content-type']) {\n this.headers['content-type'] = 'application/json';\n }\n if (this.scope.contentLen) {\n this.headers['content-length'] = body.length;\n }\n } catch (err) {\n throw new Error('Error encoding response body into JSON');\n }\n }\n }\n\n this.body = body;\n\n this.scope.add(this._key, this, this.scope, this.scopeOptions);\n return this.scope;\n};\n\nInterceptor.prototype.replyWithFile = function replyWithFile(statusCode, filePath, headers) {\n if (!fs) {\n throw new Error('No fs');\n }\n var readStream = fs.createReadStream(filePath);\n readStream.pause();\n this.filePath = filePath;\n return this.reply(statusCode, readStream, headers);\n};\n\n// Also match request headers\n// https://github.com/pgte/nock/issues/163\nInterceptor.prototype.reqheaderMatches = function reqheaderMatches(options, key) {\n // We don't try to match request headers if these weren't even specified in the request.\n if (!options.headers) {\n return true;\n }\n\n var reqHeader = this.reqheaders[key];\n var header = options.headers[key];\n if (header && (typeof header !== 'string') && header.toString) {\n header = header.toString();\n }\n\n // We skip 'host' header comparison unless it's available in both mock and actual request.\n // This because 'host' may get inserted by Nock itself and then get recorder.\n // NOTE: We use lower-case header field names throughout Nock.\n if (key === 'host' &&\n (_.isUndefined(header) ||\n _.isUndefined(reqHeader))) {\n return true;\n }\n\n if (!_.isUndefined(reqHeader) && !_.isUndefined(header)) {\n if (_.isFunction(reqHeader)) {\n return reqHeader(header);\n } else if (common.matchStringOrRegexp(header, reqHeader)) {\n return true;\n }\n }\n\n debug('request header field doesn\\'t match:', key, header, reqHeader);\n return false;\n};\n\nInterceptor.prototype.match = function match(options, body, hostNameOnly) {\n if (debug.enabled) {\n debug('match %s, body = %s', stringify(options), stringify(body));\n }\n\n if (hostNameOnly) {\n return options.hostname === this.scope.urlParts.hostname;\n }\n\n var method = (options.method || 'GET').toUpperCase()\n , path = options.path\n , matches\n , matchKey\n , proto = options.proto;\n\n if (this.scope.transformPathFunction) {\n path = this.scope.transformPathFunction(path);\n }\n if (typeof (body) !== 'string') {\n body = body.toString();\n }\n if (this.scope.transformRequestBodyFunction) {\n body = this.scope.transformRequestBodyFunction(body, this._requestBody);\n }\n\n var checkHeaders = function (header) {\n if (_.isFunction(header.value)) {\n return header.value(options.getHeader(header.name));\n }\n return common.matchStringOrRegexp(options.getHeader(header.name), header.value);\n };\n\n if (!this.scope.matchHeaders.every(checkHeaders) ||\n !this.interceptorMatchHeaders.every(checkHeaders)) {\n this.scope.logger('headers don\\'t match');\n return false;\n }\n\n var reqHeadersMatch =\n !this.reqheaders ||\n Object.keys(this.reqheaders).every(this.reqheaderMatches.bind(this, options));\n\n if (!reqHeadersMatch) {\n return false;\n }\n\n function reqheaderContains(header) {\n return _.has(options.headers, header);\n }\n\n var reqContainsBadHeaders =\n this.badheaders &&\n _.some(this.badheaders, reqheaderContains);\n\n if (reqContainsBadHeaders) {\n return false;\n }\n\n // If we have a filtered scope then we use it instead reconstructing\n // the scope from the request options (proto, host and port) as these\n // two won't necessarily match and we have to remove the scope that was\n // matched (vs. that was defined).\n if (this.__nock_filteredScope) {\n matchKey = this.__nock_filteredScope;\n } else {\n matchKey = proto + '://' + options.host;\n if (\n options.port && options.host.indexOf(':') < 0 &&\n (options.port !== 80 || options.proto !== 'http') &&\n (options.port !== 443 || options.proto !== 'https')\n ) {\n matchKey += \":\" + options.port;\n }\n }\n\n // Match query strings when using query()\n var matchQueries = true;\n var queryIndex = -1;\n var queryString;\n var queries;\n\n if (this.queries) {\n queryIndex = path.indexOf('?');\n queryString = (queryIndex !== -1) ? path.slice(queryIndex + 1) : '';\n queries = qs.parse(queryString);\n\n // Only check for query string matches if this.queries is an object\n if (_.isObject(this.queries)) {\n\n if (_.isFunction(this.queries)) {\n matchQueries = this.queries(queries);\n } else {\n // Make sure that you have an equal number of keys. We are\n // looping through the passed query params and not the expected values\n // if the user passes fewer query params than expected but all values\n // match this will throw a false positive. Testing that the length of the\n // passed query params is equal to the length of expected keys will prevent\n // us from doing any value checking BEFORE we know if they have all the proper\n // params\n debug('this.queries: %j', this.queries);\n debug('queries: %j', queries);\n if (_.size(this.queries) !== _.size(queries)) {\n matchQueries = false;\n } else {\n var self = this;\n _.forOwn(queries, function matchOneKeyVal(val, key) {\n var expVal = self.queries[key];\n var isMatch = true;\n if (val === undefined || expVal === undefined) {\n isMatch = false;\n } else if (expVal instanceof RegExp) {\n isMatch = common.matchStringOrRegexp(val, expVal);\n } else if (_.isArray(expVal) || _.isObject(expVal)) {\n isMatch = _.isEqual(val, expVal);\n } else {\n isMatch = common.matchStringOrRegexp(val, expVal);\n }\n matchQueries = matchQueries && !!isMatch;\n });\n }\n debug('matchQueries: %j', matchQueries);\n }\n }\n\n // Remove the query string from the path\n if (queryIndex !== -1) {\n path = path.substr(0, queryIndex);\n }\n }\n\n if (typeof this.uri === 'function') {\n matches = matchQueries &&\n method.toUpperCase() + ' ' + proto + '://' + options.host === this.baseUri &&\n this.uri.call(this, path);\n } else {\n matches = method === this.method &&\n common.matchStringOrRegexp(matchKey, this.basePath) &&\n common.matchStringOrRegexp(path, this.path) &&\n matchQueries;\n }\n\n // special logger for query()\n if (queryIndex !== -1) {\n this.scope.logger('matching ' + matchKey + path + '?' + queryString + ' to ' + this._key +\n ' with query(' + stringify(this.queries) + '): ' + matches);\n } else {\n this.scope.logger('matching ' + matchKey + path + ' to ' + this._key + ': ' + matches);\n }\n\n if (matches) {\n matches = (matchBody.call(options, this._requestBody, body));\n if (!matches) {\n this.scope.logger('bodies don\\'t match: \\n', this._requestBody, '\\n', body);\n }\n }\n\n return matches;\n};\n\nInterceptor.prototype.matchIndependentOfBody = function matchIndependentOfBody(options) {\n var isRegex = _.isRegExp(this.path);\n\n var method = (options.method || 'GET').toUpperCase()\n , path = options.path\n , proto = options.proto;\n\n // NOTE: Do not split off the query params as the regex could use them\n if (!isRegex) {\n path = path ? path.split('?')[0] : '';\n }\n\n if (this.scope.transformPathFunction) {\n path = this.scope.transformPathFunction(path);\n }\n\n var checkHeaders = function (header) {\n return options.getHeader && common.matchStringOrRegexp(options.getHeader(header.name), header.value);\n };\n\n if (!this.scope.matchHeaders.every(checkHeaders) ||\n !this.interceptorMatchHeaders.every(checkHeaders)) {\n return false;\n }\n\n var comparisonKey = isRegex ? this.__nock_scopeKey : this._key;\n var matchKey = method + ' ' + proto + '://' + options.host + path;\n\n if (isRegex) {\n return !!matchKey.match(comparisonKey) && !!path.match(this.path);\n }\n\n return comparisonKey === matchKey;\n};\n\nInterceptor.prototype.filteringPath = function filteringPath() {\n if (_.isFunction(arguments[0])) {\n this.scope.transformFunction = arguments[0];\n }\n return this;\n};\n\nInterceptor.prototype.discard = function discard() {\n if ((this.scope.shouldPersist() || this.counter > 0) && this.filePath) {\n this.body = fs.createReadStream(this.filePath);\n this.body.pause();\n }\n\n if (!this.scope.shouldPersist() && this.counter < 1) {\n this.scope.remove(this._key, this);\n }\n};\n\nInterceptor.prototype.matchHeader = function matchHeader(name, value) {\n this.interceptorMatchHeaders.push({ name: name, value: value });\n return this;\n};\n\nInterceptor.prototype.basicAuth = function basicAuth(options) {\n var username = options['user'];\n var password = options['pass'] || '';\n var name = 'authorization';\n var value = 'Basic ' + new Buffer(username + ':' + password).toString('base64');\n this.interceptorMatchHeaders.push({ name: name, value: value });\n return this;\n};\n\n/**\n * Set query strings for the interceptor\n * @name query\n * @param Object Object of query string name,values (accepts regexp values)\n * @public\n * @example\n * // Will match 'http://zombo.com/?q=t'\n * nock('http://zombo.com').get('/').query({q: 't'});\n */\nInterceptor.prototype.query = function query(queries) {\n this.queries = this.queries || {};\n\n // Allow all query strings to match this route\n if (queries === true) {\n this.queries = queries;\n return this;\n }\n\n if (_.isFunction(queries)) {\n this.queries = queries;\n return this;\n }\n\n var stringFormattingFn;\n if (this.scope.scopeOptions.encodedQueryParams) {\n stringFormattingFn = common.percentDecode;\n }\n\n for (var key in queries) {\n if (_.isUndefined(this.queries[key])) {\n var formattedPair = common.formatQueryValue(key, queries[key], stringFormattingFn);\n this.queries[formattedPair[0]] = formattedPair[1];\n }\n }\n\n return this;\n};\n\n/**\n * Set number of times will repeat the interceptor\n * @name times\n * @param Integer Number of times to repeat (should be > 0)\n * @public\n * @example\n * // Will repeat mock 5 times for same king of request\n * nock('http://zombo.com).get('/').times(5).reply(200, 'Ok');\n */\nInterceptor.prototype.times = function times(newCounter) {\n if (newCounter < 1) {\n return this;\n }\n\n this.counter = newCounter;\n\n return this;\n};\n\n/**\n * An sugar syntax for times(1)\n * @name once\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').once.reply(200, 'Ok');\n */\nInterceptor.prototype.once = function once() {\n return this.times(1);\n};\n\n/**\n * An sugar syntax for times(2)\n * @name twice\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').twice.reply(200, 'Ok');\n */\nInterceptor.prototype.twice = function twice() {\n return this.times(2);\n};\n\n/**\n * An sugar syntax for times(3).\n * @name thrice\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').thrice.reply(200, 'Ok');\n */\nInterceptor.prototype.thrice = function thrice() {\n return this.times(3);\n};\n\n/**\n * Delay the response by a certain number of ms.\n *\n * @param {(integer|object)} opts - Number of milliseconds to wait, or an object\n * @param {integer} [opts.head] - Number of milliseconds to wait before response is sent\n * @param {integer} [opts.body] - Number of milliseconds to wait before response body is sent\n * @return {interceptor} - the current interceptor for chaining\n */\nInterceptor.prototype.delay = function delay(opts) {\n var headDelay = 0;\n var bodyDelay = 0;\n if (_.isNumber(opts)) {\n headDelay = opts;\n } else if (_.isObject(opts)) {\n headDelay = opts.head || 0;\n bodyDelay = opts.body || 0;\n } else {\n throw new Error(\"Unexpected input opts\" + opts);\n }\n\n return this.delayConnection(headDelay)\n .delayBody(bodyDelay);\n};\n\n/**\n * Delay the response body by a certain number of ms.\n *\n * @param {integer} ms - Number of milliseconds to wait before response is sent\n * @return {interceptor} - the current interceptor for chaining\n */\nInterceptor.prototype.delayBody = function delayBody(ms) {\n this.delayInMs += ms;\n return this;\n};\n\n/**\n * Delay the connection by a certain number of ms.\n *\n * @param {integer} ms - Number of milliseconds to wait\n * @return {interceptor} - the current interceptor for chaining\n */\nInterceptor.prototype.delayConnection = function delayConnection(ms) {\n this.delayConnectionInMs += ms;\n return this;\n};\n\nInterceptor.prototype.getTotalDelay = function getTotalDelay() {\n return this.delayInMs + this.delayConnectionInMs;\n};\n\n/**\n * Make the socket idle for a certain number of ms (simulated).\n *\n * @param {integer} ms - Number of milliseconds to wait\n * @return {interceptor} - the current interceptor for chaining\n */\nInterceptor.prototype.socketDelay = function socketDelay(ms) {\n this.socketDelayInMs = ms;\n return this;\n};\n\n\n//# sourceURL=webpack:///./node_modules/nock/lib/interceptor.js?"); +eval("\n\nvar mixin = __webpack_require__(/*! ./mixin */ \"./node_modules/nock/lib/mixin.js\")\n , matchBody = __webpack_require__(/*! ./match_body */ \"./node_modules/nock/lib/match_body.js\")\n , common = __webpack_require__(/*! ./common */ \"./node_modules/nock/lib/common.js\")\n , _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\")\n , debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/index.js\")('nock.interceptor')\n , stringify = __webpack_require__(/*! json-stringify-safe */ \"./node_modules/json-stringify-safe/stringify.js\")\n , qs = __webpack_require__(/*! qs */ \"./node_modules/qs/lib/index.js\");\n\nvar fs;\n\ntry {\n fs = __webpack_require__(/*! fs */ \"fs\");\n} catch (err) {\n // do nothing, we're in the browser\n}\n\nmodule.exports = Interceptor;\n\nfunction Interceptor(scope, uri, method, requestBody, interceptorOptions) {\n this.scope = scope;\n this.interceptorMatchHeaders = [];\n this.method = method.toUpperCase();\n this.uri = uri;\n this._key = this.method + ' ' + scope.basePath + scope.basePathname + (typeof uri === 'string' ? '' : '/') + uri;\n this.basePath = this.scope.basePath;\n this.path = (typeof uri === 'string') ? scope.basePathname + uri : uri;\n\n this.baseUri = this.method + ' ' + scope.basePath + scope.basePathname;\n this.options = interceptorOptions || {};\n this.counter = 1;\n this._requestBody = requestBody;\n\n // We use lower-case header field names throughout Nock.\n this.reqheaders = common.headersFieldNamesToLowerCase((scope.scopeOptions && scope.scopeOptions.reqheaders) || {});\n this.badheaders = common.headersFieldsArrayToLowerCase((scope.scopeOptions && scope.scopeOptions.badheaders) || []);\n\n\n this.delayInMs = 0;\n this.delayConnectionInMs = 0;\n\n this.optional = false;\n}\n\nInterceptor.prototype.optionally = function optionally() {\n this.optional = true;\n return this;\n}\n\nInterceptor.prototype.replyWithError = function replyWithError(errorMessage) {\n this.errorMessage = errorMessage;\n\n _.defaults(this.options, this.scope.scopeOptions);\n\n this.scope.add(this._key, this, this.scope, this.scopeOptions);\n return this.scope;\n};\n\nInterceptor.prototype.reply = function reply(statusCode, body, rawHeaders) {\n if (arguments.length <= 2 && _.isFunction(statusCode)) {\n body = statusCode;\n statusCode = 200;\n }\n\n this.statusCode = statusCode;\n\n _.defaults(this.options, this.scope.scopeOptions);\n\n // convert rawHeaders from Array to Object\n var headers = common.headersArrayToObject(rawHeaders);\n\n if (this.scope._defaultReplyHeaders) {\n headers = headers || {};\n headers = common.headersFieldNamesToLowerCase(headers);\n headers = mixin(this.scope._defaultReplyHeaders, headers);\n }\n\n if (this.scope.date) {\n headers = headers || {};\n headers['date'] = this.scope.date.toUTCString();\n }\n\n if (headers !== undefined) {\n this.rawHeaders = [];\n\n // makes sure all keys in headers are in lower case\n for (var key in headers) {\n if (headers.hasOwnProperty(key)) {\n this.rawHeaders.push(key);\n this.rawHeaders.push(headers[key]);\n }\n }\n\n // We use lower-case headers throughout Nock.\n this.headers = common.headersFieldNamesToLowerCase(headers);\n\n debug('reply.headers:', this.headers);\n debug('reply.rawHeaders:', this.rawHeaders);\n }\n\n // If the content is not encoded we may need to transform the response body.\n // Otherwise we leave it as it is.\n if (!common.isContentEncoded(this.headers)) {\n if (body && typeof (body) !== 'string' &&\n typeof (body) !== 'function' &&\n !Buffer.isBuffer(body) &&\n !common.isStream(body)) {\n try {\n body = stringify(body);\n if (!this.headers) {\n this.headers = {};\n }\n if (!this.headers['content-type']) {\n this.headers['content-type'] = 'application/json';\n }\n if (this.scope.contentLen) {\n this.headers['content-length'] = body.length;\n }\n } catch (err) {\n throw new Error('Error encoding response body into JSON');\n }\n }\n }\n\n this.body = body;\n\n this.scope.add(this._key, this, this.scope, this.scopeOptions);\n return this.scope;\n};\n\nInterceptor.prototype.replyWithFile = function replyWithFile(statusCode, filePath, headers) {\n if (!fs) {\n throw new Error('No fs');\n }\n var readStream = fs.createReadStream(filePath);\n readStream.pause();\n this.filePath = filePath;\n return this.reply(statusCode, readStream, headers);\n};\n\n// Also match request headers\n// https://github.com/pgte/nock/issues/163\nInterceptor.prototype.reqheaderMatches = function reqheaderMatches(options, key) {\n // We don't try to match request headers if these weren't even specified in the request.\n if (!options.headers) {\n return true;\n }\n\n var reqHeader = this.reqheaders[key];\n var header = options.headers[key];\n if (header && (typeof header !== 'string') && header.toString) {\n header = header.toString();\n }\n\n // We skip 'host' header comparison unless it's available in both mock and actual request.\n // This because 'host' may get inserted by Nock itself and then get recorder.\n // NOTE: We use lower-case header field names throughout Nock.\n if (key === 'host' &&\n (_.isUndefined(header) ||\n _.isUndefined(reqHeader))) {\n return true;\n }\n\n if (!_.isUndefined(reqHeader) && !_.isUndefined(header)) {\n if (_.isFunction(reqHeader)) {\n return reqHeader(header);\n } else if (common.matchStringOrRegexp(header, reqHeader)) {\n return true;\n }\n }\n\n debug('request header field doesn\\'t match:', key, header, reqHeader);\n return false;\n};\n\nInterceptor.prototype.match = function match(options, body, hostNameOnly) {\n if (debug.enabled) {\n debug('match %s, body = %s', stringify(options), stringify(body));\n }\n\n if (hostNameOnly) {\n return options.hostname === this.scope.urlParts.hostname;\n }\n\n var method = (options.method || 'GET').toUpperCase()\n , path = options.path\n , matches\n , matchKey\n , proto = options.proto;\n\n if (this.scope.transformPathFunction) {\n path = this.scope.transformPathFunction(path);\n }\n if (typeof (body) !== 'string') {\n body = body.toString();\n }\n if (this.scope.transformRequestBodyFunction) {\n body = this.scope.transformRequestBodyFunction(body, this._requestBody);\n }\n\n var checkHeaders = function (header) {\n if (_.isFunction(header.value)) {\n return header.value(options.getHeader(header.name));\n }\n return common.matchStringOrRegexp(options.getHeader(header.name), header.value);\n };\n\n if (!this.scope.matchHeaders.every(checkHeaders) ||\n !this.interceptorMatchHeaders.every(checkHeaders)) {\n this.scope.logger('headers don\\'t match');\n return false;\n }\n\n var reqHeadersMatch =\n !this.reqheaders ||\n Object.keys(this.reqheaders).every(this.reqheaderMatches.bind(this, options));\n\n if (!reqHeadersMatch) {\n return false;\n }\n\n function reqheaderContains(header) {\n return _.has(options.headers, header);\n }\n\n var reqContainsBadHeaders =\n this.badheaders &&\n _.some(this.badheaders, reqheaderContains);\n\n if (reqContainsBadHeaders) {\n return false;\n }\n\n // If we have a filtered scope then we use it instead reconstructing\n // the scope from the request options (proto, host and port) as these\n // two won't necessarily match and we have to remove the scope that was\n // matched (vs. that was defined).\n if (this.__nock_filteredScope) {\n matchKey = this.__nock_filteredScope;\n } else {\n matchKey = proto + '://' + options.host;\n if (\n options.port && options.host.indexOf(':') < 0 &&\n (options.port !== 80 || options.proto !== 'http') &&\n (options.port !== 443 || options.proto !== 'https')\n ) {\n matchKey += \":\" + options.port;\n }\n }\n\n // Match query strings when using query()\n var matchQueries = true;\n var queryIndex = -1;\n var queryString;\n var queries;\n\n if (this.queries) {\n queryIndex = path.indexOf('?');\n queryString = (queryIndex !== -1) ? path.slice(queryIndex + 1) : '';\n queries = qs.parse(queryString);\n\n // Only check for query string matches if this.queries is an object\n if (_.isObject(this.queries)) {\n\n if (_.isFunction(this.queries)) {\n matchQueries = this.queries(queries);\n } else {\n // Make sure that you have an equal number of keys. We are\n // looping through the passed query params and not the expected values\n // if the user passes fewer query params than expected but all values\n // match this will throw a false positive. Testing that the length of the\n // passed query params is equal to the length of expected keys will prevent\n // us from doing any value checking BEFORE we know if they have all the proper\n // params\n debug('this.queries: %j', this.queries);\n debug('queries: %j', queries);\n if (_.size(this.queries) !== _.size(queries)) {\n matchQueries = false;\n } else {\n var self = this;\n _.forOwn(queries, function matchOneKeyVal(val, key) {\n var expVal = self.queries[key];\n var isMatch = true;\n if (val === undefined || expVal === undefined) {\n isMatch = false;\n } else if (expVal instanceof RegExp) {\n isMatch = common.matchStringOrRegexp(val, expVal);\n } else if (_.isArray(expVal) || _.isObject(expVal)) {\n isMatch = _.isEqual(val, expVal);\n } else {\n isMatch = common.matchStringOrRegexp(val, expVal);\n }\n matchQueries = matchQueries && !!isMatch;\n });\n }\n debug('matchQueries: %j', matchQueries);\n }\n }\n\n // Remove the query string from the path\n if (queryIndex !== -1) {\n path = path.substr(0, queryIndex);\n }\n }\n\n if (typeof this.uri === 'function') {\n matches = matchQueries &&\n common.matchStringOrRegexp(matchKey, this.basePath) &&\n this.uri.call(this, path);\n } else {\n matches = method === this.method &&\n common.matchStringOrRegexp(matchKey, this.basePath) &&\n common.matchStringOrRegexp(path, this.path) &&\n matchQueries;\n }\n\n // special logger for query()\n if (queryIndex !== -1) {\n this.scope.logger('matching ' + matchKey + path + '?' + queryString + ' to ' + this._key +\n ' with query(' + stringify(this.queries) + '): ' + matches);\n } else {\n this.scope.logger('matching ' + matchKey + path + ' to ' + this._key + ': ' + matches);\n }\n\n if (matches) {\n matches = (matchBody.call(options, this._requestBody, body));\n if (!matches) {\n this.scope.logger('bodies don\\'t match: \\n', this._requestBody, '\\n', body);\n }\n }\n\n return matches;\n};\n\nInterceptor.prototype.matchIndependentOfBody = function matchIndependentOfBody(options) {\n var isRegex = _.isRegExp(this.path);\n\n var method = (options.method || 'GET').toUpperCase()\n , path = options.path\n , proto = options.proto;\n\n // NOTE: Do not split off the query params as the regex could use them\n if (!isRegex) {\n path = path ? path.split('?')[0] : '';\n }\n\n if (this.scope.transformPathFunction) {\n path = this.scope.transformPathFunction(path);\n }\n\n var checkHeaders = function (header) {\n return options.getHeader && common.matchStringOrRegexp(options.getHeader(header.name), header.value);\n };\n\n if (!this.scope.matchHeaders.every(checkHeaders) ||\n !this.interceptorMatchHeaders.every(checkHeaders)) {\n return false;\n }\n\n var comparisonKey = isRegex ? this.__nock_scopeKey : this._key;\n var matchKey = method + ' ' + proto + '://' + options.host + path;\n\n if (isRegex) {\n return !!matchKey.match(comparisonKey) && !!path.match(this.path);\n }\n\n return comparisonKey === matchKey;\n};\n\nInterceptor.prototype.filteringPath = function filteringPath() {\n if (_.isFunction(arguments[0])) {\n this.scope.transformFunction = arguments[0];\n }\n return this;\n};\n\nInterceptor.prototype.discard = function discard() {\n if ((this.scope.shouldPersist() || this.counter > 0) && this.filePath) {\n this.body = fs.createReadStream(this.filePath);\n this.body.pause();\n }\n\n if (!this.scope.shouldPersist() && this.counter < 1) {\n this.scope.remove(this._key, this);\n }\n};\n\nInterceptor.prototype.matchHeader = function matchHeader(name, value) {\n this.interceptorMatchHeaders.push({ name: name, value: value });\n return this;\n};\n\nInterceptor.prototype.basicAuth = function basicAuth(options) {\n var username = options['user'];\n var password = options['pass'] || '';\n var name = 'authorization';\n var value = 'Basic ' + new Buffer(username + ':' + password).toString('base64');\n this.interceptorMatchHeaders.push({ name: name, value: value });\n return this;\n};\n\n/**\n * Set query strings for the interceptor\n * @name query\n * @param Object Object of query string name,values (accepts regexp values)\n * @public\n * @example\n * // Will match 'http://zombo.com/?q=t'\n * nock('http://zombo.com').get('/').query({q: 't'});\n */\nInterceptor.prototype.query = function query(queries) {\n this.queries = this.queries || {};\n\n // Allow all query strings to match this route\n if (queries === true) {\n this.queries = queries;\n return this;\n }\n\n if (_.isFunction(queries)) {\n this.queries = queries;\n return this;\n }\n\n var stringFormattingFn;\n if (this.scope.scopeOptions.encodedQueryParams) {\n stringFormattingFn = common.percentDecode;\n }\n\n for (var key in queries) {\n if (_.isUndefined(this.queries[key])) {\n var formattedPair = common.formatQueryValue(key, queries[key], stringFormattingFn);\n this.queries[formattedPair[0]] = formattedPair[1];\n }\n }\n\n return this;\n};\n\n/**\n * Set number of times will repeat the interceptor\n * @name times\n * @param Integer Number of times to repeat (should be > 0)\n * @public\n * @example\n * // Will repeat mock 5 times for same king of request\n * nock('http://zombo.com).get('/').times(5).reply(200, 'Ok');\n */\nInterceptor.prototype.times = function times(newCounter) {\n if (newCounter < 1) {\n return this;\n }\n\n this.counter = newCounter;\n\n return this;\n};\n\n/**\n * An sugar syntax for times(1)\n * @name once\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').once.reply(200, 'Ok');\n */\nInterceptor.prototype.once = function once() {\n return this.times(1);\n};\n\n/**\n * An sugar syntax for times(2)\n * @name twice\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').twice.reply(200, 'Ok');\n */\nInterceptor.prototype.twice = function twice() {\n return this.times(2);\n};\n\n/**\n * An sugar syntax for times(3).\n * @name thrice\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').thrice.reply(200, 'Ok');\n */\nInterceptor.prototype.thrice = function thrice() {\n return this.times(3);\n};\n\n/**\n * Delay the response by a certain number of ms.\n *\n * @param {(integer|object)} opts - Number of milliseconds to wait, or an object\n * @param {integer} [opts.head] - Number of milliseconds to wait before response is sent\n * @param {integer} [opts.body] - Number of milliseconds to wait before response body is sent\n * @return {interceptor} - the current interceptor for chaining\n */\nInterceptor.prototype.delay = function delay(opts) {\n var headDelay = 0;\n var bodyDelay = 0;\n if (_.isNumber(opts)) {\n headDelay = opts;\n } else if (_.isObject(opts)) {\n headDelay = opts.head || 0;\n bodyDelay = opts.body || 0;\n } else {\n throw new Error(\"Unexpected input opts\" + opts);\n }\n\n return this.delayConnection(headDelay)\n .delayBody(bodyDelay);\n};\n\n/**\n * Delay the response body by a certain number of ms.\n *\n * @param {integer} ms - Number of milliseconds to wait before response is sent\n * @return {interceptor} - the current interceptor for chaining\n */\nInterceptor.prototype.delayBody = function delayBody(ms) {\n this.delayInMs += ms;\n return this;\n};\n\n/**\n * Delay the connection by a certain number of ms.\n *\n * @param {integer} ms - Number of milliseconds to wait\n * @return {interceptor} - the current interceptor for chaining\n */\nInterceptor.prototype.delayConnection = function delayConnection(ms) {\n this.delayConnectionInMs += ms;\n return this;\n};\n\nInterceptor.prototype.getTotalDelay = function getTotalDelay() {\n return this.delayInMs + this.delayConnectionInMs;\n};\n\n/**\n * Make the socket idle for a certain number of ms (simulated).\n *\n * @param {integer} ms - Number of milliseconds to wait\n * @return {interceptor} - the current interceptor for chaining\n */\nInterceptor.prototype.socketDelay = function socketDelay(ms) {\n this.socketDelayInMs = ms;\n return this;\n};\n\n\n//# sourceURL=webpack:///./node_modules/nock/lib/interceptor.js?"); /***/ }), @@ -746,7 +746,7 @@ eval("\n\nvar inspect = __webpack_require__(/*! util */ \"util\").inspect;\nvar /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar EventEmitter = __webpack_require__(/*! events */ \"events\").EventEmitter,\n http = __webpack_require__(/*! http */ \"http\"),\n propagate = __webpack_require__(/*! propagate */ \"./node_modules/propagate/index.js\"),\n DelayedBody = __webpack_require__(/*! ./delayed_body */ \"./node_modules/nock/lib/delayed_body.js\"),\n IncomingMessage = http.IncomingMessage,\n ClientRequest = http.ClientRequest,\n common = __webpack_require__(/*! ./common */ \"./node_modules/nock/lib/common.js\"),\n Socket = __webpack_require__(/*! ./socket */ \"./node_modules/nock/lib/socket.js\"),\n _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"),\n debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/index.js\")('nock.request_overrider'),\n timers = __webpack_require__(/*! timers */ \"timers\"),\n ReadableStream = __webpack_require__(/*! stream */ \"stream\").Readable,\n globalEmitter = __webpack_require__(/*! ./global_emitter */ \"./node_modules/nock/lib/global_emitter.js\"),\n zlib = __webpack_require__(/*! zlib */ \"zlib\");\n\nfunction getHeader(request, name) {\n if (!request._headers) {\n return;\n }\n\n var key = name.toLowerCase();\n\n return request.getHeader ? request.getHeader(key) : request._headers[key];\n}\n\nfunction setHeader(request, name, value) {\n debug('setHeader', name, value);\n\n var key = name.toLowerCase();\n\n request._headers = request._headers || {};\n request._headerNames = request._headerNames || {};\n request._removedHeader = request._removedHeader || {};\n\n if (request.setHeader) {\n request.setHeader(key, value);\n } else {\n request._headers[key] = value;\n request._headerNames[key] = name;\n }\n\n if (name == 'expect' && value == '100-continue') {\n timers.setImmediate(function() {\n debug('continue');\n request.emit('continue');\n });\n }\n}\n\n// Sets request headers of the given request. This is needed during both matching phase\n// (in case header filters were specified) and mocking phase (to correctly pass mocked\n// request headers).\nfunction setRequestHeaders(req, options, interceptor) {\n // If a filtered scope is being used we have to use scope's host\n // in the header, otherwise 'host' header won't match.\n // NOTE: We use lower-case header field names throught Nock.\n var HOST_HEADER = 'host';\n if(interceptor.__nock_filteredScope && interceptor.__nock_scopeHost) {\n if(options && options.headers) {\n options.headers[HOST_HEADER] = interceptor.__nock_scopeHost;\n }\n setHeader(req, HOST_HEADER, interceptor.__nock_scopeHost);\n } else {\n // For all other cases, we always add host header equal to the\n // requested host unless it was already defined.\n if (options.host && !getHeader(req, HOST_HEADER)) {\n var hostHeader = options.host;\n\n if (options.port === 80 || options.port === 443) {\n hostHeader = hostHeader.split(':')[0];\n }\n\n setHeader(req, HOST_HEADER, hostHeader);\n }\n }\n\n}\n\nfunction RequestOverrider(req, options, interceptors, remove, cb) {\n var response;\n if (IncomingMessage) {\n response = new IncomingMessage(new EventEmitter());\n } else {\n response = new ReadableStream();\n response._read = function() {};\n }\n\n var requestBodyBuffers = [],\n aborted,\n emitError,\n end,\n ended,\n headers;\n\n // We may be changing the options object and we don't want those\n // changes affecting the user so we use a clone of the object.\n options = _.clone(options) || {};\n\n response.req = req;\n\n if (options.headers) {\n // We use lower-case header field names throught Nock.\n options.headers = common.headersFieldNamesToLowerCase(options.headers);\n\n headers = options.headers;\n _.forOwn(headers, function(val, key) {\n setHeader(req, key, val);\n });\n }\n\n /// options.auth\n if (options.auth && (! options.headers || ! options.headers.authorization)) {\n setHeader(req, 'Authorization', 'Basic ' + (new Buffer(options.auth)).toString('base64'));\n }\n\n if (! req.connection) {\n req.connection = new EventEmitter();\n }\n\n req.path = options.path;\n\n options.getHeader = function(name) {\n return getHeader(req, name);\n };\n\n req.socket = response.socket = Socket({ proto: options.proto });\n req.socket.connecting = true;\n\n req.write = function(buffer, encoding, callback) {\n debug('write', arguments);\n if (!aborted) {\n if (buffer) {\n if (!Buffer.isBuffer(buffer)) {\n buffer = new Buffer(buffer, encoding);\n }\n requestBodyBuffers.push(buffer);\n }\n if (typeof callback === 'function') {\n callback();\n }\n }\n else {\n emitError(new Error('Request aborted'));\n }\n\n timers.setImmediate(function() {\n req.emit('drain');\n });\n\n return false;\n };\n\n req.end = function(buffer, encoding, callback) {\n debug('req.end');\n if (!aborted && !ended) {\n req.write(buffer, encoding, function () {\n if (typeof callback === 'function') {\n callback();\n }\n end(cb);\n req.emit('finish');\n req.emit('end');\n });\n }\n if (aborted) {\n emitError(new Error('Request aborted'));\n }\n };\n\n req.flushHeaders = function() {\n debug('req.flushHeaders');\n if (!aborted && !ended) {\n end(cb);\n }\n if (aborted) {\n emitError(new Error('Request aborted'));\n }\n };\n\n req.abort = function() {\n if (aborted) {\n return;\n }\n debug('req.abort');\n aborted = true;\n if (!ended) {\n end();\n }\n var err = new Error();\n err.code = 'aborted';\n response.emit('close', err);\n\n req.socket.destroy();\n\n req.emit('abort');\n\n var connResetError = new Error('socket hang up');\n connResetError.code = 'ECONNRESET';\n emitError(connResetError);\n };\n\n // restify listens for a 'socket' event to\n // be emitted before calling end(), which causes\n // nock to hang with restify. The following logic\n // fakes the socket behavior for restify,\n // Fixes: https://github.com/pgte/nock/issues/79\n req.once = req.on = function(event, listener) {\n // emit a fake socket.\n if (event == 'socket') {\n listener.call(req, req.socket);\n req.socket.emit('connect', req.socket);\n req.socket.emit('secureConnect', req.socket);\n }\n\n EventEmitter.prototype.on.call(this, event, listener);\n return this;\n };\n\n emitError = function(error) {\n process.nextTick(function () {\n req.emit('error', error);\n });\n };\n\n end = function(cb) {\n debug('ending');\n ended = true;\n var requestBody,\n responseBody,\n responseBuffers,\n interceptor;\n\n var continued = false;\n\n // When request body is a binary buffer we internally use in its hexadecimal representation.\n var requestBodyBuffer = common.mergeChunks(requestBodyBuffers);\n var isBinaryRequestBodyBuffer = common.isBinaryBuffer(requestBodyBuffer);\n if(isBinaryRequestBodyBuffer) {\n requestBody = requestBodyBuffer.toString('hex');\n } else {\n requestBody = requestBodyBuffer.toString('utf8');\n }\n\n /// put back the path into options\n /// because bad behaving agents like superagent\n /// like to change request.path in mid-flight.\n options.path = req.path;\n\n // fixes #976\n options.protocol = options.proto + ':';\n\n interceptors.forEach(function(interceptor) {\n // For correct matching we need to have correct request headers - if these were specified.\n setRequestHeaders(req, options, interceptor);\n });\n\n interceptor = _.find(interceptors, function(interceptor) {\n return interceptor.match(options, requestBody);\n });\n\n if (!interceptor) {\n globalEmitter.emit('no match', req, options, requestBody);\n // Try to find a hostname match\n interceptor = _.find(interceptors, function(interceptor) {\n return interceptor.match(options, requestBody, true);\n });\n if (interceptor && req instanceof ClientRequest) {\n if (interceptor.options.allowUnmocked) {\n var newReq = new ClientRequest(options, cb);\n propagate(newReq, req);\n // We send the raw buffer as we received it, not as we interpreted it.\n newReq.end(requestBodyBuffer);\n return;\n }\n }\n\n var err = new Error(\"Nock: No match for request \" + common.stringifyRequest(options, requestBody));\n err.statusCode = err.status = 404;\n emitError(err);\n return;\n }\n\n debug('interceptor identified, starting mocking');\n\n // We again set request headers, now for our matched interceptor.\n setRequestHeaders(req, options, interceptor);\n interceptor.req = req;\n req.headers = req.getHeaders ? req.getHeaders() : req._headers;\n\n interceptor.scope.emit('request', req, interceptor);\n\n if (typeof interceptor.errorMessage !== 'undefined') {\n interceptor.interceptionCounter++;\n remove(interceptor);\n interceptor.discard();\n\n var error;\n if (_.isObject(interceptor.errorMessage)) {\n error = interceptor.errorMessage;\n } else {\n error = new Error(interceptor.errorMessage);\n }\n timers.setTimeout(emitError, interceptor.getTotalDelay(), error);\n return;\n }\n response.statusCode = Number(interceptor.statusCode) || 200;\n\n // Clone headers/rawHeaders to not override them when evaluating later\n response.headers = _.extend({}, interceptor.headers);\n response.rawHeaders = (interceptor.rawHeaders || []).slice();\n debug('response.rawHeaders:', response.rawHeaders);\n\n\n if (typeof interceptor.body === 'function') {\n if (requestBody && common.isJSONContent(options.headers)) {\n if (requestBody && common.contentEncoding(options.headers, 'gzip')) {\n if (typeof zlib.gunzipSync !== 'function') {\n emitError(new Error('Gzip encoding is currently not supported in this version of Node.'));\n return;\n }\n requestBody = String(zlib.gunzipSync(new Buffer(requestBody, 'hex')), 'hex')\n } else if (requestBody && common.contentEncoding(options.headers, 'deflate')) {\n if (typeof zlib.deflateSync !== 'function') {\n emitError(new Error('Deflate encoding is currently not supported in this version of Node.'));\n return;\n }\n requestBody = String(zlib.inflateSync(new Buffer(requestBody, 'hex')), 'hex')\n }\n\n requestBody = JSON.parse(requestBody);\n }\n\n // In case we are waiting for a callback\n if (interceptor.body.length === 3) {\n return interceptor.body(options.path, requestBody || '', continueWithResponseBody);\n }\n\n responseBody = interceptor.body(options.path, requestBody) || '';\n\n } else {\n\n // If the content is encoded we know that the response body *must* be an array\n // of response buffers which should be mocked one by one.\n // (otherwise decompressions after the first one fails as unzip expects to receive\n // buffer by buffer and not one single merged buffer)\n if(common.isContentEncoded(response.headers) && ! common.isStream(interceptor.body)) {\n\n if (interceptor.delayInMs) {\n emitError(new Error('Response delay is currently not supported with content-encoded responses.'));\n return;\n }\n\n var buffers = interceptor.body;\n if(!_.isArray(buffers)) {\n buffers = [buffers];\n }\n\n responseBuffers = _.map(buffers, function(buffer) {\n return new Buffer(buffer, 'hex');\n });\n\n } else {\n\n responseBody = interceptor.body;\n\n // If the request was binary then we assume that the response will be binary as well.\n // In that case we send the response as a Buffer object as that's what the client will expect.\n if(isBinaryRequestBodyBuffer && typeof(responseBody) === 'string') {\n // Try to create the buffer from the interceptor's body response as hex.\n try {\n responseBody = new Buffer(responseBody, 'hex');\n } catch(err) {\n debug('exception during Buffer construction from hex data:', responseBody, '-', err);\n }\n\n // Creating buffers does not necessarily throw errors, check for difference in size\n if (!responseBody || (interceptor.body.length > 0 && responseBody.length === 0)) {\n // We fallback on constructing buffer from utf8 representation of the body.\n responseBody = new Buffer(interceptor.body, 'utf8');\n }\n }\n }\n }\n\n return continueWithResponseBody(null, responseBody);\n\n function continueWithResponseBody(err, responseBody) {\n\n if (continued) {\n return;\n }\n continued = true;\n\n if (err) {\n response.statusCode = 500;\n responseBody = err.stack;\n }\n\n // Transform the response body if it exists (it may not exist\n // if we have `responseBuffers` instead)\n\n if (responseBody) {\n debug('transform the response body');\n\n if (Array.isArray(responseBody) &&\n responseBody.length >= 2 &&\n responseBody.length <= 3 &&\n typeof responseBody[0] == 'number')\n {\n debug('response body is array: %j', responseBody);\n response.statusCode = Number(responseBody[0]);\n debug('new headers: %j', responseBody[2]);\n if (! response.headers) response.headers = {};\n _.assign(response.headers, responseBody[2] || {});\n debug('response.headers after: %j', response.headers);\n responseBody = responseBody[1];\n\n response.rawHeaders = response.rawHeaders || [];\n Object.keys(response.headers).forEach(function(key) {\n response.rawHeaders.push(key, response.headers[key]);\n });\n }\n\n if (interceptor.delayInMs) {\n debug('delaying the response for', interceptor.delayInMs, 'milliseconds');\n // Because setTimeout is called immediately in DelayedBody(), so we\n // need count in the delayConnectionInMs.\n responseBody = new DelayedBody(interceptor.getTotalDelay(), responseBody);\n }\n\n if (common.isStream(responseBody)) {\n debug('response body is a stream');\n responseBody.pause();\n responseBody.on('data', function(d) {\n response.push(d);\n });\n responseBody.on('end', function() {\n response.push(null);\n });\n responseBody.on('error', function(err) {\n response.emit('error', err);\n });\n } else if (responseBody && !Buffer.isBuffer(responseBody)) {\n if (typeof responseBody === 'string') {\n responseBody = new Buffer(responseBody);\n } else {\n responseBody = JSON.stringify(responseBody);\n response.headers['content-type'] = 'application/json';\n }\n }\n }\n\n interceptor.interceptionCounter++;\n remove(interceptor);\n interceptor.discard();\n\n if (aborted) { return; }\n\n /// response.client.authorized = true\n /// fixes https://github.com/pgte/nock/issues/158\n response.client = _.extend(response.client || {}, {\n authorized: true\n });\n\n // Account for updates to Node.js response interface\n // cf https://github.com/request/request/pull/1615\n response.socket = _.extend(response.socket || {}, {\n authorized: true\n });\n\n // Evaluate functional headers.\n var evaluatedHeaders = {}\n Object.keys(response.headers).forEach(function (key) {\n var value = response.headers[key];\n\n if (typeof value === \"function\") {\n response.headers[key] = evaluatedHeaders[key] = value(req, response, responseBody);\n }\n });\n\n for(var rawHeaderIndex = 0 ; rawHeaderIndex < response.rawHeaders.length ; rawHeaderIndex += 2) {\n var key = response.rawHeaders[rawHeaderIndex];\n var value = response.rawHeaders[rawHeaderIndex + 1];\n if (typeof value === \"function\") {\n response.rawHeaders[rawHeaderIndex + 1] = evaluatedHeaders[key.toLowerCase()];\n }\n }\n\n\n process.nextTick(respond);\n\n function respond() {\n\n if (aborted) { return; }\n\n if (interceptor.socketDelayInMs && interceptor.socketDelayInMs > 0) {\n req.socket.applyDelay(interceptor.socketDelayInMs);\n }\n\n if (interceptor.delayConnectionInMs && interceptor.delayConnectionInMs > 0) {\n req.socket.applyDelay(interceptor.delayConnectionInMs);\n setTimeout(_respond, interceptor.delayConnectionInMs);\n } else {\n _respond();\n }\n\n function _respond() {\n if (aborted) { return; }\n\n debug('emitting response');\n\n if (typeof cb === 'function') {\n debug('callback with response');\n cb(response);\n }\n\n if (aborted) {\n emitError(new Error('Request aborted'));\n }\n else {\n req.emit('response', response);\n }\n\n if (common.isStream(responseBody)) {\n debug('resuming response stream');\n responseBody.resume();\n }\n else {\n responseBuffers = responseBuffers || [];\n if (typeof responseBody !== \"undefined\") {\n debug('adding body to buffer list');\n responseBuffers.push(responseBody);\n }\n\n // Stream the response chunks one at a time.\n timers.setImmediate(function emitChunk() {\n var chunk = responseBuffers.shift();\n\n if (chunk) {\n debug('emitting response chunk');\n response.push(chunk);\n timers.setImmediate(emitChunk);\n }\n else {\n debug('ending response stream');\n response.push(null);\n interceptor.scope.emit('replied', req, interceptor);\n }\n });\n }\n }\n }\n }\n };\n\n return req;\n}\n\nmodule.exports = RequestOverrider;\n\n\n//# sourceURL=webpack:///./node_modules/nock/lib/request_overrider.js?"); +eval("\n\nvar EventEmitter = __webpack_require__(/*! events */ \"events\").EventEmitter,\n http = __webpack_require__(/*! http */ \"http\"),\n propagate = __webpack_require__(/*! propagate */ \"./node_modules/propagate/index.js\"),\n DelayedBody = __webpack_require__(/*! ./delayed_body */ \"./node_modules/nock/lib/delayed_body.js\"),\n IncomingMessage = http.IncomingMessage,\n ClientRequest = http.ClientRequest,\n common = __webpack_require__(/*! ./common */ \"./node_modules/nock/lib/common.js\"),\n Socket = __webpack_require__(/*! ./socket */ \"./node_modules/nock/lib/socket.js\"),\n _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"),\n debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/index.js\")('nock.request_overrider'),\n timers = __webpack_require__(/*! timers */ \"timers\"),\n ReadableStream = __webpack_require__(/*! stream */ \"stream\").Readable,\n globalEmitter = __webpack_require__(/*! ./global_emitter */ \"./node_modules/nock/lib/global_emitter.js\"),\n zlib = __webpack_require__(/*! zlib */ \"zlib\");\n\nfunction getHeader(request, name) {\n if (!request._headers) {\n return;\n }\n\n var key = name.toLowerCase();\n\n return request.getHeader ? request.getHeader(key) : request._headers[key];\n}\n\nfunction setHeader(request, name, value) {\n debug('setHeader', name, value);\n\n var key = name.toLowerCase();\n\n request._headers = request._headers || {};\n request._headerNames = request._headerNames || {};\n request._removedHeader = request._removedHeader || {};\n\n if (request.setHeader) {\n request.setHeader(key, value);\n } else {\n request._headers[key] = value;\n request._headerNames[key] = name;\n }\n\n if (name == 'expect' && value == '100-continue') {\n timers.setImmediate(function() {\n debug('continue');\n request.emit('continue');\n });\n }\n}\n\n// Sets request headers of the given request. This is needed during both matching phase\n// (in case header filters were specified) and mocking phase (to correctly pass mocked\n// request headers).\nfunction setRequestHeaders(req, options, interceptor) {\n // If a filtered scope is being used we have to use scope's host\n // in the header, otherwise 'host' header won't match.\n // NOTE: We use lower-case header field names throught Nock.\n var HOST_HEADER = 'host';\n if(interceptor.__nock_filteredScope && interceptor.__nock_scopeHost) {\n if(options && options.headers) {\n options.headers[HOST_HEADER] = interceptor.__nock_scopeHost;\n }\n setHeader(req, HOST_HEADER, interceptor.__nock_scopeHost);\n } else {\n // For all other cases, we always add host header equal to the\n // requested host unless it was already defined.\n if (options.host && !getHeader(req, HOST_HEADER)) {\n var hostHeader = options.host;\n\n if (options.port === 80 || options.port === 443) {\n hostHeader = hostHeader.split(':')[0];\n }\n\n setHeader(req, HOST_HEADER, hostHeader);\n }\n }\n\n}\n\nfunction RequestOverrider(req, options, interceptors, remove, cb) {\n var response;\n if (IncomingMessage) {\n response = new IncomingMessage(new EventEmitter());\n } else {\n response = new ReadableStream();\n response._read = function() {};\n }\n\n var requestBodyBuffers = [],\n emitError,\n end,\n ended,\n headers;\n\n // We may be changing the options object and we don't want those\n // changes affecting the user so we use a clone of the object.\n options = _.clone(options) || {};\n\n response.req = req;\n\n if (options.headers) {\n // We use lower-case header field names throught Nock.\n options.headers = common.headersFieldNamesToLowerCase(options.headers);\n\n headers = options.headers;\n _.forOwn(headers, function(val, key) {\n setHeader(req, key, val);\n });\n }\n\n /// options.auth\n if (options.auth && (! options.headers || ! options.headers.authorization)) {\n setHeader(req, 'Authorization', 'Basic ' + (new Buffer(options.auth)).toString('base64'));\n }\n\n if (! req.connection) {\n req.connection = new EventEmitter();\n }\n\n req.path = options.path;\n\n options.getHeader = function(name) {\n return getHeader(req, name);\n };\n\n req.socket = response.socket = Socket({ proto: options.proto });\n req.socket.connecting = true;\n\n req.write = function(buffer, encoding, callback) {\n debug('write', arguments);\n if (!req.aborted) {\n if (buffer) {\n if (!Buffer.isBuffer(buffer)) {\n buffer = new Buffer(buffer, encoding);\n }\n requestBodyBuffers.push(buffer);\n }\n if (typeof callback === 'function') {\n callback();\n }\n }\n else {\n emitError(new Error('Request aborted'));\n }\n\n timers.setImmediate(function() {\n req.emit('drain');\n });\n\n return false;\n };\n\n req.end = function(buffer, encoding, callback) {\n debug('req.end');\n if (!req.aborted && !ended) {\n req.write(buffer, encoding, function () {\n if (typeof callback === 'function') {\n callback();\n }\n end(cb);\n req.emit('finish');\n req.emit('end');\n });\n }\n if (req.aborted) {\n emitError(new Error('Request aborted'));\n }\n };\n\n req.flushHeaders = function() {\n debug('req.flushHeaders');\n if (!req.aborted && !ended) {\n end(cb);\n }\n if (req.aborted) {\n emitError(new Error('Request aborted'));\n }\n };\n\n req.abort = function() {\n if (req.aborted) {\n return;\n }\n debug('req.abort');\n req.aborted = Date.now();\n if (!ended) {\n end();\n }\n var err = new Error();\n err.code = 'aborted';\n response.emit('close', err);\n\n req.socket.destroy();\n\n req.emit('abort');\n\n var connResetError = new Error('socket hang up');\n connResetError.code = 'ECONNRESET';\n emitError(connResetError);\n };\n\n // restify listens for a 'socket' event to\n // be emitted before calling end(), which causes\n // nock to hang with restify. The following logic\n // fakes the socket behavior for restify,\n // Fixes: https://github.com/pgte/nock/issues/79\n req.once = req.on = function(event, listener) {\n // emit a fake socket.\n if (event == 'socket') {\n listener.call(req, req.socket);\n req.socket.emit('connect', req.socket);\n req.socket.emit('secureConnect', req.socket);\n }\n\n EventEmitter.prototype.on.call(this, event, listener);\n return this;\n };\n\n emitError = function(error) {\n process.nextTick(function () {\n req.emit('error', error);\n });\n };\n\n end = function(cb) {\n debug('ending');\n ended = true;\n var requestBody,\n responseBody,\n responseBuffers,\n interceptor;\n\n var continued = false;\n\n // When request body is a binary buffer we internally use in its hexadecimal representation.\n var requestBodyBuffer = common.mergeChunks(requestBodyBuffers);\n var isBinaryRequestBodyBuffer = common.isBinaryBuffer(requestBodyBuffer);\n if(isBinaryRequestBodyBuffer) {\n requestBody = requestBodyBuffer.toString('hex');\n } else {\n requestBody = requestBodyBuffer.toString('utf8');\n }\n\n /// put back the path into options\n /// because bad behaving agents like superagent\n /// like to change request.path in mid-flight.\n options.path = req.path;\n\n // fixes #976\n options.protocol = options.proto + ':';\n\n interceptors.forEach(function(interceptor) {\n // For correct matching we need to have correct request headers - if these were specified.\n setRequestHeaders(req, options, interceptor);\n });\n\n interceptor = _.find(interceptors, function(interceptor) {\n return interceptor.match(options, requestBody);\n });\n\n if (!interceptor) {\n globalEmitter.emit('no match', req, options, requestBody);\n // Try to find a hostname match\n interceptor = _.find(interceptors, function(interceptor) {\n return interceptor.match(options, requestBody, true);\n });\n if (interceptor && req instanceof ClientRequest) {\n if (interceptor.options.allowUnmocked) {\n var newReq = new ClientRequest(options, cb);\n propagate(newReq, req);\n // We send the raw buffer as we received it, not as we interpreted it.\n newReq.end(requestBodyBuffer);\n return;\n }\n }\n\n var err = new Error(\"Nock: No match for request \" + common.stringifyRequest(options, requestBody));\n err.statusCode = err.status = 404;\n emitError(err);\n return;\n }\n\n debug('interceptor identified, starting mocking');\n\n // We again set request headers, now for our matched interceptor.\n setRequestHeaders(req, options, interceptor);\n interceptor.req = req;\n req.headers = req.getHeaders ? req.getHeaders() : req._headers;\n\n interceptor.scope.emit('request', req, interceptor);\n\n if (typeof interceptor.errorMessage !== 'undefined') {\n interceptor.interceptionCounter++;\n remove(interceptor);\n interceptor.discard();\n\n var error;\n if (_.isObject(interceptor.errorMessage)) {\n error = interceptor.errorMessage;\n } else {\n error = new Error(interceptor.errorMessage);\n }\n timers.setTimeout(emitError, interceptor.getTotalDelay(), error);\n return;\n }\n response.statusCode = Number(interceptor.statusCode) || 200;\n\n // Clone headers/rawHeaders to not override them when evaluating later\n response.headers = _.extend({}, interceptor.headers);\n response.rawHeaders = (interceptor.rawHeaders || []).slice();\n debug('response.rawHeaders:', response.rawHeaders);\n\n\n if (typeof interceptor.body === 'function') {\n if (requestBody && common.isJSONContent(options.headers)) {\n if (requestBody && common.contentEncoding(options.headers, 'gzip')) {\n if (typeof zlib.gunzipSync !== 'function') {\n emitError(new Error('Gzip encoding is currently not supported in this version of Node.'));\n return;\n }\n requestBody = String(zlib.gunzipSync(new Buffer(requestBody, 'hex')), 'hex')\n } else if (requestBody && common.contentEncoding(options.headers, 'deflate')) {\n if (typeof zlib.deflateSync !== 'function') {\n emitError(new Error('Deflate encoding is currently not supported in this version of Node.'));\n return;\n }\n requestBody = String(zlib.inflateSync(new Buffer(requestBody, 'hex')), 'hex')\n }\n\n requestBody = JSON.parse(requestBody);\n }\n\n // In case we are waiting for a callback\n if (interceptor.body.length === 3) {\n return interceptor.body(options.path, requestBody || '', continueWithResponseBody);\n }\n\n responseBody = interceptor.body(options.path, requestBody) || '';\n\n } else {\n\n // If the content is encoded we know that the response body *must* be an array\n // of response buffers which should be mocked one by one.\n // (otherwise decompressions after the first one fails as unzip expects to receive\n // buffer by buffer and not one single merged buffer)\n if(common.isContentEncoded(response.headers) && ! common.isStream(interceptor.body)) {\n\n if (interceptor.delayInMs) {\n emitError(new Error('Response delay is currently not supported with content-encoded responses.'));\n return;\n }\n\n var buffers = interceptor.body;\n if(!_.isArray(buffers)) {\n buffers = [buffers];\n }\n\n responseBuffers = _.map(buffers, function(buffer) {\n return new Buffer(buffer, 'hex');\n });\n\n } else {\n\n responseBody = interceptor.body;\n\n // If the request was binary then we assume that the response will be binary as well.\n // In that case we send the response as a Buffer object as that's what the client will expect.\n if(isBinaryRequestBodyBuffer && typeof(responseBody) === 'string') {\n // Try to create the buffer from the interceptor's body response as hex.\n try {\n responseBody = new Buffer(responseBody, 'hex');\n } catch(err) {\n debug('exception during Buffer construction from hex data:', responseBody, '-', err);\n }\n\n // Creating buffers does not necessarily throw errors, check for difference in size\n if (!responseBody || (interceptor.body.length > 0 && responseBody.length === 0)) {\n // We fallback on constructing buffer from utf8 representation of the body.\n responseBody = new Buffer(interceptor.body, 'utf8');\n }\n }\n }\n }\n\n return continueWithResponseBody(null, responseBody);\n\n function continueWithResponseBody(err, responseBody) {\n\n if (continued) {\n return;\n }\n continued = true;\n\n if (err) {\n response.statusCode = 500;\n responseBody = err.stack;\n }\n\n // Transform the response body if it exists (it may not exist\n // if we have `responseBuffers` instead)\n\n if (responseBody) {\n debug('transform the response body');\n\n if (Array.isArray(responseBody) &&\n responseBody.length >= 2 &&\n responseBody.length <= 3 &&\n typeof responseBody[0] == 'number')\n {\n debug('response body is array: %j', responseBody);\n response.statusCode = Number(responseBody[0]);\n debug('new headers: %j', responseBody[2]);\n if (! response.headers) response.headers = {};\n _.assign(response.headers, responseBody[2] || {});\n debug('response.headers after: %j', response.headers);\n responseBody = responseBody[1];\n\n response.rawHeaders = response.rawHeaders || [];\n Object.keys(response.headers).forEach(function(key) {\n response.rawHeaders.push(key, response.headers[key]);\n });\n }\n\n if (interceptor.delayInMs) {\n debug('delaying the response for', interceptor.delayInMs, 'milliseconds');\n // Because setTimeout is called immediately in DelayedBody(), so we\n // need count in the delayConnectionInMs.\n responseBody = new DelayedBody(interceptor.getTotalDelay(), responseBody);\n }\n\n if (common.isStream(responseBody)) {\n debug('response body is a stream');\n responseBody.pause();\n responseBody.on('data', function(d) {\n response.push(d);\n });\n responseBody.on('end', function() {\n response.push(null);\n });\n responseBody.on('error', function(err) {\n response.emit('error', err);\n });\n } else if (responseBody && !Buffer.isBuffer(responseBody)) {\n if (typeof responseBody === 'string') {\n responseBody = new Buffer(responseBody);\n } else {\n responseBody = JSON.stringify(responseBody);\n response.headers['content-type'] = 'application/json';\n }\n }\n }\n\n interceptor.interceptionCounter++;\n remove(interceptor);\n interceptor.discard();\n\n if (req.aborted) { return; }\n\n /// response.client.authorized = true\n /// fixes https://github.com/pgte/nock/issues/158\n response.client = _.extend(response.client || {}, {\n authorized: true\n });\n\n // Account for updates to Node.js response interface\n // cf https://github.com/request/request/pull/1615\n response.socket = _.extend(response.socket || {}, {\n authorized: true\n });\n\n // Evaluate functional headers.\n var evaluatedHeaders = {}\n Object.keys(response.headers).forEach(function (key) {\n var value = response.headers[key];\n\n if (typeof value === \"function\") {\n response.headers[key] = evaluatedHeaders[key] = value(req, response, responseBody);\n }\n });\n\n for(var rawHeaderIndex = 0 ; rawHeaderIndex < response.rawHeaders.length ; rawHeaderIndex += 2) {\n var key = response.rawHeaders[rawHeaderIndex];\n var value = response.rawHeaders[rawHeaderIndex + 1];\n if (typeof value === \"function\") {\n response.rawHeaders[rawHeaderIndex + 1] = evaluatedHeaders[key.toLowerCase()];\n }\n }\n\n\n process.nextTick(respond);\n\n function respond() {\n\n if (req.aborted) { return; }\n\n if (interceptor.socketDelayInMs && interceptor.socketDelayInMs > 0) {\n req.socket.applyDelay(interceptor.socketDelayInMs);\n }\n\n if (interceptor.delayConnectionInMs && interceptor.delayConnectionInMs > 0) {\n req.socket.applyDelay(interceptor.delayConnectionInMs);\n setTimeout(_respond, interceptor.delayConnectionInMs);\n } else {\n _respond();\n }\n\n function _respond() {\n if (req.aborted) { return; }\n\n debug('emitting response');\n\n if (typeof cb === 'function') {\n debug('callback with response');\n cb(response);\n }\n\n if (req.aborted) {\n emitError(new Error('Request aborted'));\n }\n else {\n req.emit('response', response);\n }\n\n if (common.isStream(responseBody)) {\n debug('resuming response stream');\n responseBody.resume();\n }\n else {\n responseBuffers = responseBuffers || [];\n if (typeof responseBody !== \"undefined\") {\n debug('adding body to buffer list');\n responseBuffers.push(responseBody);\n }\n\n // Stream the response chunks one at a time.\n timers.setImmediate(function emitChunk() {\n var chunk = responseBuffers.shift();\n\n if (chunk) {\n debug('emitting response chunk');\n response.push(chunk);\n timers.setImmediate(emitChunk);\n }\n else {\n debug('ending response stream');\n response.push(null);\n interceptor.scope.emit('replied', req, interceptor);\n }\n });\n }\n }\n }\n }\n };\n\n return req;\n}\n\nmodule.exports = RequestOverrider;\n\n\n//# sourceURL=webpack:///./node_modules/nock/lib/request_overrider.js?"); /***/ }), diff --git a/yarn.lock b/yarn.lock index 051ef1a8..5ea5d662 100644 --- a/yarn.lock +++ b/yarn.lock @@ -102,139 +102,140 @@ version "9.6.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.6.tgz#439b91f9caf3983cad2eef1e11f6bedcbf9431d2" -"@webassemblyjs/ast@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.5.10.tgz#7f1e81149ca4e103c9e7cc321ea0dcb83a392512" +"@webassemblyjs/ast@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.5.12.tgz#a9acbcb3f25333c4edfa1fdf3186b1ccf64e6664" dependencies: - "@webassemblyjs/helper-module-context" "1.5.10" - "@webassemblyjs/helper-wasm-bytecode" "1.5.10" - "@webassemblyjs/wast-parser" "1.5.10" + "@webassemblyjs/helper-module-context" "1.5.12" + "@webassemblyjs/helper-wasm-bytecode" "1.5.12" + "@webassemblyjs/wast-parser" "1.5.12" debug "^3.1.0" mamacro "^0.0.3" -"@webassemblyjs/floating-point-hex-parser@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.5.10.tgz#ae48705fd58927df62023f114520b8215330ff86" +"@webassemblyjs/floating-point-hex-parser@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.5.12.tgz#0f36044ffe9652468ce7ae5a08716a4eeff9cd9c" -"@webassemblyjs/helper-api-error@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.5.10.tgz#0baf9453ce2fd8db58f0fdb4fb2852557c71d5a7" +"@webassemblyjs/helper-api-error@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.5.12.tgz#05466833ff2f9d8953a1a327746e1d112ea62aaf" -"@webassemblyjs/helper-buffer@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.5.10.tgz#abee4284161e9cd6ba7619785ca277bfcb8052ce" +"@webassemblyjs/helper-buffer@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.5.12.tgz#1f0de5aaabefef89aec314f7f970009cd159c73d" dependencies: debug "^3.1.0" -"@webassemblyjs/helper-code-frame@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.5.10.tgz#4e23c05431665f16322104580af7c06253d4b4e0" +"@webassemblyjs/helper-code-frame@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.5.12.tgz#3cdc1953093760d1c0f0caf745ccd62bdb6627c7" dependencies: - "@webassemblyjs/wast-printer" "1.5.10" + "@webassemblyjs/wast-printer" "1.5.12" -"@webassemblyjs/helper-fsm@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.5.10.tgz#490bab613ea255a9272b764826d3cc9d15170676" +"@webassemblyjs/helper-fsm@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.5.12.tgz#6bc1442b037f8e30f2e57b987cee5c806dd15027" -"@webassemblyjs/helper-module-context@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.5.10.tgz#6fca93585228bf33e6da076d0a1373db1fdd6580" +"@webassemblyjs/helper-module-context@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.5.12.tgz#b5588ca78b33b8a0da75f9ab8c769a3707baa861" dependencies: + debug "^3.1.0" mamacro "^0.0.3" -"@webassemblyjs/helper-wasm-bytecode@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.5.10.tgz#90f6da93c7a186bfb2f587de442982ff533c4b44" +"@webassemblyjs/helper-wasm-bytecode@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.5.12.tgz#d12a3859db882a448891a866a05d0be63785b616" -"@webassemblyjs/helper-wasm-section@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.5.10.tgz#d64292a19f7f357c49719461065efdf7ec975d66" +"@webassemblyjs/helper-wasm-section@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.5.12.tgz#ff9fe1507d368ad437e7969d25e8c1693dac1884" dependencies: - "@webassemblyjs/ast" "1.5.10" - "@webassemblyjs/helper-buffer" "1.5.10" - "@webassemblyjs/helper-wasm-bytecode" "1.5.10" - "@webassemblyjs/wasm-gen" "1.5.10" + "@webassemblyjs/ast" "1.5.12" + "@webassemblyjs/helper-buffer" "1.5.12" + "@webassemblyjs/helper-wasm-bytecode" "1.5.12" + "@webassemblyjs/wasm-gen" "1.5.12" debug "^3.1.0" -"@webassemblyjs/ieee754@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.5.10.tgz#257cad440dd6c8a339402d31e035ba2e38e9c245" +"@webassemblyjs/ieee754@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.5.12.tgz#ee9574bc558888f13097ce3e7900dff234ea19a4" dependencies: ieee754 "^1.1.11" -"@webassemblyjs/leb128@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.5.10.tgz#a8e4fe5f4b16daadb241fcc44d9735e9f27b05a3" +"@webassemblyjs/leb128@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.5.12.tgz#0308eec652765ee567d8a5fa108b4f0b25b458e1" dependencies: leb "^0.3.0" -"@webassemblyjs/utf8@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.5.10.tgz#0b3b6bc86b7619c5dc7b2789db6665aa35689983" - -"@webassemblyjs/wasm-edit@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.5.10.tgz#0fe80f19e57f669eab1caa8c1faf9690b259d5b9" - dependencies: - "@webassemblyjs/ast" "1.5.10" - "@webassemblyjs/helper-buffer" "1.5.10" - "@webassemblyjs/helper-wasm-bytecode" "1.5.10" - "@webassemblyjs/helper-wasm-section" "1.5.10" - "@webassemblyjs/wasm-gen" "1.5.10" - "@webassemblyjs/wasm-opt" "1.5.10" - "@webassemblyjs/wasm-parser" "1.5.10" - "@webassemblyjs/wast-printer" "1.5.10" +"@webassemblyjs/utf8@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.5.12.tgz#d5916222ef314bf60d6806ed5ac045989bfd92ce" + +"@webassemblyjs/wasm-edit@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.5.12.tgz#821c9358e644a166f2c910e5af1b46ce795a17aa" + dependencies: + "@webassemblyjs/ast" "1.5.12" + "@webassemblyjs/helper-buffer" "1.5.12" + "@webassemblyjs/helper-wasm-bytecode" "1.5.12" + "@webassemblyjs/helper-wasm-section" "1.5.12" + "@webassemblyjs/wasm-gen" "1.5.12" + "@webassemblyjs/wasm-opt" "1.5.12" + "@webassemblyjs/wasm-parser" "1.5.12" + "@webassemblyjs/wast-printer" "1.5.12" debug "^3.1.0" -"@webassemblyjs/wasm-gen@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.5.10.tgz#8b29ddd3651259408ae5d5c816a011fb3f3f3584" +"@webassemblyjs/wasm-gen@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.5.12.tgz#0b7ccfdb93dab902cc0251014e2e18bae3139bcb" dependencies: - "@webassemblyjs/ast" "1.5.10" - "@webassemblyjs/helper-wasm-bytecode" "1.5.10" - "@webassemblyjs/ieee754" "1.5.10" - "@webassemblyjs/leb128" "1.5.10" - "@webassemblyjs/utf8" "1.5.10" + "@webassemblyjs/ast" "1.5.12" + "@webassemblyjs/helper-wasm-bytecode" "1.5.12" + "@webassemblyjs/ieee754" "1.5.12" + "@webassemblyjs/leb128" "1.5.12" + "@webassemblyjs/utf8" "1.5.12" -"@webassemblyjs/wasm-opt@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.5.10.tgz#569e45ab1b2bf0a7706cdf6d1b51d1188e9e4c7b" +"@webassemblyjs/wasm-opt@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.5.12.tgz#bd758a8bc670f585ff1ae85f84095a9e0229cbc9" dependencies: - "@webassemblyjs/ast" "1.5.10" - "@webassemblyjs/helper-buffer" "1.5.10" - "@webassemblyjs/wasm-gen" "1.5.10" - "@webassemblyjs/wasm-parser" "1.5.10" + "@webassemblyjs/ast" "1.5.12" + "@webassemblyjs/helper-buffer" "1.5.12" + "@webassemblyjs/wasm-gen" "1.5.12" + "@webassemblyjs/wasm-parser" "1.5.12" debug "^3.1.0" -"@webassemblyjs/wasm-parser@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.5.10.tgz#3e1017e49f833f46b840db7cf9d194d4f00037ff" - dependencies: - "@webassemblyjs/ast" "1.5.10" - "@webassemblyjs/helper-api-error" "1.5.10" - "@webassemblyjs/helper-wasm-bytecode" "1.5.10" - "@webassemblyjs/ieee754" "1.5.10" - "@webassemblyjs/leb128" "1.5.10" - "@webassemblyjs/wasm-parser" "1.5.10" - -"@webassemblyjs/wast-parser@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.5.10.tgz#1a3235926483c985a00ee8ebca856ffda9544934" - dependencies: - "@webassemblyjs/ast" "1.5.10" - "@webassemblyjs/floating-point-hex-parser" "1.5.10" - "@webassemblyjs/helper-api-error" "1.5.10" - "@webassemblyjs/helper-code-frame" "1.5.10" - "@webassemblyjs/helper-fsm" "1.5.10" +"@webassemblyjs/wasm-parser@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.5.12.tgz#7b10b4388ecf98bd7a22e702aa62ec2f46d0c75e" + dependencies: + "@webassemblyjs/ast" "1.5.12" + "@webassemblyjs/helper-api-error" "1.5.12" + "@webassemblyjs/helper-wasm-bytecode" "1.5.12" + "@webassemblyjs/ieee754" "1.5.12" + "@webassemblyjs/leb128" "1.5.12" + "@webassemblyjs/utf8" "1.5.12" + +"@webassemblyjs/wast-parser@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.5.12.tgz#9cf5ae600ecae0640437b5d4de5dd6b6088d0d8b" + dependencies: + "@webassemblyjs/ast" "1.5.12" + "@webassemblyjs/floating-point-hex-parser" "1.5.12" + "@webassemblyjs/helper-api-error" "1.5.12" + "@webassemblyjs/helper-code-frame" "1.5.12" + "@webassemblyjs/helper-fsm" "1.5.12" long "^3.2.0" mamacro "^0.0.3" -"@webassemblyjs/wast-printer@1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.5.10.tgz#adb38831ba45efd0a5c7971b666e179b64f68bba" +"@webassemblyjs/wast-printer@1.5.12": + version "1.5.12" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.5.12.tgz#563ca4d01b22d21640b2463dc5e3d7f7d9dac520" dependencies: - "@webassemblyjs/ast" "1.5.10" - "@webassemblyjs/wast-parser" "1.5.10" + "@webassemblyjs/ast" "1.5.12" + "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" abbrev@1, abbrev@^1.1.1: @@ -265,6 +266,10 @@ acorn@^5.5.0: version "5.5.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" +acorn@^5.6.2: + version "5.7.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" + agent-base@4, agent-base@^4.1.0, agent-base@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce" @@ -863,9 +868,11 @@ chownr@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" -chrome-trace-event@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-0.1.3.tgz#d395af2d31c87b90a716c831fe326f69768ec084" +chrome-trace-event@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz#45a91bd2c20c9411f0963b5aaeb9a1b95e09cc48" + dependencies: + tslib "^1.9.0" ci-info@^1.0.0: version "1.1.1" @@ -2674,9 +2681,9 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lint-staged@7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.1.3.tgz#0eb77b42131653808e02bc0eba66ad8ff8a8ca1f" +lint-staged@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.2.0.tgz#bdf4bb7f2f37fe689acfaec9999db288a5b26888" dependencies: app-root-path "^2.0.1" chalk "^2.3.1" @@ -3207,9 +3214,9 @@ nise@^1.3.3: path-to-regexp "^1.7.0" text-encoding "^0.6.4" -nock@9.3.0: - version "9.3.0" - resolved "https://registry.yarnpkg.com/nock/-/nock-9.3.0.tgz#4dcfdd37bd249836754d05bbac5a1f05e12e0f16" +nock@9.3.3: + version "9.3.3" + resolved "https://registry.yarnpkg.com/nock/-/nock-9.3.3.tgz#d9f4cd3c011afeadaf5ccf1b243f6e353781cda0" dependencies: chai "^4.1.2" debug "^3.1.0" @@ -4095,9 +4102,9 @@ rollup-plugin-uglify@4.0.0: "@babel/code-frame" "^7.0.0-beta.47" uglify-js "^3.3.25" -rollup@0.60.0: - version "0.60.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.60.0.tgz#2c4acaaf3d8a858a81ff740d6253e21eeb58ff21" +rollup@0.60.7: + version "0.60.7" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.60.7.tgz#2b62ef9306f719b1ab85a7814b3e6596ac51fae8" dependencies: "@types/estree" "0.0.39" "@types/node" "*" @@ -4253,9 +4260,9 @@ signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" -sinon@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-5.1.0.tgz#65f463422978638fadf750c026719697feb0dca5" +sinon@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-6.0.0.tgz#f26627e4830dc34279661474da2c9e784f166215" dependencies: "@sinonjs/formatio" "^2.0.0" diff "^3.5.0" @@ -4424,7 +4431,16 @@ snyk-tree@^1.0.0: dependencies: archy "^1.0.0" -snyk-try-require@1.3.0, snyk-try-require@^1.1.1: +snyk-try-require@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/snyk-try-require/-/snyk-try-require-1.3.1.tgz#6e026f92e64af7fcccea1ee53d524841e418a212" + dependencies: + debug "^3.1.0" + lodash.clonedeep "^4.3.0" + lru-cache "^4.0.0" + then-fs "^2.0.0" + +snyk-try-require@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/snyk-try-require/-/snyk-try-require-1.3.0.tgz#f35706acf91c8af788d58e1f1ad6bf0fcf6c5493" dependencies: @@ -4433,9 +4449,9 @@ snyk-try-require@1.3.0, snyk-try-require@^1.1.1: lru-cache "^4.0.0" then-fs "^2.0.0" -snyk@1.82.1: - version "1.82.1" - resolved "https://registry.yarnpkg.com/snyk/-/snyk-1.82.1.tgz#df0abf9d398507b512e2749790da67e56c3a853e" +snyk@1.83.0: + version "1.83.0" + resolved "https://registry.yarnpkg.com/snyk/-/snyk-1.83.0.tgz#207fb2f47306719f62664d2d2e8e807b294baea0" dependencies: abbrev "^1.1.1" ansi-escapes "^3.1.0" @@ -4465,7 +4481,7 @@ snyk@1.82.1: snyk-resolve-deps "3.1.0" snyk-sbt-plugin "1.3.0" snyk-tree "^1.0.0" - snyk-try-require "1.3.0" + snyk-try-require "1.3.1" tempfile "^2.0.0" then-fs "^2.0.0" undefsafe "^2.0.0" @@ -5112,9 +5128,9 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" -webpack-cli@3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.0.3.tgz#1a8c6e09dee1fd45305f3b3828cf081903cee0f2" +webpack-cli@3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.0.7.tgz#d4171aa6a52f28d3a40048db3d0764e1c601c029" dependencies: chalk "^2.4.1" cross-spawn "^6.0.5" @@ -5135,20 +5151,20 @@ webpack-sources@^1.0.1, webpack-sources@^1.1.0: source-list-map "^2.0.0" source-map "~0.6.1" -webpack@4.11.1: - version "4.11.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.11.1.tgz#1aa0b936f7ae93a52cf38d2ad0d0f46dcf3c2723" +webpack@4.12.0: + version "4.12.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.12.0.tgz#14758e035ae69747f68dd0edf3c5a572a82bdee9" dependencies: - "@webassemblyjs/ast" "1.5.10" - "@webassemblyjs/helper-module-context" "1.5.10" - "@webassemblyjs/wasm-edit" "1.5.10" - "@webassemblyjs/wasm-opt" "1.5.10" - "@webassemblyjs/wasm-parser" "1.5.10" - acorn "^5.0.0" + "@webassemblyjs/ast" "1.5.12" + "@webassemblyjs/helper-module-context" "1.5.12" + "@webassemblyjs/wasm-edit" "1.5.12" + "@webassemblyjs/wasm-opt" "1.5.12" + "@webassemblyjs/wasm-parser" "1.5.12" + acorn "^5.6.2" acorn-dynamic-import "^3.0.0" ajv "^6.1.0" ajv-keywords "^3.1.0" - chrome-trace-event "^0.1.1" + chrome-trace-event "^1.0.0" enhanced-resolve "^4.0.0" eslint-scope "^3.7.1" json-parse-better-errors "^1.0.2"