diff --git a/.gitattributes b/.gitattributes index b9558de78944..0f0d132ac99c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -jupyterlab/yarn.js binary +jupyterlab/staging/yarn.js binary diff --git a/jupyterlab/staging/yarn.js b/jupyterlab/staging/yarn.js index 0be0beed5602..ef41487f99be 100644 --- a/jupyterlab/staging/yarn.js +++ b/jupyterlab/staging/yarn.js @@ -65,11 +65,17 @@ module.exports = /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 395); +/******/ return __webpack_require__(__webpack_require__.s = 410); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ +/***/ (function(module, exports) { + +module.exports = require("path"); + +/***/ }), +/* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77,7 +83,7 @@ module.exports = exports.__esModule = true; -var _promise = __webpack_require__(4); +var _promise = __webpack_require__(6); var _promise2 = _interopRequireDefault(_promise); @@ -113,19 +119,34 @@ exports.default = function (fn) { }; /***/ }), -/* 1 */ -/***/ (function(module, exports) { +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { -module.exports = require("path"); +"use strict"; + + +exports.__esModule = true; + +exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; /***/ }), -/* 2 */ +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(473), __esModule: true }; + +/***/ }), +/* 4 */ /***/ (function(module, exports) { module.exports = require("util"); /***/ }), -/* 3 */ +/* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -134,47 +155,103 @@ module.exports = require("util"); Object.defineProperty(exports, "__esModule", { value: true }); -class MessageError extends Error { - constructor(msg, code) { - super(msg); - this.code = code; - } +exports.ResponseError = exports.ProcessTermError = exports.SecurityError = exports.ProcessSpawnError = exports.MessageError = undefined; + +var _classCallCheck2; +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } -exports.MessageError = MessageError; -class ProcessSpawnError extends MessageError { - constructor(msg, code, process) { - super(msg, code); - this.process = process; - } +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); } -exports.ProcessSpawnError = ProcessSpawnError; -class SecurityError extends MessageError {} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var MessageError = exports.MessageError = function (_Error) { + (0, (_inherits2 || _load_inherits()).default)(MessageError, _Error); + + function MessageError(msg, code) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, MessageError); -exports.SecurityError = SecurityError; -class ProcessTermError extends MessageError {} + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Error.call(this, msg)); -exports.ProcessTermError = ProcessTermError; -class ResponseError extends Error { - constructor(msg, responseCode) { - super(msg); - this.responseCode = responseCode; + _this.code = code; + return _this; } -} -exports.ResponseError = ResponseError; + return MessageError; +}(Error); + +var ProcessSpawnError = exports.ProcessSpawnError = function (_MessageError) { + (0, (_inherits2 || _load_inherits()).default)(ProcessSpawnError, _MessageError); + + function ProcessSpawnError(msg, code, process) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ProcessSpawnError); + + var _this2 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError.call(this, msg, code)); + + _this2.process = process; + return _this2; + } + + return ProcessSpawnError; +}(MessageError); + +var SecurityError = exports.SecurityError = function (_MessageError2) { + (0, (_inherits2 || _load_inherits()).default)(SecurityError, _MessageError2); + + function SecurityError() { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, SecurityError); + return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError2.apply(this, arguments)); + } + + return SecurityError; +}(MessageError); + +var ProcessTermError = exports.ProcessTermError = function (_MessageError3) { + (0, (_inherits2 || _load_inherits()).default)(ProcessTermError, _MessageError3); + + function ProcessTermError() { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ProcessTermError); + return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError3.apply(this, arguments)); + } + + return ProcessTermError; +}(MessageError); + +var ResponseError = exports.ResponseError = function (_Error2) { + (0, (_inherits2 || _load_inherits()).default)(ResponseError, _Error2); + + function ResponseError(msg, responseCode) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ResponseError); + + var _this5 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Error2.call(this, msg)); + + _this5.responseCode = responseCode; + return _this5; + } + + return ResponseError; +}(Error); /***/ }), -/* 4 */ +/* 6 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = { "default": __webpack_require__(463), __esModule: true }; +module.exports = { "default": __webpack_require__(480), __esModule: true }; /***/ }), -/* 5 */ +/* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -188,39 +265,45 @@ exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.make var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(33)); + return _map = _interopRequireDefault(__webpack_require__(37)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); + return _set = _interopRequireDefault(__webpack_require__(15)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } -let buildActionsForCopy = (() => { +var buildActionsForCopy = function () { var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { // - let build = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - const src = data.src, - dest = data.dest, - type = data.type; + var build = function () { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + var src = data.src, + dest = data.dest, + type = data.type; - const onFresh = data.onFresh || noop; - const onDone = data.onDone || noop; + var onFresh = data.onFresh || noop; + var onDone = data.onDone || noop; // TODO https://github.com/yarnpkg/yarn/issues/3751 // related to bundled dependencies handling @@ -234,7 +317,7 @@ let buildActionsForCopy = (() => { yield mkdirp((_path || _load_path()).default.dirname(dest)); onFresh(); actions.symlink.push({ - dest: dest, + dest, linkname: src }); onDone(); @@ -246,14 +329,14 @@ let buildActionsForCopy = (() => { return; } - const srcStat = yield lstat(src); - let srcFiles; + var srcStat = yield lstat(src); + var srcFiles = void 0; if (srcStat.isDirectory()) { srcFiles = yield readdir(src); } - let destStat; + var destStat = void 0; try { // try accessing the destination destStat = yield lstat(dest); @@ -266,9 +349,9 @@ let buildActionsForCopy = (() => { // if destination exists if (destStat) { - const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); - const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); - const bothFiles = srcStat.isFile() && destStat.isFile(); + var bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); + var bothFolders = srcStat.isDirectory() && destStat.isDirectory(); + var bothFiles = srcStat.isFile() && destStat.isFile(); // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving // us modes that aren't valid. investigate this, it's generally safe to proceed. @@ -287,7 +370,7 @@ let buildActionsForCopy = (() => { } if (bothSymlinks) { - const srcReallink = yield readlink(src); + var srcReallink = yield readlink(src); if (srcReallink === (yield readlink(dest))) { // if both symlinks are the same then we can continue on onDone(); @@ -298,17 +381,43 @@ let buildActionsForCopy = (() => { if (bothFolders) { // mark files that aren't in this folder as possibly extraneous - const destFiles = yield readdir(dest); + var destFiles = yield readdir(dest); invariant(srcFiles, 'src files not initialised'); - for (const file of destFiles) { - if (srcFiles.indexOf(file) < 0) { - const loc = (_path || _load_path()).default.join(dest, file); - possibleExtraneous.add(loc); + for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref7; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref7 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref7 = _i4.value; + } + + var _file2 = _ref7; + + if (srcFiles.indexOf(_file2) < 0) { + var _loc = (_path || _load_path()).default.join(dest, _file2); + possibleExtraneous.add(_loc); + + if ((yield lstat(_loc)).isDirectory()) { + for (var _iterator5 = yield readdir(_loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref8; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref8 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref8 = _i5.value; + } + + var _file3 = _ref8; - if ((yield lstat(loc)).isDirectory()) { - for (const file of yield readdir(loc)) { - possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); + possibleExtraneous.add((_path || _load_path()).default.join(_loc, _file3)); } } } @@ -323,57 +432,72 @@ let buildActionsForCopy = (() => { if (srcStat.isSymbolicLink()) { onFresh(); - const linkname = yield readlink(src); + var _linkname = yield readlink(src); actions.symlink.push({ - dest: dest, - linkname: linkname + dest, + linkname: _linkname }); onDone(); } else if (srcStat.isDirectory()) { - if (!destStat) { - reporter.verbose(reporter.lang('verboseFileFolder', dest)); - yield mkdirp(dest); - } + yield* function* () { + if (!destStat) { + reporter.verbose(reporter.lang('verboseFileFolder', dest)); + yield mkdirp(dest); + } - const destParts = dest.split((_path || _load_path()).default.sep); - while (destParts.length) { - files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); - destParts.pop(); - } + var destParts = dest.split((_path || _load_path()).default.sep); + while (destParts.length) { + files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); + destParts.pop(); + } - // push all files to queue - invariant(srcFiles, 'src files not initialised'); - let remaining = srcFiles.length; - if (!remaining) { - onDone(); - } - for (const file of srcFiles) { - queue.push({ - dest: (_path || _load_path()).default.join(dest, file), - onFresh: onFresh, - onDone: function (_onDone) { - function onDone() { - return _onDone.apply(this, arguments); - } + // push all files to queue + invariant(srcFiles, 'src files not initialised'); + var remaining = srcFiles.length; + if (!remaining) { + onDone(); + } + for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref9; - onDone.toString = function () { - return _onDone.toString(); - }; + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref9 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref9 = _i6.value; + } - return onDone; - }(function () { - if (--remaining === 0) { - onDone(); - } - }), - src: (_path || _load_path()).default.join(src, file) - }); - } + var _file4 = _ref9; + + queue.push({ + dest: (_path || _load_path()).default.join(dest, _file4), + onFresh, + onDone: function (_onDone) { + function onDone() { + return _onDone.apply(this, arguments); + } + + onDone.toString = function () { + return _onDone.toString(); + }; + + return onDone; + }(function () { + if (--remaining === 0) { + onDone(); + } + }), + src: (_path || _load_path()).default.join(src, _file4) + }); + } + }(); } else if (srcStat.isFile()) { onFresh(); actions.file.push({ - src: src, - dest: dest, + src, + dest, atime: srcStat.atime, mtime: srcStat.mtime, mode: srcStat.mode @@ -385,27 +509,45 @@ let buildActionsForCopy = (() => { }); return function build(_x9) { - return _ref3.apply(this, arguments); + return _ref6.apply(this, arguments); }; - })(); + }(); - const artifactFiles = new (_set || _load_set()).default(events.artifactFiles || []); - const files = new (_set || _load_set()).default(); + var artifactFiles = new (_set || _load_set()).default(events.artifactFiles || []); + var files = new (_set || _load_set()).default(); // initialise events - for (const item of queue) { - const onDone = item.onDone; + + var _loop = function _loop(item) { + var onDone = item.onDone; item.onDone = function () { events.onProgress(item.dest); if (onDone) { onDone(); } }; + }; + + for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref3; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } + + var item = _ref3; + + _loop(item); } events.onStart(queue.length); // start building actions - const actions = { + var actions = { file: [], symlink: [], link: [] @@ -414,19 +556,45 @@ let buildActionsForCopy = (() => { // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items // at a time due to the requirement to push items onto the queue while (queue.length) { - const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); + var items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); yield (_promise || _load_promise()).default.all(items.map(build)); } // simulate the existence of some files to prevent considering them extraenous - for (const file of artifactFiles) { - if (possibleExtraneous.has(file)) { - reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); - possibleExtraneous.delete(file); + for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref4; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref4 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref4 = _i2.value; + } + + var _file = _ref4; + + if (possibleExtraneous.has(_file)) { + reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', _file)); + possibleExtraneous.delete(_file); } } - for (const loc of possibleExtraneous) { + for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref5; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref5 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref5 = _i3.value; + } + + var loc = _ref5; + if (files.has(loc.toLowerCase())) { possibleExtraneous.delete(loc); } @@ -438,19 +606,19 @@ let buildActionsForCopy = (() => { return function buildActionsForCopy(_x5, _x6, _x7, _x8) { return _ref2.apply(this, arguments); }; -})(); +}(); -let buildActionsForHardlink = (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { +var buildActionsForHardlink = function () { + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { // - let build = (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - const src = data.src, - dest = data.dest; + var build = function () { + var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + var src = data.src, + dest = data.dest; - const onFresh = data.onFresh || noop; - const onDone = data.onDone || noop; + var onFresh = data.onFresh || noop; + var onDone = data.onDone || noop; if (files.has(dest.toLowerCase())) { // Fixes issue https://github.com/yarnpkg/yarn/issues/2734 // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1, @@ -467,20 +635,20 @@ let buildActionsForHardlink = (() => { return; } - const srcStat = yield lstat(src); - let srcFiles; + var srcStat = yield lstat(src); + var srcFiles = void 0; if (srcStat.isDirectory()) { srcFiles = yield readdir(src); } - const destExists = yield exists(dest); + var destExists = yield exists(dest); if (destExists) { - const destStat = yield lstat(dest); + var destStat = yield lstat(dest); - const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); - const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); - const bothFiles = srcStat.isFile() && destStat.isFile(); + var bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); + var bothFolders = srcStat.isDirectory() && destStat.isDirectory(); + var bothFiles = srcStat.isFile() && destStat.isFile(); if (srcStat.mode !== destStat.mode) { try { @@ -500,7 +668,7 @@ let buildActionsForHardlink = (() => { } if (bothSymlinks) { - const srcReallink = yield readlink(src); + var srcReallink = yield readlink(src); if (srcReallink === (yield readlink(dest))) { // if both symlinks are the same then we can continue on onDone(); @@ -511,17 +679,43 @@ let buildActionsForHardlink = (() => { if (bothFolders) { // mark files that aren't in this folder as possibly extraneous - const destFiles = yield readdir(dest); + var destFiles = yield readdir(dest); invariant(srcFiles, 'src files not initialised'); - for (const file of destFiles) { - if (srcFiles.indexOf(file) < 0) { - const loc = (_path || _load_path()).default.join(dest, file); - possibleExtraneous.add(loc); + for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { + var _ref15; - if ((yield lstat(loc)).isDirectory()) { - for (const file of yield readdir(loc)) { - possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref15 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref15 = _i10.value; + } + + var _file6 = _ref15; + + if (srcFiles.indexOf(_file6) < 0) { + var _loc2 = (_path || _load_path()).default.join(dest, _file6); + possibleExtraneous.add(_loc2); + + if ((yield lstat(_loc2)).isDirectory()) { + for (var _iterator11 = yield readdir(_loc2), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) { + var _ref16; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref16 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref16 = _i11.value; + } + + var _file7 = _ref16; + + possibleExtraneous.add((_path || _load_path()).default.join(_loc2, _file7)); } } } @@ -531,55 +725,70 @@ let buildActionsForHardlink = (() => { if (srcStat.isSymbolicLink()) { onFresh(); - const linkname = yield readlink(src); + var _linkname2 = yield readlink(src); actions.symlink.push({ - dest: dest, - linkname: linkname + dest, + linkname: _linkname2 }); onDone(); } else if (srcStat.isDirectory()) { - reporter.verbose(reporter.lang('verboseFileFolder', dest)); - yield mkdirp(dest); + yield* function* () { + reporter.verbose(reporter.lang('verboseFileFolder', dest)); + yield mkdirp(dest); - const destParts = dest.split((_path || _load_path()).default.sep); - while (destParts.length) { - files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); - destParts.pop(); - } + var destParts = dest.split((_path || _load_path()).default.sep); + while (destParts.length) { + files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); + destParts.pop(); + } - // push all files to queue - invariant(srcFiles, 'src files not initialised'); - let remaining = srcFiles.length; - if (!remaining) { - onDone(); - } - for (const file of srcFiles) { - queue.push({ - onFresh: onFresh, - src: (_path || _load_path()).default.join(src, file), - dest: (_path || _load_path()).default.join(dest, file), - onDone: function (_onDone2) { - function onDone() { - return _onDone2.apply(this, arguments); - } + // push all files to queue + invariant(srcFiles, 'src files not initialised'); + var remaining = srcFiles.length; + if (!remaining) { + onDone(); + } + for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) { + var _ref17; - onDone.toString = function () { - return _onDone2.toString(); - }; + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref17 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref17 = _i12.value; + } - return onDone; - }(function () { - if (--remaining === 0) { - onDone(); - } - }) - }); - } + var _file8 = _ref17; + + queue.push({ + onFresh, + src: (_path || _load_path()).default.join(src, _file8), + dest: (_path || _load_path()).default.join(dest, _file8), + onDone: function (_onDone2) { + function onDone() { + return _onDone2.apply(this, arguments); + } + + onDone.toString = function () { + return _onDone2.toString(); + }; + + return onDone; + }(function () { + if (--remaining === 0) { + onDone(); + } + }) + }); + } + }(); } else if (srcStat.isFile()) { onFresh(); actions.link.push({ - src: src, - dest: dest, + src, + dest, removeDest: destExists }); onDone(); @@ -589,25 +798,43 @@ let buildActionsForHardlink = (() => { }); return function build(_x14) { - return _ref5.apply(this, arguments); + return _ref14.apply(this, arguments); }; - })(); + }(); - const artifactFiles = new (_set || _load_set()).default(events.artifactFiles || []); - const files = new (_set || _load_set()).default(); + var artifactFiles = new (_set || _load_set()).default(events.artifactFiles || []); + var files = new (_set || _load_set()).default(); // initialise events - for (const item of queue) { - const onDone = item.onDone || noop; + + var _loop2 = function _loop2(item) { + var onDone = item.onDone || noop; item.onDone = function () { events.onProgress(item.dest); onDone(); }; + }; + + for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { + var _ref11; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref11 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref11 = _i7.value; + } + + var item = _ref11; + + _loop2(item); } events.onStart(queue.length); // start building actions - const actions = { + var actions = { file: [], symlink: [], link: [] @@ -616,19 +843,45 @@ let buildActionsForHardlink = (() => { // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items // at a time due to the requirement to push items onto the queue while (queue.length) { - const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); + var items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); yield (_promise || _load_promise()).default.all(items.map(build)); } // simulate the existence of some files to prevent considering them extraenous - for (const file of artifactFiles) { - if (possibleExtraneous.has(file)) { - reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); - possibleExtraneous.delete(file); + for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { + var _ref12; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref12 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref12 = _i8.value; + } + + var _file5 = _ref12; + + if (possibleExtraneous.has(_file5)) { + reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', _file5)); + possibleExtraneous.delete(_file5); } } - for (const loc of possibleExtraneous) { + for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { + var _ref13; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref13 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref13 = _i9.value; + } + + var loc = _ref13; + if (files.has(loc.toLowerCase())) { possibleExtraneous.delete(loc); } @@ -638,13 +891,13 @@ let buildActionsForHardlink = (() => { }); return function buildActionsForHardlink(_x10, _x11, _x12, _x13) { - return _ref4.apply(this, arguments); + return _ref10.apply(this, arguments); }; -})(); +}(); -let copyBulk = exports.copyBulk = (() => { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { - const events = { +var copyBulk = exports.copyBulk = function () { + var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { + var events = { onStart: _events && _events.onStart || noop, onProgress: _events && _events.onProgress || noop, possibleExtraneous: _events ? _events.possibleExtraneous : new (_set || _load_set()).default(), @@ -652,22 +905,22 @@ let copyBulk = exports.copyBulk = (() => { artifactFiles: _events && _events.artifactFiles || [] }; - const actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter); + var actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter); events.onStart(actions.file.length + actions.symlink.length + actions.link.length); - const fileActions = actions.file; + var fileActions = actions.file; - const currentlyWriting = new (_map || _load_map()).default(); + var currentlyWriting = new (_map || _load_map()).default(); - yield (_promise2 || _load_promise2()).queue(fileActions, (() => { - var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - let writePromise; + yield (_promise2 || _load_promise2()).queue(fileActions, function () { + var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + var writePromise = void 0; while (writePromise = currentlyWriting.get(data.dest)) { yield writePromise; } reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest)); - const copier = safeCopyFile(data, function () { + var copier = safeCopyFile(data, function () { return currentlyWriting.delete(data.dest); }); currentlyWriting.set(data.dest, copier); @@ -676,27 +929,27 @@ let copyBulk = exports.copyBulk = (() => { }); return function (_x20) { - return _ref8.apply(this, arguments); + return _ref20.apply(this, arguments); }; - })(), CONCURRENT_QUEUE_ITEMS); + }(), CONCURRENT_QUEUE_ITEMS); // we need to copy symlinks last as they could reference files we were copying - const symlinkActions = actions.symlink; + var symlinkActions = actions.symlink; yield (_promise2 || _load_promise2()).queue(symlinkActions, function (data) { - const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); + var linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); return symlink(linkname, data.dest); }); }); return function copyBulk(_x17, _x18, _x19) { - return _ref7.apply(this, arguments); + return _ref19.apply(this, arguments); }; -})(); +}(); -let hardlinkBulk = exports.hardlinkBulk = (() => { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { - const events = { +var hardlinkBulk = exports.hardlinkBulk = function () { + var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { + var events = { onStart: _events && _events.onStart || noop, onProgress: _events && _events.onProgress || noop, possibleExtraneous: _events ? _events.possibleExtraneous : new (_set || _load_set()).default(), @@ -704,13 +957,13 @@ let hardlinkBulk = exports.hardlinkBulk = (() => { ignoreBasenames: [] }; - const actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter); + var actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter); events.onStart(actions.file.length + actions.symlink.length + actions.link.length); - const fileActions = actions.link; + var fileActions = actions.link; - yield (_promise2 || _load_promise2()).queue(fileActions, (() => { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + yield (_promise2 || _load_promise2()).queue(fileActions, function () { + var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest)); if (data.removeDest) { yield unlink(data.dest); @@ -719,52 +972,65 @@ let hardlinkBulk = exports.hardlinkBulk = (() => { }); return function (_x24) { - return _ref10.apply(this, arguments); + return _ref22.apply(this, arguments); }; - })(), CONCURRENT_QUEUE_ITEMS); + }(), CONCURRENT_QUEUE_ITEMS); // we need to copy symlinks last as they could reference files we were copying - const symlinkActions = actions.symlink; + var symlinkActions = actions.symlink; yield (_promise2 || _load_promise2()).queue(symlinkActions, function (data) { - const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); + var linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); return symlink(linkname, data.dest); }); }); return function hardlinkBulk(_x21, _x22, _x23) { - return _ref9.apply(this, arguments); + return _ref21.apply(this, arguments); }; -})(); +}(); + +var readFileAny = exports.readFileAny = function () { + var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { + for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) { + var _ref24; + + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref24 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref24 = _i13.value; + } -let readFileAny = exports.readFileAny = (() => { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { - for (const file of files) { - if (yield exists(file)) { - return readFile(file); + var _file9 = _ref24; + + if (yield exists(_file9)) { + return readFile(_file9); } } return null; }); return function readFileAny(_x25) { - return _ref11.apply(this, arguments); + return _ref23.apply(this, arguments); }; -})(); +}(); -let readJson = exports.readJson = (() => { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { +var readJson = exports.readJson = function () { + var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { return (yield readJsonAndFile(loc)).object; }); return function readJson(_x26) { - return _ref12.apply(this, arguments); + return _ref25.apply(this, arguments); }; -})(); +}(); -let readJsonAndFile = exports.readJsonAndFile = (() => { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - const file = yield readFile(loc); +var readJsonAndFile = exports.readJsonAndFile = function () { + var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + var file = yield readFile(loc); try { return { object: (0, (_map2 || _load_map2()).default)(JSON.parse(stripBOM(file))), @@ -777,16 +1043,16 @@ let readJsonAndFile = exports.readJsonAndFile = (() => { }); return function readJsonAndFile(_x27) { - return _ref13.apply(this, arguments); + return _ref26.apply(this, arguments); }; -})(); +}(); -let find = exports.find = (() => { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { - const parts = dir.split((_path || _load_path()).default.sep); +var find = exports.find = function () { + var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { + var parts = dir.split((_path || _load_path()).default.sep); while (parts.length) { - const loc = parts.concat(filename).join((_path || _load_path()).default.sep); + var loc = parts.concat(filename).join((_path || _load_path()).default.sep); if (yield exists(loc)) { return loc; @@ -799,17 +1065,17 @@ let find = exports.find = (() => { }); return function find(_x28, _x29) { - return _ref14.apply(this, arguments); + return _ref27.apply(this, arguments); }; -})(); +}(); -let symlink = exports.symlink = (() => { - var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { +var symlink = exports.symlink = function () { + var _ref28 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { try { - const stats = yield lstat(dest); + var stats = yield lstat(dest); if (stats.isSymbolicLink() && (yield exists(dest))) { - const resolved = yield realpath(dest); + var resolved = yield realpath(dest); if (resolved === src) { return; } @@ -828,15 +1094,15 @@ let symlink = exports.symlink = (() => { yield fsSymlink(src, dest, 'junction'); } else { // use relative paths otherwise which will be retained if the directory is moved - let relative; + var _relative = void 0; if (yield exists(src)) { - relative = (_path || _load_path()).default.relative((_fs || _load_fs()).default.realpathSync((_path || _load_path()).default.dirname(dest)), (_fs || _load_fs()).default.realpathSync(src)); + _relative = (_path || _load_path()).default.relative((_fs || _load_fs()).default.realpathSync((_path || _load_path()).default.dirname(dest)), (_fs || _load_fs()).default.realpathSync(src)); } else { - relative = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src); + _relative = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src); } // When path.relative returns an empty string for the current directory, we should instead use // '.', which is a valid fs.symlink target. - yield fsSymlink(relative || '.', dest); + yield fsSymlink(_relative || '.', dest); } } catch (err) { if (err.code === 'EEXIST') { @@ -849,72 +1115,85 @@ let symlink = exports.symlink = (() => { }); return function symlink(_x30, _x31) { - return _ref15.apply(this, arguments); + return _ref28.apply(this, arguments); }; -})(); +}(); -let walk = exports.walk = (() => { - var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir) { - let ignoreBasenames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default(); +var walk = exports.walk = function () { + var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir) { + var ignoreBasenames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default(); - let files = []; + var files = []; - let filenames = yield readdir(dir); + var filenames = yield readdir(dir); if (ignoreBasenames.size) { filenames = filenames.filter(function (name) { return !ignoreBasenames.has(name); }); } - for (const name of filenames) { - const relative = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name; - const loc = (_path || _load_path()).default.join(dir, name); - const stat = yield lstat(loc); + for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) { + var _ref30; + + if (_isArray14) { + if (_i14 >= _iterator14.length) break; + _ref30 = _iterator14[_i14++]; + } else { + _i14 = _iterator14.next(); + if (_i14.done) break; + _ref30 = _i14.value; + } + + var name = _ref30; + + var _relative2 = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name; + var loc = (_path || _load_path()).default.join(dir, name); + var _stat = yield lstat(loc); files.push({ - relative: relative, + relative: _relative2, basename: name, absolute: loc, - mtime: +stat.mtime + mtime: +_stat.mtime }); - if (stat.isDirectory()) { - files = files.concat((yield walk(loc, relative, ignoreBasenames))); + if (_stat.isDirectory()) { + files = files.concat((yield walk(loc, _relative2, ignoreBasenames))); } } return files; }); - return function walk(_x33, _x34) { - return _ref16.apply(this, arguments); + return function walk(_x32, _x33) { + return _ref29.apply(this, arguments); }; -})(); +}(); -let getFileSizeOnDisk = exports.getFileSizeOnDisk = (() => { - var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - const stat = yield lstat(loc); - const size = stat.size, - blockSize = stat.blksize; +var getFileSizeOnDisk = exports.getFileSizeOnDisk = function () { + var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + var stat = yield lstat(loc); + var size = stat.size, + blockSize = stat.blksize; return Math.ceil(size / blockSize) * blockSize; }); return function getFileSizeOnDisk(_x35) { - return _ref17.apply(this, arguments); + return _ref31.apply(this, arguments); }; -})(); +}(); -let getEolFromFile = (() => { - var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { +var getEolFromFile = function () { + var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { if (!(yield exists(path))) { return undefined; } - const buffer = yield readFileBuffer(path); + var buffer = yield readFileBuffer(path); - for (let i = 0; i < buffer.length; ++i) { + for (var i = 0; i < buffer.length; ++i) { if (buffer[i] === cr) { return '\r\n'; } @@ -926,13 +1205,13 @@ let getEolFromFile = (() => { }); return function getEolFromFile(_x36) { - return _ref18.apply(this, arguments); + return _ref32.apply(this, arguments); }; -})(); +}(); -let writeFilePreservingEol = exports.writeFilePreservingEol = (() => { - var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { - const eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; +var writeFilePreservingEol = exports.writeFilePreservingEol = function () { + var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { + var eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; if (eol !== '\n') { data = data.replace(/\n/g, eol); } @@ -940,15 +1219,15 @@ let writeFilePreservingEol = exports.writeFilePreservingEol = (() => { }); return function writeFilePreservingEol(_x37, _x38) { - return _ref19.apply(this, arguments); + return _ref33.apply(this, arguments); }; -})(); +}(); -let hardlinksWork = exports.hardlinksWork = (() => { - var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { - const filename = 'test-file' + Math.random(); - const file = (_path || _load_path()).default.join(dir, filename); - const fileLink = (_path || _load_path()).default.join(dir, filename + '-link'); +var hardlinksWork = exports.hardlinksWork = function () { + var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { + var filename = 'test-file' + Math.random(); + var file = (_path || _load_path()).default.join(dir, filename); + var fileLink = (_path || _load_path()).default.join(dir, filename + '-link'); try { yield writeFile(file, 'test'); yield link(file, fileLink); @@ -962,33 +1241,34 @@ let hardlinksWork = exports.hardlinksWork = (() => { }); return function hardlinksWork(_x39) { - return _ref20.apply(this, arguments); + return _ref34.apply(this, arguments); }; -})(); +}(); // not a strict polyfill for Node's fs.mkdtemp -let makeTempDir = exports.makeTempDir = (() => { - var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { - const dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`); +var makeTempDir = exports.makeTempDir = function () { + var _ref35 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { + var dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`); yield unlink(dir); yield mkdirp(dir); return dir; }); return function makeTempDir(_x40) { - return _ref21.apply(this, arguments); + return _ref35.apply(this, arguments); }; -})(); +}(); -let readFirstAvailableStream = exports.readFirstAvailableStream = (() => { - var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { +var readFirstAvailableStream = exports.readFirstAvailableStream = function () { + var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { var _this = this; - let stream; - const triedPaths = []; - for (const tarballPath of paths) { + var stream = void 0; + var triedPaths = []; + + var _loop3 = function* _loop3(tarballPath) { if (tarballPath) { try { // We need the weird `await new Promise()` construct for `createReadStream` because @@ -997,56 +1277,88 @@ let readFirstAvailableStream = exports.readFirstAvailableStream = (() => { // is not handled, it crashes node. A saner way to handle this with multiple tries is // the following construct. stream = yield new (_promise || _load_promise()).default(function (resolve, reject) { - const maybeStream = (_fs || _load_fs()).default.createReadStream(tarballPath); + var maybeStream = (_fs || _load_fs()).default.createReadStream(tarballPath); maybeStream.on('error', reject).on('readable', resolve.bind(_this, maybeStream)); }); - break; + return 'break'; } catch (err) { // Try the next one triedPaths.push(tarballPath); } } + }; + + for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) { + var _ref37; + + if (_isArray15) { + if (_i15 >= _iterator15.length) break; + _ref37 = _iterator15[_i15++]; + } else { + _i15 = _iterator15.next(); + if (_i15.done) break; + _ref37 = _i15.value; + } + + var tarballPath = _ref37; + + var _ret5 = yield* _loop3(tarballPath); + + if (_ret5 === 'break') break; } - return { stream: stream, triedPaths: triedPaths }; + return { stream, triedPaths }; }); return function readFirstAvailableStream(_x41) { - return _ref22.apply(this, arguments); + return _ref36.apply(this, arguments); }; -})(); +}(); -let getFirstSuitableFolder = exports.getFirstSuitableFolder = (() => { - var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { - let mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.W_OK | constants.X_OK; +var getFirstSuitableFolder = exports.getFirstSuitableFolder = function () { + var _ref38 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { + var mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.W_OK | constants.X_OK; - const result = { + var result = { skipped: [], folder: null }; - for (const folder of paths) { + for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) { + var _ref39; + + if (_isArray16) { + if (_i16 >= _iterator16.length) break; + _ref39 = _iterator16[_i16++]; + } else { + _i16 = _iterator16.next(); + if (_i16.done) break; + _ref39 = _i16.value; + } + + var _folder = _ref39; + try { - yield mkdirp(folder); - yield access(folder, mode); + yield mkdirp(_folder); + yield access(_folder, mode); - result.folder = folder; + result.folder = _folder; return result; } catch (error) { result.skipped.push({ - error: error, - folder: folder + error, + folder: _folder }); } } return result; }); - return function getFirstSuitableFolder(_x43) { - return _ref23.apply(this, arguments); + return function getFirstSuitableFolder(_x42) { + return _ref38.apply(this, arguments); }; -})(); +}(); exports.copy = copy; exports.readFile = readFile; @@ -1056,97 +1368,103 @@ exports.normalizeOS = normalizeOS; var _fs; function _load_fs() { - return _fs = _interopRequireDefault(__webpack_require__(8)); + return _fs = _interopRequireDefault(__webpack_require__(10)); } var _glob; function _load_glob() { - return _glob = _interopRequireDefault(__webpack_require__(170)); + return _glob = _interopRequireDefault(__webpack_require__(182)); } var _os; function _load_os() { - return _os = _interopRequireDefault(__webpack_require__(75)); + return _os = _interopRequireDefault(__webpack_require__(70)); } var _path; function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); + return _path = _interopRequireDefault(__webpack_require__(0)); } var _blockingQueue; function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(102)); + return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); } var _promise2; function _load_promise2() { - return _promise2 = _interopRequireWildcard(__webpack_require__(85)); + return _promise2 = _interopRequireWildcard(__webpack_require__(91)); } var _promise3; function _load_promise3() { - return _promise3 = __webpack_require__(85); + return _promise3 = __webpack_require__(91); } var _map2; function _load_map2() { - return _map2 = _interopRequireDefault(__webpack_require__(28)); + return _map2 = _interopRequireDefault(__webpack_require__(34)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : { +var constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : { R_OK: (_fs || _load_fs()).default.R_OK, W_OK: (_fs || _load_fs()).default.W_OK, X_OK: (_fs || _load_fs()).default.X_OK }; -const lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock'); - -const readFileBuffer = exports.readFileBuffer = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readFile); -const writeFile = exports.writeFile = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.writeFile); -const readlink = exports.readlink = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readlink); -const realpath = exports.realpath = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.realpath); -const readdir = exports.readdir = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readdir); -const rename = exports.rename = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.rename); -const access = exports.access = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.access); -const stat = exports.stat = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.stat); -const unlink = exports.unlink = (0, (_promise3 || _load_promise3()).promisify)(__webpack_require__(662)); -const mkdirp = exports.mkdirp = (0, (_promise3 || _load_promise3()).promisify)(__webpack_require__(180)); -const exists = exports.exists = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.exists, true); -const lstat = exports.lstat = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.lstat); -const chmod = exports.chmod = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.chmod); -const link = exports.link = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.link); -const glob = exports.glob = (0, (_promise3 || _load_promise3()).promisify)((_glob || _load_glob()).default); +var lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock'); + +var readFileBuffer = exports.readFileBuffer = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readFile); +var writeFile = exports.writeFile = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.writeFile); +var readlink = exports.readlink = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readlink); +var realpath = exports.realpath = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.realpath); +var readdir = exports.readdir = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readdir); +var rename = exports.rename = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.rename); +var access = exports.access = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.access); +var stat = exports.stat = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.stat); +var unlink = exports.unlink = (0, (_promise3 || _load_promise3()).promisify)(__webpack_require__(689)); +var mkdirp = exports.mkdirp = (0, (_promise3 || _load_promise3()).promisify)(__webpack_require__(192)); +var exists = exports.exists = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.exists, true); +var lstat = exports.lstat = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.lstat); +var chmod = exports.chmod = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.chmod); +var link = exports.link = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.link); +var glob = exports.glob = (0, (_promise3 || _load_promise3()).promisify)((_glob || _load_glob()).default); // fs.copyFile uses the native file copying instructions on the system, performing much better // than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the // concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD. -const CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4; - -const open = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.open); -const close = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.close); -const write = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.write); -const futimes = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.futimes); -const copyFile = (_fs || _load_fs()).default.copyFile ? // Don't use `promisify` to avoid passing the last, argument `data`, to the native method -(src, dest, flags, data) => new (_promise || _load_promise()).default((resolve, reject) => (_fs || _load_fs()).default.copyFile(src, dest, flags, err => err ? reject(err) : resolve(err))) : (() => { +var CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4; + +var open = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.open); +var close = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.close); +var write = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.write); +var futimes = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.futimes); +var copyFile = (_fs || _load_fs()).default.copyFile ? // Don't use `promisify` to avoid passing the last, argument `data`, to the native method +function (src, dest, flags, data) { + return new (_promise || _load_promise()).default(function (resolve, reject) { + return (_fs || _load_fs()).default.copyFile(src, dest, flags, function (err) { + return err ? reject(err) : resolve(err); + }); + }); +} : function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest, flags, data) { // Use open -> write -> futimes -> close sequence to avoid opening the file twice: // one with writeFile and one with utimes - const fd = yield open(dest, 'w', data.mode); + var fd = yield open(dest, 'w', data.mode); try { - const buffer = yield readFileBuffer(src); - yield write(fd, buffer, 0, buffer.length); + var _buffer = yield readFileBuffer(src); + yield write(fd, _buffer, 0, _buffer.length); yield futimes(fd, data.atime, data.mtime); } finally { yield close(fd); @@ -1156,16 +1474,16 @@ const copyFile = (_fs || _load_fs()).default.copyFile ? // Don't use `promisify` return function (_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; -})(); -const fsSymlink = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.symlink); -const invariant = __webpack_require__(6); -const stripBOM = __webpack_require__(303); +}(); +var fsSymlink = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.symlink); +var invariant = __webpack_require__(9); +var stripBOM = __webpack_require__(320); -const noop = () => {}; +var noop = function noop() {}; -const fileDatesEqual = exports.fileDatesEqual = (a, b) => { - const aTime = a.getTime(); - const bTime = b.getTime(); +var fileDatesEqual = exports.fileDatesEqual = function fileDatesEqual(a, b) { + var aTime = a.getTime(); + var bTime = b.getTime(); if (process.platform !== 'win32') { return aTime === bTime; @@ -1179,8 +1497,8 @@ const fileDatesEqual = exports.fileDatesEqual = (a, b) => { return true; } - const aTimeSec = Math.floor(aTime / 1000); - const bTimeSec = Math.floor(bTime / 1000); + var aTimeSec = Math.floor(aTime / 1000); + var bTimeSec = Math.floor(bTime / 1000); // See https://github.com/nodejs/node/issues/2069 // Some versions of Node on windows zero the milliseconds when utime is used @@ -1194,7 +1512,7 @@ const fileDatesEqual = exports.fileDatesEqual = (a, b) => { }; function copy(src, dest, reporter) { - return copyBulk([{ src: src, dest: dest }], reporter); + return copyBulk([{ src, dest }], reporter); } /** @@ -1205,8 +1523,8 @@ function copy(src, dest, reporter) { * `data` contains target file attributes like mode, atime and mtime. Built-in copyFile copies these * automatically but our polyfill needs the do this manually, thus needs the info. */ -const safeCopyFile = (() => { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data, cleanup) { +var safeCopyFile = function () { + var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data, cleanup) { try { yield unlink(data.dest); yield copyFile(data.src, data.dest, 0, data); @@ -1216,12 +1534,12 @@ const safeCopyFile = (() => { }); return function safeCopyFile(_x15, _x16) { - return _ref6.apply(this, arguments); + return _ref18.apply(this, arguments); }; -})(); +}(); function _readFile(loc, encoding) { - return new (_promise || _load_promise()).default((resolve, reject) => { + return new (_promise || _load_promise()).default(function (resolve, reject) { (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) { if (err) { reject(err); @@ -1244,71 +1562,11 @@ function normalizeOS(body) { return body.replace(/\r\n/g, '\n'); } -const cr = new Buffer('\r', 'utf8')[0]; -const lf = new Buffer('\n', 'utf8')[0]; +var cr = new Buffer('\r', 'utf8')[0]; +var lf = new Buffer('\n', 'utf8')[0]; /***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - - - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var NODE_ENV = process.env.NODE_ENV; - -var invariant = function(condition, format, a, b, c, d, e, f) { - if (NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error( - 'Minified exception occurred; use the non-minified dev environment ' + - 'for the full error message and additional helpful warnings.' - ); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error( - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -}; - -module.exports = invariant; - - -/***/ }), -/* 7 */ +/* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1318,62 +1576,52 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.getPathKey = getPathKey; -const os = __webpack_require__(75); -const path = __webpack_require__(1); -const userHome = __webpack_require__(86).default; -const isWebpackBundle = __webpack_require__(598); +var os = __webpack_require__(70); +var path = __webpack_require__(0); +var userHome = __webpack_require__(73).default; + +var _require = __webpack_require__(449), + getCacheDir = _require.getCacheDir, + getConfigDir = _require.getConfigDir, + getDataDir = _require.getDataDir; + +var isWebpackBundle = __webpack_require__(622); -const DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies']; -const RESOLUTIONS = exports.RESOLUTIONS = 'resolutions'; -const MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS].concat(DEPENDENCY_TYPES); +var DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies']; +var RESOLUTIONS = exports.RESOLUTIONS = 'resolutions'; +var MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS].concat(DEPENDENCY_TYPES); -const SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0'; +var SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0'; -const YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com'; +var YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com'; -const YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/'; -const YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh'; -const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi'; +var YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/'; +var YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh'; +var YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi'; -const SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; -const SELF_UPDATE_TARBALL_URL = exports.SELF_UPDATE_TARBALL_URL = 'https://yarnpkg.com/latest.tar.gz'; -const SELF_UPDATE_DOWNLOAD_FOLDER = exports.SELF_UPDATE_DOWNLOAD_FOLDER = 'updates'; +var SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; +var SELF_UPDATE_TARBALL_URL = exports.SELF_UPDATE_TARBALL_URL = 'https://yarnpkg.com/latest.tar.gz'; +var SELF_UPDATE_DOWNLOAD_FOLDER = exports.SELF_UPDATE_DOWNLOAD_FOLDER = 'updates'; // cache version, bump whenever we make backwards incompatible changes -const CACHE_VERSION = exports.CACHE_VERSION = 1; +var CACHE_VERSION = exports.CACHE_VERSION = 1; // lockfile version, bump whenever we make backwards incompatible changes -const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; +var LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; // max amount of network requests to perform concurrently -const NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8; +var NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8; // HTTP timeout used when downloading packages -const NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds +var NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds // max amount of child processes to execute concurrently -const CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5; - -const REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid']; - -function getDirectory(category) { - // use %LOCALAPPDATA%/Yarn on Windows - if (process.platform === 'win32' && process.env.LOCALAPPDATA) { - return path.join(process.env.LOCALAPPDATA, 'Yarn', category); - } +var CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5; - // otherwise use ~/.{category}/yarn - return path.join(userHome, `.${category}`, 'yarn'); -} +var REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid']; function getPreferredCacheDirectories() { - const preferredCacheDirectories = []; - - if (process.platform === 'darwin') { - preferredCacheDirectories.push(path.join(userHome, 'Library', 'Caches', 'Yarn')); - } else { - preferredCacheDirectories.push(getDirectory('cache')); - } + var preferredCacheDirectories = [getCacheDir()]; if (process.getuid) { // $FlowFixMe: process.getuid exists, dammit @@ -1385,13 +1633,14 @@ function getPreferredCacheDirectories() { return preferredCacheDirectories; } -const PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); -const CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getDirectory('config'); -const LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(CONFIG_DIRECTORY, 'link'); -const GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(CONFIG_DIRECTORY, 'global'); +var PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); +var CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir(); +var DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir(); +var LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link'); +var GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global'); -const NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath; -const YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath(); +var NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath; +var YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath(); // Webpack needs to be configured with node.__dirname/__filename = false function getYarnBinPath() { @@ -1402,36 +1651,36 @@ function getYarnBinPath() { } } -const NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules'; -const NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json'; +var NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules'; +var NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json'; -const POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`; -const FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn'); +var POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`; +var FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn'); -const META_FOLDER = exports.META_FOLDER = '.yarn-meta'; -const INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity'; -const LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock'; -const METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json'; -const TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz'; -const CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean'; -const ACCESS_FILENAME = exports.ACCESS_FILENAME = '.yarn-access'; +var META_FOLDER = exports.META_FOLDER = '.yarn-meta'; +var INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity'; +var LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock'; +var METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json'; +var TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz'; +var CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean'; +var ACCESS_FILENAME = exports.ACCESS_FILENAME = '.yarn-access'; -const DEFAULT_INDENT = exports.DEFAULT_INDENT = ' '; -const SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997; -const SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance'; +var DEFAULT_INDENT = exports.DEFAULT_INDENT = ' '; +var SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997; +var SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance'; -const ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env); +var ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env); function getPathKey(platform, env) { - let pathKey = 'PATH'; + var pathKey = 'PATH'; // windows calls its path "Path" usually, but this is not guaranteed. if (platform === 'win32') { pathKey = 'Path'; - for (const key in env) { - if (key.toLowerCase() === 'path') { - pathKey = key; + for (var _key in env) { + if (_key.toLowerCase() === 'path') { + pathKey = _key; } } } @@ -1439,7 +1688,7 @@ function getPathKey(platform, env) { return pathKey; } -const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { +var VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { major: 'red', premajor: 'red', minor: 'yellow', @@ -1452,39 +1701,161 @@ const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { }; /***/ }), -/* 8 */ +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var NODE_ENV = process.env.NODE_ENV; + +var invariant = function(condition, format, a, b, c, d, e, f) { + if (NODE_ENV !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } + + if (!condition) { + var error; + if (format === undefined) { + error = new Error( + 'Minified exception occurred; use the non-minified dev environment ' + + 'for the full error message and additional helpful warnings.' + ); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error( + format.replace(/%s/g, function() { return args[argIndex++]; }) + ); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +}; + +module.exports = invariant; + + +/***/ }), +/* 10 */ /***/ (function(module, exports) { module.exports = require("fs"); /***/ }), -/* 9 */ +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _setPrototypeOf = __webpack_require__(251); + +var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); + +var _create = __webpack_require__(450); + +var _create2 = _interopRequireDefault(_create); + +var _typeof2 = __webpack_require__(252); + +var _typeof3 = _interopRequireDefault(_typeof2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); + } + + subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; +}; + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _typeof2 = __webpack_require__(252); + +var _typeof3 = _interopRequireDefault(_typeof2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; +}; + +/***/ }), +/* 13 */ /***/ (function(module, exports) { module.exports = require("crypto"); /***/ }), -/* 10 */ +/* 14 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = { "default": __webpack_require__(461), __esModule: true }; +module.exports = { "default": __webpack_require__(478), __esModule: true }; /***/ }), -/* 11 */ +/* 15 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = { "default": __webpack_require__(464), __esModule: true }; +module.exports = { "default": __webpack_require__(481), __esModule: true }; /***/ }), -/* 12 */ +/* 16 */ /***/ (function(module, exports, __webpack_require__) { // Copyright (c) 2012, Mark Cavage. All rights reserved. // Copyright 2015 Joyent, Inc. -var assert = __webpack_require__(31); -var Stream = __webpack_require__(25).Stream; -var util = __webpack_require__(2); +var assert = __webpack_require__(36); +var Stream = __webpack_require__(29).Stream; +var util = __webpack_require__(4); ///--- Globals @@ -1693,19 +2064,19 @@ module.exports = _setExports(process.env.NODE_NDEBUG); /***/ }), -/* 13 */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = { "default": __webpack_require__(460), __esModule: true }; +module.exports = { "default": __webpack_require__(476), __esModule: true }; /***/ }), -/* 14 */ +/* 18 */ /***/ (function(module, exports) { module.exports = require("url"); /***/ }), -/* 15 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1718,7 +2089,7 @@ Object.defineProperty(exports, "__esModule", { var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } exports.sortAlpha = sortAlpha; @@ -1733,14 +2104,14 @@ exports.sleep = sleep; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const _camelCase = __webpack_require__(443); +var _camelCase = __webpack_require__(460); function sortAlpha(a, b) { // sort alphabetically in a deterministic way - const shortLen = Math.min(a.length, b.length); - for (let i = 0; i < shortLen; i++) { - const aChar = a.charCodeAt(i); - const bChar = b.charCodeAt(i); + var shortLen = Math.min(a.length, b.length); + for (var i = 0; i < shortLen; i++) { + var aChar = a.charCodeAt(i); + var bChar = b.charCodeAt(i); if (aChar !== bChar) { return aChar - bChar; } @@ -1749,10 +2120,10 @@ function sortAlpha(a, b) { } function entries(obj) { - const entries = []; + var entries = []; if (obj) { - for (const key in obj) { - entries.push([key, obj[key]]); + for (var _key in obj) { + entries.push([_key, obj[_key]]); } } return entries; @@ -1783,7 +2154,7 @@ function addSuffix(pattern, suffix) { } function hyphenate(str) { - return str.replace(/[A-Z]/g, match => { + return str.replace(/[A-Z]/g, function (match) { return '-' + match.charAt(0).toLowerCase(); }); } @@ -1800,7 +2171,7 @@ function compareSortedArrays(array1, array2) { if (array1.length !== array2.length) { return false; } - for (let i = 0, len = array1.length; i < len; i++) { + for (var i = 0, len = array1.length; i < len; i++) { if (array1[i] !== array2[i]) { return false; } @@ -1809,13 +2180,13 @@ function compareSortedArrays(array1, array2) { } function sleep(ms) { - return new (_promise || _load_promise()).default(resolve => { + return new (_promise || _load_promise()).default(function (resolve) { setTimeout(resolve, ms); }); } /***/ }), -/* 16 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1826,28 +2197,40 @@ Object.defineProperty(exports, "__esModule", { }); exports.stringify = exports.parse = undefined; +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(33)); + return _map = _interopRequireDefault(__webpack_require__(37)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); + return _keys = _interopRequireDefault(__webpack_require__(14)); } var _parse; function _load_parse() { - return _parse = __webpack_require__(222); + return _parse = __webpack_require__(233); } Object.defineProperty(exports, 'parse', { @@ -1860,7 +2243,7 @@ Object.defineProperty(exports, 'parse', { var _stringify; function _load_stringify() { - return _stringify = __webpack_require__(400); + return _stringify = __webpack_require__(415); } Object.defineProperty(exports, 'stringify', { @@ -1875,40 +2258,40 @@ exports.explodeEntry = explodeEntry; var _misc; function _load_misc() { - return _misc = __webpack_require__(15); + return _misc = __webpack_require__(19); } var _normalizePattern; function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(39); + return _normalizePattern = __webpack_require__(42); } var _parse2; function _load_parse2() { - return _parse2 = _interopRequireDefault(__webpack_require__(222)); + return _parse2 = _interopRequireDefault(__webpack_require__(233)); } var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); +var invariant = __webpack_require__(9); -const path = __webpack_require__(1); +var path = __webpack_require__(0); function getName(pattern) { return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name; @@ -1923,7 +2306,7 @@ function keyForRemote(remote) { } function implodeEntry(pattern, obj) { - const inferredName = getName(pattern); + var inferredName = getName(pattern); return { name: inferredName === obj.name ? undefined : obj.name, version: obj.version, @@ -1932,7 +2315,8 @@ function implodeEntry(pattern, obj) { registry: obj.registry === 'npm' ? undefined : obj.registry, dependencies: blankObjectUndefined(obj.dependencies), optionalDependencies: blankObjectUndefined(obj.optionalDependencies), - permissions: blankObjectUndefined(obj.permissions) + permissions: blankObjectUndefined(obj.permissions), + prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants) }; } @@ -1946,14 +2330,15 @@ function explodeEntry(pattern, obj) { return obj; } -class Lockfile { - constructor() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - let cache = _ref.cache, +var Lockfile = function () { + function Lockfile() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + cache = _ref.cache, source = _ref.source, parseResultType = _ref.parseResultType; + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Lockfile); + this.source = source || ''; this.cache = cache; this.parseResultType = parseResultType; @@ -1962,14 +2347,14 @@ class Lockfile { // source string if the `cache` was parsed - static fromDirectory(dir, reporter) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + Lockfile.fromDirectory = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, reporter) { // read the manifest in this directory - const lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME); + var lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME); - let lockfile; - let rawLockfile = ''; - let parseResult; + var lockfile = void 0; + var rawLockfile = ''; + var parseResult = void 0; if (yield (_fs || _load_fs()).exists(lockfileLoc)) { rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc); @@ -1991,16 +2376,22 @@ class Lockfile { } return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type }); - })(); - } + }); - getLocked(pattern) { - const cache = this.cache; + function fromDirectory(_x2, _x3) { + return _ref2.apply(this, arguments); + } + + return fromDirectory; + }(); + + Lockfile.prototype.getLocked = function getLocked(pattern) { + var cache = this.cache; if (!cache) { return undefined; } - const shrunk = pattern in cache && cache[pattern]; + var shrunk = pattern in cache && cache[pattern]; if (typeof shrunk === 'string') { return this.getLocked(shrunk); @@ -2010,35 +2401,48 @@ class Lockfile { } return undefined; - } + }; - removePattern(pattern) { - const cache = this.cache; + Lockfile.prototype.removePattern = function removePattern(pattern) { + var cache = this.cache; if (!cache) { return; } delete cache[pattern]; - } + }; - getLockfile(patterns) { - const lockfile = {}; - const seen = new (_map || _load_map()).default(); + Lockfile.prototype.getLockfile = function getLockfile(patterns) { + var lockfile = {}; + var seen = new (_map || _load_map()).default(); // order by name so that lockfile manifest is assigned to the first dependency with this manifest // the others that have the same remoteKey will just refer to the first // ordering allows for consistency in lockfile when it is serialized - const sortedPatternsKeys = (0, (_keys || _load_keys()).default)(patterns).sort((_misc || _load_misc()).sortAlpha); + var sortedPatternsKeys = (0, (_keys || _load_keys()).default)(patterns).sort((_misc || _load_misc()).sortAlpha); - for (const pattern of sortedPatternsKeys) { - const pkg = patterns[pattern]; - const remote = pkg._remote, - ref = pkg._reference; + for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref3; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } + + var pattern = _ref3; + + var pkg = patterns[pattern]; + var remote = pkg._remote, + ref = pkg._reference; invariant(ref, 'Package is missing a reference'); invariant(remote, 'Package is missing a remote'); - const remoteKey = keyForRemote(remote); - const seenPattern = remoteKey && seen.get(remoteKey); + var remoteKey = keyForRemote(remote); + var seenPattern = remoteKey && seen.get(remoteKey); if (seenPattern) { // no point in duplicating it lockfile[pattern] = seenPattern; @@ -2050,8 +2454,7 @@ class Lockfile { } continue; } - - const obj = implodeEntry(pattern, { + var obj = implodeEntry(pattern, { name: pkg.name, version: pkg.version, uid: pkg._uid, @@ -2060,8 +2463,10 @@ class Lockfile { dependencies: pkg.dependencies, peerDependencies: pkg.peerDependencies, optionalDependencies: pkg.optionalDependencies, - permissions: ref.permissions + permissions: ref.permissions, + prebuiltVariants: pkg.prebuiltVariants }); + lockfile[pattern] = obj; if (remoteKey) { @@ -2070,97 +2475,15 @@ class Lockfile { } return lockfile; - } -} -exports.default = Lockfile; - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _isIterable2 = __webpack_require__(435); - -var _isIterable3 = _interopRequireDefault(_isIterable2); - -var _getIterator2 = __webpack_require__(434); - -var _getIterator3 = _interopRequireDefault(_getIterator2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function () { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if ((0, _isIterable3.default)(Object(arr))) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } }; -}(); - -/***/ }), -/* 18 */ -/***/ (function(module, exports) { -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; + return Lockfile; +}(); +exports.default = Lockfile; /***/ }), -/* 19 */ +/* 21 */ /***/ (function(module, exports) { exports = module.exports = SemVer; @@ -3369,7 +3692,42 @@ function prerelease(version, loose) { /***/ }), -/* 20 */ +/* 22 */ +/***/ (function(module, exports) { + +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +var core = module.exports = {version: '2.4.0'}; +if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef + +/***/ }), +/* 24 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -3387,9 +3745,9 @@ module.exports = { opensshCipherInfo: opensshCipherInfo }; -var assert = __webpack_require__(12); -var PrivateKey = __webpack_require__(24); -var crypto = __webpack_require__(9); +var assert = __webpack_require__(16); +var PrivateKey = __webpack_require__(28); +var crypto = __webpack_require__(13); var MAX_CLASS_DEPTH = 3; @@ -3576,7 +3934,7 @@ function calculateDSAPublic(g, p, x) { assert.buffer(p); assert.buffer(x); try { - var bigInt = __webpack_require__(57).BigInteger; + var bigInt = __webpack_require__(60).BigInteger; } catch (e) { throw (new Error('To load a PKCS#8 format DSA private key, ' + 'the node jsbn library is required.')); @@ -3593,7 +3951,7 @@ function addRSAMissing(key) { assert.object(key); assertCompatible(key, PrivateKey, [1, 1]); try { - var bigInt = __webpack_require__(57).BigInteger; + var bigInt = __webpack_require__(60).BigInteger; } catch (e) { throw (new Error('To write a PEM private key from ' + 'this source, the node jsbn lib is required.')); @@ -3663,14 +4021,36 @@ function opensshCipherInfo(cipher) { /***/ }), -/* 21 */ -/***/ (function(module, exports) { +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { -var core = module.exports = {version: '2.4.0'}; -if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef +"use strict"; + + +exports.__esModule = true; + +var _assign = __webpack_require__(17); + +var _assign2 = _interopRequireDefault(_assign); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = _assign2.default || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; /***/ }), -/* 22 */ +/* 26 */ /***/ (function(module, exports) { // Copyright 2015 Joyent, Inc. @@ -3844,26 +4224,26 @@ module.exports = { /***/ }), -/* 23 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = Key; -var assert = __webpack_require__(12); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(9); -var Fingerprint = __webpack_require__(95); -var Signature = __webpack_require__(43); -var DiffieHellman = __webpack_require__(298).DiffieHellman; -var errs = __webpack_require__(42); -var utils = __webpack_require__(20); -var PrivateKey = __webpack_require__(24); +var assert = __webpack_require__(16); +var algs = __webpack_require__(26); +var crypto = __webpack_require__(13); +var Fingerprint = __webpack_require__(101); +var Signature = __webpack_require__(50); +var DiffieHellman = __webpack_require__(315).DiffieHellman; +var errs = __webpack_require__(49); +var utils = __webpack_require__(24); +var PrivateKey = __webpack_require__(28); var edCompat; try { - edCompat = __webpack_require__(299); + edCompat = __webpack_require__(316); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } @@ -3872,13 +4252,13 @@ var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var formats = {}; -formats['auto'] = __webpack_require__(300); -formats['pem'] = __webpack_require__(58); -formats['pkcs1'] = __webpack_require__(184); -formats['pkcs8'] = __webpack_require__(96); -formats['rfc4253'] = __webpack_require__(63); -formats['ssh'] = __webpack_require__(301); -formats['ssh-private'] = __webpack_require__(128); +formats['auto'] = __webpack_require__(317); +formats['pem'] = __webpack_require__(61); +formats['pkcs1'] = __webpack_require__(196); +formats['pkcs8'] = __webpack_require__(102); +formats['rfc4253'] = __webpack_require__(68); +formats['ssh'] = __webpack_require__(318); +formats['ssh-private'] = __webpack_require__(136); formats['openssh'] = formats['ssh-private']; function Key(opts) { @@ -4124,46 +4504,46 @@ Key._oldVersionDetect = function (obj) { /***/ }), -/* 24 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = PrivateKey; -var assert = __webpack_require__(12); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(9); -var Fingerprint = __webpack_require__(95); -var Signature = __webpack_require__(43); -var errs = __webpack_require__(42); -var util = __webpack_require__(2); -var utils = __webpack_require__(20); -var dhe = __webpack_require__(298); +var assert = __webpack_require__(16); +var algs = __webpack_require__(26); +var crypto = __webpack_require__(13); +var Fingerprint = __webpack_require__(101); +var Signature = __webpack_require__(50); +var errs = __webpack_require__(49); +var util = __webpack_require__(4); +var utils = __webpack_require__(24); +var dhe = __webpack_require__(315); var generateECDSA = dhe.generateECDSA; var generateED25519 = dhe.generateED25519; var edCompat; var ed; try { - edCompat = __webpack_require__(299); + edCompat = __webpack_require__(316); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } -var Key = __webpack_require__(23); +var Key = __webpack_require__(27); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var KeyEncryptedError = errs.KeyEncryptedError; var formats = {}; -formats['auto'] = __webpack_require__(300); -formats['pem'] = __webpack_require__(58); -formats['pkcs1'] = __webpack_require__(184); -formats['pkcs8'] = __webpack_require__(96); -formats['rfc4253'] = __webpack_require__(63); -formats['ssh-private'] = __webpack_require__(128); +formats['auto'] = __webpack_require__(317); +formats['pem'] = __webpack_require__(61); +formats['pkcs1'] = __webpack_require__(196); +formats['pkcs8'] = __webpack_require__(102); +formats['rfc4253'] = __webpack_require__(68); +formats['ssh-private'] = __webpack_require__(136); formats['openssh'] = formats['ssh-private']; formats['ssh'] = formats['ssh-private']; @@ -4219,7 +4599,7 @@ PrivateKey.prototype.derive = function (newType, newSize) { if (this.type === 'ed25519' && newType === 'curve25519') { if (ed === undefined) - ed = __webpack_require__(175); + ed = __webpack_require__(187); priv = this.part.r.data; if (priv[0] === 0x00) @@ -4238,7 +4618,7 @@ PrivateKey.prototype.derive = function (newType, newSize) { })); } else if (this.type === 'curve25519' && newType === 'ed25519') { if (ed === undefined) - ed = __webpack_require__(175); + ed = __webpack_require__(187); priv = this.part.r.data; if (priv[0] === 0x00) @@ -4385,13 +4765,29 @@ PrivateKey._oldVersionDetect = function (obj) { /***/ }), -/* 25 */ +/* 29 */ /***/ (function(module, exports) { module.exports = require("stream"); /***/ }), -/* 26 */ +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(173)('wks') + , uid = __webpack_require__(120) + , Symbol = __webpack_require__(35).Symbol + , USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; + +/***/ }), +/* 31 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** @@ -21480,10 +21876,16 @@ module.exports = require("stream"); } }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)(module))) /***/ }), -/* 27 */ +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(474), __esModule: true }; + +/***/ }), +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21497,56 +21899,62 @@ exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefi var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); + return _set = _interopRequireDefault(__webpack_require__(15)); } var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); -} - -var _toConsumableArray2; - -function _load_toConsumableArray() { - return _toConsumableArray2 = _interopRequireDefault(__webpack_require__(32)); + return _extends2 = _interopRequireDefault(__webpack_require__(25)); } var _assign; function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); + return _assign = _interopRequireDefault(__webpack_require__(17)); } var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); + return _keys = _interopRequireDefault(__webpack_require__(14)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } -let install = exports.install = (() => { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) { +var install = exports.install = function () { + var _ref35 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) { yield wrapLifecycle(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const install = new Install(flags, config, reporter, lockfile); + var install = new Install(flags, config, reporter, lockfile); yield install.init(); })); }); - return function install(_x17, _x18, _x19, _x20) { - return _ref11.apply(this, arguments); + return function install(_x16, _x17, _x18, _x19) { + return _ref35.apply(this, arguments); }; -})(); +}(); -let run = exports.run = (() => { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - let lockfile; - let error = 'installCommandRenamed'; +var run = exports.run = function () { + var _ref37 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var lockfile = void 0; + var error = 'installCommandRenamed'; if (flags.lockfile === false) { lockfile = new (_lockfile || _load_lockfile()).default(); } else { @@ -21554,7 +21962,7 @@ let run = exports.run = (() => { } if (args.length) { - const exampleArgs = args.slice(); + var exampleArgs = args.slice(); if (flags.saveDev) { exampleArgs.push('--dev'); @@ -21571,7 +21979,7 @@ let run = exports.run = (() => { if (flags.saveTilde) { exampleArgs.push('--tilde'); } - let command = 'add'; + var command = 'add'; if (flags.global) { error = 'globalFlagRemoved'; command = 'global add'; @@ -21582,13 +21990,13 @@ let run = exports.run = (() => { yield install(config, reporter, flags, lockfile); }); - return function run(_x21, _x22, _x23, _x24) { - return _ref13.apply(this, arguments); + return function run(_x20, _x21, _x22, _x23) { + return _ref37.apply(this, arguments); }; -})(); +}(); -let wrapLifecycle = exports.wrapLifecycle = (() => { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) { +var wrapLifecycle = exports.wrapLifecycle = function () { + var _ref38 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) { yield config.executeLifecycleScript('preinstall'); yield factory(); @@ -21605,146 +22013,159 @@ let wrapLifecycle = exports.wrapLifecycle = (() => { } }); - return function wrapLifecycle(_x25, _x26, _x27) { - return _ref14.apply(this, arguments); + return function wrapLifecycle(_x24, _x25, _x26) { + return _ref38.apply(this, arguments); }; -})(); +}(); exports.hasWrapper = hasWrapper; exports.setFlags = setFlags; +var _hooks; + +function _load_hooks() { + return _hooks = __webpack_require__(439); +} + var _index; function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(150)); + return _index = _interopRequireDefault(__webpack_require__(156)); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _integrityChecker; function _load_integrityChecker() { - return _integrityChecker = _interopRequireDefault(__webpack_require__(141)); + return _integrityChecker = _interopRequireDefault(__webpack_require__(148)); } var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(16)); + return _lockfile = _interopRequireDefault(__webpack_require__(20)); } var _lockfile2; function _load_lockfile2() { - return _lockfile2 = __webpack_require__(16); + return _lockfile2 = __webpack_require__(20); } var _packageFetcher; function _load_packageFetcher() { - return _packageFetcher = _interopRequireWildcard(__webpack_require__(224)); + return _packageFetcher = _interopRequireWildcard(__webpack_require__(235)); } var _packageInstallScripts; function _load_packageInstallScripts() { - return _packageInstallScripts = _interopRequireDefault(__webpack_require__(403)); + return _packageInstallScripts = _interopRequireDefault(__webpack_require__(418)); } var _packageCompatibility; function _load_packageCompatibility() { - return _packageCompatibility = _interopRequireWildcard(__webpack_require__(223)); + return _packageCompatibility = _interopRequireWildcard(__webpack_require__(234)); } var _packageResolver; function _load_packageResolver() { - return _packageResolver = _interopRequireDefault(__webpack_require__(225)); + return _packageResolver = _interopRequireDefault(__webpack_require__(236)); } var _packageLinker; function _load_packageLinker() { - return _packageLinker = _interopRequireDefault(__webpack_require__(142)); + return _packageLinker = _interopRequireDefault(__webpack_require__(149)); } var _index2; function _load_index2() { - return _index2 = __webpack_require__(37); + return _index2 = __webpack_require__(40); } var _index3; function _load_index3() { - return _index3 = __webpack_require__(38); + return _index3 = __webpack_require__(41); } var _autoclean; function _load_autoclean() { - return _autoclean = __webpack_require__(213); + return _autoclean = __webpack_require__(224); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _normalizePattern; function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(39); + return _normalizePattern = __webpack_require__(42); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); + return _map = _interopRequireDefault(__webpack_require__(34)); } var _yarnVersion; function _load_yarnVersion() { - return _yarnVersion = __webpack_require__(76); + return _yarnVersion = __webpack_require__(81); } var _workspaceLayout; function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(67)); + return _workspaceLayout = _interopRequireDefault(__webpack_require__(74)); } var _resolutionMap; function _load_resolutionMap() { - return _resolutionMap = _interopRequireDefault(__webpack_require__(228)); + return _resolutionMap = _interopRequireDefault(__webpack_require__(239)); +} + +var _guessName; + +function _load_guessName() { + return _guessName = _interopRequireDefault(__webpack_require__(111)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const emoji = __webpack_require__(280); +var deepEqual = __webpack_require__(525); -const invariant = __webpack_require__(6); -const path = __webpack_require__(1); -const semver = __webpack_require__(19); -const uuid = __webpack_require__(74); +var emoji = __webpack_require__(293); +var invariant = __webpack_require__(9); +var path = __webpack_require__(0); +var semver = __webpack_require__(21); +var uuid = __webpack_require__(80); -const ONE_DAY = 1000 * 60 * 60 * 24; +var ONE_DAY = 1000 * 60 * 60 * 24; /** * Try and detect the installation method for Yarn and provide a command to update it with. @@ -21792,7 +22213,7 @@ function getUpdateInstaller(installationMethod) { } function normalizeFlags(config, rawFlags) { - const flags = { + var flags = { // install har: !!rawFlags.har, ignorePlatform: !!rawFlags.ignorePlatform, @@ -21803,6 +22224,7 @@ function normalizeFlags(config, rawFlags) { flat: !!rawFlags.flat, lockfile: rawFlags.lockfile !== false, pureLockfile: !!rawFlags.pureLockfile, + updateChecksums: !!rawFlags.updateChecksums, skipIntegrityCheck: !!rawFlags.skipIntegrityCheck, frozenLockfile: !!rawFlags.frozenLockfile, linkDuplicates: !!rawFlags.linkDuplicates, @@ -21819,7 +22241,7 @@ function normalizeFlags(config, rawFlags) { // outdated, update-interactive includeWorkspaceDeps: !!rawFlags.includeWorkspaceDeps, - // remove, update + // add, remove, update workspaceRootIsCwd: rawFlags.workspaceRootIsCwd !== false }; @@ -21846,8 +22268,10 @@ function normalizeFlags(config, rawFlags) { return flags; } -class Install { - constructor(flags, config, reporter, lockfile) { +var Install = exports.Install = function () { + function Install(flags, config, reporter, lockfile) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Install); + this.rootManifestRegistries = []; this.rootPatternsToOrigin = (0, (_map || _load_map()).default)(); this.lockfile = lockfile; @@ -21866,44 +22290,68 @@ class Install { * Create a list of dependency requests from the current directories manifests. */ - fetchRequestFromCwd() { - var _arguments = arguments, - _this = this; + Install.prototype.fetchRequestFromCwd = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _this = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let excludePatterns = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : []; - let ignoreUnusedPatterns = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : false; + var excludePatterns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var ignoreUnusedPatterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - const patterns = []; - const deps = []; - let resolutionDeps = []; - const manifest = {}; + var patterns = []; + var deps = []; + var resolutionDeps = []; + var manifest = {}; - const ignorePatterns = []; - const usedPatterns = []; - let workspaceLayout; + var ignorePatterns = []; + var usedPatterns = []; + var workspaceLayout = void 0; // some commands should always run in the context of the entire workspace - const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd; + var cwd = this.flags.includeWorkspaceDeps || this.flags.workspaceRootIsCwd ? this.config.lockfileFolder : this.config.cwd; // non-workspaces are always root, otherwise check for workspace root - const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd; + var cwdIsRoot = !this.config.workspaceRootFolder || this.config.lockfileFolder === cwd; // exclude package names that are in install args - const excludeNames = []; - for (const pattern of excludePatterns) { - // can't extract a package name from this - if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) { - continue; + var excludeNames = []; + for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; } - // extract the name - const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern); - excludeNames.push(parts.name); + var _pattern = _ref2; + + if ((0, (_index3 || _load_index3()).getExoticResolver)(_pattern)) { + excludeNames.push((0, (_guessName || _load_guessName()).default)(_pattern)); + } else { + // extract the name + var parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(_pattern); + excludeNames.push(parts.name); + } } - const stripExcluded = function stripExcluded(manifest) { - for (const exclude of excludeNames) { + var stripExcluded = function stripExcluded(manifest) { + for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var exclude = _ref3; + if (manifest.dependencies && manifest.dependencies[exclude]) { delete manifest.dependencies[exclude]; } @@ -21916,34 +22364,59 @@ class Install { } }; - for (const registry of (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries)) { - const filename = (_index2 || _load_index2()).registries[registry].filename; + var _loop = function* _loop(registry) { + var filename = (_index2 || _load_index2()).registries[registry].filename; - const loc = path.join(cwd, filename); + var loc = path.join(cwd, filename); if (!(yield (_fs || _load_fs()).exists(loc))) { - continue; + return 'continue'; } _this.rootManifestRegistries.push(registry); - const projectManifestJson = yield _this.config.readJson(loc); + var projectManifestJson = yield _this.config.readJson(loc); yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot); (0, (_assign || _load_assign()).default)(_this.resolutions, projectManifestJson.resolutions); (0, (_assign || _load_assign()).default)(manifest, projectManifestJson); _this.resolutionMap.init(_this.resolutions); - for (const packageName of (0, (_keys || _load_keys()).default)(_this.resolutionMap.resolutionsByPackage)) { - for (const _ref of _this.resolutionMap.resolutionsByPackage[packageName]) { - const pattern = _ref.pattern; + for (var _iterator4 = (0, (_keys || _load_keys()).default)(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref5; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } + + var _packageName = _ref5; + + for (var _iterator6 = _this.resolutionMap.resolutionsByPackage[_packageName], _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref9; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref9 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref9 = _i6.value; + } + + var _ref8 = _ref9; + var _pattern3 = _ref8.pattern; - resolutionDeps = [].concat((0, (_toConsumableArray2 || _load_toConsumableArray()).default)(resolutionDeps), [{ registry: registry, pattern: pattern, optional: false, hint: 'resolution' }]); + resolutionDeps = [].concat(resolutionDeps, [{ registry, pattern: _pattern3, optional: false, hint: 'resolution' }]); } } - const pushDeps = function pushDeps(depType, manifest, _ref2, isUsed) { - let hint = _ref2.hint, - optional = _ref2.optional; + var pushDeps = function pushDeps(depType, manifest, _ref6, isUsed) { + var hint = _ref6.hint, + optional = _ref6.optional; if (ignoreUnusedPatterns && !isUsed) { return; @@ -21954,54 +22427,69 @@ class Install { if (_this.flags.flat && !isUsed) { return; } - const depMap = manifest[depType]; - for (const name in depMap) { + var depMap = manifest[depType]; + for (var name in depMap) { if (excludeNames.indexOf(name) >= 0) { continue; } - let pattern = name; - if (!_this.lockfile.getLocked(pattern)) { + var _pattern2 = name; + if (!_this.lockfile.getLocked(_pattern2)) { // when we use --save we save the dependency to the lockfile with just the name rather than the // version combo - pattern += '@' + depMap[name]; + _pattern2 += '@' + depMap[name]; } // normalization made sure packages are mentioned only once if (isUsed) { - usedPatterns.push(pattern); + usedPatterns.push(_pattern2); } else { - ignorePatterns.push(pattern); + ignorePatterns.push(_pattern2); } - _this.rootPatternsToOrigin[pattern] = depType; - patterns.push(pattern); - deps.push({ pattern: pattern, registry: registry, hint: hint, optional: optional, workspaceName: manifest.name, workspaceLoc: manifest._loc }); + _this.rootPatternsToOrigin[_pattern2] = depType; + patterns.push(_pattern2); + deps.push({ pattern: _pattern2, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc }); } }; - pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true); - pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production); - pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true); + if (cwdIsRoot) { + pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true); + pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production); + pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true); + } if (_this.config.workspaceRootFolder) { - const workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename); - const workspacesRoot = path.dirname(workspaceLoc); + var workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename); + var workspacesRoot = path.dirname(workspaceLoc); - let workspaceManifestJson = projectManifestJson; + var workspaceManifestJson = projectManifestJson; if (!cwdIsRoot) { // the manifest we read before was a child workspace, so get the root workspaceManifestJson = yield _this.config.readJson(workspaceLoc); yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true); } - const workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson); + var workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson); workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config); // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine - const workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies); - for (const workspaceName of (0, (_keys || _load_keys()).default)(workspaces)) { - const workspaceManifest = workspaces[workspaceName].manifest; + var workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies); + for (var _iterator5 = (0, (_keys || _load_keys()).default)(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref7; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref7 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref7 = _i5.value; + } + + var workspaceName = _ref7; + + var workspaceManifest = workspaces[workspaceName].manifest; workspaceDependencies[workspaceName] = workspaceManifest.version; // include dependencies from all workspaces @@ -22011,7 +22499,7 @@ class Install { pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true); } } - const virtualDependencyManifest = { + var virtualDependencyManifest = { _uid: '', name: `workspace-aggregator-${uuid.v4()}`, version: '1.0.0', @@ -22019,10 +22507,12 @@ class Install { _loc: workspacesRoot, dependencies: workspaceDependencies, devDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.devDependencies), - optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies) + optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies), + private: workspaceManifestJson.private, + workspaces: workspaceManifestJson.workspaces }; workspaceLayout.virtualManifestName = virtualDependencyManifest.name; - const virtualDep = {}; + var virtualDep = {}; virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version; workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest }; @@ -22032,308 +22522,420 @@ class Install { pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true); } - break; + return 'break'; + }; + + _loop2: for (var _iterator3 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + var registry = _ref4; + + var _ret = yield* _loop(registry); + + switch (_ret) { + case 'continue': + continue; + + case 'break': + break _loop2;} } // inherit root flat flag + + if (manifest.flat) { - _this.flags.flat = true; + this.flags.flat = true; } return { - requests: [].concat((0, (_toConsumableArray2 || _load_toConsumableArray()).default)(resolutionDeps), deps), - patterns: patterns, - manifest: manifest, - usedPatterns: usedPatterns, - ignorePatterns: ignorePatterns, - workspaceLayout: workspaceLayout + requests: [].concat(resolutionDeps, deps), + patterns, + manifest, + usedPatterns, + ignorePatterns, + workspaceLayout }; - })(); - } + }); + + function fetchRequestFromCwd() { + return _ref.apply(this, arguments); + } + + return fetchRequestFromCwd; + }(); /** * TODO description */ - prepareRequests(requests) { + Install.prototype.prepareRequests = function prepareRequests(requests) { return requests; - } + }; - preparePatterns(patterns) { + Install.prototype.preparePatterns = function preparePatterns(patterns) { return patterns; - } + }; - bailout(patterns, workspaceLayout) { - var _this2 = this; + Install.prototype.preparePatternsForLinking = function preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { + return patterns; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (_this2.flags.skipIntegrityCheck || _this2.flags.force) { + Install.prototype.bailout = function () { + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) { + if (this.flags.skipIntegrityCheck || this.flags.force) { return false; } - const lockfileCache = _this2.lockfile.cache; + var lockfileCache = this.lockfile.cache; if (!lockfileCache) { return false; } - const lockfileClean = _this2.lockfile.parseResultType === 'success'; - const match = yield _this2.integrityChecker.check(patterns, lockfileCache, _this2.flags, workspaceLayout); - if (_this2.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) { - throw new (_errors || _load_errors()).MessageError(_this2.reporter.lang('frozenLockfileError')); + var lockfileClean = this.lockfile.parseResultType === 'success'; + var match = yield this.integrityChecker.check(patterns, lockfileCache, this.flags, workspaceLayout); + if (this.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('frozenLockfileError')); } - const haveLockfile = yield (_fs || _load_fs()).exists(path.join(_this2.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); + var haveLockfile = yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); if (match.integrityMatches && haveLockfile && lockfileClean) { - _this2.reporter.success(_this2.reporter.lang('upToDate')); + this.reporter.success(this.reporter.lang('upToDate')); return true; } if (match.integrityFileMissing && haveLockfile) { // Integrity file missing, force script installations - _this2.scripts.setForce(true); + this.scripts.setForce(true); return false; } if (match.hardRefreshRequired) { // e.g. node version doesn't match, force script installations - _this2.scripts.setForce(true); + this.scripts.setForce(true); return false; } if (!patterns.length && !match.integrityFileMissing) { - _this2.reporter.success(_this2.reporter.lang('nothingToInstall')); - yield _this2.createEmptyManifestFolders(); - yield _this2.saveLockfileAndIntegrity(patterns, workspaceLayout); + this.reporter.success(this.reporter.lang('nothingToInstall')); + yield this.createEmptyManifestFolders(); + yield this.saveLockfileAndIntegrity(patterns, workspaceLayout); return true; } return false; - })(); - } + }); + + function bailout(_x3, _x4) { + return _ref10.apply(this, arguments); + } + + return bailout; + }(); /** * Produce empty folders for all used root manifests. */ - createEmptyManifestFolders() { - var _this3 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (_this3.config.modulesFolder) { + Install.prototype.createEmptyManifestFolders = function () { + var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (this.config.modulesFolder) { // already created return; } - for (const registryName of _this3.rootManifestRegistries) { - const folder = _this3.config.registries[registryName].folder; + for (var _iterator7 = this.rootManifestRegistries, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { + var _ref12; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref12 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref12 = _i7.value; + } - yield (_fs || _load_fs()).mkdirp(path.join(_this3.config.lockfileFolder, folder)); + var registryName = _ref12; + var folder = this.config.registries[registryName].folder; + + yield (_fs || _load_fs()).mkdirp(path.join(this.config.lockfileFolder, folder)); } - })(); - } + }); + + function createEmptyManifestFolders() { + return _ref11.apply(this, arguments); + } + + return createEmptyManifestFolders; + }(); /** * TODO description */ - markIgnored(patterns) { - for (const pattern of patterns) { - const manifest = this.resolver.getStrictResolvedPattern(pattern); - const ref = manifest._reference; + Install.prototype.markIgnored = function markIgnored(patterns) { + for (var _iterator8 = patterns, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { + var _ref13; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref13 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref13 = _i8.value; + } + + var _pattern4 = _ref13; + + var _manifest = this.resolver.getStrictResolvedPattern(_pattern4); + var ref = _manifest._reference; invariant(ref, 'expected package reference'); // just mark the package as ignored. if the package is used by a required package, the hoister // will take care of that. ref.ignore = true; } - } + }; + + /** + * helper method that gets only recent manifests + * used by global.ls command + */ + + + Install.prototype.getFlattenedDeps = function () { + var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _ref15 = yield this.fetchRequestFromCwd(), + depRequests = _ref15.requests, + rawPatterns = _ref15.patterns; + + yield this.resolver.init(depRequests, {}); + + var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config); + this.resolver.updateManifests(manifests); + + return this.flatten(rawPatterns); + }); + + function getFlattenedDeps() { + return _ref14.apply(this, arguments); + } + + return getFlattenedDeps; + }(); /** * TODO description */ - init() { - var _this4 = this; + Install.prototype.init = function () { + var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _this2 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this4.checkUpdate(); + this.checkUpdate(); // warn if we have a shrinkwrap - if (yield (_fs || _load_fs()).exists(path.join(_this4.config.lockfileFolder, 'npm-shrinkwrap.json'))) { - _this4.reporter.warn(_this4.reporter.lang('shrinkwrapWarning')); + if (yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, 'npm-shrinkwrap.json'))) { + this.reporter.warn(this.reporter.lang('shrinkwrapWarning')); } - let flattenedTopLevelPatterns = []; - const steps = []; - - var _ref3 = yield _this4.fetchRequestFromCwd(); + var flattenedTopLevelPatterns = []; + var steps = []; - const depRequests = _ref3.requests, - rawPatterns = _ref3.patterns, - ignorePatterns = _ref3.ignorePatterns, - workspaceLayout = _ref3.workspaceLayout, - manifest = _ref3.manifest; + var _ref17 = yield this.fetchRequestFromCwd(), + depRequests = _ref17.requests, + rawPatterns = _ref17.patterns, + ignorePatterns = _ref17.ignorePatterns, + workspaceLayout = _ref17.workspaceLayout, + manifest = _ref17.manifest; - let topLevelPatterns = []; + var topLevelPatterns = []; - const artifacts = yield _this4.integrityChecker.getArtifacts(); + var artifacts = yield this.integrityChecker.getArtifacts(); if (artifacts) { - _this4.linker.setArtifacts(artifacts); - _this4.scripts.setArtifacts(artifacts); + this.linker.setArtifacts(artifacts); + this.scripts.setArtifacts(artifacts); } - if (!_this4.flags.ignoreEngines && typeof manifest.engines === 'object') { - steps.push((() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this4.reporter.step(curr, total, _this4.reporter.lang('checkingManifest'), emoji.get('mag')); - yield (_packageCompatibility || _load_packageCompatibility()).checkOne((0, (_extends2 || _load_extends()).default)({ _reference: {} }, manifest), _this4.config, _this4.flags.ignoreEngines); + if (!this.flags.ignoreEngines && typeof manifest.engines === 'object') { + steps.push(function () { + var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { + _this2.reporter.step(curr, total, _this2.reporter.lang('checkingManifest'), emoji.get('mag')); + yield (_packageCompatibility || _load_packageCompatibility()).checkOne((0, (_extends2 || _load_extends()).default)({ _reference: {} }, manifest), _this2.config, _this2.flags.ignoreEngines); }); - return function (_x3, _x4) { - return _ref4.apply(this, arguments); + return function (_x5, _x6) { + return _ref18.apply(this, arguments); }; - })()); + }()); } - steps.push((() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this4.reporter.step(curr, total, _this4.reporter.lang('resolvingPackages'), emoji.get('mag')); - _this4.resolutionMap.setTopLevelPatterns(rawPatterns); - yield _this4.resolver.init(_this4.prepareRequests(depRequests), { - isFlat: _this4.flags.flat, - isFrozen: _this4.flags.frozenLockfile, - workspaceLayout: workspaceLayout + steps.push(function (curr, total) { + return (0, (_hooks || _load_hooks()).callThroughHook)('resolveStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this2.reporter.step(curr, total, _this2.reporter.lang('resolvingPackages'), emoji.get('mag')); + _this2.resolutionMap.setTopLevelPatterns(rawPatterns); + yield _this2.resolver.init(_this2.prepareRequests(depRequests), { + isFlat: _this2.flags.flat, + isFrozen: _this2.flags.frozenLockfile, + workspaceLayout }); - topLevelPatterns = _this4.preparePatterns(rawPatterns); - flattenedTopLevelPatterns = yield _this4.flatten(topLevelPatterns); - return { bailout: yield _this4.bailout(topLevelPatterns, workspaceLayout) }; - }); - - return function (_x5, _x6) { - return _ref5.apply(this, arguments); - }; - })()); - - steps.push((() => { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this4.markIgnored(ignorePatterns); - _this4.reporter.step(curr, total, _this4.reporter.lang('fetchingPackages'), emoji.get('truck')); - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this4.resolver.getManifests(), _this4.config); - _this4.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(_this4.resolver.getManifests(), _this4.config, _this4.flags.ignoreEngines); - }); + topLevelPatterns = _this2.preparePatterns(rawPatterns); + flattenedTopLevelPatterns = yield _this2.flatten(topLevelPatterns); + return { bailout: yield _this2.bailout(topLevelPatterns, workspaceLayout) }; + })); + }); - return function (_x7, _x8) { - return _ref6.apply(this, arguments); - }; - })()); + steps.push(function (curr, total) { + return (0, (_hooks || _load_hooks()).callThroughHook)('fetchStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this2.markIgnored(ignorePatterns); + _this2.reporter.step(curr, total, _this2.reporter.lang('fetchingPackages'), emoji.get('truck')); + var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this2.resolver.getManifests(), _this2.config); + _this2.resolver.updateManifests(manifests); + yield (_packageCompatibility || _load_packageCompatibility()).check(_this2.resolver.getManifests(), _this2.config, _this2.flags.ignoreEngines); + })); + }); - steps.push((() => { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { + steps.push(function (curr, total) { + return (0, (_hooks || _load_hooks()).callThroughHook)('linkStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // remove integrity hash to make this operation atomic - yield _this4.integrityChecker.removeIntegrityFile(); - _this4.reporter.step(curr, total, _this4.reporter.lang('linkingDependencies'), emoji.get('link')); - yield _this4.linker.init(flattenedTopLevelPatterns, workspaceLayout, { - linkDuplicates: _this4.flags.linkDuplicates, - ignoreOptional: _this4.flags.ignoreOptional + yield _this2.integrityChecker.removeIntegrityFile(); + _this2.reporter.step(curr, total, _this2.reporter.lang('linkingDependencies'), emoji.get('link')); + flattenedTopLevelPatterns = _this2.preparePatternsForLinking(flattenedTopLevelPatterns, manifest, _this2.config.lockfileFolder === _this2.config.cwd); + yield _this2.linker.init(flattenedTopLevelPatterns, workspaceLayout, { + linkDuplicates: _this2.flags.linkDuplicates, + ignoreOptional: _this2.flags.ignoreOptional }); - }); - - return function (_x9, _x10) { - return _ref7.apply(this, arguments); - }; - })()); + })); + }); - steps.push((() => { - var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this4.reporter.step(curr, total, _this4.flags.force ? _this4.reporter.lang('rebuildingPackages') : _this4.reporter.lang('buildingFreshPackages'), emoji.get('page_with_curl')); + steps.push(function (curr, total) { + return (0, (_hooks || _load_hooks()).callThroughHook)('buildStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this2.reporter.step(curr, total, _this2.flags.force ? _this2.reporter.lang('rebuildingPackages') : _this2.reporter.lang('buildingFreshPackages'), emoji.get('page_with_curl')); - if (_this4.flags.ignoreScripts) { - _this4.reporter.warn(_this4.reporter.lang('ignoredScripts')); + if (_this2.flags.ignoreScripts) { + _this2.reporter.warn(_this2.reporter.lang('ignoredScripts')); } else { - yield _this4.scripts.init(flattenedTopLevelPatterns); + yield _this2.scripts.init(flattenedTopLevelPatterns); } - }); + })); + }); - return function (_x11, _x12) { - return _ref8.apply(this, arguments); - }; - })()); - - if (_this4.flags.har) { - steps.push((() => { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - const formattedDate = new Date().toISOString().replace(/:/g, '-'); - const filename = `yarn-install_${formattedDate}.har`; - _this4.reporter.step(curr, total, _this4.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record')); - yield _this4.config.requestManager.saveHar(filename); + if (this.flags.har) { + steps.push(function () { + var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { + var formattedDate = new Date().toISOString().replace(/:/g, '-'); + var filename = `yarn-install_${formattedDate}.har`; + _this2.reporter.step(curr, total, _this2.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record')); + yield _this2.config.requestManager.saveHar(filename); }); - return function (_x13, _x14) { - return _ref9.apply(this, arguments); + return function (_x7, _x8) { + return _ref23.apply(this, arguments); }; - })()); + }()); } - if (yield _this4.shouldClean()) { - steps.push((() => { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this4.reporter.step(curr, total, _this4.reporter.lang('cleaningModules'), emoji.get('recycle')); - yield (0, (_autoclean || _load_autoclean()).clean)(_this4.config, _this4.reporter); + if (yield this.shouldClean()) { + steps.push(function () { + var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { + _this2.reporter.step(curr, total, _this2.reporter.lang('cleaningModules'), emoji.get('recycle')); + yield (0, (_autoclean || _load_autoclean()).clean)(_this2.config, _this2.reporter); }); - return function (_x15, _x16) { - return _ref10.apply(this, arguments); + return function (_x9, _x10) { + return _ref24.apply(this, arguments); }; - })()); + }()); } - let currentStep = 0; - for (const step of steps) { - const stepResult = yield step(++currentStep, steps.length); + var currentStep = 0; + for (var _iterator9 = steps, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { + var _ref25; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref25 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref25 = _i9.value; + } + + var step = _ref25; + + var stepResult = yield step(++currentStep, steps.length); if (stepResult && stepResult.bailout) { - _this4.maybeOutputUpdate(); + this.maybeOutputUpdate(); return flattenedTopLevelPatterns; } } // fin! // The second condition is to make sure lockfile can be updated when running `remove` command. - if (topLevelPatterns.length || (yield (_fs || _load_fs()).exists(path.join(_this4.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)))) { - yield _this4.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout); + if (topLevelPatterns.length || (yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)))) { + yield this.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout); } else { - _this4.reporter.info(_this4.reporter.lang('notSavedLockfileNoDependencies')); + this.reporter.info(this.reporter.lang('notSavedLockfileNoDependencies')); } - _this4.maybeOutputUpdate(); - _this4.config.requestManager.clearCache(); + this.maybeOutputUpdate(); + this.config.requestManager.clearCache(); return flattenedTopLevelPatterns; - })(); - } + }); + + function init() { + return _ref16.apply(this, arguments); + } + + return init; + }(); /** * Check if we should run the cleaning step. */ - shouldClean() { + Install.prototype.shouldClean = function shouldClean() { return (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME)); - } + }; /** * TODO */ - flatten(patterns) { - var _this5 = this; + Install.prototype.flatten = function () { + var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns) { + var _this3 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (!_this5.flags.flat) { + if (!this.flags.flat) { return patterns; } - const flattenedPatterns = []; + var flattenedPatterns = []; + + for (var _iterator10 = this.resolver.getAllDependencyNamesByLevelOrder(patterns), _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { + var _ref27; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref27 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref27 = _i10.value; + } + + var name = _ref27; - for (const name of _this5.resolver.getAllDependencyNamesByLevelOrder(patterns)) { - const infos = _this5.resolver.getAllInfoForPackageName(name).filter(function (manifest) { - const ref = manifest._reference; + var infos = this.resolver.getAllInfoForPackageName(name).filter(function (manifest) { + var ref = manifest._reference; invariant(ref, 'expected package reference'); return !ref.ignore; }); @@ -22345,91 +22947,108 @@ class Install { if (infos.length === 1) { // single version of this package // take out a single pattern as multiple patterns may have resolved to this package - flattenedPatterns.push(_this5.resolver.patternsByPackage[name][0]); + flattenedPatterns.push(this.resolver.patternsByPackage[name][0]); continue; } - const options = infos.map(function (info) { - const ref = info._reference; + var options = infos.map(function (info) { + var ref = info._reference; invariant(ref, 'expected reference'); return { // TODO `and is required by {PARENT}`, - name: _this5.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version), + name: _this3.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version), value: info.version }; }); - const versions = infos.map(function (info) { + var versions = infos.map(function (info) { return info.version; }); - let version; + var version = void 0; - const resolutionVersion = _this5.resolutions[name]; + var resolutionVersion = this.resolutions[name]; if (resolutionVersion && versions.indexOf(resolutionVersion) >= 0) { // use json `resolution` version version = resolutionVersion; } else { - version = yield _this5.reporter.select(_this5.reporter.lang('manualVersionResolution', name), _this5.reporter.lang('answer'), options); - _this5.resolutions[name] = version; + version = yield this.reporter.select(this.reporter.lang('manualVersionResolution', name), this.reporter.lang('answer'), options); + this.resolutions[name] = version; } - flattenedPatterns.push(_this5.resolver.collapseAllVersionsOfPackage(name, version)); + flattenedPatterns.push(this.resolver.collapseAllVersionsOfPackage(name, version)); } // save resolutions to their appropriate root manifest - if ((0, (_keys || _load_keys()).default)(_this5.resolutions).length) { - const manifests = yield _this5.config.getRootManifests(); + if ((0, (_keys || _load_keys()).default)(this.resolutions).length) { + var manifests = yield this.config.getRootManifests(); - for (const name in _this5.resolutions) { - const version = _this5.resolutions[name]; + for (var _name in this.resolutions) { + var version = this.resolutions[_name]; - const patterns = _this5.resolver.patternsByPackage[name]; - if (!patterns) { + var _patterns = this.resolver.patternsByPackage[_name]; + if (!_patterns) { continue; } - let manifest; - for (const pattern of patterns) { - manifest = _this5.resolver.getResolvedPattern(pattern); - if (manifest) { + var _manifest2 = void 0; + for (var _iterator11 = _patterns, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) { + var _ref28; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref28 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref28 = _i11.value; + } + + var _pattern5 = _ref28; + + _manifest2 = this.resolver.getResolvedPattern(_pattern5); + if (_manifest2) { break; } } - invariant(manifest, 'expected manifest'); + invariant(_manifest2, 'expected manifest'); - const ref = manifest._reference; + var ref = _manifest2._reference; invariant(ref, 'expected reference'); - const object = manifests[ref.registry].object; + var object = manifests[ref.registry].object; object.resolutions = object.resolutions || {}; - object.resolutions[name] = version; + object.resolutions[_name] = version; } - yield _this5.config.saveRootManifests(manifests); + yield this.config.saveRootManifests(manifests); } return flattenedPatterns; - })(); - } + }); + + function flatten(_x11) { + return _ref26.apply(this, arguments); + } + + return flatten; + }(); /** * Remove offline tarballs that are no longer required */ - pruneOfflineMirror(lockfile) { - var _this6 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const mirror = _this6.config.getOfflineMirrorPath(); + Install.prototype.pruneOfflineMirror = function () { + var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile) { + var mirror = this.config.getOfflineMirrorPath(); if (!mirror) { return; } - const requiredTarballs = new (_set || _load_set()).default(); - for (const dependency in lockfile) { - const resolved = lockfile[dependency].resolved; + var requiredTarballs = new (_set || _load_set()).default(); + for (var dependency in lockfile) { + var resolved = lockfile[dependency].resolved; if (resolved) { - const basename = path.basename(resolved.split('#')[0]); + var basename = path.basename(resolved.split('#')[0]); if (dependency[0] === '@' && basename[0] !== '@') { requiredTarballs.add(`${dependency.split('/')[0]}-${basename}`); } @@ -22437,28 +23056,47 @@ class Install { } } - const mirrorFiles = yield (_fs || _load_fs()).walk(mirror); - for (const file of mirrorFiles) { - const isTarball = path.extname(file.basename) === '.tgz'; + var mirrorFiles = yield (_fs || _load_fs()).walk(mirror); + for (var _iterator12 = mirrorFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) { + var _ref30; + + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref30 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref30 = _i12.value; + } + + var file = _ref30; + + var isTarball = path.extname(file.basename) === '.tgz'; if (isTarball && !requiredTarballs.has(file.basename)) { yield (_fs || _load_fs()).unlink(file.absolute); } } - })(); - } + }); + + function pruneOfflineMirror(_x12) { + return _ref29.apply(this, arguments); + } + + return pruneOfflineMirror; + }(); /** * Save updated integrity and lockfiles. */ - saveLockfileAndIntegrity(patterns, workspaceLayout) { - var _this7 = this; + Install.prototype.saveLockfileAndIntegrity = function () { + var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) { + var _this4 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const resolvedPatterns = {}; - (0, (_keys || _load_keys()).default)(_this7.resolver.patterns).forEach(function (pattern) { + var resolvedPatterns = {}; + (0, (_keys || _load_keys()).default)(this.resolver.patterns).forEach(function (pattern) { if (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern)) { - resolvedPatterns[pattern] = _this7.resolver.patterns[pattern]; + resolvedPatterns[pattern] = _this4.resolver.patterns[pattern]; } }); @@ -22467,109 +23105,134 @@ class Install { return !workspaceLayout || !workspaceLayout.getManifestByPattern(p); }); - const lockfileBasedOnResolver = _this7.lockfile.getLockfile(resolvedPatterns); + var lockfileBasedOnResolver = this.lockfile.getLockfile(resolvedPatterns); - if (_this7.config.pruneOfflineMirror) { - yield _this7.pruneOfflineMirror(lockfileBasedOnResolver); + if (this.config.pruneOfflineMirror) { + yield this.pruneOfflineMirror(lockfileBasedOnResolver); } // write integrity hash - yield _this7.integrityChecker.save(patterns, lockfileBasedOnResolver, _this7.flags, workspaceLayout, _this7.scripts.getArtifacts()); + yield this.integrityChecker.save(patterns, lockfileBasedOnResolver, this.flags, workspaceLayout, this.scripts.getArtifacts()); // --no-lockfile or --pure-lockfile or --frozen-lockfile flag - if (_this7.flags.lockfile === false || _this7.flags.pureLockfile || _this7.flags.frozenLockfile) { + if (this.flags.lockfile === false || this.flags.pureLockfile || this.flags.frozenLockfile) { return; } - const lockFileHasAllPatterns = patterns.every(function (p) { - return _this7.lockfile.getLocked(p); + var lockFileHasAllPatterns = patterns.every(function (p) { + return _this4.lockfile.getLocked(p); }); - const lockfilePatternsMatch = (0, (_keys || _load_keys()).default)(_this7.lockfile.cache || {}).every(function (p) { + var lockfilePatternsMatch = (0, (_keys || _load_keys()).default)(this.lockfile.cache || {}).every(function (p) { return lockfileBasedOnResolver[p]; }); - const resolverPatternsAreSameAsInLockfile = (0, (_keys || _load_keys()).default)(lockfileBasedOnResolver).every(function (pattern) { - const manifest = _this7.lockfile.getLocked(pattern); - return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved; + var resolverPatternsAreSameAsInLockfile = (0, (_keys || _load_keys()).default)(lockfileBasedOnResolver).every(function (pattern) { + var manifest = _this4.lockfile.getLocked(pattern); + return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved && deepEqual(manifest.prebuiltVariants, lockfileBasedOnResolver[pattern].prebuiltVariants); }); // remove command is followed by install with force, lockfile will be rewritten in any case then - if (!_this7.flags.force && _this7.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && patterns.length) { + if (!this.flags.force && this.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && patterns.length) { return; } // build lockfile location - const loc = path.join(_this7.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME); + var loc = path.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME); // write lockfile - const lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, _this7.config.enableLockfileVersions); + var lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, this.config.enableLockfileVersions); yield (_fs || _load_fs()).writeFilePreservingEol(loc, lockSource); - _this7._logSuccessSaveLockfile(); - })(); - } + this._logSuccessSaveLockfile(); + }); - _logSuccessSaveLockfile() { + function saveLockfileAndIntegrity(_x13, _x14) { + return _ref31.apply(this, arguments); + } + + return saveLockfileAndIntegrity; + }(); + + Install.prototype._logSuccessSaveLockfile = function _logSuccessSaveLockfile() { this.reporter.success(this.reporter.lang('savedLockfile')); - } + }; /** * Load the dependency graph of the current install. Only does package resolving and wont write to the cwd. */ - hydrate(ignoreUnusedPatterns) { - var _this8 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const request = yield _this8.fetchRequestFromCwd([], ignoreUnusedPatterns); - const depRequests = request.requests, - rawPatterns = request.patterns, - ignorePatterns = request.ignorePatterns, - workspaceLayout = request.workspaceLayout; + + Install.prototype.hydrate = function () { + var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ignoreUnusedPatterns) { + var request = yield this.fetchRequestFromCwd([], ignoreUnusedPatterns); + var depRequests = request.requests, + rawPatterns = request.patterns, + ignorePatterns = request.ignorePatterns, + workspaceLayout = request.workspaceLayout; - yield _this8.resolver.init(depRequests, { - isFlat: _this8.flags.flat, - isFrozen: _this8.flags.frozenLockfile, - workspaceLayout: workspaceLayout + yield this.resolver.init(depRequests, { + isFlat: this.flags.flat, + isFrozen: this.flags.frozenLockfile, + workspaceLayout }); - yield _this8.flatten(rawPatterns); - _this8.markIgnored(ignorePatterns); + yield this.flatten(rawPatterns); + this.markIgnored(ignorePatterns); // fetch packages, should hit cache most of the time - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this8.resolver.getManifests(), _this8.config); - _this8.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(_this8.resolver.getManifests(), _this8.config, _this8.flags.ignoreEngines); + var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config); + this.resolver.updateManifests(manifests); + yield (_packageCompatibility || _load_packageCompatibility()).check(this.resolver.getManifests(), this.config, this.flags.ignoreEngines); // expand minimal manifests - for (const manifest of _this8.resolver.getManifests()) { - const ref = manifest._reference; + for (var _iterator13 = this.resolver.getManifests(), _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) { + var _ref33; + + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref33 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref33 = _i13.value; + } + + var _manifest3 = _ref33; + + var ref = _manifest3._reference; invariant(ref, 'expected reference'); - const type = ref.remote.type; + var type = ref.remote.type; // link specifier won't ever hit cache - let loc = ''; + var _loc = ''; if (type === 'link') { continue; } else if (type === 'workspace') { if (!ref.remote.reference) { continue; } - loc = ref.remote.reference; + _loc = ref.remote.reference; } else { - loc = _this8.config.generateHardModulePath(ref); + _loc = this.config.generateHardModulePath(ref); } - const newPkg = yield _this8.config.readManifest(loc); - yield _this8.resolver.updateManifest(ref, newPkg); + var newPkg = yield this.config.readManifest(_loc); + yield this.resolver.updateManifest(ref, newPkg); } return request; - })(); - } + }); + + function hydrate(_x15) { + return _ref32.apply(this, arguments); + } + + return hydrate; + }(); /** * Check for updates every day and output a nag message if there's a newer version. */ - checkUpdate() { + Install.prototype.checkUpdate = function checkUpdate() { if (this.config.nonInteractive) { // don't show upgrade dialog on CI or non-TTY terminals return; @@ -22581,7 +23244,7 @@ class Install { } // only check for updates once a day - const lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0; + var lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0; if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) { return; } @@ -22591,16 +23254,16 @@ class Install { return; } - this._checkUpdate().catch(() => { + this._checkUpdate().catch(function () { // swallow errors }); - } + }; - _checkUpdate() { - var _this9 = this; + Install.prototype._checkUpdate = function () { + var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _this5 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let latestVersion = yield _this9.config.requestManager.request({ + var latestVersion = yield this.config.requestManager.request({ url: (_constants || _load_constants()).SELF_UPDATE_VERSION_URL }); invariant(typeof latestVersion === 'string', 'expected string'); @@ -22610,43 +23273,51 @@ class Install { } // ensure we only check for updates periodically - _this9.config.registries.yarn.saveHomeConfig({ + this.config.registries.yarn.saveHomeConfig({ lastUpdateCheck: Date.now() }); if (semver.gt(latestVersion, (_yarnVersion || _load_yarnVersion()).version)) { - const installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)(); - _this9.maybeOutputUpdate = function () { - _this9.reporter.warn(_this9.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version)); + var installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)(); + this.maybeOutputUpdate = function () { + _this5.reporter.warn(_this5.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version)); - const command = getUpdateCommand(installationMethod); + var command = getUpdateCommand(installationMethod); if (command) { - _this9.reporter.info(_this9.reporter.lang('yarnOutdatedCommand')); - _this9.reporter.command(command); + _this5.reporter.info(_this5.reporter.lang('yarnOutdatedCommand')); + _this5.reporter.command(command); } else { - const installer = getUpdateInstaller(installationMethod); + var installer = getUpdateInstaller(installationMethod); if (installer) { - _this9.reporter.info(_this9.reporter.lang('yarnOutdatedInstaller', installer)); + _this5.reporter.info(_this5.reporter.lang('yarnOutdatedInstaller', installer)); } } }; } - })(); - } + }); + + function _checkUpdate() { + return _ref34.apply(this, arguments); + } + + return _checkUpdate; + }(); /** * Method to override with a possible upgrade message. */ - maybeOutputUpdate() {} -} + Install.prototype.maybeOutputUpdate = function maybeOutputUpdate() {}; + + return Install; +}(); -exports.Install = Install; function hasWrapper(commander, args) { return true; } function setFlags(commander) { + commander.description('Yarn install is used to install all dependencies for a project.'); commander.usage('install [flags]'); commander.option('-g, --global', 'DEPRECATED'); commander.option('-S, --save', 'DEPRECATED - save package to your `dependencies`'); @@ -22658,7 +23329,7 @@ function setFlags(commander) { } /***/ }), -/* 28 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22671,7 +23342,13 @@ Object.defineProperty(exports, "__esModule", { var _setPrototypeOf; function _load_setPrototypeOf() { - return _setPrototypeOf = _interopRequireDefault(__webpack_require__(436)); + return _setPrototypeOf = _interopRequireDefault(__webpack_require__(251)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } exports.default = nullify; @@ -22679,10 +23356,23 @@ exports.default = nullify; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function nullify() { - let obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (Array.isArray(obj)) { - for (const item of obj) { + for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var item = _ref; + nullify(item); } } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') { @@ -22690,7 +23380,7 @@ function nullify() { // for..in can only be applied to 'object', not 'function' if (typeof obj === 'object') { - for (const key in obj) { + for (var key in obj) { nullify(obj[key]); } } @@ -22700,115 +23390,103 @@ function nullify() { } /***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _assign = __webpack_require__(13); - -var _assign2 = _interopRequireDefault(_assign); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _assign2.default || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -var store = __webpack_require__(259)('wks') - , uid = __webpack_require__(164) - , Symbol = __webpack_require__(35).Symbol - , USE_SYMBOL = typeof Symbol == 'function'; - -var $exports = module.exports = function(name){ - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; +/* 35 */ +/***/ (function(module, exports) { -$exports.store = store; +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); +if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef /***/ }), -/* 31 */ +/* 36 */ /***/ (function(module, exports) { module.exports = require("assert"); /***/ }), -/* 32 */ +/* 37 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -exports.__esModule = true; - -var _from = __webpack_require__(87); +module.exports = { "default": __webpack_require__(475), __esModule: true }; -var _from2 = _interopRequireDefault(_from); +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var global = __webpack_require__(35) + , core = __webpack_require__(23) + , ctx = __webpack_require__(54) + , hide = __webpack_require__(55) + , PROTOTYPE = 'prototype'; -exports.default = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , IS_WRAP = type & $export.W + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] + , key, own, out; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if(own && key in exports)continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function(C){ + var F = function(a, b, c){ + if(this instanceof C){ + switch(arguments.length){ + case 0: return new C; + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if(IS_PROTO){ + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); } - - return arr2; - } else { - return (0, _from2.default)(arr); } }; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; /***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(459), __esModule: true }; - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(458), __esModule: true }; - -/***/ }), -/* 35 */ -/***/ (function(module, exports) { - -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); -if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef - -/***/ }), -/* 36 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var escapeStringRegexp = __webpack_require__(167); -var ansiStyles = __webpack_require__(583); -var stripAnsi = __webpack_require__(173); -var hasAnsi = __webpack_require__(556); -var supportsColor = __webpack_require__(586); +var escapeStringRegexp = __webpack_require__(179); +var ansiStyles = __webpack_require__(605); +var stripAnsi = __webpack_require__(185); +var hasAnsi = __webpack_require__(578); +var supportsColor = __webpack_require__(608); var defineProps = Object.defineProperties; var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); @@ -22922,7 +23600,7 @@ module.exports.supportsColor = supportsColor; /***/ }), -/* 37 */ +/* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22936,32 +23614,32 @@ exports.registryNames = exports.registries = undefined; var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); + return _keys = _interopRequireDefault(__webpack_require__(14)); } var _yarnRegistry; function _load_yarnRegistry() { - return _yarnRegistry = _interopRequireDefault(__webpack_require__(406)); + return _yarnRegistry = _interopRequireDefault(__webpack_require__(421)); } var _npmRegistry; function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(48)); + return _npmRegistry = _interopRequireDefault(__webpack_require__(53)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const registries = exports.registries = { +var registries = exports.registries = { npm: (_npmRegistry || _load_npmRegistry()).default, yarn: (_yarnRegistry || _load_yarnRegistry()).default }; -const registryNames = exports.registryNames = (0, (_keys || _load_keys()).default)(registries); +var registryNames = exports.registryNames = (0, (_keys || _load_keys()).default)(registries); /***/ }), -/* 38 */ +/* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22972,10 +23650,34 @@ Object.defineProperty(exports, "__esModule", { }); exports.hostedGit = exports.registries = undefined; +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); + return _set = _interopRequireDefault(__webpack_require__(15)); } exports.getExoticResolver = getExoticResolver; @@ -22984,94 +23686,107 @@ exports.hostedGitFragmentToGitUrl = hostedGitFragmentToGitUrl; var _baseResolver; function _load_baseResolver() { - return _baseResolver = _interopRequireDefault(__webpack_require__(81)); + return _baseResolver = _interopRequireDefault(__webpack_require__(86)); } var _npmResolver; function _load_npmResolver() { - return _npmResolver = _interopRequireDefault(__webpack_require__(147)); + return _npmResolver = _interopRequireDefault(__webpack_require__(154)); } var _yarnResolver; function _load_yarnResolver() { - return _yarnResolver = _interopRequireDefault(__webpack_require__(231)); + return _yarnResolver = _interopRequireDefault(__webpack_require__(242)); } var _gitResolver; function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(82)); + return _gitResolver = _interopRequireDefault(__webpack_require__(87)); } var _tarballResolver; function _load_tarballResolver() { - return _tarballResolver = _interopRequireDefault(__webpack_require__(419)); + return _tarballResolver = _interopRequireDefault(__webpack_require__(434)); } var _githubResolver; function _load_githubResolver() { - return _githubResolver = _interopRequireDefault(__webpack_require__(229)); + return _githubResolver = _interopRequireDefault(__webpack_require__(240)); } var _fileResolver; function _load_fileResolver() { - return _fileResolver = _interopRequireDefault(__webpack_require__(145)); + return _fileResolver = _interopRequireDefault(__webpack_require__(152)); } var _linkResolver; function _load_linkResolver() { - return _linkResolver = _interopRequireDefault(__webpack_require__(230)); + return _linkResolver = _interopRequireDefault(__webpack_require__(241)); } var _gitlabResolver; function _load_gitlabResolver() { - return _gitlabResolver = _interopRequireDefault(__webpack_require__(417)); + return _gitlabResolver = _interopRequireDefault(__webpack_require__(432)); } var _gistResolver; function _load_gistResolver() { - return _gistResolver = _interopRequireDefault(__webpack_require__(146)); + return _gistResolver = _interopRequireDefault(__webpack_require__(153)); } var _bitbucketResolver; function _load_bitbucketResolver() { - return _bitbucketResolver = _interopRequireDefault(__webpack_require__(416)); + return _bitbucketResolver = _interopRequireDefault(__webpack_require__(431)); } var _hostedGitResolver; function _load_hostedGitResolver() { - return _hostedGitResolver = __webpack_require__(66); + return _hostedGitResolver = __webpack_require__(72); } var _registryResolver; function _load_registryResolver() { - return _registryResolver = _interopRequireDefault(__webpack_require__(418)); + return _registryResolver = _interopRequireDefault(__webpack_require__(433)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const registries = exports.registries = { +var registries = exports.registries = { npm: (_npmResolver || _load_npmResolver()).default, yarn: (_yarnResolver || _load_yarnResolver()).default }; // -const exotics = new (_set || _load_set()).default([(_gitResolver || _load_gitResolver()).default, (_tarballResolver || _load_tarballResolver()).default, (_githubResolver || _load_githubResolver()).default, (_fileResolver || _load_fileResolver()).default, (_linkResolver || _load_linkResolver()).default, (_gitlabResolver || _load_gitlabResolver()).default, (_gistResolver || _load_gistResolver()).default, (_bitbucketResolver || _load_bitbucketResolver()).default]); +var exotics = new (_set || _load_set()).default([(_gitResolver || _load_gitResolver()).default, (_tarballResolver || _load_tarballResolver()).default, (_githubResolver || _load_githubResolver()).default, (_fileResolver || _load_fileResolver()).default, (_linkResolver || _load_linkResolver()).default, (_gitlabResolver || _load_gitlabResolver()).default, (_gistResolver || _load_gistResolver()).default, (_bitbucketResolver || _load_bitbucketResolver()).default]); function getExoticResolver(pattern) { - for (const Resolver of exotics) { + for (var _iterator = exotics, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var Resolver = _ref; + if (Resolver.isVersion(pattern)) { return Resolver; } @@ -23081,15 +23796,15 @@ function getExoticResolver(pattern) { // -const hostedGit = exports.hostedGit = { +var hostedGit = exports.hostedGit = { github: (_githubResolver || _load_githubResolver()).default, gitlab: (_gitlabResolver || _load_gitlabResolver()).default, bitbucket: (_bitbucketResolver || _load_bitbucketResolver()).default }; function hostedGitFragmentToGitUrl(fragment, reporter) { - for (const key in hostedGit) { - const Resolver = hostedGit[key]; + for (var key in hostedGit) { + var Resolver = hostedGit[key]; if (Resolver.isVersion(fragment)) { return Resolver.getGitHTTPUrl((0, (_hostedGitResolver || _load_hostedGitResolver()).explodeHostedGitFragment)(fragment, reporter)); } @@ -23100,16 +23815,25 @@ function hostedGitFragmentToGitUrl(fragment, reporter) { // -for (const key in registries) { +for (var key in registries) { var _class, _temp; - const RegistryResolver = registries[key]; + var RegistryResolver = registries[key]; - exotics.add((_temp = _class = class extends (_registryResolver || _load_registryResolver()).default {}, _class.protocol = key, _class.factory = RegistryResolver, _temp)); + exotics.add((_temp = _class = function (_ExoticRegistryResolv) { + (0, (_inherits2 || _load_inherits()).default)(_class, _ExoticRegistryResolv); + + function _class() { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, _class); + return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticRegistryResolv.apply(this, arguments)); + } + + return _class; + }((_registryResolver || _load_registryResolver()).default), _class.protocol = key, _class.factory = RegistryResolver, _temp)); } /***/ }), -/* 39 */ +/* 42 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -23125,19 +23849,19 @@ exports.normalizePattern = normalizePattern; */ function normalizePattern(pattern) { - let hasVersion = false; - let range = 'latest'; - let name = pattern; + var hasVersion = false; + var range = 'latest'; + var name = pattern; // if we're a scope then remove the @ and add it back later - let isScoped = false; + var isScoped = false; if (name[0] === '@') { isScoped = true; name = name.slice(1); } // take first part as the name - const parts = name.split('@'); + var parts = name.split('@'); if (parts.length > 1) { name = parts.shift(); range = parts.join('@'); @@ -23154,11 +23878,32 @@ function normalizePattern(pattern) { name = `@${name}`; } - return { name: name, range: range, hasVersion: hasVersion }; + return { name, range, hasVersion }; } /***/ }), -/* 40 */ +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(47) + , IE8_DOM_DEFINE = __webpack_require__(262) + , toPrimitive = __webpack_require__(175) + , dP = Object.defineProperty; + +exports.f = __webpack_require__(48) ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; +}; + +/***/ }), +/* 44 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. @@ -29346,82 +30091,342 @@ observableProto.flatMapLatest = observableProto.switchMap = function(selector, r }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)(module))) /***/ }), -/* 41 */ +/* 45 */ /***/ (function(module, exports, __webpack_require__) { -var global = __webpack_require__(35) - , core = __webpack_require__(21) - , ctx = __webpack_require__(50) - , hide = __webpack_require__(61) - , PROTOTYPE = 'prototype'; +"use strict"; -var $export = function(type, name, source){ - var IS_FORCED = type & $export.F - , IS_GLOBAL = type & $export.G - , IS_STATIC = type & $export.S - , IS_PROTO = type & $export.P - , IS_BIND = type & $export.B - , IS_WRAP = type & $export.W - , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) - , expProto = exports[PROTOTYPE] - , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] - , key, own, out; - if(IS_GLOBAL)source = name; - for(key in source){ - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - if(own && key in exports)continue; - // export native or passed - out = own ? target[key] : source[key]; - // prevent global pollution for namespaces - exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] - // bind timers to global for call from export context - : IS_BIND && own ? ctx(out, global) - // wrap global constructors for prevent change them in library - : IS_WRAP && target[key] == out ? (function(C){ - var F = function(a, b, c){ - if(this instanceof C){ - switch(arguments.length){ - case 0: return new C; - case 1: return new C(a); - case 2: return new C(a, b); - } return new C(a, b, c); - } return C.apply(this, arguments); - }; - F[PROTOTYPE] = C[PROTOTYPE]; - return F; - // make static versions for prototype methods - })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% - if(IS_PROTO){ - (exports.virtual || (exports.virtual = {}))[key] = out; - // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% - if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.exec = exports.queue = undefined; + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + +var _keys; + +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); +} + +var _promise; + +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} + +exports.forkp = forkp; +exports.spawnp = spawnp; +exports.forwardSignalToSpawnedProcesses = forwardSignalToSpawnedProcesses; +exports.spawn = spawn; + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _blockingQueue; + +function _load_blockingQueue() { + return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _promise2; + +function _load_promise2() { + return _promise2 = __webpack_require__(91); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* global child_process$spawnOpts */ + +var child = __webpack_require__(140); + +var queue = exports.queue = new (_blockingQueue || _load_blockingQueue()).default('child', (_constants || _load_constants()).CHILD_CONCURRENCY); + +// TODO: this uid check is kinda whack +var uid = 0; + +var exec = exports.exec = (0, (_promise2 || _load_promise2()).promisify)(child.exec); + +function forkp(program, args, opts) { + return new (_promise || _load_promise()).default(function (resolve, reject) { + var proc = child.fork(program, args, opts); + + proc.on('error', function (error) { + reject(error); + }); + + proc.on('close', function (exitCode) { + resolve(exitCode); + }); + }); +} + +function spawnp(program, args, opts) { + return new (_promise || _load_promise()).default(function (resolve, reject) { + var proc = child.spawn(program, args, opts); + + proc.on('error', function (error) { + reject(error); + }); + + proc.on('close', function (exitCode) { + resolve(exitCode); + }); + }); +} + +var spawnedProcesses = {}; + +function forwardSignalToSpawnedProcesses(signal) { + for (var _iterator = (0, (_keys || _load_keys()).default)(spawnedProcesses), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; } + + var key = _ref; + + spawnedProcesses[key].kill(signal); + } +} + +function spawn(program, args) { + var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var onData = arguments[3]; + + var key = opts.cwd || String(++uid); + return queue.push(key, function () { + return new (_promise || _load_promise()).default(function (resolve, reject) { + var proc = child.spawn(program, args, opts); + spawnedProcesses[key] = proc; + + var processingDone = false; + var processClosed = false; + var err = null; + + var stdout = ''; + + proc.on('error', function (err) { + if (err.code === 'ENOENT') { + reject(new (_errors || _load_errors()).ProcessSpawnError(`Couldn't find the binary ${program}`, err.code, program)); + } else { + reject(err); + } + }); + + function updateStdout(chunk) { + stdout += chunk; + if (onData) { + onData(chunk); + } + } + + function finish() { + delete spawnedProcesses[key]; + if (err) { + reject(err); + } else { + resolve(stdout.trim()); + } + } + + if (typeof opts.process === 'function') { + opts.process(proc, updateStdout, reject, function () { + if (processClosed) { + finish(); + } else { + processingDone = true; + } + }); + } else { + if (proc.stderr) { + proc.stderr.on('data', updateStdout); + } + + if (proc.stdout) { + proc.stdout.on('data', updateStdout); + } + + processingDone = true; + } + + proc.on('close', function (code, signal) { + if (signal || code >= 1) { + err = new (_errors || _load_errors()).ProcessTermError(['Command failed.', signal ? `Exit signal: ${signal}` : `Exit code: ${code}`, `Command: ${program}`, `Arguments: ${args.join(' ')}`, `Directory: ${opts.cwd || process.cwd()}`, `Output:\n${stdout.trim()}`].join('\n')); + err.EXIT_SIGNAL = signal; + err.EXIT_CODE = code; + } + + if (processingDone || err) { + finish(); + } else { + processClosed = true; + } + }); + }); + }); +} + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + +var _promise; + +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _keys; + +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); +} + +exports.default = function (rootCommandName, subCommands) { + var run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var subName = (0, (_misc || _load_misc()).camelCase)(args.shift() || ''); + if (subName && subCommands[subName]) { + var command = subCommands[subName]; + var res = yield command(config, reporter, flags, args); + if (res !== false) { + return (_promise || _load_promise()).default.resolve(); + } + } + + if (usage && usage.length) { + reporter.error(`${reporter.lang('usage')}:`); + for (var _iterator = usage, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var msg = _ref2; + + reporter.error(`yarn ${rootCommandName} ${msg}`); + } + } + return (_promise || _load_promise()).default.reject(new (_errors || _load_errors()).MessageError(reporter.lang('invalidCommand', subCommandNames.join(', ')))); + }); + + return function run(_x2, _x3, _x4, _x5) { + return _ref.apply(this, arguments); + }; + }(); + + var usage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + + var subCommandNames = (0, (_keys || _load_keys()).default)(subCommands).map((_misc || _load_misc()).hyphenate); + + function setFlags(commander) { + commander.usage(`${rootCommandName} [${subCommandNames.join('|')}] [flags]`); + } + + function hasWrapper(commander, args) { + return true; } + + var examples = usage.map(function (cmd) { + return `${rootCommandName} ${cmd}`; + }); + + return { run, setFlags, hasWrapper, examples }; }; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -$export.U = 64; // safe -$export.R = 128; // real proto method for `library` -module.exports = $export; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _misc; + +function _load_misc() { + return _misc = __webpack_require__(19); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/* 42 */ +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(56); +module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; +}; + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(64)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; +}); + +/***/ }), +/* 49 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. -var assert = __webpack_require__(12); -var util = __webpack_require__(2); +var assert = __webpack_require__(16); +var util = __webpack_require__(4); function FingerprintFormatError(fp, format) { if (Error.captureStackTrace) @@ -29505,20 +30510,20 @@ module.exports = { /***/ }), -/* 43 */ +/* 50 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = Signature; -var assert = __webpack_require__(12); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(9); -var errs = __webpack_require__(42); -var utils = __webpack_require__(20); -var asn1 = __webpack_require__(46); -var SSHBuffer = __webpack_require__(129); +var assert = __webpack_require__(16); +var algs = __webpack_require__(26); +var crypto = __webpack_require__(13); +var errs = __webpack_require__(49); +var utils = __webpack_require__(24); +var asn1 = __webpack_require__(52); +var SSHBuffer = __webpack_require__(137); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var SignatureParseError = errs.SignatureParseError; @@ -29824,192 +30829,13 @@ Signature._oldVersionDetect = function (obj) { /***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.exec = exports.queue = undefined; - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); -} - -exports.forkp = forkp; -exports.spawnp = spawnp; -exports.forwardSignalToSpawnedProcesses = forwardSignalToSpawnedProcesses; -exports.spawn = spawn; - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); -} - -var _blockingQueue; - -function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(102)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _promise2; - -function _load_promise2() { - return _promise2 = __webpack_require__(85); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* global child_process$spawnOpts */ - -const child = __webpack_require__(132); - -const queue = exports.queue = new (_blockingQueue || _load_blockingQueue()).default('child', (_constants || _load_constants()).CHILD_CONCURRENCY); - -// TODO: this uid check is kinda whack -let uid = 0; - -const exec = exports.exec = (0, (_promise2 || _load_promise2()).promisify)(child.exec); - -function forkp(program, args, opts) { - return new (_promise || _load_promise()).default((resolve, reject) => { - const proc = child.fork(program, args, opts); - - proc.on('error', error => { - reject(error); - }); - - proc.on('close', exitCode => { - resolve(exitCode); - }); - }); -} - -function spawnp(program, args, opts) { - return new (_promise || _load_promise()).default((resolve, reject) => { - const proc = child.spawn(program, args, opts); - - proc.on('error', error => { - reject(error); - }); - - proc.on('close', exitCode => { - resolve(exitCode); - }); - }); -} - -const spawnedProcesses = {}; - -function forwardSignalToSpawnedProcesses(signal) { - for (const key of (0, (_keys || _load_keys()).default)(spawnedProcesses)) { - spawnedProcesses[key].kill(signal); - } -} - -function spawn(program, args) { - let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - let onData = arguments[3]; - - const key = opts.cwd || String(++uid); - return queue.push(key, () => new (_promise || _load_promise()).default((resolve, reject) => { - const proc = child.spawn(program, args, opts); - spawnedProcesses[key] = proc; - - let processingDone = false; - let processClosed = false; - let err = null; - - let stdout = ''; - - proc.on('error', err => { - if (err.code === 'ENOENT') { - reject(new (_errors || _load_errors()).ProcessSpawnError(`Couldn't find the binary ${program}`, err.code, program)); - } else { - reject(err); - } - }); - - function updateStdout(chunk) { - stdout += chunk; - if (onData) { - onData(chunk); - } - } - - function finish() { - delete spawnedProcesses[key]; - if (err) { - reject(err); - } else { - resolve(stdout.trim()); - } - } - - if (typeof opts.process === 'function') { - opts.process(proc, updateStdout, reject, function () { - if (processClosed) { - finish(); - } else { - processingDone = true; - } - }); - } else { - if (proc.stderr) { - proc.stderr.on('data', updateStdout); - } - - if (proc.stdout) { - proc.stdout.on('data', updateStdout); - } - - processingDone = true; - } - - proc.on('close', (code, signal) => { - if (signal || code >= 1) { - err = new (_errors || _load_errors()).ProcessTermError(['Command failed.', signal ? `Exit signal: ${signal}` : `Exit code: ${code}`, `Command: ${program}`, `Arguments: ${args.join(' ')}`, `Directory: ${opts.cwd || process.cwd()}`, `Output:\n${stdout.trim()}`].join('\n')); - err.EXIT_SIGNAL = signal; - err.EXIT_CODE = code; - } - - if (processingDone || err) { - finish(); - } else { - processClosed = true; - } - }); - })); -} - -/***/ }), -/* 45 */ +/* 51 */ /***/ (function(module, exports) { module.exports = require("http"); /***/ }), -/* 46 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2011 Mark Cavage All rights reserved. @@ -30017,7 +30843,7 @@ module.exports = require("http"); // If you have no idea what ASN.1 or BER is, see this: // ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc -var Ber = __webpack_require__(362); +var Ber = __webpack_require__(375); @@ -30035,7 +30861,7 @@ module.exports = { /***/ }), -/* 47 */ +/* 53 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30044,208 +30870,144 @@ module.exports = { Object.defineProperty(exports, "__esModule", { value: true }); +exports.SCOPE_SEPARATOR = undefined; -var _promise; +var _getIterator2; -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); -} - -exports.default = function (rootCommandName, subCommands) { - let run = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const subName = (0, (_misc || _load_misc()).camelCase)(args.shift() || ''); - if (subName && subCommands[subName]) { - const command = subCommands[subName]; - const res = yield command(config, reporter, flags, args); - if (res !== false) { - return (_promise || _load_promise()).default.resolve(); - } - } - - if (usage && usage.length) { - reporter.error(`${reporter.lang('usage')}:`); - for (const msg of usage) { - reporter.error(`yarn ${rootCommandName} ${msg}`); - } - } - return (_promise || _load_promise()).default.reject(new (_errors || _load_errors()).MessageError(reporter.lang('invalidCommand', subCommandNames.join(', ')))); - }); - - return function run(_x2, _x3, _x4, _x5) { - return _ref.apply(this, arguments); - }; - })(); - - let usage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - - const subCommandNames = (0, (_keys || _load_keys()).default)(subCommands).map((_misc || _load_misc()).hyphenate); - - function setFlags(commander) { - commander.usage(`${rootCommandName} [${subCommandNames.join('|')}] [flags]`); - } - - function hasWrapper(commander, args) { - return true; - } - - const examples = usage.map(cmd => { - return `${rootCommandName} ${cmd}`; - }); - - return { run: run, setFlags: setFlags, hasWrapper: hasWrapper, examples: examples }; -}; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); + return _keys = _interopRequireDefault(__webpack_require__(14)); } -var _misc; +var _assign; -function _load_misc() { - return _misc = __webpack_require__(15); +function _load_assign() { + return _assign = _interopRequireDefault(__webpack_require__(17)); } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { +var _classCallCheck2; -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SCOPE_SEPARATOR = undefined; - -var _slicedToArray2; - -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(17)); +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } -var _asyncToGenerator2; +var _possibleConstructorReturn2; -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); } -var _assign; +var _inherits2; -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); } var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); + return _set = _interopRequireDefault(__webpack_require__(15)); } var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _npmResolver; function _load_npmResolver() { - return _npmResolver = _interopRequireDefault(__webpack_require__(147)); + return _npmResolver = _interopRequireDefault(__webpack_require__(154)); } var _envReplace; function _load_envReplace() { - return _envReplace = _interopRequireDefault(__webpack_require__(421)); + return _envReplace = _interopRequireDefault(__webpack_require__(436)); } var _baseRegistry; function _load_baseRegistry() { - return _baseRegistry = _interopRequireDefault(__webpack_require__(405)); + return _baseRegistry = _interopRequireDefault(__webpack_require__(420)); } var _misc; function _load_misc() { - return _misc = __webpack_require__(15); + return _misc = __webpack_require__(19); } var _path; function _load_path() { - return _path = __webpack_require__(237); + return _path = __webpack_require__(248); } var _normalizeUrl; function _load_normalizeUrl() { - return _normalizeUrl = _interopRequireDefault(__webpack_require__(621)); + return _normalizeUrl = _interopRequireDefault(__webpack_require__(645)); } var _userHomeDir; function _load_userHomeDir() { - return _userHomeDir = _interopRequireDefault(__webpack_require__(86)); + return _userHomeDir = _interopRequireDefault(__webpack_require__(73)); } var _userHomeDir2; function _load_userHomeDir2() { - return _userHomeDir2 = __webpack_require__(86); + return _userHomeDir2 = __webpack_require__(73); } var _path2; function _load_path2() { - return _path2 = _interopRequireDefault(__webpack_require__(1)); + return _path2 = _interopRequireDefault(__webpack_require__(0)); } var _url; function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(14)); + return _url = _interopRequireDefault(__webpack_require__(18)); } var _ini; function _load_ini() { - return _ini = _interopRequireDefault(__webpack_require__(568)); + return _ini = _interopRequireDefault(__webpack_require__(590)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const DEFAULT_REGISTRY = 'https://registry.npmjs.org/'; -const REGEX_REGISTRY_HTTP_PROTOCOL = /^https?:/i; -const REGEX_REGISTRY_PREFIX = /^(https?:)?\/\//i; -const REGEX_REGISTRY_SUFFIX = /registry\/?$/; +var DEFAULT_REGISTRY = 'https://registry.npmjs.org/'; +var REGEX_REGISTRY_HTTP_PROTOCOL = /^https?:/i; +var REGEX_REGISTRY_PREFIX = /^(https?:)?\/\//i; +var REGEX_REGISTRY_SUFFIX = /registry\/?$/; -const SCOPE_SEPARATOR = exports.SCOPE_SEPARATOR = '%2f'; +var SCOPE_SEPARATOR = exports.SCOPE_SEPARATOR = '%2f'; // All scoped package names are of the format `@scope%2fpkg` from the use of NpmRegistry.escapeName // `(?:^|\/)` Match either the start of the string or a `/` but don't capture // `[^\/?]+?` Match any character that is not '/' or '?' and capture, up until the first occurance of: @@ -30253,7 +31015,7 @@ const SCOPE_SEPARATOR = exports.SCOPE_SEPARATOR = '%2f'; // The reason for matching a plain `/` is NPM registry being inconsistent about escaping `/` in // scoped package names: when you're fetching a tarball, it is not escaped, when you want info // about the package, it is escaped. -const SCOPED_PKG_REGEXP = /(?:^|\/)(@[^\/?]+?)(?=%2f|\/)/; +var SCOPED_PKG_REGEXP = /(?:^|\/)(@[^\/?]+?)(?=%2f|\/)/; // TODO: Use the method from src/cli/commands/global.js for this instead function getGlobalPrefix() { @@ -30264,7 +31026,7 @@ function getGlobalPrefix() { return (_path2 || _load_path2()).default.dirname(process.execPath); } else { // /usr/local/bin/node --> prefix=/usr/local - let prefix = (_path2 || _load_path2()).default.dirname((_path2 || _load_path2()).default.dirname(process.execPath)); + var prefix = (_path2 || _load_path2()).default.dirname((_path2 || _load_path2()).default.dirname(process.execPath)); // destdir only is respected on Unix if (process.env.DESTDIR) { @@ -30275,7 +31037,7 @@ function getGlobalPrefix() { } } -const PATH_CONFIG_OPTIONS = new (_set || _load_set()).default(['cache', 'cafile', 'prefix', 'userconfig']); +var PATH_CONFIG_OPTIONS = new (_set || _load_set()).default(['cache', 'cafile', 'prefix', 'userconfig']); function isPathConfigOption(key) { return PATH_CONFIG_OPTIONS.has(key); @@ -30293,67 +31055,79 @@ function normalizePath(val) { return (0, (_path || _load_path()).resolveWithHome)(val); } -class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default { - constructor(cwd, registries, requestManager, reporter) { - super(cwd, registries, requestManager, reporter); - this.folder = 'node_modules'; +function urlParts(requestUrl) { + var normalizedUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl); + var parsed = (_url || _load_url()).default.parse(normalizedUrl); + var host = parsed.host || ''; + var path = parsed.path || ''; + return { host, path }; +} + +var NpmRegistry = function (_Registry) { + (0, (_inherits2 || _load_inherits()).default)(NpmRegistry, _Registry); + + function NpmRegistry(cwd, registries, requestManager, reporter) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NpmRegistry); + + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Registry.call(this, cwd, registries, requestManager, reporter)); + + _this.folder = 'node_modules'; + return _this; } - static escapeName(name) { + NpmRegistry.escapeName = function escapeName(name) { // scoped packages contain slashes and the npm registry expects them to be escaped return name.replace('/', SCOPE_SEPARATOR); - } + }; - isScopedPackage(packageIdent) { + NpmRegistry.prototype.isScopedPackage = function isScopedPackage(packageIdent) { return SCOPED_PKG_REGEXP.test(packageIdent); - } + }; - getRequestUrl(registry, pathname) { - const isUrl = REGEX_REGISTRY_PREFIX.test(pathname); + NpmRegistry.prototype.getRequestUrl = function getRequestUrl(registry, pathname) { + var isUrl = REGEX_REGISTRY_PREFIX.test(pathname); if (isUrl) { return pathname; } else { return (_url || _load_url()).default.resolve((0, (_misc || _load_misc()).addSuffix)(registry, '/'), pathname); } - } + }; - isRequestToRegistry(requestUrl, registryUrl) { - const normalizedRequestUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl); - const normalizedRegistryUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(registryUrl); - const requestParsed = (_url || _load_url()).default.parse(normalizedRequestUrl); - const registryParsed = (_url || _load_url()).default.parse(normalizedRegistryUrl); - const requestHost = requestParsed.host || ''; - const registryHost = registryParsed.host || ''; - const requestPath = requestParsed.path || ''; - const registryPath = registryParsed.path || ''; - const customHostSuffix = this.getRegistryOrGlobalOption(registryUrl, 'custom-host-suffix'); + NpmRegistry.prototype.isRequestToRegistry = function isRequestToRegistry(requestUrl, registryUrl) { + var request = urlParts(requestUrl); + var registry = urlParts(registryUrl); + var customHostSuffix = this.getRegistryOrGlobalOption(registryUrl, 'custom-host-suffix'); - return requestHost === registryHost && (requestPath.startsWith(registryPath) || + var requestToRegistryHost = request.host === registry.host; + var requestToYarn = (_constants || _load_constants()).YARN_REGISTRY.indexOf(request.host) !== -1 && DEFAULT_REGISTRY.indexOf(registry.host) !== -1; + var requestToRegistryPath = request.path.startsWith(registry.path); // For some registries, the package path does not prefix with the registry path - typeof customHostSuffix === 'string' && requestHost.endsWith(customHostSuffix)); - } + var customHostSuffixInUse = typeof customHostSuffix === 'string' && request.host.endsWith(customHostSuffix); + + return (requestToRegistryHost || requestToYarn) && (requestToRegistryPath || customHostSuffixInUse); + }; - request(pathname) { - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let packageName = arguments[2]; + NpmRegistry.prototype.request = function request(pathname) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var packageName = arguments[2]; // packageName needs to be escaped when if it is passed - const packageIdent = packageName && NpmRegistry.escapeName(packageName) || pathname; - const registry = this.getRegistry(packageIdent); - const requestUrl = this.getRequestUrl(registry, pathname); + var packageIdent = packageName && NpmRegistry.escapeName(packageName) || pathname; + var registry = this.getRegistry(packageIdent); + var requestUrl = this.getRequestUrl(registry, pathname); - const alwaysAuth = this.getRegistryOrGlobalOption(registry, 'always-auth'); + var alwaysAuth = this.getRegistryOrGlobalOption(registry, 'always-auth'); - const headers = (0, (_assign || _load_assign()).default)({ + var headers = (0, (_assign || _load_assign()).default)({ Accept: 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' }, opts.headers); - const isToRegistry = this.isRequestToRegistry(requestUrl, registry); + var isToRegistry = this.isRequestToRegistry(requestUrl, registry) || this.requestNeedsAuth(requestUrl); // this.token must be checked to account for publish requests on non-scopped packages if (this.token || isToRegistry && (alwaysAuth || this.isScopedPackage(packageIdent))) { - const authorization = this.getAuth(packageIdent); + var authorization = this.getAuth(packageIdent); if (authorization) { headers.authorization = authorization; } @@ -30364,45 +31138,72 @@ class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default { method: opts.method, body: opts.body, auth: opts.auth, - headers: headers, + headers, json: !opts.buffer, buffer: opts.buffer, process: opts.process, gzip: true }); - } + }; - checkOutdated(config, name, range) { - var _this = this; + NpmRegistry.prototype.requestNeedsAuth = function requestNeedsAuth(requestUrl) { + var config = this.config; + var requestParts = urlParts(requestUrl); + return !!(0, (_keys || _load_keys()).default)(config).find(function (option) { + var parts = option.split(':'); + if (parts.length === 2 && parts[1] === '_authToken') { + var registryParts = urlParts(parts[0]); + if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) { + return true; + } + } + return false; + }); + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const req = yield _this.request(NpmRegistry.escapeName(name), { + NpmRegistry.prototype.checkOutdated = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name, range) { + var req = yield this.request(NpmRegistry.escapeName(name), { headers: { Accept: 'application/json' } }); if (!req) { throw new Error('couldnt find ' + name); } - const repository = req.repository, - homepage = req.homepage; + // By default use top level 'repository' and 'homepage' values + var repository = req.repository, + homepage = req.homepage; + + var wantedPkg = yield (_npmResolver || _load_npmResolver()).default.findVersionInRegistryResponse(config, range, req); - const url = homepage || repository && repository.url || ''; + // But some local repositories like Verdaccio do not return 'repository' nor 'homepage' + // in top level data structure, so we fallback to wanted package manifest + if (!repository && !homepage) { + repository = wantedPkg.repository; + homepage = wantedPkg.homepage; + } + + var url = homepage || repository && repository.url || ''; return { latest: req['dist-tags'].latest, - wanted: (yield (_npmResolver || _load_npmResolver()).default.findVersionInRegistryResponse(config, range, req)).version, - url: url + wanted: wantedPkg.version, + url }; - })(); - } + }); - getPossibleConfigLocations(filename, reporter) { - var _this2 = this; + function checkOutdated(_x2, _x3, _x4) { + return _ref.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + return checkOutdated; + }(); + + NpmRegistry.prototype.getPossibleConfigLocations = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, reporter) { // npmrc --> ./.npmrc, ~/.npmrc, ${prefix}/etc/npmrc - const localfile = '.' + filename; - const possibles = [[false, (_path2 || _load_path2()).default.join(_this2.cwd, localfile)], [true, _this2.config.userconfig || (_path2 || _load_path2()).default.join((_userHomeDir || _load_userHomeDir()).default, localfile)], [false, (_path2 || _load_path2()).default.join(getGlobalPrefix(), 'etc', filename)]]; + var localfile = '.' + filename; + var possibles = [[false, (_path2 || _load_path2()).default.join(this.cwd, localfile)], [true, this.config.userconfig || (_path2 || _load_path2()).default.join((_userHomeDir || _load_userHomeDir()).default, localfile)], [false, (_path2 || _load_path2()).default.join(getGlobalPrefix(), 'etc', filename)]]; // When home directory for global install is different from where $HOME/npmrc is stored, // E.g. /usr/local/share vs /root on linux machines, check the additional location @@ -30411,18 +31212,28 @@ class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default { } // npmrc --> ../.npmrc, ../../.npmrc, etc. - const foldersFromRootToCwd = (0, (_path || _load_path()).getPosixPath)(_this2.cwd).split('/'); + var foldersFromRootToCwd = (0, (_path || _load_path()).getPosixPath)(this.cwd).split('/'); while (foldersFromRootToCwd.length > 1) { possibles.push([false, (_path2 || _load_path2()).default.join(foldersFromRootToCwd.join((_path2 || _load_path2()).default.sep), localfile)]); foldersFromRootToCwd.pop(); } - const actuals = []; - for (const _ref of possibles) { - var _ref2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref, 2); + var actuals = []; + for (var _iterator = possibles, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref4; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } - const isHome = _ref2[0]; - const loc = _ref2[1]; + var _ref3 = _ref4; + var isHome = _ref3[0]; + var loc = _ref3[1]; reporter.verbose(reporter.lang('configPossibleFile', loc)); if (yield (_fs || _load_fs()).exists(loc)) { @@ -30431,24 +31242,30 @@ class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default { } } return actuals; - })(); - } + }); - static getConfigEnv() { - let env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : process.env; + function getPossibleConfigLocations(_x5, _x6) { + return _ref2.apply(this, arguments); + } + + return getPossibleConfigLocations; + }(); + + NpmRegistry.getConfigEnv = function getConfigEnv() { + var env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : process.env; // To match NPM's behavior, HOME is always the user's home directory. - const overrideEnv = { + var overrideEnv = { HOME: (_userHomeDir2 || _load_userHomeDir2()).home }; return (0, (_assign || _load_assign()).default)({}, env, overrideEnv); - } + }; - static normalizeConfig(config) { - const env = NpmRegistry.getConfigEnv(); + NpmRegistry.normalizeConfig = function normalizeConfig(config) { + var env = NpmRegistry.getConfigEnv(); config = (_baseRegistry || _load_baseRegistry()).default.normalizeConfig(config); - for (const key in config) { + for (var key in config) { config[key] = (0, (_envReplace || _load_envReplace()).default)(config[key], env); if (isPathConfigOption(key)) { config[key] = normalizePath(config[key]); @@ -30456,139 +31273,163 @@ class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default { } return config; - } - - loadConfig() { - var _this3 = this; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + NpmRegistry.prototype.loadConfig = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // docs: https://docs.npmjs.com/misc/config - _this3.mergeEnv('npm_config_'); + this.mergeEnv('npm_config_'); - for (const _ref3 of yield _this3.getPossibleConfigLocations('npmrc', _this3.reporter)) { - var _ref4 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref3, 3); + for (var _iterator2 = yield this.getPossibleConfigLocations('npmrc', this.reporter), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref7; - const loc = _ref4[1]; - const file = _ref4[2]; + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref7 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref7 = _i2.value; + } - const config = NpmRegistry.normalizeConfig((_ini || _load_ini()).default.parse(file)); + var _ref6 = _ref7; + var loc = _ref6[1]; + var file = _ref6[2]; + + var config = NpmRegistry.normalizeConfig((_ini || _load_ini()).default.parse(file)); // normalize offline mirror path relative to the current npmrc - const offlineLoc = config['yarn-offline-mirror']; + var offlineLoc = config['yarn-offline-mirror']; // don't normalize if we already have a mirror path - if (!_this3.config['yarn-offline-mirror'] && offlineLoc) { - const mirrorLoc = config['yarn-offline-mirror'] = (_path2 || _load_path2()).default.resolve((_path2 || _load_path2()).default.dirname(loc), offlineLoc); + if (!this.config['yarn-offline-mirror'] && offlineLoc) { + var mirrorLoc = config['yarn-offline-mirror'] = (_path2 || _load_path2()).default.resolve((_path2 || _load_path2()).default.dirname(loc), offlineLoc); yield (_fs || _load_fs()).mkdirp(mirrorLoc); } - _this3.config = (0, (_assign || _load_assign()).default)({}, config, _this3.config); + this.config = (0, (_assign || _load_assign()).default)({}, config, this.config); } - })(); - } + }); - getScope(packageIdent) { - const match = packageIdent.match(SCOPED_PKG_REGEXP); + function loadConfig() { + return _ref5.apply(this, arguments); + } + + return loadConfig; + }(); + + NpmRegistry.prototype.getScope = function getScope(packageIdent) { + var match = packageIdent.match(SCOPED_PKG_REGEXP); return match && match[1] || ''; - } + }; - getRegistry(packageIdent) { + NpmRegistry.prototype.getRegistry = function getRegistry(packageIdent) { // Try extracting registry from the url, then scoped registry, and default registry if (packageIdent.match(REGEX_REGISTRY_PREFIX)) { - const availableRegistries = this.getAvailableRegistries(); - const registry = availableRegistries.find(registry => packageIdent.startsWith(registry)); + var availableRegistries = this.getAvailableRegistries(); + var registry = availableRegistries.find(function (registry) { + return packageIdent.startsWith(registry); + }); if (registry) { return String(registry); } } - for (const scope of [this.getScope(packageIdent), '']) { - const registry = this.getScopedOption(scope, 'registry') || this.registries.yarn.getScopedOption(scope, 'registry'); - if (registry) { - return String(registry); + var _arr = [this.getScope(packageIdent), '']; + for (var _i3 = 0; _i3 < _arr.length; _i3++) { + var scope = _arr[_i3]; + var _registry = this.getScopedOption(scope, 'registry') || this.registries.yarn.getScopedOption(scope, 'registry'); + if (_registry) { + return String(_registry); } } return DEFAULT_REGISTRY; - } + }; - getAuth(packageIdent) { + NpmRegistry.prototype.getAuth = function getAuth(packageIdent) { if (this.token) { return this.token; } - const baseRegistry = this.getRegistry(packageIdent); - const registries = [baseRegistry]; + var baseRegistry = this.getRegistry(packageIdent); + var registries = [baseRegistry]; // If sending a request to the Yarn registry, we must also send it the auth token for the npm registry if (baseRegistry === (_constants || _load_constants()).YARN_REGISTRY) { registries.push(DEFAULT_REGISTRY); } - for (const registry of registries) { + for (var _iterator3 = registries, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref8; + + if (_isArray3) { + if (_i4 >= _iterator3.length) break; + _ref8 = _iterator3[_i4++]; + } else { + _i4 = _iterator3.next(); + if (_i4.done) break; + _ref8 = _i4.value; + } + + var registry = _ref8; + // Check for bearer token. - const authToken = this.getRegistryOrGlobalOption(registry, '_authToken'); + var authToken = this.getRegistryOrGlobalOption(registry, '_authToken'); if (authToken) { return `Bearer ${String(authToken)}`; } // Check for basic auth token. - const auth = this.getRegistryOrGlobalOption(registry, '_auth'); + var auth = this.getRegistryOrGlobalOption(registry, '_auth'); if (auth) { return `Basic ${String(auth)}`; } // Check for basic username/password auth. - const username = this.getRegistryOrGlobalOption(registry, 'username'); - const password = this.getRegistryOrGlobalOption(registry, '_password'); + var username = this.getRegistryOrGlobalOption(registry, 'username'); + var password = this.getRegistryOrGlobalOption(registry, '_password'); if (username && password) { - const pw = new Buffer(String(password), 'base64').toString(); + var pw = new Buffer(String(password), 'base64').toString(); return 'Basic ' + new Buffer(String(username) + ':' + pw).toString('base64'); } } return ''; - } + }; - getScopedOption(scope, option) { + NpmRegistry.prototype.getScopedOption = function getScopedOption(scope, option) { return this.getOption(scope + (scope ? ':' : '') + option); - } + }; - getRegistryOption(registry, option) { - const pre = REGEX_REGISTRY_HTTP_PROTOCOL; - const suf = REGEX_REGISTRY_SUFFIX; + NpmRegistry.prototype.getRegistryOption = function getRegistryOption(registry, option) { + var pre = REGEX_REGISTRY_HTTP_PROTOCOL; + var suf = REGEX_REGISTRY_SUFFIX; // When registry is used config scope, the trailing '/' is required - const reg = (0, (_misc || _load_misc()).addSuffix)(registry, '/'); + var reg = (0, (_misc || _load_misc()).addSuffix)(registry, '/'); // 1st attempt, try to get option for the given registry URL // 2nd attempt, remove the 'https?:' prefix of the registry URL // 3nd attempt, remove the 'registry/?' suffix of the registry URL return this.getScopedOption(reg, option) || pre.test(reg) && this.getRegistryOption(reg.replace(pre, ''), option) || suf.test(reg) && this.getRegistryOption(reg.replace(suf, ''), option); - } + }; - getRegistryOrGlobalOption(registry, option) { + NpmRegistry.prototype.getRegistryOrGlobalOption = function getRegistryOrGlobalOption(registry, option) { return this.getRegistryOption(registry, option) || this.getOption(option); - } -} -exports.default = NpmRegistry; -NpmRegistry.filename = 'package.json'; + }; -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { + return NpmRegistry; +}((_baseRegistry || _load_baseRegistry()).default); -var isObject = __webpack_require__(52); -module.exports = function(it){ - if(!isObject(it))throw TypeError(it + ' is not an object!'); - return it; -}; +NpmRegistry.filename = 'package.json'; +exports.default = NpmRegistry; /***/ }), -/* 50 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { // optional / simple context binding -var aFunction = __webpack_require__(155); +var aFunction = __webpack_require__(162); module.exports = function(fn, that, length){ aFunction(fn); if(that === undefined)return fn; @@ -30609,16 +31450,20 @@ module.exports = function(fn, that, length){ }; /***/ }), -/* 51 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { -// Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(68)(function(){ - return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; -}); +var dP = __webpack_require__(43) + , createDesc = __webpack_require__(95); +module.exports = __webpack_require__(48) ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); +} : function(object, key, value){ + object[key] = value; + return object; +}; /***/ }), -/* 52 */ +/* 56 */ /***/ (function(module, exports) { module.exports = function(it){ @@ -30626,41 +31471,20 @@ module.exports = function(it){ }; /***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(49) - , IE8_DOM_DEFINE = __webpack_require__(249) - , toPrimitive = __webpack_require__(261) - , dP = Object.defineProperty; - -exports.f = __webpack_require__(51) ? Object.defineProperty : function defineProperty(O, P, Attributes){ - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if(IE8_DOM_DEFINE)try { - return dP(O, P, Attributes); - } catch(e){ /* empty */ } - if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); - if('value' in Attributes)O[P] = Attributes.value; - return O; -}; - -/***/ }), -/* 54 */ +/* 57 */ /***/ (function(module, exports, __webpack_require__) { try { - var util = __webpack_require__(2); + var util = __webpack_require__(4); if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { - module.exports = __webpack_require__(567); + module.exports = __webpack_require__(589); } /***/ }), -/* 55 */ +/* 58 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30668,11 +31492,11 @@ try { * Should be extended by prompt types. */ -var _ = __webpack_require__(26); -var chalk = __webpack_require__(36); -var runAsync = __webpack_require__(126); -var Choices = __webpack_require__(570); -var ScreenManager = __webpack_require__(581); +var _ = __webpack_require__(31); +var chalk = __webpack_require__(39); +var runAsync = __webpack_require__(134); +var Choices = __webpack_require__(592); +var ScreenManager = __webpack_require__(603); var Prompt = module.exports = function (question, rl, answers) { // Setup instance defaults property @@ -30803,12 +31627,12 @@ Prompt.prototype.getQuestion = function () { /***/ }), -/* 56 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var rx = __webpack_require__(127); +var rx = __webpack_require__(135); function normalizeKeypressEvents(value, key) { return {value: value, key: key || {}}; @@ -30855,7 +31679,7 @@ module.exports = function (rl) { /***/ }), -/* 57 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { (function(){ @@ -32218,7 +33042,7 @@ module.exports = function (rl) { /***/ }), -/* 58 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -32228,20 +33052,20 @@ module.exports = { write: write }; -var assert = __webpack_require__(12); -var asn1 = __webpack_require__(46); -var crypto = __webpack_require__(9); -var algs = __webpack_require__(22); -var utils = __webpack_require__(20); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(52); +var crypto = __webpack_require__(13); +var algs = __webpack_require__(26); +var utils = __webpack_require__(24); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(28); -var pkcs1 = __webpack_require__(184); -var pkcs8 = __webpack_require__(96); -var sshpriv = __webpack_require__(128); -var rfc4253 = __webpack_require__(63); +var pkcs1 = __webpack_require__(196); +var pkcs8 = __webpack_require__(102); +var sshpriv = __webpack_require__(136); +var rfc4253 = __webpack_require__(68); -var errors = __webpack_require__(42); +var errors = __webpack_require__(49); /* * For reading we support both PKCS#1 and PKCS#8. If we find a private key, @@ -32410,7 +33234,7 @@ function write(key, options, type) { /***/ }), -/* 59 */ +/* 62 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32425,14 +33249,14 @@ module.exports = { toHash: toHash, getProperty: getProperty, escapeQuotes: escapeQuotes, - ucs2length: __webpack_require__(330), + ucs2length: __webpack_require__(343), varOccurences: varOccurences, varReplace: varReplace, cleanUpCode: cleanUpCode, cleanUpVarErrors: cleanUpVarErrors, schemaHasRules: schemaHasRules, schemaHasRulesExcept: schemaHasRulesExcept, - stableStringify: __webpack_require__(177), + stableStringify: __webpack_require__(189), toQuotedString: toQuotedString, getPathExpr: getPathExpr, getPath: getPath, @@ -32674,7 +33498,7 @@ function unescapeJsonPointer(str) { /***/ }), -/* 60 */ +/* 63 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32684,45 +33508,91 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); +} + var _baseResolver; function _load_baseResolver() { - return _baseResolver = _interopRequireDefault(__webpack_require__(81)); + return _baseResolver = _interopRequireDefault(__webpack_require__(86)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -class ExoticResolver extends (_baseResolver || _load_baseResolver()).default { +var ExoticResolver = function (_BaseResolver) { + (0, (_inherits2 || _load_inherits()).default)(ExoticResolver, _BaseResolver); + + function ExoticResolver() { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ExoticResolver); + return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.apply(this, arguments)); + } - static isVersion(pattern) { - const proto = this.protocol; + ExoticResolver.isVersion = function isVersion(pattern) { + var proto = this.protocol; if (proto) { return pattern.startsWith(`${proto}:`); } else { throw new Error('No protocol specified'); } - } -} + }; + + return ExoticResolver; +}((_baseResolver || _load_baseResolver()).default); + exports.default = ExoticResolver; /***/ }), -/* 61 */ +/* 64 */ +/***/ (function(module, exports) { + +module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } +}; + +/***/ }), +/* 65 */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function(it, key){ + return hasOwnProperty.call(it, key); +}; + +/***/ }), +/* 66 */ /***/ (function(module, exports, __webpack_require__) { -var dP = __webpack_require__(53) - , createDesc = __webpack_require__(109); -module.exports = __webpack_require__(51) ? function(object, key, value){ - return dP.f(object, key, createDesc(1, value)); -} : function(object, key, value){ - object[key] = value; - return object; +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(167) + , defined = __webpack_require__(114); +module.exports = function(it){ + return IObject(defined(it)); }; /***/ }), -/* 62 */ +/* 67 */ /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__(25); +var Stream = __webpack_require__(29); if (process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream; exports = module.exports = Stream.Readable; @@ -32733,18 +33603,18 @@ if (process.env.READABLE_STREAM === 'disable' && Stream) { exports.PassThrough = Stream.PassThrough; exports.Stream = Stream; } else { - exports = module.exports = __webpack_require__(287); + exports = module.exports = __webpack_require__(300); exports.Stream = Stream || exports; exports.Readable = exports; - exports.Writable = __webpack_require__(289); - exports.Duplex = __webpack_require__(72); - exports.Transform = __webpack_require__(288); - exports.PassThrough = __webpack_require__(640); + exports.Writable = __webpack_require__(302); + exports.Duplex = __webpack_require__(78); + exports.Transform = __webpack_require__(301); + exports.PassThrough = __webpack_require__(664); } /***/ }), -/* 63 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -32762,12 +33632,12 @@ module.exports = { algToKeyType: algToKeyType }; -var assert = __webpack_require__(12); -var algs = __webpack_require__(22); -var utils = __webpack_require__(20); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var SSHBuffer = __webpack_require__(129); +var assert = __webpack_require__(16); +var algs = __webpack_require__(26); +var utils = __webpack_require__(24); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(28); +var SSHBuffer = __webpack_require__(137); function algToKeyType(alg) { assert.string(alg); @@ -32896,13 +33766,19 @@ function write(key, options) { /***/ }), -/* 64 */ +/* 69 */ /***/ (function(module, exports) { module.exports = require("events"); /***/ }), -/* 65 */ +/* 70 */ +/***/ (function(module, exports) { + +module.exports = require("os"); + +/***/ }), +/* 71 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32915,19 +33791,25 @@ Object.defineProperty(exports, "__esModule", { var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } var _stringify; function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(34)); + return _stringify = _interopRequireDefault(__webpack_require__(32)); } exports.stringifyLangArgs = stringifyLangArgs; @@ -32935,29 +33817,35 @@ exports.stringifyLangArgs = stringifyLangArgs; var _format; function _load_format() { - return _format = __webpack_require__(226); + return _format = __webpack_require__(237); } var _index; function _load_index() { - return _index = _interopRequireWildcard(__webpack_require__(227)); + return _index = _interopRequireWildcard(__webpack_require__(238)); } var _isCi; function _load_isCi() { - return _isCi = _interopRequireDefault(__webpack_require__(174)); + return _isCi = _interopRequireDefault(__webpack_require__(186)); +} + +var _os; + +function _load_os() { + return _os = _interopRequireDefault(__webpack_require__(70)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var util = __webpack_require__(4); /* eslint no-unused-vars: 0 */ -const util = __webpack_require__(2); -const EventEmitter = __webpack_require__(64).EventEmitter; +var EventEmitter = __webpack_require__(69).EventEmitter; function stringifyLangArgs(args) { return args.map(function (val) { @@ -32965,10 +33853,11 @@ function stringifyLangArgs(args) { return val.inspect(); } else { try { - const str = (0, (_stringify || _load_stringify()).default)(val) || val + ''; - // should match all "u001b" that follow an odd number of backslashes and convert them to ESC + var str = (0, (_stringify || _load_stringify()).default)(val) || val + ''; + // should match all literal line breaks and + // "u001b" that follow an odd number of backslashes and convert them to ESC // we do this because the JSON.stringify process has escaped these characters - return str.replace(/((?:^|[^\\])(?:\\{2})*)\\u001[bB]/g, '$1\u001b'); + return str.replace(/((?:^|[^\\])(?:\\{2})*)\\u001[bB]/g, '$1\u001b').replace(/[\\]r[\\]n|[\\]n/g, (_os || _load_os()).default.EOL); } catch (e) { return util.inspect(val); } @@ -32976,11 +33865,12 @@ function stringifyLangArgs(args) { }); } -class BaseReporter { - constructor() { - let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; +var BaseReporter = function () { + function BaseReporter() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseReporter); - const lang = 'en'; + var lang = 'en'; this.language = lang; this.stdout = opts.stdout || process.stdout; @@ -32998,8 +33888,8 @@ class BaseReporter { this.format = (_format || _load_format()).defaultFormatter; } - lang(key) { - const msg = (_index || _load_index())[this.language][key] || (_index || _load_index()).en[key]; + BaseReporter.prototype.lang = function lang(key) { + var msg = (_index || _load_index())[this.language][key] || (_index || _load_index()).en[key]; if (!msg) { throw new ReferenceError(`Unknown language key ${key}`); } @@ -33010,44 +33900,47 @@ class BaseReporter { args[_key - 1] = arguments[_key]; } - const stringifiedArgs = stringifyLangArgs(args); + var stringifiedArgs = stringifyLangArgs(args); // replace $0 placeholders with args - return msg.replace(/\$(\d+)/g, (str, i) => { + return msg.replace(/\$(\d+)/g, function (str, i) { return stringifiedArgs[i]; }); - } + }; /** * `stringifyLangArgs` run `JSON.stringify` on strings too causing * them to appear quoted. This marks them as "raw" and prevents * the quiating and escaping */ - rawText(str) { + + + BaseReporter.prototype.rawText = function rawText(str) { return { - inspect: function inspect() { + inspect() { return str; } }; - } + }; - verbose(msg) { + BaseReporter.prototype.verbose = function verbose(msg) { if (this.isVerbose) { this._verbose(msg); } - } + }; - verboseInspect(val) { + BaseReporter.prototype.verboseInspect = function verboseInspect(val) { if (this.isVerbose) { this._verboseInspect(val); } - } + }; - _verbose(msg) {} - _verboseInspect(val) {} + BaseReporter.prototype._verbose = function _verbose(msg) {}; - _getStandardInput() { - let standardInput; + BaseReporter.prototype._verboseInspect = function _verboseInspect(val) {}; + + BaseReporter.prototype._getStandardInput = function _getStandardInput() { + var standardInput = void 0; // Accessing stdin in a win32 headless process (e.g., Visual Studio) may throw an exception. try { @@ -33061,121 +33954,153 @@ class BaseReporter { } return standardInput; - } + }; + + BaseReporter.prototype.initPeakMemoryCounter = function initPeakMemoryCounter() { + var _this = this; - initPeakMemoryCounter() { this.checkPeakMemory(); - this.peakMemoryInterval = setInterval(() => { - this.checkPeakMemory(); + this.peakMemoryInterval = setInterval(function () { + _this.checkPeakMemory(); }, 1000); // $FlowFixMe: Node's setInterval returns a Timeout, not a Number this.peakMemoryInterval.unref(); - } - - checkPeakMemory() { - var _process$memoryUsage = process.memoryUsage(); + }; - const heapTotal = _process$memoryUsage.heapTotal; + BaseReporter.prototype.checkPeakMemory = function checkPeakMemory() { + var _process$memoryUsage = process.memoryUsage(), + heapTotal = _process$memoryUsage.heapTotal; if (heapTotal > this.peakMemory) { this.peakMemory = heapTotal; } - } + }; - close() { + BaseReporter.prototype.close = function close() { if (this.peakMemoryInterval) { clearInterval(this.peakMemoryInterval); this.peakMemoryInterval = null; } - } + }; - getTotalTime() { + BaseReporter.prototype.getTotalTime = function getTotalTime() { return Date.now() - this.startTime; - } + }; // TODO - list(key, items, hints) {} + + + BaseReporter.prototype.list = function list(key, items, hints) {}; // Outputs basic tree structure to console - tree(key, obj) {} + + + BaseReporter.prototype.tree = function tree(key, obj) {}; // called whenever we begin a step in the CLI. - step(current, total, message, emoji) {} + + + BaseReporter.prototype.step = function step(current, total, message, emoji) {}; // a error message has been triggered. this however does not always meant an abrupt // program end. - error(message) {} + + + BaseReporter.prototype.error = function error(message) {}; // an info message has been triggered. this provides things like stats and diagnostics. - info(message) {} + + + BaseReporter.prototype.info = function info(message) {}; // a warning message has been triggered. - warn(message) {} + + + BaseReporter.prototype.warn = function warn(message) {}; // a success message has been triggered. - success(message) {} + + + BaseReporter.prototype.success = function success(message) {}; // a simple log message // TODO: rethink the {force} parameter. In the meantime, please don't use it (cf comments in #4143). - log(message) { - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$force = _ref.force; - let force = _ref$force === undefined ? false : _ref$force; - } + + BaseReporter.prototype.log = function log(message) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$force = _ref.force, + force = _ref$force === undefined ? false : _ref$force; + }; // a shell command has been executed - command(command) {} + + + BaseReporter.prototype.command = function command(_command) {}; // inspect and pretty-print any value - inspect(value) {} + + + BaseReporter.prototype.inspect = function inspect(value) {}; // the screen shown at the very start of the CLI - header(command, pkg) {} + + + BaseReporter.prototype.header = function header(command, pkg) {}; // the screen shown at the very end of the CLI - footer(showPeakMemory) {} + + + BaseReporter.prototype.footer = function footer(showPeakMemory) {}; // - table(head, body) {} + + + BaseReporter.prototype.table = function table(head, body) {}; // render an activity spinner and return a function that will trigger an update - activity() { + + + BaseReporter.prototype.activity = function activity() { return { - tick: function tick(name) {}, - end: function end() {} + tick(name) {}, + end() {} }; - } + }; // - activitySet(total, workers) { + + + BaseReporter.prototype.activitySet = function activitySet(total, workers) { return { spinners: Array(workers).fill({ - clear: function clear() {}, - setPrefix: function setPrefix() {}, - tick: function tick() {}, - end: function end() {} + clear() {}, + setPrefix() {}, + tick() {}, + end() {} }), - end: function end() {} + end() {} }; - } + }; // - question(question) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + + BaseReporter.prototype.question = function question(_question) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return (_promise || _load_promise()).default.reject(new Error('Not implemented')); - } + }; // - questionAffirm(question) { - var _this = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const condition = true; // trick eslint + + BaseReporter.prototype.questionAffirm = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (question) { + var condition = true; // trick eslint while (condition) { - let answer = yield _this.question(question); + var answer = yield this.question(question); answer = answer.toLowerCase(); if (answer === 'y' || answer === 'yes') { @@ -33185,39 +34110,56 @@ class BaseReporter { return false; } - _this.error('Invalid answer for question'); + this.error('Invalid answer for question'); } return false; - })(); - } + }); + + function questionAffirm(_x4) { + return _ref2.apply(this, arguments); + } + + return questionAffirm; + }(); // prompt the user to select an option from an array - select(header, question, options) { + + + BaseReporter.prototype.select = function select(header, question, options) { return (_promise || _load_promise()).default.reject(new Error('Not implemented')); - } + }; // render a progress bar and return a function which when called will trigger an update - progress(total) { + + + BaseReporter.prototype.progress = function progress(total) { return function () {}; - } + }; // utility function to disable progress bar - disableProgress() { + + + BaseReporter.prototype.disableProgress = function disableProgress() { this.noProgress = true; - } + }; // - prompt(message, choices) { - let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + + BaseReporter.prototype.prompt = function prompt(message, choices) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return (_promise || _load_promise()).default.reject(new Error('Not implemented')); - } -} + }; + + return BaseReporter; +}(); + exports.default = BaseReporter; /***/ }), -/* 66 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33230,7 +34172,25 @@ Object.defineProperty(exports, "__esModule", { var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); } exports.explodeHostedGitFragment = explodeHostedGitFragment; @@ -33238,48 +34198,48 @@ exports.explodeHostedGitFragment = explodeHostedGitFragment; var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _index; function _load_index() { - return _index = __webpack_require__(37); + return _index = __webpack_require__(40); } var _gitResolver; function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(82)); + return _gitResolver = _interopRequireDefault(__webpack_require__(87)); } var _exoticResolver; function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(60)); + return _exoticResolver = _interopRequireDefault(__webpack_require__(63)); } var _git; function _load_git() { - return _git = _interopRequireDefault(__webpack_require__(148)); + return _git = _interopRequireDefault(__webpack_require__(155)); } var _guessName; function _load_guessName() { - return _guessName = _interopRequireDefault(__webpack_require__(149)); + return _guessName = _interopRequireDefault(__webpack_require__(111)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function explodeHostedGitFragment(fragment, reporter) { - const preParts = fragment.split('@'); + var preParts = fragment.split('@'); if (preParts.length > 2) { fragment = preParts[1] + '@' + preParts[2]; } - const parts = fragment.split(':'); + var parts = fragment.split(':'); if (parts.length == 3) { // protocol + host + folder @@ -33299,20 +34259,20 @@ function explodeHostedGitFragment(fragment, reporter) { throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidHostedGitFragment', fragment)); } - const userParts = fragment.split('/'); + var userParts = fragment.split('/'); if (userParts.length >= 2) { if (userParts[0].indexOf('@') >= 0) { userParts.shift(); } - const user = userParts.shift(); - const repoParts = userParts.join('/').split(/(?:[.]git)?#(.*)/); + var _user = userParts.shift(); + var repoParts = userParts.join('/').split(/(?:[.]git)?#(.*)/); if (repoParts.length <= 3) { return { - user: user, - repo: repoParts[0].replace('.git', ''), + user: _user, + repo: repoParts[0].replace(/\.git$/, ''), hash: repoParts[1] || '' }; } @@ -33321,63 +34281,66 @@ function explodeHostedGitFragment(fragment, reporter) { throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidHostedGitFragment', fragment)); } -class HostedGitResolver extends (_exoticResolver || _load_exoticResolver()).default { - constructor(request, fragment) { - super(request, fragment); +var HostedGitResolver = function (_ExoticResolver) { + (0, (_inherits2 || _load_inherits()).default)(HostedGitResolver, _ExoticResolver); - const exploded = this.exploded = explodeHostedGitFragment(fragment, this.reporter); - const user = exploded.user, - repo = exploded.repo, - hash = exploded.hash; + function HostedGitResolver(request, fragment) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, HostedGitResolver); - this.user = user; - this.repo = repo; - this.hash = hash; + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment)); + + var exploded = _this.exploded = explodeHostedGitFragment(fragment, _this.reporter); + var user = exploded.user, + repo = exploded.repo, + hash = exploded.hash; + + _this.user = user; + _this.repo = repo; + _this.hash = hash; + return _this; } - static getTarballUrl(exploded, commit) { + HostedGitResolver.getTarballUrl = function getTarballUrl(exploded, commit) { exploded; commit; throw new Error('Not implemented'); - } + }; - static getGitHTTPUrl(exploded) { + HostedGitResolver.getGitHTTPUrl = function getGitHTTPUrl(exploded) { exploded; throw new Error('Not implemented'); - } + }; - static getGitHTTPBaseUrl(exploded) { + HostedGitResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(exploded) { exploded; throw new Error('Not implemented'); - } + }; - static getGitSSHUrl(exploded) { + HostedGitResolver.getGitSSHUrl = function getGitSSHUrl(exploded) { exploded; throw new Error('Not implemented'); - } + }; - static getHTTPFileUrl(exploded, filename, commit) { + HostedGitResolver.getHTTPFileUrl = function getHTTPFileUrl(exploded, filename, commit) { exploded; filename; commit; throw new Error('Not implemented'); - } - - getRefOverHTTP(url) { - var _this = this; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); - const client = new (_git || _load_git()).default(_this.config, gitUrl, _this.hash); + HostedGitResolver.prototype.getRefOverHTTP = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) { + var gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); + var client = new (_git || _load_git()).default(this.config, gitUrl, this.hash); - let out = yield _this.config.requestManager.request({ + var out = yield this.config.requestManager.request({ url: `${url}/info/refs?service=git-upload-pack`, - queue: _this.resolver.fetchingQueue + queue: this.resolver.fetchingQueue }); if (out) { // clean up output - let lines = out.trim().split('\n'); + var lines = out.trim().split('\n'); // remove first two lines which contains compatibility info etc lines = lines.slice(2); @@ -33392,29 +34355,35 @@ class HostedGitResolver extends (_exoticResolver || _load_exoticResolver()).defa out = lines.join('\n'); } else { - throw new Error(_this.reporter.lang('hostedGitResolveError')); + throw new Error(this.reporter.lang('hostedGitResolveError')); } return client.setRefHosted(out); - })(); - } + }); - resolveOverHTTP(url) { - var _this2 = this; + function getRefOverHTTP(_x) { + return _ref.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const commit = yield _this2.getRefOverHTTP(url); - const config = _this2.config; + return getRefOverHTTP; + }(); + + HostedGitResolver.prototype.resolveOverHTTP = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) { + var _this2 = this; + + var commit = yield this.getRefOverHTTP(url); + var config = this.config; - const tarballUrl = _this2.constructor.getTarballUrl(_this2.exploded, commit); + var tarballUrl = this.constructor.getTarballUrl(this.exploded, commit); - const tryRegistry = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { - const filename = (_index || _load_index()).registries[registry].filename; + var tryRegistry = function () { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { + var filename = (_index || _load_index()).registries[registry].filename; - const href = _this2.constructor.getHTTPFileUrl(_this2.exploded, filename, commit); - const file = yield config.requestManager.request({ + var href = _this2.constructor.getHTTPFileUrl(_this2.exploded, filename, commit); + var file = yield config.requestManager.request({ url: href, queue: _this2.resolver.fetchingQueue }); @@ -33422,7 +34391,7 @@ class HostedGitResolver extends (_exoticResolver || _load_exoticResolver()).defa return null; } - const json = yield config.readJson(href, function () { + var json = yield config.readJson(href, function () { return JSON.parse(file); }); json._uid = commit; @@ -33430,29 +34399,29 @@ class HostedGitResolver extends (_exoticResolver || _load_exoticResolver()).defa resolved: tarballUrl, type: 'tarball', reference: tarballUrl, - registry: registry + registry }; return json; }); - return function tryRegistry(_x) { - return _ref.apply(this, arguments); + return function tryRegistry(_x3) { + return _ref3.apply(this, arguments); }; - })(); + }(); - const file = yield tryRegistry(_this2.registry); + var file = yield tryRegistry(this.registry); if (file) { return file; } - for (const registry in (_index || _load_index()).registries) { - if (registry === _this2.registry) { + for (var registry in (_index || _load_index()).registries) { + if (registry === this.registry) { continue; } - const file = yield tryRegistry(registry); - if (file) { - return file; + var _file = yield tryRegistry(registry); + if (_file) { + return _file; } } @@ -33468,41 +34437,49 @@ class HostedGitResolver extends (_exoticResolver || _load_exoticResolver()).defa hash: undefined } }; - })(); - } + }); - hasHTTPCapability(url) { - var _this3 = this; + function resolveOverHTTP(_x2) { + return _ref2.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - return (yield _this3.config.requestManager.request({ - url: url, + return resolveOverHTTP; + }(); + + HostedGitResolver.prototype.hasHTTPCapability = function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) { + return (yield this.config.requestManager.request({ + url, method: 'HEAD', - queue: _this3.resolver.fetchingQueue, + queue: this.resolver.fetchingQueue, followRedirect: false })) !== false; - })(); - } + }); - resolve() { - var _this4 = this; + function hasHTTPCapability(_x4) { + return _ref4.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + return hasHTTPCapability; + }(); + + HostedGitResolver.prototype.resolve = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // If we already have the tarball, just return it without having to make any HTTP requests. - const shrunk = _this4.request.getLocked('tarball'); + var shrunk = this.request.getLocked('tarball'); if (shrunk) { return shrunk; } - const httpUrl = _this4.constructor.getGitHTTPUrl(_this4.exploded); - const httpBaseUrl = _this4.constructor.getGitHTTPBaseUrl(_this4.exploded); - const sshUrl = _this4.constructor.getGitSSHUrl(_this4.exploded); + var httpUrl = this.constructor.getGitHTTPUrl(this.exploded); + var httpBaseUrl = this.constructor.getGitHTTPBaseUrl(this.exploded); + var sshUrl = this.constructor.getGitSSHUrl(this.exploded); // If we can access the files over HTTP then we should as it's MUCH faster than git // archive and tarball unarchiving. The HTTP API is only available for public repos // though. - if (yield _this4.hasHTTPCapability(httpBaseUrl)) { - return _this4.resolveOverHTTP(httpUrl); + if (yield this.hasHTTPCapability(httpBaseUrl)) { + return this.resolveOverHTTP(httpUrl); } // If the url is accessible over git archive then we should immediately delegate to @@ -33511,22 +34488,59 @@ class HostedGitResolver extends (_exoticResolver || _load_exoticResolver()).defa // NOTE: Here we use a different url than when we delegate to the git resolver later on. // This is because `git archive` requires access over ssh and github only allows that // if you have write permissions - const sshGitUrl = (_git || _load_git()).default.npmUrlToGitUrl(sshUrl); + var sshGitUrl = (_git || _load_git()).default.npmUrlToGitUrl(sshUrl); if (yield (_git || _load_git()).default.hasArchiveCapability(sshGitUrl)) { - const archiveClient = new (_git || _load_git()).default(_this4.config, sshGitUrl, _this4.hash); - const commit = yield archiveClient.init(); - return _this4.fork((_gitResolver || _load_gitResolver()).default, true, `${sshUrl}#${commit}`); + var archiveClient = new (_git || _load_git()).default(this.config, sshGitUrl, this.hash); + var commit = yield archiveClient.init(); + return this.fork((_gitResolver || _load_gitResolver()).default, true, `${sshUrl}#${commit}`); } // fallback to the plain git resolver - return _this4.fork((_gitResolver || _load_gitResolver()).default, true, sshUrl); - })(); - } -} + return this.fork((_gitResolver || _load_gitResolver()).default, true, sshUrl); + }); + + function resolve() { + return _ref5.apply(this, arguments); + } + + return resolve; + }(); + + return HostedGitResolver; +}((_exoticResolver || _load_exoticResolver()).default); + exports.default = HostedGitResolver; /***/ }), -/* 67 */ +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.home = undefined; + +var _rootUser; + +function _load_rootUser() { + return _rootUser = _interopRequireDefault(__webpack_require__(448)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var path = __webpack_require__(0); + +var home = exports.home = __webpack_require__(70).homedir(); + +var userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve('/usr/local/share') : home; + +exports.default = userHomeDir; + +/***/ }), +/* 74 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33536,76 +34550,73 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + var _normalizePattern2; function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(39); + return _normalizePattern2 = __webpack_require__(42); } -const semver = __webpack_require__(19); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var semver = __webpack_require__(21); + +var WorkspaceLayout = function () { + function WorkspaceLayout(workspaces, config) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, WorkspaceLayout); -class WorkspaceLayout { - constructor(workspaces, config) { this.workspaces = workspaces; this.config = config; } - getWorkspaceManifest(key) { + WorkspaceLayout.prototype.getWorkspaceManifest = function getWorkspaceManifest(key) { return this.workspaces[key]; - } - - getManifestByPattern(pattern) { - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern); + }; - const name = _normalizePattern.name, - range = _normalizePattern.range; + WorkspaceLayout.prototype.getManifestByPattern = function getManifestByPattern(pattern) { + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern), + name = _normalizePattern.name, + range = _normalizePattern.range; - const workspace = this.getWorkspaceManifest(name); + var workspace = this.getWorkspaceManifest(name); if (!workspace || !semver.satisfies(workspace.manifest.version, range, this.config.looseSemver)) { return null; } return workspace; - } -} -exports.default = WorkspaceLayout; + }; -/***/ }), -/* 68 */ -/***/ (function(module, exports) { + return WorkspaceLayout; +}(); -module.exports = function(exec){ - try { - return !!exec(); - } catch(e){ - return true; - } -}; +exports.default = WorkspaceLayout; /***/ }), -/* 69 */ -/***/ (function(module, exports) { - -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function(it, key){ - return hasOwnProperty.call(it, key); -}; +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }), -/* 70 */ -/***/ (function(module, exports) { +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(270) + , enumBugKeys = __webpack_require__(166); -module.exports = {}; +module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); +}; /***/ }), -/* 71 */ +/* 76 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var $at = __webpack_require__(486)(true); +var $at = __webpack_require__(503)(true); // 21.1.3.27 String.prototype[@@iterator]() -__webpack_require__(159)(String, 'String', function(iterated){ +__webpack_require__(168)(String, 'String', function(iterated){ this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() @@ -33620,7 +34631,445 @@ __webpack_require__(159)(String, 'String', function(iterated){ }); /***/ }), -/* 72 */ +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * micromatch + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + +var expand = __webpack_require__(636); +var utils = __webpack_require__(191); + +/** + * The main function. Pass an array of filepaths, + * and a string or array of glob patterns + * + * @param {Array|String} `files` + * @param {Array|String} `patterns` + * @param {Object} `opts` + * @return {Array} Array of matches + */ + +function micromatch(files, patterns, opts) { + if (!files || !patterns) return []; + opts = opts || {}; + + if (typeof opts.cache === 'undefined') { + opts.cache = true; + } + + if (!Array.isArray(patterns)) { + return match(files, patterns, opts); + } + + var len = patterns.length, i = 0; + var omit = [], keep = []; + + while (len--) { + var glob = patterns[i++]; + if (typeof glob === 'string' && glob.charCodeAt(0) === 33 /* ! */) { + omit.push.apply(omit, match(files, glob.slice(1), opts)); + } else { + keep.push.apply(keep, match(files, glob, opts)); + } + } + return utils.diff(keep, omit); +} + +/** + * Return an array of files that match the given glob pattern. + * + * This function is called by the main `micromatch` function If you only + * need to pass a single pattern you might get very minor speed improvements + * using this function. + * + * @param {Array} `files` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Array} + */ + +function match(files, pattern, opts) { + if (utils.typeOf(files) !== 'string' && !Array.isArray(files)) { + throw new Error(msg('match', 'files', 'a string or array')); + } + + files = utils.arrayify(files); + opts = opts || {}; + + var negate = opts.negate || false; + var orig = pattern; + + if (typeof pattern === 'string') { + negate = pattern.charAt(0) === '!'; + if (negate) { + pattern = pattern.slice(1); + } + + // we need to remove the character regardless, + // so the above logic is still needed + if (opts.nonegate === true) { + negate = false; + } + } + + var _isMatch = matcher(pattern, opts); + var len = files.length, i = 0; + var res = []; + + while (i < len) { + var file = files[i++]; + var fp = utils.unixify(file, opts); + + if (!_isMatch(fp)) { continue; } + res.push(fp); + } + + if (res.length === 0) { + if (opts.failglob === true) { + throw new Error('micromatch.match() found no matches for: "' + orig + '".'); + } + + if (opts.nonull || opts.nullglob) { + res.push(utils.unescapeGlob(orig)); + } + } + + // if `negate` was defined, diff negated files + if (negate) { res = utils.diff(files, res); } + + // if `ignore` was defined, diff ignored filed + if (opts.ignore && opts.ignore.length) { + pattern = opts.ignore; + opts = utils.omit(opts, ['ignore']); + res = utils.diff(res, micromatch(res, pattern, opts)); + } + + if (opts.nodupes) { + return utils.unique(res); + } + return res; +} + +/** + * Returns a function that takes a glob pattern or array of glob patterns + * to be used with `Array#filter()`. (Internally this function generates + * the matching function using the [matcher] method). + * + * ```js + * var fn = mm.filter('[a-c]'); + * ['a', 'b', 'c', 'd', 'e'].filter(fn); + * //=> ['a', 'b', 'c'] + * ``` + * @param {String|Array} `patterns` Can be a glob or array of globs. + * @param {Options} `opts` Options to pass to the [matcher] method. + * @return {Function} Filter function to be passed to `Array#filter()`. + */ + +function filter(patterns, opts) { + if (!Array.isArray(patterns) && typeof patterns !== 'string') { + throw new TypeError(msg('filter', 'patterns', 'a string or array')); + } + + patterns = utils.arrayify(patterns); + var len = patterns.length, i = 0; + var patternMatchers = Array(len); + while (i < len) { + patternMatchers[i] = matcher(patterns[i++], opts); + } + + return function(fp) { + if (fp == null) return []; + var len = patternMatchers.length, i = 0; + var res = true; + + fp = utils.unixify(fp, opts); + while (i < len) { + var fn = patternMatchers[i++]; + if (!fn(fp)) { + res = false; + break; + } + } + return res; + }; +} + +/** + * Returns true if the filepath contains the given + * pattern. Can also return a function for matching. + * + * ```js + * isMatch('foo.md', '*.md', {}); + * //=> true + * + * isMatch('*.md', {})('foo.md') + * //=> true + * ``` + * @param {String} `fp` + * @param {String} `pattern` + * @param {Object} `opts` + * @return {Boolean} + */ + +function isMatch(fp, pattern, opts) { + if (typeof fp !== 'string') { + throw new TypeError(msg('isMatch', 'filepath', 'a string')); + } + + fp = utils.unixify(fp, opts); + if (utils.typeOf(pattern) === 'object') { + return matcher(fp, pattern); + } + return matcher(pattern, opts)(fp); +} + +/** + * Returns true if the filepath matches the + * given pattern. + */ + +function contains(fp, pattern, opts) { + if (typeof fp !== 'string') { + throw new TypeError(msg('contains', 'pattern', 'a string')); + } + + opts = opts || {}; + opts.contains = (pattern !== ''); + fp = utils.unixify(fp, opts); + + if (opts.contains && !utils.isGlob(pattern)) { + return fp.indexOf(pattern) !== -1; + } + return matcher(pattern, opts)(fp); +} + +/** + * Returns true if a file path matches any of the + * given patterns. + * + * @param {String} `fp` The filepath to test. + * @param {String|Array} `patterns` Glob patterns to use. + * @param {Object} `opts` Options to pass to the `matcher()` function. + * @return {String} + */ + +function any(fp, patterns, opts) { + if (!Array.isArray(patterns) && typeof patterns !== 'string') { + throw new TypeError(msg('any', 'patterns', 'a string or array')); + } + + patterns = utils.arrayify(patterns); + var len = patterns.length; + + fp = utils.unixify(fp, opts); + while (len--) { + var isMatch = matcher(patterns[len], opts); + if (isMatch(fp)) { + return true; + } + } + return false; +} + +/** + * Filter the keys of an object with the given `glob` pattern + * and `options` + * + * @param {Object} `object` + * @param {Pattern} `object` + * @return {Array} + */ + +function matchKeys(obj, glob, options) { + if (utils.typeOf(obj) !== 'object') { + throw new TypeError(msg('matchKeys', 'first argument', 'an object')); + } + + var fn = matcher(glob, options); + var res = {}; + + for (var key in obj) { + if (obj.hasOwnProperty(key) && fn(key)) { + res[key] = obj[key]; + } + } + return res; +} + +/** + * Return a function for matching based on the + * given `pattern` and `options`. + * + * @param {String} `pattern` + * @param {Object} `options` + * @return {Function} + */ + +function matcher(pattern, opts) { + // pattern is a function + if (typeof pattern === 'function') { + return pattern; + } + // pattern is a regex + if (pattern instanceof RegExp) { + return function(fp) { + return pattern.test(fp); + }; + } + + if (typeof pattern !== 'string') { + throw new TypeError(msg('matcher', 'pattern', 'a string, regex, or function')); + } + + // strings, all the way down... + pattern = utils.unixify(pattern, opts); + + // pattern is a non-glob string + if (!utils.isGlob(pattern)) { + return utils.matchPath(pattern, opts); + } + // pattern is a glob string + var re = makeRe(pattern, opts); + + // `matchBase` is defined + if (opts && opts.matchBase) { + return utils.hasFilename(re, opts); + } + // `matchBase` is not defined + return function(fp) { + fp = utils.unixify(fp, opts); + return re.test(fp); + }; +} + +/** + * Create and cache a regular expression for matching + * file paths. + * + * If the leading character in the `glob` is `!`, a negation + * regex is returned. + * + * @param {String} `glob` + * @param {Object} `options` + * @return {RegExp} + */ + +function toRegex(glob, options) { + // clone options to prevent mutating the original object + var opts = Object.create(options || {}); + var flags = opts.flags || ''; + if (opts.nocase && flags.indexOf('i') === -1) { + flags += 'i'; + } + + var parsed = expand(glob, opts); + + // pass in tokens to avoid parsing more than once + opts.negated = opts.negated || parsed.negated; + opts.negate = opts.negated; + glob = wrapGlob(parsed.pattern, opts); + var re; + + try { + re = new RegExp(glob, flags); + return re; + } catch (err) { + err.reason = 'micromatch invalid regex: (' + re + ')'; + if (opts.strict) throw new SyntaxError(err); + } + + // we're only here if a bad pattern was used and the user + // passed `options.silent`, so match nothing + return /$^/; +} + +/** + * Create the regex to do the matching. If the leading + * character in the `glob` is `!` a negation regex is returned. + * + * @param {String} `glob` + * @param {Boolean} `negate` + */ + +function wrapGlob(glob, opts) { + var prefix = (opts && !opts.contains) ? '^' : ''; + var after = (opts && !opts.contains) ? '$' : ''; + glob = ('(?:' + glob + ')' + after); + if (opts && opts.negate) { + return prefix + ('(?!^' + glob + ').*$'); + } + return prefix + glob; +} + +/** + * Create and cache a regular expression for matching file paths. + * If the leading character in the `glob` is `!`, a negation + * regex is returned. + * + * @param {String} `glob` + * @param {Object} `options` + * @return {RegExp} + */ + +function makeRe(glob, opts) { + if (utils.typeOf(glob) !== 'string') { + throw new Error(msg('makeRe', 'glob', 'a string')); + } + return utils.cache(toRegex, glob, opts); +} + +/** + * Make error messages consistent. Follows this format: + * + * ```js + * msg(methodName, argNumber, nativeType); + * // example: + * msg('matchKeys', 'first', 'an object'); + * ``` + * + * @param {String} `method` + * @param {String} `num` + * @param {String} `type` + * @return {String} + */ + +function msg(method, what, type) { + return 'micromatch.' + method + '(): ' + what + ' should be ' + type + '.'; +} + +/** + * Public methods + */ + +/* eslint no-multi-spaces: 0 */ +micromatch.any = any; +micromatch.braces = micromatch.braceExpand = utils.braces; +micromatch.contains = contains; +micromatch.expand = expand; +micromatch.filter = filter; +micromatch.isMatch = isMatch; +micromatch.makeRe = makeRe; +micromatch.match = match; +micromatch.matcher = matcher; +micromatch.matchKeys = matchKeys; + +/** + * Expose `micromatch` + */ + +module.exports = micromatch; + + +/***/ }), +/* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33644,16 +35093,16 @@ var objectKeys = Object.keys || function (obj) { module.exports = Duplex; /**/ -var processNextTick = __webpack_require__(182); +var processNextTick = __webpack_require__(194); /**/ /**/ -var util = __webpack_require__(92); -util.inherits = __webpack_require__(54); +var util = __webpack_require__(99); +util.inherits = __webpack_require__(57); /**/ -var Readable = __webpack_require__(287); -var Writable = __webpack_require__(289); +var Readable = __webpack_require__(300); +var Writable = __webpack_require__(302); util.inherits(Duplex, Readable); @@ -33701,10 +35150,10 @@ function forEach(xs, f) { } /***/ }), -/* 73 */ +/* 79 */ /***/ (function(module, exports, __webpack_require__) { -var buffer = __webpack_require__(98) +var buffer = __webpack_require__(104) if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer @@ -33765,11 +35214,11 @@ SafeBuffer.allocUnsafeSlow = function (size) { /***/ }), -/* 74 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { -var v1 = __webpack_require__(696); -var v4 = __webpack_require__(697); +var v1 = __webpack_require__(722); +var v4 = __webpack_require__(723); var uuid = v4; uuid.v1 = v1; @@ -33779,13 +35228,7 @@ module.exports = uuid; /***/ }), -/* 75 */ -/***/ (function(module, exports) { - -module.exports = require("os"); - -/***/ }), -/* 76 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33799,12 +35242,12 @@ exports.getInstallationMethod = exports.version = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let getInstallationMethod = exports.getInstallationMethod = (() => { +var getInstallationMethod = exports.getInstallationMethod = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let installationMethod = originalInstallationMethod; + var installationMethod = originalInstallationMethod; // If there's a package.json in the parent directory, it could have an // override for the installation method, so we should prefer that over @@ -33814,10 +35257,10 @@ let getInstallationMethod = exports.getInstallationMethod = (() => { // Homebrew (so things like update notifications can point out the correct // command to upgrade). try { - const manifestPath = (_path || _load_path()).default.join(__dirname, '..', 'package.json'); + var manifestPath = (_path || _load_path()).default.join(__dirname, '..', 'package.json'); if ((_fs2 || _load_fs2()).default.existsSync(manifestPath)) { // non-async version is deprecated - const manifest = yield (0, (_fs || _load_fs()).readJson)(manifestPath); + var manifest = yield (0, (_fs || _load_fs()).readJson)(manifestPath); if (manifest.installationMethod) { installationMethod = manifest.installationMethod; } @@ -33831,46 +35274,46 @@ let getInstallationMethod = exports.getInstallationMethod = (() => { return function getInstallationMethod() { return _ref.apply(this, arguments); }; -})(); +}(); var _fs; function _load_fs() { - return _fs = __webpack_require__(5); + return _fs = __webpack_require__(7); } var _fs2; function _load_fs2() { - return _fs2 = _interopRequireDefault(__webpack_require__(8)); + return _fs2 = _interopRequireDefault(__webpack_require__(10)); } var _path; function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); + return _path = _interopRequireDefault(__webpack_require__(0)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // This will be bundled directly in the .js file for production builds -var _require = __webpack_require__(314); /** - * Determines the current version of Yarn itself. - * - */ +var _require = __webpack_require__(327), + version = _require.version, + originalInstallationMethod = _require.installationMethod; /** + * Determines the current version of Yarn itself. + * + */ -const version = _require.version, - originalInstallationMethod = _require.installationMethod; exports.version = version; /***/ }), -/* 77 */ +/* 82 */ /***/ (function(module, exports) { module.exports = require("net"); /***/ }), -/* 78 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33881,32 +35324,56 @@ Object.defineProperty(exports, "__esModule", { }); exports.run = exports.getBinFolder = undefined; -var _set; +var _keys; -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); } -var _keys; +var _set; -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } -let updateCwd = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); +} + +var updateCwd = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { yield (_fs || _load_fs()).mkdirp(config.globalFolder); yield config.init({ @@ -33919,28 +35386,67 @@ let updateCwd = (() => { }); return function updateCwd(_x) { - return _ref.apply(this, arguments); + return _ref2.apply(this, arguments); }; -})(); +}(); -let getBins = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { +var getBins = function () { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { // build up list of registry folders to search for binaries - const dirs = []; - for (const registryName of (0, (_keys || _load_keys()).default)((_index || _load_index()).registries)) { - const registry = config.registries[registryName]; + var dirs = []; + for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref4; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref4 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref4 = _i2.value; + } + + var registryName = _ref4; + + var registry = config.registries[registryName]; dirs.push(registry.loc); } // build up list of binary files - const paths = new (_set || _load_set()).default(); - for (const dir of dirs) { - const binDir = path.join(dir, '.bin'); + var paths = new (_set || _load_set()).default(); + for (var _iterator3 = dirs, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref5; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref5 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref5 = _i3.value; + } + + var dir = _ref5; + + var binDir = path.join(dir, '.bin'); if (!(yield (_fs || _load_fs()).exists(binDir))) { continue; } - for (const name of yield (_fs || _load_fs()).readdir(binDir)) { + for (var _iterator4 = yield (_fs || _load_fs()).readdir(binDir), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref6; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } + + var name = _ref6; + paths.add(path.join(binDir, name)); } } @@ -33948,12 +35454,12 @@ let getBins = (() => { }); return function getBins(_x2) { - return _ref2.apply(this, arguments); + return _ref3.apply(this, arguments); }; -})(); +}(); -let getGlobalPrefix = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { +var getGlobalPrefix = function () { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { if (flags.prefix) { return flags.prefix; } else if (config.getOption('prefix', true)) { @@ -33962,7 +35468,7 @@ let getGlobalPrefix = (() => { return process.env.PREFIX; } - const potentialPrefixFolders = [(_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX]; + var potentialPrefixFolders = [(_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX]; if (process.platform === 'win32') { // %LOCALAPPDATA%\Yarn --> C:\Users\Alice\AppData\Local\Yarn if (process.env.LOCALAPPDATA) { @@ -33972,11 +35478,11 @@ let getGlobalPrefix = (() => { potentialPrefixFolders.unshift((_constants || _load_constants()).POSIX_GLOBAL_PREFIX); } - const binFolders = potentialPrefixFolders.map(function (prefix) { + var binFolders = potentialPrefixFolders.map(function (prefix) { return path.join(prefix, 'bin'); }); - const prefixFolderQueryResult = yield (_fs || _load_fs()).getFirstSuitableFolder(binFolders); - const prefix = prefixFolderQueryResult.folder && path.dirname(prefixFolderQueryResult.folder); + var prefixFolderQueryResult = yield (_fs || _load_fs()).getFirstSuitableFolder(binFolders); + var prefix = prefixFolderQueryResult.folder && path.dirname(prefixFolderQueryResult.folder); if (!prefix) { config.reporter.warn(config.reporter.lang('noGlobalFolder', prefixFolderQueryResult.skipped.map(function (item) { @@ -33990,25 +35496,25 @@ let getGlobalPrefix = (() => { }); return function getGlobalPrefix(_x3, _x4) { - return _ref3.apply(this, arguments); + return _ref7.apply(this, arguments); }; -})(); +}(); -let getBinFolder = exports.getBinFolder = (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { - const prefix = yield getGlobalPrefix(config, flags); +var getBinFolder = exports.getBinFolder = function () { + var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { + var prefix = yield getGlobalPrefix(config, flags); return path.resolve(prefix, 'bin'); }); return function getBinFolder(_x5, _x6) { - return _ref4.apply(this, arguments); + return _ref8.apply(this, arguments); }; -})(); +}(); -let initUpdateBins = (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags) { - const beforeBins = yield getBins(config); - const binFolder = yield getBinFolder(config, flags); +var initUpdateBins = function () { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags) { + var beforeBins = yield getBins(config); + var binFolder = yield getBinFolder(config, flags); function throwPermError(err, dest) { if (err.code === 'EACCES') { @@ -34025,17 +35531,30 @@ let initUpdateBins = (() => { throwPermError(err, binFolder); } - const afterBins = yield getBins(config); + var afterBins = yield getBins(config); // remove old bins - for (const src of beforeBins) { + for (var _iterator5 = beforeBins, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref11; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref11 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref11 = _i5.value; + } + + var src = _ref11; + if (afterBins.has(src)) { // not old continue; } // remove old bin - const dest = path.join(binFolder, path.basename(src)); + var dest = path.join(binFolder, path.basename(src)); try { yield (_fs || _load_fs()).unlink(dest); } catch (err) { @@ -34044,17 +35563,30 @@ let initUpdateBins = (() => { } // add new bins - for (const src of afterBins) { - if (beforeBins.has(src)) { + for (var _iterator6 = afterBins, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref12; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref12 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref12 = _i6.value; + } + + var _src = _ref12; + + if (beforeBins.has(_src)) { // already inserted continue; } // insert new bin - const dest = path.join(binFolder, path.basename(src)); + var dest = path.join(binFolder, path.basename(_src)); try { yield (_fs || _load_fs()).unlink(dest); - yield (0, (_packageLinker || _load_packageLinker()).linkBin)(src, dest); + yield (0, (_packageLinker || _load_packageLinker()).linkBin)(_src, dest); if (process.platform === 'win32' && dest.indexOf('.cmd') !== -1) { yield (_fs || _load_fs()).rename(dest + '.cmd', dest); } @@ -34066,30 +35598,43 @@ let initUpdateBins = (() => { }); return function initUpdateBins(_x7, _x8, _x9) { - return _ref5.apply(this, arguments); + return _ref9.apply(this, arguments); }; -})(); +}(); -let _list = (() => { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { +var list = function () { + var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { yield updateCwd(config); // install so we get hard file paths - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - const install = new (_install || _load_install()).Install({ skipIntegrityCheck: true }, config, new (_baseReporter || _load_baseReporter()).default(), lockfile); - const patterns = yield install.init(); + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); + var install = new (_install || _load_install()).Install({}, config, new (_baseReporter || _load_baseReporter()).default(), lockfile); + var patterns = yield install.getFlattenedDeps(); // dump global modules - for (const pattern of patterns) { - const manifest = install.resolver.getStrictResolvedPattern(pattern); + for (var _iterator7 = patterns, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { + var _ref14; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref14 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref14 = _i7.value; + } + + var pattern = _ref14; + + var manifest = install.resolver.getStrictResolvedPattern(pattern); ls(manifest, reporter, false); } }); - return function _list(_x10, _x11, _x12, _x13) { - return _ref7.apply(this, arguments); + return function list(_x10, _x11, _x12, _x13) { + return _ref13.apply(this, arguments); }; -})(); +}(); exports.hasWrapper = hasWrapper; exports.setFlags = setFlags; @@ -34097,114 +35642,134 @@ exports.setFlags = setFlags; var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _index; function _load_index() { - return _index = __webpack_require__(37); + return _index = __webpack_require__(40); } var _baseReporter; function _load_baseReporter() { - return _baseReporter = _interopRequireDefault(__webpack_require__(65)); + return _baseReporter = _interopRequireDefault(__webpack_require__(71)); } var _buildSubCommands2; function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(47)); + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(46)); } var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(16)); + return _lockfile = _interopRequireDefault(__webpack_require__(20)); } var _install; function _load_install() { - return _install = __webpack_require__(27); + return _install = __webpack_require__(33); } var _add; function _load_add() { - return _add = __webpack_require__(100); + return _add = __webpack_require__(107); } var _remove; function _load_remove() { - return _remove = __webpack_require__(217); + return _remove = __webpack_require__(228); } var _upgrade; function _load_upgrade() { - return _upgrade = __webpack_require__(140); + return _upgrade = __webpack_require__(147); } var _upgradeInteractive; function _load_upgradeInteractive() { - return _upgradeInteractive = __webpack_require__(219); + return _upgradeInteractive = __webpack_require__(230); } var _packageLinker; function _load_packageLinker() { - return _packageLinker = __webpack_require__(142); + return _packageLinker = __webpack_require__(149); } var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -class GlobalAdd extends (_add || _load_add()).Add { - constructor(args, flags, config, reporter, lockfile) { - super(args, flags, config, reporter, lockfile); +var GlobalAdd = function (_Add) { + (0, (_inherits2 || _load_inherits()).default)(GlobalAdd, _Add); + + function GlobalAdd(args, flags, config, reporter, lockfile) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GlobalAdd); - this.linker.setTopLevelBinLinking(false); + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Add.call(this, args, flags, config, reporter, lockfile)); + + _this.linker.setTopLevelBinLinking(false); + return _this; } - maybeOutputSaveTree() { - for (const pattern of this.addedPatterns) { - const manifest = this.resolver.getStrictResolvedPattern(pattern); + GlobalAdd.prototype.maybeOutputSaveTree = function maybeOutputSaveTree() { + for (var _iterator = this.addedPatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var pattern = _ref; + + var manifest = this.resolver.getStrictResolvedPattern(pattern); ls(manifest, this.reporter, true); } return (_promise || _load_promise()).default.resolve(); - } + }; - _logSuccessSaveLockfile() { + GlobalAdd.prototype._logSuccessSaveLockfile = function _logSuccessSaveLockfile() { // noop - } -} + }; + + return GlobalAdd; +}((_add || _load_add()).Add); -const path = __webpack_require__(1); +var path = __webpack_require__(0); function hasWrapper(flags, args) { return args[0] !== 'bin' && args[0] !== 'dir'; } function ls(manifest, reporter, saved) { - const bins = manifest.bin ? (0, (_keys || _load_keys()).default)(manifest.bin) : []; - const human = `${manifest.name}@${manifest.version}`; + var bins = manifest.bin ? (0, (_keys || _load_keys()).default)(manifest.bin) : []; + var human = `${manifest.name}@${manifest.version}`; if (bins.length) { if (saved) { reporter.success(reporter.lang('packageInstalledWithBinaries', human)); @@ -34218,137 +35783,104 @@ function ls(manifest, reporter, saved) { } var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('global', { - add: (() => { - var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + add(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { yield updateCwd(config); - const updateBins = yield initUpdateBins(config, reporter, flags); + var updateBins = yield initUpdateBins(config, reporter, flags); if (args.indexOf('yarn') !== -1) { reporter.warn(reporter.lang('packageContainsYarnAsGlobal')); } // install module - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - const install = new GlobalAdd(args, flags, config, reporter, lockfile); + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); + var install = new GlobalAdd(args, flags, config, reporter, lockfile); yield install.init(); // link binaries yield updateBins(); - }); - - function add(_x14, _x15, _x16, _x17) { - return _ref8.apply(this, arguments); - } + })(); + }, - return add; - })(), - bin: (() => { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + bin(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { reporter.log((yield getBinFolder(config, flags)), { force: true }); - }); - - function bin(_x18, _x19, _x20, _x21) { - return _ref9.apply(this, arguments); - } + })(); + }, - return bin; - })(), - dir: function dir(config, reporter, flags, args) { + dir(config, reporter, flags, args) { reporter.log(config.globalFolder, { force: true }); return (_promise || _load_promise()).default.resolve(); }, - ls: (() => { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - reporter.warn(`\`yarn global ls\` is deprecated. Please use \`yarn global list\`.`); - yield _list(config, reporter, flags, args); - }); - function ls(_x22, _x23, _x24, _x25) { - return _ref10.apply(this, arguments); - } - - return ls; - })(), - list: (() => { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - yield _list(config, reporter, flags, args); - }); + ls(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + reporter.warn(`\`yarn global ls\` is deprecated. Please use \`yarn global list\`.`); + yield list(config, reporter, flags, args); + })(); + }, - function list(_x26, _x27, _x28, _x29) { - return _ref11.apply(this, arguments); - } + list(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield list(config, reporter, flags, args); + })(); + }, - return list; - })(), - remove: (() => { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + remove(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { yield updateCwd(config); - const updateBins = yield initUpdateBins(config, reporter, flags); + var updateBins = yield initUpdateBins(config, reporter, flags); // remove module yield (0, (_remove || _load_remove()).run)(config, reporter, flags, args); // remove binaries yield updateBins(); - }); - - function remove(_x30, _x31, _x32, _x33) { - return _ref12.apply(this, arguments); - } + })(); + }, - return remove; - })(), - upgrade: (() => { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + upgrade(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { yield updateCwd(config); - const updateBins = yield initUpdateBins(config, reporter, flags); + var updateBins = yield initUpdateBins(config, reporter, flags); // upgrade module yield (0, (_upgrade || _load_upgrade()).run)(config, reporter, flags, args); // update binaries yield updateBins(); - }); - - function upgrade(_x34, _x35, _x36, _x37) { - return _ref13.apply(this, arguments); - } + })(); + }, - return upgrade; - })(), - upgradeInteractive: (() => { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + upgradeInteractive(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { yield updateCwd(config); - const updateBins = yield initUpdateBins(config, reporter, flags); + var updateBins = yield initUpdateBins(config, reporter, flags); // upgrade module yield (0, (_upgradeInteractive || _load_upgradeInteractive()).run)(config, reporter, flags, args); // update binaries yield updateBins(); - }); - - function upgradeInteractive(_x38, _x39, _x40, _x41) { - return _ref14.apply(this, arguments); - } - - return upgradeInteractive; - })() -}); + })(); + } +}), + run = _buildSubCommands.run, + _setFlags = _buildSubCommands.setFlags; -const run = _buildSubCommands.run, - _setFlags = _buildSubCommands.setFlags; exports.run = run; function setFlags(commander) { _setFlags(commander); + commander.description('Installs packages globally on your operating system.'); commander.option('--prefix ', 'bin prefix to use to install binaries'); + commander.option('--latest', 'upgrade to the latest version of packages'); } /***/ }), -/* 79 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34362,19 +35894,19 @@ exports.run = exports.getToken = undefined; var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let getCredentials = (() => { +var getCredentials = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { - var _config$registries$ya = config.registries.yarn.config; - let username = _config$registries$ya.username, + var _config$registries$ya = config.registries.yarn.config, + username = _config$registries$ya.username, email = _config$registries$ya.email; @@ -34396,21 +35928,22 @@ let getCredentials = (() => { } } - yield config.registries.yarn.saveHomeConfig({ username: username, email: email }); + yield config.registries.yarn.saveHomeConfig({ username, email }); - return { username: username, email: email }; + return { username, email }; }); return function getCredentials(_x, _x2) { return _ref.apply(this, arguments); }; -})(); +}(); -let getToken = exports.getToken = (() => { +var getToken = exports.getToken = function () { var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { - let name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + var flags = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - const auth = config.registries.npm.getAuth(name); + var auth = config.registries.npm.getAuth(name); if (auth) { config.registries.npm.setToken(auth); return function revoke() { @@ -34419,7 +35952,7 @@ let getToken = exports.getToken = (() => { }; } - const env = process.env.YARN_AUTH_TOKEN || process.env.NPM_AUTH_TOKEN; + var env = process.env.YARN_AUTH_TOKEN || process.env.NPM_AUTH_TOKEN; if (env) { config.registries.npm.setToken(`Bearer ${env}`); return function revoke() { @@ -34428,8 +35961,13 @@ let getToken = exports.getToken = (() => { }; } + // make sure we're not running in non-interactive mode before asking for login + if (flags.nonInteractive || config.nonInteractive) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('nonInteractiveNoToken')); + } + // - const creds = yield getCredentials(config, reporter); + var creds = yield getCredentials(config, reporter); if (!creds) { reporter.warn(reporter.lang('loginAsPublic')); return function revoke() { @@ -34438,39 +35976,39 @@ let getToken = exports.getToken = (() => { }; } - const username = creds.username, - email = creds.email; + var username = creds.username, + email = creds.email; - const password = yield reporter.question(reporter.lang('npmPassword'), { + var password = yield reporter.question(reporter.lang('npmPassword'), { password: true, required: true }); // - const userobj = { + var userobj = { _id: `org.couchdb.user:${username}`, name: username, - password: password, - email: email, + password, + email, type: 'user', roles: [], date: new Date().toISOString() }; // - const res = yield config.registries.npm.request(`-/user/org.couchdb.user:${encodeURIComponent(username)}`, { + var res = yield config.registries.npm.request(`-/user/org.couchdb.user:${encodeURIComponent(username)}`, { method: 'PUT', body: userobj, - auth: { username: username, password: password, email: email } + auth: { username, password, email } }); if (res && res.ok) { reporter.success(reporter.lang('loggedIn')); - const token = res.token; + var token = res.token; config.registries.npm.setToken(`Bearer ${token}`); - return (() => { + return function () { var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { reporter.success(reporter.lang('revokedToken')); yield config.registries.npm.request(`-/user/token/${token}`, { @@ -34483,26 +36021,26 @@ let getToken = exports.getToken = (() => { } return revoke; - })(); + }(); } else { throw new (_errors || _load_errors()).MessageError(reporter.lang('incorrectCredentials')); } }); - return function getToken(_x4, _x5) { + return function getToken(_x3, _x4) { return _ref2.apply(this, arguments); }; -})(); +}(); -let run = exports.run = (() => { +var run = exports.run = function () { var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { yield getCredentials(config, reporter); }); - return function run(_x6, _x7, _x8, _x9) { + return function run(_x7, _x8, _x9, _x10) { return _ref4.apply(this, arguments); }; -})(); +}(); exports.hasWrapper = hasWrapper; exports.setFlags = setFlags; @@ -34510,7 +36048,7 @@ exports.setFlags = setFlags; var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -34519,10 +36057,12 @@ function hasWrapper(commander, args) { return true; } -function setFlags(commander) {} +function setFlags(commander) { + commander.description('Stores registry username and email.'); +} /***/ }), -/* 80 */ +/* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34535,113 +36075,121 @@ Object.defineProperty(exports, "__esModule", { var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } -var _toConsumableArray2; +var _getIterator2; -function _load_toConsumableArray() { - return _toConsumableArray2 = _interopRequireDefault(__webpack_require__(32)); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _assign; function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); + return _assign = _interopRequireDefault(__webpack_require__(17)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } var _path; function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); + return _path = _interopRequireDefault(__webpack_require__(0)); } var _invariant; function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); + return _invariant = _interopRequireDefault(__webpack_require__(9)); } var _semver; function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(19)); + return _semver = _interopRequireDefault(__webpack_require__(21)); } var _validate; function _load_validate() { - return _validate = __webpack_require__(84); + return _validate = __webpack_require__(90); } var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(16)); + return _lockfile = _interopRequireDefault(__webpack_require__(20)); } var _packageReference; function _load_packageReference() { - return _packageReference = _interopRequireDefault(__webpack_require__(404)); + return _packageReference = _interopRequireDefault(__webpack_require__(419)); } var _index; function _load_index() { - return _index = __webpack_require__(38); + return _index = __webpack_require__(41); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _version; function _load_version() { - return _version = _interopRequireWildcard(__webpack_require__(152)); + return _version = _interopRequireWildcard(__webpack_require__(159)); } var _workspaceResolver; function _load_workspaceResolver() { - return _workspaceResolver = _interopRequireDefault(__webpack_require__(415)); + return _workspaceResolver = _interopRequireDefault(__webpack_require__(430)); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _normalizePattern4; function _load_normalizePattern() { - return _normalizePattern4 = __webpack_require__(39); + return _normalizePattern4 = __webpack_require__(42); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const micromatch = __webpack_require__(93); +var micromatch = __webpack_require__(77); + +var PackageRequest = function () { + function PackageRequest(req, resolver) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageRequest); -class PackageRequest { - constructor(req, resolver) { this.parentRequest = req.parentRequest; this.parentNames = req.parentNames || []; this.lockfile = resolver.lockfile; @@ -34652,19 +36200,21 @@ class PackageRequest { this.pattern = req.pattern; this.config = resolver.config; this.foundInfo = null; - - resolver.usedRegistries.add(req.registry); } - getLocked(remoteType) { + PackageRequest.prototype.init = function init() { + this.resolver.usedRegistries.add(this.registry); + }; + + PackageRequest.prototype.getLocked = function getLocked(remoteType) { // always prioritise root lockfile - const shrunk = this.lockfile.getLocked(this.pattern); + var shrunk = this.lockfile.getLocked(this.pattern); if (shrunk && shrunk.resolved) { - const resolvedParts = (_version || _load_version()).explodeHashedUrl(shrunk.resolved); + var resolvedParts = (_version || _load_version()).explodeHashedUrl(shrunk.resolved); // Detect Git protocols (git://HOST/PATH or git+PROTOCOL://HOST/PATH) - const preferredRemoteType = /^git(\+[a-z0-9]+)?:\/\//.test(resolvedParts.url) ? 'git' : remoteType; + var preferredRemoteType = /^git(\+[a-z0-9]+)?:\/\//.test(resolvedParts.url) ? 'git' : remoteType; return { name: shrunk.name, @@ -34677,32 +36227,29 @@ class PackageRequest { hash: resolvedParts.hash, registry: shrunk.registry }, - optionalDependencies: shrunk.optionalDependencies, - dependencies: shrunk.dependencies + optionalDependencies: shrunk.optionalDependencies || {}, + dependencies: shrunk.dependencies || {}, + prebuiltVariants: shrunk.prebuiltVariants || {} }; } else { return null; } - } + }; /** * If the input pattern matches a registry one then attempt to find it on the registry. * Otherwise fork off to an exotic resolver if one matches. */ - findVersionOnRegistry(pattern) { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref = yield _this.normalize(pattern); - - const range = _ref.range, - name = _ref.name; - + PackageRequest.prototype.findVersionOnRegistry = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) { + var _ref2 = yield this.normalize(pattern), + range = _ref2.range, + name = _ref2.name; - const exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range); + var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range); if (exoticResolver) { - let data = yield _this.findExoticVersionInfo(exoticResolver, range); + var data = yield this.findExoticVersionInfo(exoticResolver, range); // clone data as we're manipulating it in place and this could be resolved multiple // times @@ -34716,37 +36263,50 @@ class PackageRequest { return data; } - const Resolver = _this.getRegistryResolver(); - const resolver = new Resolver(_this, name, range); - return resolver.resolve(); - })(); - } + var Resolver = this.getRegistryResolver(); + var resolver = new Resolver(this, name, range); + try { + return yield resolver.resolve(); + } catch (err) { + // if it is not an error thrown by yarn and it has a parent request, + // thow a more readable error + if (!(err instanceof (_errors || _load_errors()).MessageError) && this.parentRequest && this.parentRequest.pattern) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('requiredPackageNotFoundRegistry', pattern, this.parentRequest.pattern, this.registry)); + } + throw err; + } + }); + + function findVersionOnRegistry(_x) { + return _ref.apply(this, arguments); + } + + return findVersionOnRegistry; + }(); /** * Get the registry resolver associated with this package request. */ - getRegistryResolver() { - const Resolver = (_index || _load_index()).registries[this.registry]; + PackageRequest.prototype.getRegistryResolver = function getRegistryResolver() { + var Resolver = (_index || _load_index()).registries[this.registry]; if (Resolver) { return Resolver; } else { throw new (_errors || _load_errors()).MessageError(this.reporter.lang('unknownRegistryResolver', this.registry)); } - } - - normalizeRange(pattern) { - var _this2 = this; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + PackageRequest.prototype.normalizeRange = function () { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) { if (pattern.indexOf(':') > -1 || pattern.indexOf('@') > -1 || (0, (_index || _load_index()).getExoticResolver)(pattern)) { return pattern; } if (!(_semver || _load_semver()).default.validRange(pattern)) { try { - if (yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(_this2.config.cwd, pattern, (_constants || _load_constants()).NODE_PACKAGE_JSON))) { - _this2.reporter.warn(_this2.reporter.lang('implicitFileDeprecated', pattern)); + if (yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(this.config.cwd, pattern, (_constants || _load_constants()).NODE_PACKAGE_JSON))) { + this.reporter.warn(this.reporter.lang('implicitFileDeprecated', pattern)); return `file:${pattern}`; } } catch (err) { @@ -34755,234 +36315,292 @@ class PackageRequest { } return pattern; - })(); - } + }); - normalize(pattern) { - var _this3 = this; + function normalizeRange(_x2) { + return _ref3.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _normalizePattern = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern); + return normalizeRange; + }(); - const name = _normalizePattern.name, - range = _normalizePattern.range, - hasVersion = _normalizePattern.hasVersion; + PackageRequest.prototype.normalize = function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) { + var _normalizePattern = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern), + name = _normalizePattern.name, + range = _normalizePattern.range, + hasVersion = _normalizePattern.hasVersion; - const newRange = yield _this3.normalizeRange(range); - return { name: name, range: newRange, hasVersion: hasVersion }; - })(); - } + var newRange = yield this.normalizeRange(range); + return { name, range: newRange, hasVersion }; + }); + + function normalize(_x3) { + return _ref4.apply(this, arguments); + } + + return normalize; + }(); /** * Construct an exotic resolver instance with the input `ExoticResolver` and `range`. */ - findExoticVersionInfo(ExoticResolver, range) { - const resolver = new ExoticResolver(this, range); + PackageRequest.prototype.findExoticVersionInfo = function findExoticVersionInfo(ExoticResolver, range) { + var resolver = new ExoticResolver(this, range); return resolver.resolve(); - } + }; /** * If the current pattern matches an exotic resolver then delegate to it or else try * the registry. */ - findVersionInfo() { - const exoticResolver = (0, (_index || _load_index()).getExoticResolver)(this.pattern); + PackageRequest.prototype.findVersionInfo = function findVersionInfo() { + var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(this.pattern); if (exoticResolver) { return this.findExoticVersionInfo(exoticResolver, this.pattern); } else if ((_workspaceResolver || _load_workspaceResolver()).default.isWorkspace(this.pattern, this.resolver.workspaceLayout)) { (0, (_invariant || _load_invariant()).default)(this.resolver.workspaceLayout, 'expected workspaceLayout'); - const resolver = new (_workspaceResolver || _load_workspaceResolver()).default(this, this.pattern, this.resolver.workspaceLayout); + var resolver = new (_workspaceResolver || _load_workspaceResolver()).default(this, this.pattern, this.resolver.workspaceLayout); return resolver.resolve(); } else { return this.findVersionOnRegistry(this.pattern); } - } + }; - reportResolvedRangeMatch(info, resolved) {} + PackageRequest.prototype.reportResolvedRangeMatch = function reportResolvedRangeMatch(info, resolved) {}; /** * Do the final resolve of a package that had a match with an existing version. * After all unique versions have been discovered, so the best available version * is found. */ - resolveToExistingVersion(info) { - // get final resolved version - var _normalizePattern2 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern); - const range = _normalizePattern2.range, - name = _normalizePattern2.name; - const solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; - const resolved = this.resolver.getHighestRangeVersionMatch(name, solvedRange, info); + PackageRequest.prototype.resolveToExistingVersion = function resolveToExistingVersion(info) { + // get final resolved version + var _normalizePattern2 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern), + range = _normalizePattern2.range, + name = _normalizePattern2.name; + + var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; + var resolved = this.resolver.getHighestRangeVersionMatch(name, solvedRange, info); (0, (_invariant || _load_invariant()).default)(resolved, 'should have a resolved reference'); this.reportResolvedRangeMatch(info, resolved); - const ref = resolved._reference; + var ref = resolved._reference; (0, (_invariant || _load_invariant()).default)(ref, 'Resolved package info has no package reference'); ref.addRequest(this); ref.addPattern(this.pattern, resolved); ref.addOptional(this.optional); - } + }; /** * TODO description */ - find(_ref2) { - var _this4 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let fresh = _ref2.fresh, - frozen = _ref2.frozen; + + PackageRequest.prototype.find = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref6) { + var fresh = _ref6.fresh, + frozen = _ref6.frozen; // find version info for this package pattern - const info = yield _this4.findVersionInfo(); + var info = yield this.findVersionInfo(); + + if (!(_semver || _load_semver()).default.valid(info.version)) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('invalidPackageVersion', info.name, info.version)); + } info.fresh = fresh; - (0, (_validate || _load_validate()).cleanDependencies)(info, false, _this4.reporter, function () { + (0, (_validate || _load_validate()).cleanDependencies)(info, false, this.reporter, function () { // swallow warnings }); // check if while we were resolving this dep we've already resolved one that satisfies // the same range - var _normalizePattern3 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(_this4.pattern); - - const range = _normalizePattern3.range, - name = _normalizePattern3.name; + var _normalizePattern3 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern), + range = _normalizePattern3.range, + name = _normalizePattern3.name; - const solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; - const resolved = !info.fresh || frozen ? _this4.resolver.getExactVersionMatch(name, solvedRange, info) : _this4.resolver.getHighestRangeVersionMatch(name, solvedRange, info); + var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; + var resolved = !info.fresh || frozen ? this.resolver.getExactVersionMatch(name, solvedRange, info) : this.resolver.getHighestRangeVersionMatch(name, solvedRange, info); if (resolved) { - _this4.resolver.reportPackageWithExistingVersion(_this4, info); + this.resolver.reportPackageWithExistingVersion(this, info); return; } - if (info.flat && !_this4.resolver.flat) { - throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('flatGlobalError')); + if (info.flat && !this.resolver.flat) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('flatGlobalError')); } // validate version info - PackageRequest.validateVersionInfo(info, _this4.reporter); + PackageRequest.validateVersionInfo(info, this.reporter); // - const remote = info._remote; + var remote = info._remote; (0, (_invariant || _load_invariant()).default)(remote, 'Missing remote'); // set package reference - const ref = new (_packageReference || _load_packageReference()).default(_this4, info, remote); - ref.addPattern(_this4.pattern, info); - ref.addOptional(_this4.optional); + var ref = new (_packageReference || _load_packageReference()).default(this, info, remote); + ref.addPattern(this.pattern, info); + ref.addOptional(this.optional); ref.setFresh(fresh); info._reference = ref; info._remote = remote; // start installation of dependencies - const promises = []; - const deps = []; - const parentNames = [].concat((0, (_toConsumableArray2 || _load_toConsumableArray()).default)(_this4.parentNames), [name]); + var promises = []; + var deps = []; + var parentNames = [].concat(this.parentNames, [name]); // normal deps - for (const depName in info.dependencies) { - const depPattern = depName + '@' + info.dependencies[depName]; + for (var depName in info.dependencies) { + var depPattern = depName + '@' + info.dependencies[depName]; deps.push(depPattern); - promises.push(_this4.resolver.find({ + promises.push(this.resolver.find({ pattern: depPattern, registry: remote.registry, // dependencies of optional dependencies should themselves be optional - optional: _this4.optional, - parentRequest: _this4, - parentNames: parentNames + optional: this.optional, + parentRequest: this, + parentNames })); } // optional deps - for (const depName in info.optionalDependencies) { - const depPattern = depName + '@' + info.optionalDependencies[depName]; - deps.push(depPattern); - promises.push(_this4.resolver.find({ - pattern: depPattern, + for (var _depName in info.optionalDependencies) { + var _depPattern = _depName + '@' + info.optionalDependencies[_depName]; + deps.push(_depPattern); + promises.push(this.resolver.find({ + pattern: _depPattern, registry: remote.registry, optional: true, - parentRequest: _this4, - parentNames: parentNames + parentRequest: this, + parentNames })); } - if (remote.type === 'workspace' && !_this4.config.production) { + if (remote.type === 'workspace' && !this.config.production) { // workspaces support dev dependencies - for (const depName in info.devDependencies) { - const depPattern = depName + '@' + info.devDependencies[depName]; - deps.push(depPattern); - promises.push(_this4.resolver.find({ - pattern: depPattern, + for (var _depName2 in info.devDependencies) { + var _depPattern2 = _depName2 + '@' + info.devDependencies[_depName2]; + deps.push(_depPattern2); + promises.push(this.resolver.find({ + pattern: _depPattern2, registry: remote.registry, optional: false, - parentRequest: _this4, - parentNames: parentNames + parentRequest: this, + parentNames })); } } - for (const promise of promises) { + for (var _iterator = promises, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref7; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref7 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref7 = _i.value; + } + + var promise = _ref7; + yield promise; } ref.addDependencies(deps); // Now that we have all dependencies, it's safe to propagate optional - for (const otherRequest of ref.requests.slice(1)) { + for (var _iterator2 = ref.requests.slice(1), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref8; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref8 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref8 = _i2.value; + } + + var otherRequest = _ref8; + ref.addOptional(otherRequest.optional); } - })(); - } + }); + + function find(_x4) { + return _ref5.apply(this, arguments); + } + + return find; + }(); /** * TODO description */ - static validateVersionInfo(info, reporter) { + PackageRequest.validateVersionInfo = function validateVersionInfo(info, reporter) { // human readable name to use in errors - const human = `${info.name}@${info.version}`; + var human = `${info.name}@${info.version}`; info.version = PackageRequest.getPackageVersion(info); - for (const key of (_constants || _load_constants()).REQUIRED_PACKAGE_KEYS) { + for (var _iterator3 = (_constants || _load_constants()).REQUIRED_PACKAGE_KEYS, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref9; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref9 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref9 = _i3.value; + } + + var key = _ref9; + if (!info[key]) { throw new (_errors || _load_errors()).MessageError(reporter.lang('missingRequiredPackageKey', human, key)); } } - } + }; /** * Returns the package version if present, else defaults to the uid */ - static getPackageVersion(info) { + PackageRequest.getPackageVersion = function getPackageVersion(info) { // TODO possibly reconsider this behaviour return info.version === undefined ? info._uid : info.version; - } + }; /** * Gets all of the outdated packages and sorts them appropriately */ - static getOutdatedPackages(lockfile, install, config, reporter, filterByPatterns, flags) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref3 = yield install.fetchRequestFromCwd(); - - const reqPatterns = _ref3.requests, - workspaceLayout = _ref3.workspaceLayout; + PackageRequest.getOutdatedPackages = function () { + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile, install, config, reporter, filterByPatterns, flags) { + var _ref11 = yield install.fetchRequestFromCwd(), + reqPatterns = _ref11.requests, + workspaceLayout = _ref11.workspaceLayout; // Filter out workspace patterns if necessary - let depReqPatterns = workspaceLayout ? reqPatterns.filter(function (p) { + + var depReqPatterns = workspaceLayout ? reqPatterns.filter(function (p) { return !workspaceLayout.getManifestByPattern(p.pattern); }) : reqPatterns; // filter the list down to just the packages requested. // prevents us from having to query the metadata for all packages. if (filterByPatterns && filterByPatterns.length) { - const filterByNames = filterByPatterns.map(function (pattern) { + var filterByNames = filterByPatterns.map(function (pattern) { return (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern).name; }); depReqPatterns = depReqPatterns.filter(function (dep) { @@ -34990,47 +36608,47 @@ class PackageRequest { }); } - const deps = yield (_promise || _load_promise()).default.all(depReqPatterns.map((() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref4) { - let pattern = _ref4.pattern, - hint = _ref4.hint, - workspaceName = _ref4.workspaceName, - workspaceLoc = _ref4.workspaceLoc; + var deps = yield (_promise || _load_promise()).default.all(depReqPatterns.map(function () { + var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref13) { + var pattern = _ref13.pattern, + hint = _ref13.hint, + workspaceName = _ref13.workspaceName, + workspaceLoc = _ref13.workspaceLoc; - const locked = lockfile.getLocked(pattern); + var locked = lockfile.getLocked(pattern); if (!locked) { throw new (_errors || _load_errors()).MessageError(reporter.lang('lockfileOutdated')); } - const name = locked.name, - current = locked.version; + var name = locked.name, + current = locked.version; - let latest = ''; - let wanted = ''; - let url = ''; + var latest = ''; + var wanted = ''; + var url = ''; - const normalized = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern); + var normalized = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern); if ((0, (_index || _load_index()).getExoticResolver)(pattern) || (0, (_index || _load_index()).getExoticResolver)(normalized.range)) { latest = wanted = 'exotic'; url = normalized.range; } else { - const registry = config.registries[locked.registry]; + var registry = config.registries[locked.registry]; - var _ref6 = yield registry.checkOutdated(config, name, normalized.range); + var _ref14 = yield registry.checkOutdated(config, name, normalized.range); - latest = _ref6.latest; - wanted = _ref6.wanted; - url = _ref6.url; + latest = _ref14.latest; + wanted = _ref14.wanted; + url = _ref14.url; } return { - name: name, - current: current, - wanted: wanted, - latest: latest, - url: url, - hint: hint, + name, + current, + wanted, + latest, + url, + hint, range: normalized.range, upgradeTo: '', workspaceName: workspaceName || '', @@ -35038,29 +36656,38 @@ class PackageRequest { }; }); - return function (_x) { - return _ref5.apply(this, arguments); + return function (_x11) { + return _ref12.apply(this, arguments); }; - })())); + }())); // Make sure to always output `exotic` versions to be compatible with npm - const isDepOld = function isDepOld(_ref7) { - let current = _ref7.current, - latest = _ref7.latest, - wanted = _ref7.wanted; + var isDepOld = function isDepOld(_ref15) { + var current = _ref15.current, + latest = _ref15.latest, + wanted = _ref15.wanted; return latest === 'exotic' || (_semver || _load_semver()).default.lt(current, wanted) || (_semver || _load_semver()).default.lt(current, latest); }; - const orderByName = function orderByName(depA, depB) { + var orderByName = function orderByName(depA, depB) { return depA.name.localeCompare(depB.name); }; return deps.filter(isDepOld).sort(orderByName); - })(); - } -} + }); + + function getOutdatedPackages(_x5, _x6, _x7, _x8, _x9, _x10) { + return _ref10.apply(this, arguments); + } + + return getOutdatedPackages; + }(); + + return PackageRequest; +}(); + exports.default = PackageRequest; /***/ }), -/* 81 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35069,8 +36696,19 @@ exports.default = PackageRequest; Object.defineProperty(exports, "__esModule", { value: true }); -class BaseResolver { - constructor(request, fragment) { + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BaseResolver = function () { + function BaseResolver(request, fragment) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseResolver); + this.resolver = request.resolver; this.reporter = request.reporter; this.fragment = fragment; @@ -35080,24 +36718,27 @@ class BaseResolver { this.config = request.config; } - fork(Resolver, resolveArg) { + BaseResolver.prototype.fork = function fork(Resolver, resolveArg) { for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; } - const resolver = new (Function.prototype.bind.apply(Resolver, [null].concat([this.request], args)))(); + var resolver = new (Function.prototype.bind.apply(Resolver, [null].concat([this.request], args)))(); resolver.registry = this.registry; return resolver.resolve(resolveArg); - } + }; - resolve(resolveArg) { + BaseResolver.prototype.resolve = function resolve(resolveArg) { throw new Error('Not implemented'); - } -} + }; + + return BaseResolver; +}(); + exports.default = BaseResolver; /***/ }), -/* 82 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35110,79 +36751,101 @@ Object.defineProperty(exports, "__esModule", { var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); } var _index; function _load_index() { - return _index = __webpack_require__(38); + return _index = __webpack_require__(41); } var _misc; function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(15)); + return _misc = _interopRequireWildcard(__webpack_require__(19)); } var _version; function _load_version() { - return _version = _interopRequireWildcard(__webpack_require__(152)); + return _version = _interopRequireWildcard(__webpack_require__(159)); } var _guessName; function _load_guessName() { - return _guessName = _interopRequireDefault(__webpack_require__(149)); + return _guessName = _interopRequireDefault(__webpack_require__(111)); } var _index2; function _load_index2() { - return _index2 = __webpack_require__(37); + return _index2 = __webpack_require__(40); } var _exoticResolver; function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(60)); + return _exoticResolver = _interopRequireDefault(__webpack_require__(63)); } var _git; function _load_git() { - return _git = _interopRequireDefault(__webpack_require__(148)); + return _git = _interopRequireDefault(__webpack_require__(155)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const urlParse = __webpack_require__(14).parse; +var urlParse = __webpack_require__(18).parse; -const GIT_PROTOCOL_PATTERN = /git\+.+:/; +var GIT_PROTOCOL_PATTERN = /git\+.+:/; // we purposefully omit https and http as those are only valid if they end in the .git extension -const GIT_PROTOCOLS = ['git:', 'ssh:']; +var GIT_PROTOCOLS = ['git:', 'ssh:']; -const GIT_HOSTS = ['github.com', 'gitlab.com', 'bitbucket.com', 'bitbucket.org']; +var GIT_HOSTS = ['github.com', 'gitlab.com', 'bitbucket.com', 'bitbucket.org']; -class GitResolver extends (_exoticResolver || _load_exoticResolver()).default { - constructor(request, fragment) { - super(request, fragment); +var GitResolver = function (_ExoticResolver) { + (0, (_inherits2 || _load_inherits()).default)(GitResolver, _ExoticResolver); - var _versionUtil$explodeH = (_version || _load_version()).explodeHashedUrl(fragment); + function GitResolver(request, fragment) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitResolver); - const url = _versionUtil$explodeH.url, - hash = _versionUtil$explodeH.hash; + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment)); - this.url = url; - this.hash = hash; + var _versionUtil$explodeH = (_version || _load_version()).explodeHashedUrl(fragment), + url = _versionUtil$explodeH.url, + hash = _versionUtil$explodeH.hash; + + _this.url = url; + _this.hash = hash; + return _this; } - static isVersion(pattern) { - const parts = urlParse(pattern); + GitResolver.isVersion = function isVersion(pattern) { + var parts = urlParse(pattern); // this pattern hasn't been exploded yet, we'll hit this code path again later once // we've been normalized #59 @@ -35190,7 +36853,7 @@ class GitResolver extends (_exoticResolver || _load_exoticResolver()).default { return false; } - const pathname = parts.pathname; + var pathname = parts.pathname; if (pathname && pathname.endsWith('.git')) { // ends in .git return true; @@ -35205,31 +36868,31 @@ class GitResolver extends (_exoticResolver || _load_exoticResolver()).default { } if (parts.hostname && parts.path) { - const path = parts.path; + var path = parts.path; if (GIT_HOSTS.indexOf(parts.hostname) >= 0) { // only if dependency is pointing to a git repo, // e.g. facebook/flow and not file in a git repo facebook/flow/archive/v1.0.0.tar.gz - return path.split('/').filter(p => !!p).length === 2; + return path.split('/').filter(function (p) { + return !!p; + }).length === 2; } } return false; - } + }; - resolve(forked) { - var _this = this; + GitResolver.prototype.resolve = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (forked) { + var tryRegistry = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { + var filename = (_index2 || _load_index2()).registries[registry].filename; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let tryRegistry = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { - const filename = (_index2 || _load_index2()).registries[registry].filename; - - const file = yield client.getFile(filename); + var file = yield client.getFile(filename); if (!file) { return null; } - const json = yield config.readJson(`${url}/${filename}`, function () { + var json = yield config.readJson(`${url}/${filename}`, function () { return JSON.parse(file); }); json._uid = commit; @@ -35238,67 +36901,67 @@ class GitResolver extends (_exoticResolver || _load_exoticResolver()).default { type: 'git', reference: url, hash: commit, - registry: registry + registry }; return json; }); - return function tryRegistry(_x) { - return _ref.apply(this, arguments); + return function tryRegistry(_x2) { + return _ref2.apply(this, arguments); }; - })(); + }(); - const url = _this.url; + var url = this.url; // shortcut for hosted git. we will fallback to a GitResolver if the hosted git // optimisations fail which the `forked` flag indicates so we don't get into an // infinite loop - const parts = urlParse(url); + var parts = urlParse(url); if (false) { // check if this git url uses any of the hostnames defined in our hosted git resolvers - for (const name in (_index || _load_index()).hostedGit) { - const Resolver = (_index || _load_index()).hostedGit[name]; + for (var name in (_index || _load_index()).hostedGit) { + var Resolver = (_index || _load_index()).hostedGit[name]; if (Resolver.hostname !== parts.hostname) { continue; } // we have a match! clean up the pathname of url artifacts - let pathname = parts.pathname; + var pathname = parts.pathname; pathname = (_misc || _load_misc()).removePrefix(pathname, '/'); // remove prefixed slash pathname = (_misc || _load_misc()).removeSuffix(pathname, '.git'); // remove .git suffix if present - const url = `${pathname}${_this.hash ? '#' + decodeURIComponent(_this.hash) : ''}`; - return _this.fork(Resolver, false, url); + var _url = `${pathname}${this.hash ? '#' + decodeURIComponent(this.hash) : ''}`; + return this.fork(Resolver, false, _url); } } // get from lockfile - const shrunk = _this.request.getLocked('git'); + var shrunk = this.request.getLocked('git'); if (shrunk) { return shrunk; } - const config = _this.config; + var config = this.config; - const gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); - const client = new (_git || _load_git()).default(config, gitUrl, _this.hash); - const commit = yield client.init(); + var gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); + var client = new (_git || _load_git()).default(config, gitUrl, this.hash); + var commit = yield client.init(); - const file = yield tryRegistry(_this.registry); + var file = yield tryRegistry(this.registry); if (file) { return file; } - for (const registry in (_index2 || _load_index2()).registries) { - if (registry === _this.registry) { + for (var registry in (_index2 || _load_index2()).registries) { + if (registry === this.registry) { continue; } - const file = yield tryRegistry(registry); - if (file) { - return file; + var _file = yield tryRegistry(registry); + if (_file) { + return _file; } } @@ -35315,13 +36978,95 @@ class GitResolver extends (_exoticResolver || _load_exoticResolver()).default { registry: 'npm' } }; - })(); - } -} + }); + + function resolve(_x) { + return _ref.apply(this, arguments); + } + + return resolve; + }(); + + return GitResolver; +}((_exoticResolver || _load_exoticResolver()).default); + exports.default = GitResolver; /***/ }), -/* 83 */ +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.HashStream = undefined; + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); +} + +exports.hash = hash; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var crypto = __webpack_require__(13); +var stream = __webpack_require__(29); + +function hash(content) { + var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md5'; + + return crypto.createHash(type).update(content).digest('hex'); +} + +var HashStream = exports.HashStream = function (_stream$Transform) { + (0, (_inherits2 || _load_inherits()).default)(HashStream, _stream$Transform); + + function HashStream(options) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, HashStream); + + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _stream$Transform.call(this, options)); + + _this._hash = crypto.createHash('sha1'); + _this._updated = false; + return _this; + } + + HashStream.prototype._transform = function _transform(chunk, encoding, callback) { + this._updated = true; + this._hash.update(chunk); + callback(null, chunk); + }; + + HashStream.prototype.getHash = function getHash() { + return this._hash.digest('hex'); + }; + + HashStream.prototype.test = function test(sum) { + return this._updated && sum === this.getHash(); + }; + + return HashStream; +}(stream.Transform); + +/***/ }), +/* 89 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35335,65 +37080,59 @@ exports.execCommand = exports.execFromManifest = exports.executeLifecycleScript var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } -var _keys; +var _getIterator2; -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } -var _toConsumableArray2; +var _keys; -function _load_toConsumableArray() { - return _toConsumableArray2 = _interopRequireDefault(__webpack_require__(32)); +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); } var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); -} - -var _slicedToArray2; - -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(17)); + return _set = _interopRequireDefault(__webpack_require__(15)); } var _stringify; function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(34)); + return _stringify = _interopRequireDefault(__webpack_require__(32)); } var _assign; function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); + return _assign = _interopRequireDefault(__webpack_require__(17)); } var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); + return _extends2 = _interopRequireDefault(__webpack_require__(25)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let makeEnv = exports.makeEnv = (() => { +var makeEnv = exports.makeEnv = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, cwd, config) { - const env = (0, (_extends2 || _load_extends()).default)({ + var env = (0, (_extends2 || _load_extends()).default)({ NODE: process.execPath }, process.env); // Merge in the `env` object specified in .yarnrc - const customEnv = config.getOption('env'); + var customEnv = config.getOption('env'); if (customEnv && typeof customEnv === 'object') { (0, (_assign || _load_assign()).default)(env, customEnv); } @@ -35416,40 +37155,38 @@ let makeEnv = exports.makeEnv = (() => { original: process.argv.slice(2) }); - const manifest = yield config.maybeReadManifest(cwd); + var manifest = yield config.maybeReadManifest(cwd); if (manifest) { if (manifest.scripts && Object.prototype.hasOwnProperty.call(manifest.scripts, stage)) { env.npm_lifecycle_script = manifest.scripts[stage]; } // add npm_package_* - const queue = [['', manifest]]; + var queue = [['', manifest]]; while (queue.length) { var _queue$pop = queue.pop(), - _queue$pop2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_queue$pop, 2); + _key = _queue$pop[0], + val = _queue$pop[1]; - const key = _queue$pop2[0], - val = _queue$pop2[1]; - - if (key[0] === '_') { + if (_key[0] === '_') { continue; } if (typeof val === 'object') { - for (const subKey in val) { - const completeKey = [key, subKey].filter(function (part) { + for (var subKey in val) { + var completeKey = [_key, subKey].filter(function (part) { return !!part; }).join('_'); queue.push([completeKey, val[subKey]]); } - } else if (IGNORE_MANIFEST_KEYS.indexOf(key) < 0) { - let cleanVal = String(val); + } else if (IGNORE_MANIFEST_KEYS.indexOf(_key) < 0) { + var cleanVal = String(val); if (cleanVal.indexOf('\n') >= 0) { cleanVal = (0, (_stringify || _load_stringify()).default)(cleanVal); } //replacing invalid chars with underscore - const cleanKey = key.replace(/[^a-zA-Z0-9_]/g, '_'); + var cleanKey = _key.replace(/[^a-zA-Z0-9_]/g, '_'); env[`npm_package_${cleanKey}`] = cleanVal; } @@ -35457,50 +37194,81 @@ let makeEnv = exports.makeEnv = (() => { } // add npm_config_* - const keys = new (_set || _load_set()).default([].concat((0, (_toConsumableArray2 || _load_toConsumableArray()).default)((0, (_keys || _load_keys()).default)(config.registries.yarn.config)), (0, (_toConsumableArray2 || _load_toConsumableArray()).default)((0, (_keys || _load_keys()).default)(config.registries.npm.config)))); - for (const key of keys) { - if (key.match(/:_/) || IGNORE_CONFIG_KEYS.indexOf(key) >= 0) { + var keys = new (_set || _load_set()).default([].concat((0, (_keys || _load_keys()).default)(config.registries.yarn.config), (0, (_keys || _load_keys()).default)(config.registries.npm.config))); + for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var _key2 = _ref2; + + if (_key2.match(/:_/) || IGNORE_CONFIG_KEYS.indexOf(_key2) >= 0) { continue; } - let val = config.getOption(key); + var _val = config.getOption(_key2); - if (!val) { - val = ''; - } else if (typeof val === 'number') { - val = '' + val; - } else if (typeof val !== 'string') { - val = (0, (_stringify || _load_stringify()).default)(val); + if (!_val) { + _val = ''; + } else if (typeof _val === 'number') { + _val = '' + _val; + } else if (typeof _val !== 'string') { + _val = (0, (_stringify || _load_stringify()).default)(_val); } - if (val.indexOf('\n') >= 0) { - val = (0, (_stringify || _load_stringify()).default)(val); + if (_val.indexOf('\n') >= 0) { + _val = (0, (_stringify || _load_stringify()).default)(_val); } - const cleanKey = key.replace(/^_+/, ''); - const envKey = `npm_config_${cleanKey}`.replace(/[^a-zA-Z0-9_]/g, '_'); - env[envKey] = val; + var _cleanKey = _key2.replace(/^_+/, ''); + var envKey = `npm_config_${_cleanKey}`.replace(/[^a-zA-Z0-9_]/g, '_'); + env[envKey] = _val; } // split up the path - const envPath = env[(_constants || _load_constants()).ENV_PATH_KEY]; - const pathParts = envPath ? envPath.split(path.delimiter) : []; + var envPath = env[(_constants || _load_constants()).ENV_PATH_KEY]; + var pathParts = envPath ? envPath.split(path.delimiter) : []; // Include node-gyp version that was bundled with the current Node.js version, // if available. pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin')); pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin')); + // Include node-gyp version from homebrew managed npm, if available. + pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'libexec', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin')); // Add global bin folder if it is not present already, as some packages depend // on a globally-installed version of node-gyp. - const globalBin = yield (0, (_global || _load_global()).getBinFolder)(config, {}); + var globalBin = yield (0, (_global || _load_global()).getBinFolder)(config, {}); if (pathParts.indexOf(globalBin) === -1) { pathParts.unshift(globalBin); } // add .bin folders to PATH - for (const registry of (0, (_keys || _load_keys()).default)((_index || _load_index()).registries)) { - const binFolder = path.join(config.registries[registry].folder, '.bin'); + for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var registry = _ref3; + + var binFolder = path.join(config.registries[registry].folder, '.bin'); + if (config.workspacesEnabled && config.workspaceRootFolder) { + pathParts.unshift(path.join(config.workspaceRootFolder, binFolder)); + } pathParts.unshift(path.join(config.linkFolder, binFolder)); pathParts.unshift(path.join(cwd, binFolder)); } @@ -35518,27 +37286,37 @@ let makeEnv = exports.makeEnv = (() => { return function makeEnv(_x, _x2, _x3) { return _ref.apply(this, arguments); }; -})(); +}(); -let executeLifecycleScript = exports.executeLifecycleScript = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, config, cwd, cmd, spinner) { +var executeLifecycleScript = exports.executeLifecycleScript = function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, config, cwd, cmd, spinner, customShell) { // if we don't have a spinner then pipe everything to the terminal - const stdio = spinner ? undefined : 'inherit'; + var stdio = spinner ? undefined : 'inherit'; - const env = yield makeEnv(stage, cwd, config); + var env = yield makeEnv(stage, cwd, config); yield checkForGypIfNeeded(config, cmd, env[(_constants || _load_constants()).ENV_PATH_KEY].split(path.delimiter)); // get shell - if (process.platform === 'win32') { + var sh = 'sh'; + var shFlag = '-c'; + + var windowsVerbatimArguments = undefined; + + if (customShell) { + sh = customShell; + } else if (process.platform === 'win32') { + sh = process.env.comspec || 'cmd'; + shFlag = '/d /s /c'; + windowsVerbatimArguments = true; // handle windows run scripts starting with a relative path cmd = (0, (_fixCmdWinSlashes || _load_fixCmdWinSlashes()).fixCmdWinSlashes)(cmd); } - let updateProgress; + var updateProgress = void 0; if (spinner) { updateProgress = function updateProgress(data) { - const dataStr = data.toString() // turn buffer into string + var dataStr = data.toString() // turn buffer into string .trim(); // trim whitespace invariant(spinner && spinner.tick, 'We should have spinner and its ticker here'); @@ -35551,23 +37329,23 @@ let executeLifecycleScript = exports.executeLifecycleScript = (() => { } }; } - const stdout = yield (_child || _load_child()).spawn(cmd, [], { shell: true, cwd: cwd, env: env, stdio: stdio }, updateProgress); + var stdout = yield (_child || _load_child()).spawn(sh, [shFlag, cmd], { cwd, env, stdio, windowsVerbatimArguments }, updateProgress); - return { cwd: cwd, command: cmd, stdout: stdout }; + return { cwd, command: cmd, stdout }; }); - return function executeLifecycleScript(_x4, _x5, _x6, _x7, _x8) { - return _ref2.apply(this, arguments); + return function executeLifecycleScript(_x4, _x5, _x6, _x7, _x8, _x9) { + return _ref4.apply(this, arguments); }; -})(); +}(); -let _checkForGyp = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, paths) { - const reporter = config.reporter; +var _checkForGyp = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, paths) { + var reporter = config.reporter; // Check every directory in the PATH - const allChecks = yield (_promise || _load_promise()).default.all(paths.map(function (dir) { + var allChecks = yield (_promise || _load_promise()).default.all(paths.map(function (dir) { return (0, (_fs || _load_fs()).exists)(path.join(dir, 'node-gyp')); })); if (allChecks.some(Boolean)) { @@ -35584,36 +37362,36 @@ let _checkForGyp = (() => { } }); - return function _checkForGyp(_x9, _x10) { - return _ref3.apply(this, arguments); + return function _checkForGyp(_x10, _x11) { + return _ref5.apply(this, arguments); }; -})(); +}(); -let execFromManifest = exports.execFromManifest = (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, commandName, cwd) { - const pkg = yield config.maybeReadManifest(cwd); +var execFromManifest = exports.execFromManifest = function () { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, commandName, cwd) { + var pkg = yield config.maybeReadManifest(cwd); if (!pkg || !pkg.scripts) { return; } - const cmd = pkg.scripts[commandName]; + var cmd = pkg.scripts[commandName]; if (cmd) { yield execCommand(commandName, config, cmd, cwd); } }); - return function execFromManifest(_x11, _x12, _x13) { - return _ref4.apply(this, arguments); + return function execFromManifest(_x12, _x13, _x14) { + return _ref6.apply(this, arguments); }; -})(); +}(); -let execCommand = exports.execCommand = (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, config, cmd, cwd) { - const reporter = config.reporter; +var execCommand = exports.execCommand = function () { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, config, cmd, cwd, customShell) { + var reporter = config.reporter; try { reporter.command(cmd); - yield executeLifecycleScript(stage, config, cwd, cmd); + yield executeLifecycleScript(stage, config, cwd, cmd, undefined, customShell); return (_promise || _load_promise()).default.resolve(); } catch (err) { if (err instanceof (_errors || _load_errors()).ProcessTermError) { @@ -35624,72 +37402,72 @@ let execCommand = exports.execCommand = (() => { } }); - return function execCommand(_x14, _x15, _x16, _x17) { - return _ref5.apply(this, arguments); + return function execCommand(_x15, _x16, _x17, _x18, _x19) { + return _ref7.apply(this, arguments); }; -})(); +}(); var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _child; function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(44)); + return _child = _interopRequireWildcard(__webpack_require__(45)); } var _fs; function _load_fs() { - return _fs = __webpack_require__(5); + return _fs = __webpack_require__(7); } var _index; function _load_index() { - return _index = __webpack_require__(38); + return _index = __webpack_require__(41); } var _fixCmdWinSlashes; function _load_fixCmdWinSlashes() { - return _fixCmdWinSlashes = __webpack_require__(422); + return _fixCmdWinSlashes = __webpack_require__(437); } var _global; function _load_global() { - return _global = __webpack_require__(78); + return _global = __webpack_require__(83); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); +var invariant = __webpack_require__(9); -const path = __webpack_require__(1); +var path = __webpack_require__(0); -const IGNORE_MANIFEST_KEYS = ['readme']; +var IGNORE_MANIFEST_KEYS = ['readme']; // We treat these configs as internal, thus not expose them to process.env. // This helps us avoid some gyp issues when building native modules. // See https://github.com/yarnpkg/yarn/issues/2286. -const IGNORE_CONFIG_KEYS = ['lastUpdateCheck']; +var IGNORE_CONFIG_KEYS = ['lastUpdateCheck']; exports.default = executeLifecycleScript; -let checkGypPromise = null; +var checkGypPromise = null; /** * Special case: Some packages depend on node-gyp, but don't specify this in * their package.json dependencies. They assume that node-gyp is available @@ -35708,7 +37486,7 @@ function checkForGypIfNeeded(config, cmd, paths) { } /***/ }), -/* 84 */ +/* 90 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35718,35 +37496,35 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); -} - var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); + return _keys = _interopRequireDefault(__webpack_require__(14)); } -var _slicedToArray2; +var _set; -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(17)); +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(33)); + return _map = _interopRequireDefault(__webpack_require__(37)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } exports.isValidPackageName = isValidPackageName; exports.default = function (info, isRoot, reporter, warn) { if (isRoot) { - for (const key in (_typos || _load_typos()).default) { + for (var key in (_typos || _load_typos()).default) { if (key in info) { warn(reporter.lang('manifestPotentialTypo', key, (_typos || _load_typos()).default[key])); } @@ -35754,7 +37532,7 @@ exports.default = function (info, isRoot, reporter, warn) { } // validate name - const name = info.name; + var name = info.name; if (typeof name === 'string') { if (isRoot && isBuiltinModule(name)) { @@ -35772,7 +37550,7 @@ exports.default = function (info, isRoot, reporter, warn) { } // cannot equal node_modules or favicon.ico - const lower = name.toLowerCase(); + var lower = name.toLowerCase(); if (lower === 'node_modules' || lower === 'favicon.ico') { throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameBlacklisted')); } @@ -35781,7 +37559,7 @@ exports.default = function (info, isRoot, reporter, warn) { // validate license if (isRoot && !info.private) { if (typeof info.license === 'string') { - const license = info.license.replace(/\*$/g, ''); + var license = info.license.replace(/\*$/g, ''); if (!(0, (_util || _load_util()).isValidLicense)(license)) { warn(reporter.lang('manifestLicenseInvalid')); } @@ -35791,10 +37569,23 @@ exports.default = function (info, isRoot, reporter, warn) { } // validate strings - for (const key of strings) { - const val = info[key]; + for (var _iterator = strings, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var _key = _ref; + + var val = info[_key]; if (val && typeof val !== 'string') { - throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestStringExpected', key)); + throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestStringExpected', _key)); } } @@ -35806,28 +37597,28 @@ exports.cleanDependencies = cleanDependencies; var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _util; function _load_util() { - return _util = __webpack_require__(151); + return _util = __webpack_require__(157); } var _typos; function _load_typos() { - return _typos = _interopRequireDefault(__webpack_require__(429)); + return _typos = _interopRequireDefault(__webpack_require__(445)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const isBuiltinModule = __webpack_require__(588); +var isBuiltinModule = __webpack_require__(611); -const strings = ['name', 'version']; +var strings = ['name', 'version']; -const dependencyKeys = [ +var dependencyKeys = [ // npm registry will include optionalDependencies in dependencies and we'll want to dedupe them from the // other fields first 'optionalDependencies', @@ -35846,7 +37637,7 @@ function isValidScopedName(name) { return false; } - const parts = name.slice(1).split('/'); + var parts = name.slice(1).split('/'); return parts.length === 2 && isValidName(parts[0]) && isValidName(parts[1]); } @@ -35856,63 +37647,122 @@ function isValidPackageName(name) { function cleanDependencies(info, isRoot, reporter, warn) { // get dependency objects - const depTypes = []; - for (const type of dependencyKeys) { - const deps = info[type]; + var depTypes = []; + for (var _iterator2 = dependencyKeys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var _type = _ref2; + + var deps = info[_type]; if (!deps || typeof deps !== 'object') { continue; } - depTypes.push([type, deps]); + depTypes.push([_type, deps]); } // aggregate all non-trivial deps (not '' or '*') - const nonTrivialDeps = new (_map || _load_map()).default(); - for (const _ref of depTypes) { - var _ref2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref, 2); + var nonTrivialDeps = new (_map || _load_map()).default(); + for (var _iterator3 = depTypes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + var _ref3 = _ref4; + var _type2 = _ref3[0]; + var deps = _ref3[1]; - const type = _ref2[0]; - const deps = _ref2[1]; + for (var _iterator5 = (0, (_keys || _load_keys()).default)(deps), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref7; - for (const name of (0, (_keys || _load_keys()).default)(deps)) { - const version = deps[name]; - if (!nonTrivialDeps.has(name) && version && version !== '*') { - nonTrivialDeps.set(name, { type: type, version: version }); + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref7 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref7 = _i5.value; + } + + var name = _ref7; + + var _version = deps[name]; + if (!nonTrivialDeps.has(name) && _version && _version !== '*') { + nonTrivialDeps.set(name, { type: _type2, version: _version }); } } } // overwrite first dep of package with non-trivial version, remove the rest - const setDeps = new (_set || _load_set()).default(); - for (const _ref3 of depTypes) { - var _ref4 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref3, 2); + var setDeps = new (_set || _load_set()).default(); + for (var _iterator4 = depTypes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref6; - const type = _ref4[0]; - const deps = _ref4[1]; + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } - for (const name of (0, (_keys || _load_keys()).default)(deps)) { - let version = deps[name]; + var _ref5 = _ref6; + var _type3 = _ref5[0]; + var _deps = _ref5[1]; - const dep = nonTrivialDeps.get(name); + for (var _iterator6 = (0, (_keys || _load_keys()).default)(_deps), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref8; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref8 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref8 = _i6.value; + } + + var _name = _ref8; + + var _version2 = _deps[_name]; + + var dep = nonTrivialDeps.get(_name); if (dep) { - if (version && version !== '*' && version !== dep.version && isRoot) { + if (_version2 && _version2 !== '*' && _version2 !== dep.version && isRoot) { // only throw a warning when at the root - warn(reporter.lang('manifestDependencyCollision', dep.type, name, dep.version, type, version)); + warn(reporter.lang('manifestDependencyCollision', dep.type, _name, dep.version, _type3, _version2)); } - version = dep.version; + _version2 = dep.version; } - if (setDeps.has(name)) { - delete deps[name]; + if (setDeps.has(_name)) { + delete _deps[_name]; } else { - deps[name] = version; - setDeps.add(name); + _deps[_name] = _version2; + setDeps.add(_name); } } } } /***/ }), -/* 85 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35925,7 +37775,7 @@ Object.defineProperty(exports, "__esModule", { var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } exports.wait = wait; @@ -35935,7 +37785,7 @@ exports.queue = queue; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function wait(delay) { - return new (_promise || _load_promise()).default(resolve => { + return new (_promise || _load_promise()).default(function (resolve) { setTimeout(resolve, delay); }); } @@ -35952,7 +37802,7 @@ function promisify(fn, firstData) { result[_key2 - 1] = arguments[_key2]; } - let res = result; + var res = result; if (result.length <= 1) { res = result[0]; @@ -35976,27 +37826,27 @@ function promisify(fn, firstData) { } function queue(arr, promiseProducer) { - let concurrency = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; + var concurrency = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; concurrency = Math.min(concurrency, arr.length); // clone arr = arr.slice(); - const results = []; - let total = arr.length; + var results = []; + var total = arr.length; if (!total) { return (_promise || _load_promise()).default.resolve(results); } - return new (_promise || _load_promise()).default((resolve, reject) => { - for (let i = 0; i < concurrency; i++) { + return new (_promise || _load_promise()).default(function (resolve, reject) { + for (var i = 0; i < concurrency; i++) { next(); } function next() { - const item = arr.shift(); - const promise = promiseProducer(item); + var item = arr.shift(); + var promise = promiseProducer(item); promise.then(function (result) { results.push(result); @@ -36015,86 +37865,70 @@ function queue(arr, promiseProducer) { } /***/ }), -/* 86 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.home = undefined; - -var _rootUser; - -function _load_rootUser() { - return _rootUser = _interopRequireDefault(__webpack_require__(432)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const path = __webpack_require__(1); +module.exports = { "default": __webpack_require__(472), __esModule: true }; -const home = exports.home = __webpack_require__(75).homedir(); +/***/ }), +/* 93 */ +/***/ (function(module, exports) { -const userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve('/usr/local/share') : home; +var toString = {}.toString; -exports.default = userHomeDir; +module.exports = function(it){ + return toString.call(it).slice(8, -1); +}; /***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { +/* 94 */ +/***/ (function(module, exports) { -module.exports = { "default": __webpack_require__(455), __esModule: true }; +module.exports = {}; /***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _from = __webpack_require__(87); - -var _from2 = _interopRequireDefault(_from); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/* 95 */ +/***/ (function(module, exports) { -exports.default = function (arr) { - return Array.isArray(arr) ? arr : (0, _from2.default)(arr); +module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; }; /***/ }), -/* 89 */ -/***/ (function(module, exports) { +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { -var toString = {}.toString; +var def = __webpack_require__(43).f + , has = __webpack_require__(65) + , TAG = __webpack_require__(30)('toStringTag'); -module.exports = function(it){ - return toString.call(it).slice(8, -1); +module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); }; /***/ }), -/* 90 */ +/* 97 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) -var defined = __webpack_require__(107); +var defined = __webpack_require__(114); module.exports = function(it){ return Object(defined(it)); }; /***/ }), -/* 91 */ +/* 98 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(491); +__webpack_require__(507); var global = __webpack_require__(35) - , hide = __webpack_require__(61) - , Iterators = __webpack_require__(70) + , hide = __webpack_require__(55) + , Iterators = __webpack_require__(94) , TO_STRING_TAG = __webpack_require__(30)('toStringTag'); for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ @@ -36106,7 +37940,7 @@ for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList' } /***/ }), -/* 92 */ +/* 99 */ /***/ (function(module, exports) { // Copyright Joyent, Inc. and other Node contributors. @@ -36219,467 +38053,29 @@ function objectToString(o) { /***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * micromatch - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - - - -var expand = __webpack_require__(612); -var utils = __webpack_require__(179); - -/** - * The main function. Pass an array of filepaths, - * and a string or array of glob patterns - * - * @param {Array|String} `files` - * @param {Array|String} `patterns` - * @param {Object} `opts` - * @return {Array} Array of matches - */ - -function micromatch(files, patterns, opts) { - if (!files || !patterns) return []; - opts = opts || {}; - - if (typeof opts.cache === 'undefined') { - opts.cache = true; - } - - if (!Array.isArray(patterns)) { - return match(files, patterns, opts); - } - - var len = patterns.length, i = 0; - var omit = [], keep = []; - - while (len--) { - var glob = patterns[i++]; - if (typeof glob === 'string' && glob.charCodeAt(0) === 33 /* ! */) { - omit.push.apply(omit, match(files, glob.slice(1), opts)); - } else { - keep.push.apply(keep, match(files, glob, opts)); - } - } - return utils.diff(keep, omit); -} - -/** - * Return an array of files that match the given glob pattern. - * - * This function is called by the main `micromatch` function If you only - * need to pass a single pattern you might get very minor speed improvements - * using this function. - * - * @param {Array} `files` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Array} - */ - -function match(files, pattern, opts) { - if (utils.typeOf(files) !== 'string' && !Array.isArray(files)) { - throw new Error(msg('match', 'files', 'a string or array')); - } - - files = utils.arrayify(files); - opts = opts || {}; - - var negate = opts.negate || false; - var orig = pattern; - - if (typeof pattern === 'string') { - negate = pattern.charAt(0) === '!'; - if (negate) { - pattern = pattern.slice(1); - } - - // we need to remove the character regardless, - // so the above logic is still needed - if (opts.nonegate === true) { - negate = false; - } - } - - var _isMatch = matcher(pattern, opts); - var len = files.length, i = 0; - var res = []; - - while (i < len) { - var file = files[i++]; - var fp = utils.unixify(file, opts); - - if (!_isMatch(fp)) { continue; } - res.push(fp); - } - - if (res.length === 0) { - if (opts.failglob === true) { - throw new Error('micromatch.match() found no matches for: "' + orig + '".'); - } - - if (opts.nonull || opts.nullglob) { - res.push(utils.unescapeGlob(orig)); - } - } - - // if `negate` was defined, diff negated files - if (negate) { res = utils.diff(files, res); } - - // if `ignore` was defined, diff ignored filed - if (opts.ignore && opts.ignore.length) { - pattern = opts.ignore; - opts = utils.omit(opts, ['ignore']); - res = utils.diff(res, micromatch(res, pattern, opts)); - } - - if (opts.nodupes) { - return utils.unique(res); - } - return res; -} - -/** - * Returns a function that takes a glob pattern or array of glob patterns - * to be used with `Array#filter()`. (Internally this function generates - * the matching function using the [matcher] method). - * - * ```js - * var fn = mm.filter('[a-c]'); - * ['a', 'b', 'c', 'd', 'e'].filter(fn); - * //=> ['a', 'b', 'c'] - * ``` - * @param {String|Array} `patterns` Can be a glob or array of globs. - * @param {Options} `opts` Options to pass to the [matcher] method. - * @return {Function} Filter function to be passed to `Array#filter()`. - */ - -function filter(patterns, opts) { - if (!Array.isArray(patterns) && typeof patterns !== 'string') { - throw new TypeError(msg('filter', 'patterns', 'a string or array')); - } - - patterns = utils.arrayify(patterns); - var len = patterns.length, i = 0; - var patternMatchers = Array(len); - while (i < len) { - patternMatchers[i] = matcher(patterns[i++], opts); - } - - return function(fp) { - if (fp == null) return []; - var len = patternMatchers.length, i = 0; - var res = true; - - fp = utils.unixify(fp, opts); - while (i < len) { - var fn = patternMatchers[i++]; - if (!fn(fp)) { - res = false; - break; - } - } - return res; - }; -} - -/** - * Returns true if the filepath contains the given - * pattern. Can also return a function for matching. - * - * ```js - * isMatch('foo.md', '*.md', {}); - * //=> true - * - * isMatch('*.md', {})('foo.md') - * //=> true - * ``` - * @param {String} `fp` - * @param {String} `pattern` - * @param {Object} `opts` - * @return {Boolean} - */ - -function isMatch(fp, pattern, opts) { - if (typeof fp !== 'string') { - throw new TypeError(msg('isMatch', 'filepath', 'a string')); - } - - fp = utils.unixify(fp, opts); - if (utils.typeOf(pattern) === 'object') { - return matcher(fp, pattern); - } - return matcher(pattern, opts)(fp); -} - -/** - * Returns true if the filepath matches the - * given pattern. - */ - -function contains(fp, pattern, opts) { - if (typeof fp !== 'string') { - throw new TypeError(msg('contains', 'pattern', 'a string')); - } - - opts = opts || {}; - opts.contains = (pattern !== ''); - fp = utils.unixify(fp, opts); - - if (opts.contains && !utils.isGlob(pattern)) { - return fp.indexOf(pattern) !== -1; - } - return matcher(pattern, opts)(fp); -} - -/** - * Returns true if a file path matches any of the - * given patterns. - * - * @param {String} `fp` The filepath to test. - * @param {String|Array} `patterns` Glob patterns to use. - * @param {Object} `opts` Options to pass to the `matcher()` function. - * @return {String} - */ - -function any(fp, patterns, opts) { - if (!Array.isArray(patterns) && typeof patterns !== 'string') { - throw new TypeError(msg('any', 'patterns', 'a string or array')); - } - - patterns = utils.arrayify(patterns); - var len = patterns.length; - - fp = utils.unixify(fp, opts); - while (len--) { - var isMatch = matcher(patterns[len], opts); - if (isMatch(fp)) { - return true; - } - } - return false; -} - -/** - * Filter the keys of an object with the given `glob` pattern - * and `options` - * - * @param {Object} `object` - * @param {Pattern} `object` - * @return {Array} - */ - -function matchKeys(obj, glob, options) { - if (utils.typeOf(obj) !== 'object') { - throw new TypeError(msg('matchKeys', 'first argument', 'an object')); - } - - var fn = matcher(glob, options); - var res = {}; - - for (var key in obj) { - if (obj.hasOwnProperty(key) && fn(key)) { - res[key] = obj[key]; - } - } - return res; -} - -/** - * Return a function for matching based on the - * given `pattern` and `options`. - * - * @param {String} `pattern` - * @param {Object} `options` - * @return {Function} - */ - -function matcher(pattern, opts) { - // pattern is a function - if (typeof pattern === 'function') { - return pattern; - } - // pattern is a regex - if (pattern instanceof RegExp) { - return function(fp) { - return pattern.test(fp); - }; - } - - if (typeof pattern !== 'string') { - throw new TypeError(msg('matcher', 'pattern', 'a string, regex, or function')); - } - - // strings, all the way down... - pattern = utils.unixify(pattern, opts); - - // pattern is a non-glob string - if (!utils.isGlob(pattern)) { - return utils.matchPath(pattern, opts); - } - // pattern is a glob string - var re = makeRe(pattern, opts); - - // `matchBase` is defined - if (opts && opts.matchBase) { - return utils.hasFilename(re, opts); - } - // `matchBase` is not defined - return function(fp) { - fp = utils.unixify(fp, opts); - return re.test(fp); - }; -} - -/** - * Create and cache a regular expression for matching - * file paths. - * - * If the leading character in the `glob` is `!`, a negation - * regex is returned. - * - * @param {String} `glob` - * @param {Object} `options` - * @return {RegExp} - */ - -function toRegex(glob, options) { - // clone options to prevent mutating the original object - var opts = Object.create(options || {}); - var flags = opts.flags || ''; - if (opts.nocase && flags.indexOf('i') === -1) { - flags += 'i'; - } - - var parsed = expand(glob, opts); - - // pass in tokens to avoid parsing more than once - opts.negated = opts.negated || parsed.negated; - opts.negate = opts.negated; - glob = wrapGlob(parsed.pattern, opts); - var re; - - try { - re = new RegExp(glob, flags); - return re; - } catch (err) { - err.reason = 'micromatch invalid regex: (' + re + ')'; - if (opts.strict) throw new SyntaxError(err); - } - - // we're only here if a bad pattern was used and the user - // passed `options.silent`, so match nothing - return /$^/; -} - -/** - * Create the regex to do the matching. If the leading - * character in the `glob` is `!` a negation regex is returned. - * - * @param {String} `glob` - * @param {Boolean} `negate` - */ - -function wrapGlob(glob, opts) { - var prefix = (opts && !opts.contains) ? '^' : ''; - var after = (opts && !opts.contains) ? '$' : ''; - glob = ('(?:' + glob + ')' + after); - if (opts && opts.negate) { - return prefix + ('(?!^' + glob + ').*$'); - } - return prefix + glob; -} - -/** - * Create and cache a regular expression for matching file paths. - * If the leading character in the `glob` is `!`, a negation - * regex is returned. - * - * @param {String} `glob` - * @param {Object} `options` - * @return {RegExp} - */ - -function makeRe(glob, opts) { - if (utils.typeOf(glob) !== 'string') { - throw new Error(msg('makeRe', 'glob', 'a string')); - } - return utils.cache(toRegex, glob, opts); -} - -/** - * Make error messages consistent. Follows this format: - * - * ```js - * msg(methodName, argNumber, nativeType); - * // example: - * msg('matchKeys', 'first', 'an object'); - * ``` - * - * @param {String} `method` - * @param {String} `num` - * @param {String} `type` - * @return {String} - */ - -function msg(method, what, type) { - return 'micromatch.' + method + '(): ' + what + ' should be ' + type + '.'; -} - -/** - * Public methods - */ - -/* eslint no-multi-spaces: 0 */ -micromatch.any = any; -micromatch.braces = micromatch.braceExpand = utils.braces; -micromatch.contains = contains; -micromatch.expand = expand; -micromatch.filter = filter; -micromatch.isMatch = isMatch; -micromatch.makeRe = makeRe; -micromatch.match = match; -micromatch.matcher = matcher; -micromatch.matchKeys = matchKeys; - -/** - * Expose `micromatch` - */ - -module.exports = micromatch; - - -/***/ }), -/* 94 */ +/* 100 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2016 Joyent, Inc. module.exports = Certificate; -var assert = __webpack_require__(12); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(9); -var Fingerprint = __webpack_require__(95); -var Signature = __webpack_require__(43); -var errs = __webpack_require__(42); -var util = __webpack_require__(2); -var utils = __webpack_require__(20); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var Identity = __webpack_require__(97); +var assert = __webpack_require__(16); +var algs = __webpack_require__(26); +var crypto = __webpack_require__(13); +var Fingerprint = __webpack_require__(101); +var Signature = __webpack_require__(50); +var errs = __webpack_require__(49); +var util = __webpack_require__(4); +var utils = __webpack_require__(24); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(28); +var Identity = __webpack_require__(103); var formats = {}; -formats['openssh'] = __webpack_require__(679); -formats['x509'] = __webpack_require__(302); -formats['pem'] = __webpack_require__(680); +formats['openssh'] = __webpack_require__(708); +formats['x509'] = __webpack_require__(319); +formats['pem'] = __webpack_require__(709); var CertificateParseError = errs.CertificateParseError; var InvalidAlgorithmError = errs.InvalidAlgorithmError; @@ -37040,20 +38436,20 @@ Certificate._oldVersionDetect = function (obj) { /***/ }), -/* 95 */ +/* 101 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = Fingerprint; -var assert = __webpack_require__(12); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(9); -var errs = __webpack_require__(42); -var Key = __webpack_require__(23); -var Certificate = __webpack_require__(94); -var utils = __webpack_require__(20); +var assert = __webpack_require__(16); +var algs = __webpack_require__(26); +var crypto = __webpack_require__(13); +var errs = __webpack_require__(49); +var Key = __webpack_require__(27); +var Certificate = __webpack_require__(100); +var utils = __webpack_require__(24); var FingerprintFormatError = errs.FingerprintFormatError; var InvalidAlgorithmError = errs.InvalidAlgorithmError; @@ -37207,7 +38603,7 @@ Fingerprint._oldVersionDetect = function (obj) { /***/ }), -/* 96 */ +/* 102 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -37222,13 +38618,13 @@ module.exports = { writeECDSACurve: writeECDSACurve }; -var assert = __webpack_require__(12); -var asn1 = __webpack_require__(46); -var algs = __webpack_require__(22); -var utils = __webpack_require__(20); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var pem = __webpack_require__(58); +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(52); +var algs = __webpack_require__(26); +var utils = __webpack_require__(24); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(28); +var pem = __webpack_require__(61); function read(buf, options) { return (pem.read(buf, options, 'pkcs8')); @@ -37718,22 +39114,22 @@ function writePkcs8ECDSAPrivate(key, der) { /***/ }), -/* 97 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = Identity; -var assert = __webpack_require__(12); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(9); -var Fingerprint = __webpack_require__(95); -var Signature = __webpack_require__(43); -var errs = __webpack_require__(42); -var util = __webpack_require__(2); -var utils = __webpack_require__(20); -var asn1 = __webpack_require__(46); +var assert = __webpack_require__(16); +var algs = __webpack_require__(26); +var crypto = __webpack_require__(13); +var Fingerprint = __webpack_require__(101); +var Signature = __webpack_require__(50); +var errs = __webpack_require__(49); +var util = __webpack_require__(4); +var utils = __webpack_require__(24); +var asn1 = __webpack_require__(52); /*JSSTYLED*/ var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i; @@ -38001,19 +39397,19 @@ Identity._oldVersionDetect = function (obj) { /***/ }), -/* 98 */ +/* 104 */ /***/ (function(module, exports) { module.exports = require("buffer"); /***/ }), -/* 99 */ +/* 105 */ /***/ (function(module, exports) { module.exports = require("tty"); /***/ }), -/* 100 */ +/* 106 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38022,3375 +39418,4018 @@ module.exports = require("tty"); Object.defineProperty(exports, "__esModule", { value: true }); -exports.run = exports.Add = undefined; -var _keys; +var _stringify; -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); +function _load_stringify() { + return _stringify = _interopRequireDefault(__webpack_require__(32)); } -var _asyncToGenerator2; +var _extends2; -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(25)); } -let run = exports.run = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (!args.length) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('missingAddDependencies')); - } - - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); +var _set; - yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const install = new Add(args, flags, config, reporter, lockfile); - yield install.init(); - })); - }); +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); +} - return function run(_x, _x2, _x3, _x4) { - return _ref2.apply(this, arguments); - }; -})(); +var _promise; -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} -var _lockfile; +var _getIterator2; -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(16)); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } -var _normalizePattern2; +var _asyncToGenerator2; -function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(39); +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -var _workspaceLayout; +var _classCallCheck2; -function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(67)); +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } -var _index; +var _keys; -function _load_index() { - return _index = __webpack_require__(38); +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); } -var _list; +exports.extractWorkspaces = extractWorkspaces; -function _load_list() { - return _list = __webpack_require__(216); +var _executeLifecycleScript; + +function _load_executeLifecycleScript() { + return _executeLifecycleScript = __webpack_require__(89); } -var _install; +var _path; -function _load_install() { - return _install = __webpack_require__(27); +function _load_path() { + return _path = __webpack_require__(248); } -var _errors; +var _index; -function _load_errors() { - return _errors = __webpack_require__(3); +function _load_index() { + return _index = _interopRequireDefault(__webpack_require__(156)); } -var _constants; +var _errors; -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); +function _load_errors() { + return _errors = __webpack_require__(5); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } -var _invariant; +var _constants; -function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); } -var _path; +var _packageConstraintResolver; -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); +function _load_packageConstraintResolver() { + return _packageConstraintResolver = _interopRequireDefault(__webpack_require__(416)); } -var _semver; +var _requestManager; -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(19)); +function _load_requestManager() { + return _requestManager = _interopRequireDefault(__webpack_require__(249)); } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +var _index2; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _load_index2() { + return _index2 = __webpack_require__(40); +} -class Add extends (_install || _load_install()).Install { - constructor(args, flags, config, reporter, lockfile) { - super(flags, config, reporter, lockfile); - this.args = args; - // only one flag is supported, so we can figure out which one was passed to `yarn add` - this.flagToOrigin = [flags.dev && 'devDependencies', flags.optional && 'optionalDependencies', flags.peer && 'peerDependencies', 'dependencies'].filter(Boolean).shift(); - } +var _index3; - /** - * TODO - */ +function _load_index3() { + return _index3 = __webpack_require__(144); +} - prepareRequests(requests) { - const requestsWithArgs = requests.slice(); +var _map; - for (const pattern of this.args) { - requestsWithArgs.push({ - pattern: pattern, - registry: 'npm', - optional: false - }); - } - return requestsWithArgs; - } +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(34)); +} - /** - * returns version for a pattern based on Manifest - */ - getPatternVersion(pattern, pkg) { - const tilde = this.flags.tilde; - const configPrefix = String(this.config.getOption('save-prefix')); - const exact = this.flags.exact || Boolean(this.config.getOption('save-exact')) || configPrefix === ''; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - const hasVersion = _normalizePattern.hasVersion, - range = _normalizePattern.range; +var detectIndent = __webpack_require__(527); - let version; +var invariant = __webpack_require__(9); +var path = __webpack_require__(0); +var micromatch = __webpack_require__(77); +var isCi = __webpack_require__(186); - if ((0, (_index || _load_index()).getExoticResolver)(pattern)) { - // wasn't a name/range tuple so this is just a raw exotic pattern - version = pattern; - } else if (hasVersion && range && ((_semver || _load_semver()).default.satisfies(pkg.version, range) || (0, (_index || _load_index()).getExoticResolver)(range))) { - // if the user specified a range then use it verbatim - version = range; - } else { - let prefix; - if (tilde) { - prefix = '~'; - } else if (exact) { - prefix = ''; - } else { - prefix = configPrefix || '^'; - } +function sortObject(object) { + var sortedObject = {}; + (0, (_keys || _load_keys()).default)(object).sort().forEach(function (item) { + sortedObject[item] = object[item]; + }); + return sortedObject; +} - version = `${prefix}${pkg.version}`; - } - return version; - } +var Config = function () { + function Config(reporter) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Config); - preparePatterns(patterns) { - const preparedPatterns = patterns.slice(); - for (const pattern of this.resolver.dedupePatterns(this.args)) { - const pkg = this.resolver.getResolvedPattern(pattern); - (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${pattern}`); - const version = this.getPatternVersion(pattern, pkg); - const newPattern = `${pkg.name}@${version}`; - preparedPatterns.push(newPattern); - this.addedPatterns.push(newPattern); - if (newPattern === pattern) { - continue; - } - this.resolver.replacePattern(pattern, newPattern); - } - return preparedPatterns; + this.constraintResolver = new (_packageConstraintResolver || _load_packageConstraintResolver()).default(this, reporter); + this.requestManager = new (_requestManager || _load_requestManager()).default(reporter); + this.reporter = reporter; + this._init({}); } - bailout(patterns, workspaceLayout) { - var _this = this; + // - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const lockfileCache = _this.lockfile.cache; - if (!lockfileCache) { - return false; - } - const match = yield _this.integrityChecker.check(patterns, lockfileCache, _this.flags, workspaceLayout); - const haveLockfile = yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(_this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); - if (match.integrityFileMissing && haveLockfile) { - // Integrity file missing, force script installations - _this.scripts.setForce(true); - } - return false; - })(); - } - /** - * Description - */ + // cache packages in offline mirror folder as new .tgz files - init() { - var _this2 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const isWorkspaceRoot = _this2.config.workspaceRootFolder && _this2.config.cwd === _this2.config.workspaceRootFolder; + // - // running "yarn add something" in a workspace root is often a mistake - if (isWorkspaceRoot && !_this2.flags.ignoreWorkspaceRootCheck) { - throw new (_errors || _load_errors()).MessageError(_this2.reporter.lang('workspacesAddRootCheck')); - } - _this2.addedPatterns = []; - const patterns = yield (_install || _load_install()).Install.prototype.init.call(_this2); - yield _this2.maybeOutputSaveTree(patterns); - yield _this2.savePackages(); - return patterns; - })(); - } + // - /** - * Description - */ - fetchRequestFromCwd() { - return (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this, this.args); - } + // - /** - * Output a tree of any newly added dependencies. - */ - maybeOutputSaveTree(patterns) { - var _this3 = this; + // - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // don't limit the shown tree depth - const opts = { - reqDepth: 0 - }; - var _ref = yield (0, (_list || _load_list()).buildTree)(_this3.resolver, _this3.linker, patterns, opts, true, true); + // - const trees = _ref.trees, - count = _ref.count; - _this3.reporter.success(count === 1 ? _this3.reporter.lang('savedNewDependency') : _this3.reporter.lang('savedNewDependencies', count)); - _this3.reporter.tree('newDependencies', trees); - })(); - } + // - /** - * Save added packages to manifest if any of the --save flags were used. - */ - savePackages() { - var _this4 = this; + // - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // fill rootPatternsToOrigin without `excludePatterns` - yield (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(_this4); - const patternOrigins = (0, (_keys || _load_keys()).default)(_this4.rootPatternsToOrigin); - - // get all the different registry manifests in this folder - const manifests = yield _this4.config.getRootManifests(); - - // add new patterns to their appropriate registry manifest - for (const pattern of _this4.addedPatterns) { - const pkg = _this4.resolver.getResolvedPattern(pattern); - (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${pattern}`); - const version = _this4.getPatternVersion(pattern, pkg); - const ref = pkg._reference; - (0, (_invariant || _load_invariant()).default)(ref, 'expected package reference'); - // lookup the package to determine dependency type; used during `yarn upgrade` - const depType = patternOrigins.reduce(function (acc, prev) { - if (prev.indexOf(`${pkg.name}@`) === 0) { - return _this4.rootPatternsToOrigin[prev]; - } - return acc; - }, null); - // depType is calculated when `yarn upgrade` command is used - const target = depType || _this4.flagToOrigin; + // - // add it to manifest - const object = manifests[ref.registry].object; + // - object[target] = object[target] || {}; - object[target][pkg.name] = version; - if (target !== _this4.flagToOrigin) { - _this4.reporter.warn(_this4.reporter.lang('moduleAlreadyInManifest', pkg.name, depType, _this4.flagToOrigin)); - } - } + // - yield _this4.config.saveRootManifests(manifests); - })(); - } -} -exports.Add = Add; -function hasWrapper(commander) { - return true; -} + // -function setFlags(commander) { - commander.usage('add [packages ...] [flags]'); - commander.option('-W, --ignore-workspace-root-check', 'required to run yarn add inside a workspace root'); - commander.option('-D, --dev', 'save package to your `devDependencies`'); - commander.option('-P, --peer', 'save package to your `peerDependencies`'); - commander.option('-O, --optional', 'save package to your `optionalDependencies`'); - commander.option('-E, --exact', 'install exact version'); - commander.option('-T, --tilde', 'install most recent release with the same minor version'); -} -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { + // -"use strict"; + // Whether we should ignore executing lifecycle scripts -Object.defineProperty(exports, "__esModule", { - value: true -}); -var _stringify; + // -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(34)); -} -var _asyncToGenerator2; + // -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); -} -var _promise; + // -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); -} -var _index; + // -function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(150)); -} -var _constants; + /** + * Execute a promise produced by factory if it doesn't exist in our cache with + * the associated key. + */ -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); -} + Config.prototype.getCache = function getCache(key, factory) { + var _this = this; -var _fs; + var cached = this.cache[key]; + if (cached) { + return cached; + } -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); -} + return this.cache[key] = factory().catch(function (err) { + _this.cache[key] = null; + throw err; + }); + }; -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + /** + * Get a config option from our yarn config. + */ -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + Config.prototype.getOption = function getOption(key) { + var resolve = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; -const path = __webpack_require__(1); -/* eslint no-unused-vars: 0 */ + var value = this.registries.yarn.getOption(key); -class BaseFetcher { - constructor(dest, remote, config) { - this.reporter = config.reporter; - this.packageName = remote.packageName; - this.reference = remote.reference; - this.registry = remote.registry; - this.hash = remote.hash; - this.remote = remote; - this.config = config; - this.dest = dest; - } + if (resolve && typeof value === 'string' && value.length) { + return (0, (_path || _load_path()).resolveWithHome)(value); + } - setupMirrorFromCache() { - // fetcher subclasses may use this to perform actions such as copying over a cached tarball to the offline - // mirror etc - return (_promise || _load_promise()).default.resolve(); - } + return value; + }; - _fetch() { - return (_promise || _load_promise()).default.reject(new Error('Not implemented')); - } + /** + * Reduce a list of versions to a single one based on an input range. + */ - fetch(defaultManifest) { - var _this = this; + Config.prototype.resolveConstraints = function resolveConstraints(versions, range) { + return this.constraintResolver.reduce(versions, range); + }; - const dest = this.dest; + /** + * Initialise config. Fetch registry options, find package roots. + */ - return (_fs || _load_fs()).lockQueue.push(dest, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield (_fs || _load_fs()).mkdirp(dest); + Config.prototype.init = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _this2 = this; - // fetch package and get the hash + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var _ref2 = yield _this._fetch(); + this._init(opts); - const hash = _ref2.hash; + this.workspaceRootFolder = yield this.findWorkspaceRoot(this.cwd); + this.lockfileFolder = this.workspaceRootFolder || this.cwd; + this.linkedModules = []; - const pkg = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // load the new normalized manifest - try { - return yield _this.config.readManifest(dest, _this.registry); - } catch (e) { - if (e.code === 'ENOENT' && defaultManifest) { - return (0, (_index || _load_index()).default)(defaultManifest, dest, _this.config, false); - } else { - throw e; - } + var linkedModules = void 0; + try { + linkedModules = yield (_fs || _load_fs()).readdir(this.linkFolder); + } catch (err) { + if (err.code === 'ENOENT') { + linkedModules = []; + } else { + throw err; } - })(); + } - yield (_fs || _load_fs()).writeFile(path.join(dest, (_constants || _load_constants()).METADATA_FILENAME), (0, (_stringify || _load_stringify()).default)({ - manifest: pkg, - artifacts: [], - remote: _this.remote, - registry: _this.registry, - hash: hash - }, null, ' ')); + var _loop = function* _loop(dir) { + var linkedPath = path.join(_this2.linkFolder, dir); - return { - hash: hash, - dest: dest, - package: pkg, - cached: false + if (dir[0] === '@') { + var _linkedModules; + + // it's a scope, not a package + var scopedLinked = yield (_fs || _load_fs()).readdir(linkedPath); + (_linkedModules = _this2.linkedModules).push.apply(_linkedModules, scopedLinked.map(function (scopedDir) { + return path.join(dir, scopedDir); + })); + } else { + _this2.linkedModules.push(dir); + } }; - })); - } -} -exports.default = BaseFetcher; -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { + for (var _iterator = linkedModules, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; -"use strict"; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + var dir = _ref2; + yield* _loop(dir); + } -Object.defineProperty(exports, "__esModule", { - value: true -}); + for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref3; -var _promise; + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); -} + var _key = _ref3; -var _keys; + var Registry = (_index2 || _load_index2()).registries[_key]; -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); -} + // instantiate registry + var _registry = new Registry(this.cwd, this.registries, this.requestManager, this.reporter); + yield _registry.init({ + registry: opts.registry + }); -var _stringify; + this.registries[_key] = _registry; + this.registryFolders.push(_registry.folder); + var rootModuleFolder = path.join(this.cwd, _registry.folder); + if (this.rootModuleFolders.indexOf(rootModuleFolder) < 0) { + this.rootModuleFolders.push(rootModuleFolder); + } + } -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(34)); -} + this.networkConcurrency = opts.networkConcurrency || Number(this.getOption('network-concurrency')) || (_constants || _load_constants()).NETWORK_CONCURRENCY; -var _map; + this.childConcurrency = opts.childConcurrency || Number(this.getOption('child-concurrency')) || Number(process.env.CHILD_CONCURRENCY) || (_constants || _load_constants()).CHILD_CONCURRENCY; -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); -} + this.networkTimeout = opts.networkTimeout || Number(this.getOption('network-timeout')) || (_constants || _load_constants()).NETWORK_TIMEOUT; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var httpProxy = opts.httpProxy || this.getOption('proxy'); + var httpsProxy = opts.httpsProxy || this.getOption('https-proxy'); + this.requestManager.setOptions({ + userAgent: String(this.getOption('user-agent')), + httpProxy: httpProxy === false ? false : String(httpProxy || ''), + httpsProxy: httpsProxy === false ? false : String(httpsProxy || ''), + strictSSL: Boolean(this.getOption('strict-ssl')), + ca: Array.prototype.concat(opts.ca || this.getOption('ca') || []).map(String), + cafile: String(opts.cafile || this.getOption('cafile', true) || ''), + cert: String(opts.cert || this.getOption('cert') || ''), + key: String(opts.key || this.getOption('key') || ''), + networkConcurrency: this.networkConcurrency, + networkTimeout: this.networkTimeout + }); -const debug = __webpack_require__(503)('yarn'); + var cacheRootFolder = opts.cacheFolder || this.getOption('cache-folder', true); -class BlockingQueue { - constructor(alias) { - let maxConcurrency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; + if (!cacheRootFolder) { + var preferredCacheFolders = (_constants || _load_constants()).PREFERRED_MODULE_CACHE_DIRECTORIES; + var preferredCacheFolder = opts.preferredCacheFolder || this.getOption('preferred-cache-folder', true); - this.concurrencyQueue = []; - this.maxConcurrency = maxConcurrency; - this.runningCount = 0; - this.warnedStuck = false; - this.alias = alias; - this.first = true; + if (preferredCacheFolder) { + preferredCacheFolders = [String(preferredCacheFolder)].concat(preferredCacheFolders); + } - this.running = (0, (_map || _load_map()).default)(); - this.queue = (0, (_map || _load_map()).default)(); + var cacheFolderQuery = yield (_fs || _load_fs()).getFirstSuitableFolder(preferredCacheFolders, (_fs || _load_fs()).constants.W_OK | (_fs || _load_fs()).constants.X_OK | (_fs || _load_fs()).constants.R_OK // eslint-disable-line no-bitwise + ); + for (var _iterator3 = cacheFolderQuery.skipped, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref4; - this.stuckTick = this.stuckTick.bind(this); - } + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } - stillActive() { - if (this.stuckTimer) { - clearTimeout(this.stuckTimer); - } + var skippedEntry = _ref4; - this.stuckTimer = setTimeout(this.stuckTick, 5000); + this.reporter.warn(this.reporter.lang('cacheFolderSkipped', skippedEntry.folder)); + } - // We need to check the existense of unref because of https://github.com/facebook/jest/issues/4559 - // $FlowFixMe: Node's setInterval returns a Timeout, not a Number - this.stuckTimer.unref && this.stuckTimer.unref(); - } + cacheRootFolder = cacheFolderQuery.folder; + if (cacheRootFolder && cacheFolderQuery.skipped.length > 0) { + this.reporter.warn(this.reporter.lang('cacheFolderSelected', cacheRootFolder)); + } + } - stuckTick() { - if (this.runningCount === 1) { - this.warnedStuck = true; - debug(`The ${(0, (_stringify || _load_stringify()).default)(this.alias)} blocking queue may be stuck. 5 seconds ` + `without any activity with 1 worker: ${(0, (_keys || _load_keys()).default)(this.running)[0]}`); - } - } + if (!cacheRootFolder) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('cacheFolderMissing')); + } else { + this._cacheRootFolder = String(cacheRootFolder); + } + this.workspacesEnabled = this.getOption('workspaces-experimental') !== false; + this.workspacesNohoistEnabled = this.getOption('workspaces-nohoist-experimental') !== false; - push(key, factory) { - if (this.first) { - this.first = false; - } else { - this.stillActive(); - } + this.pruneOfflineMirror = Boolean(this.getOption('yarn-offline-mirror-pruning')); + this.enableMetaFolder = Boolean(this.getOption('enable-meta-folder')); + this.enableLockfileVersions = Boolean(this.getOption('yarn-enable-lockfile-versions')); + this.linkFileDependencies = Boolean(this.getOption('yarn-link-file-dependencies')); + this.packBuiltPackages = Boolean(this.getOption('experimental-pack-script-packages-in-mirror')); - return new (_promise || _load_promise()).default((resolve, reject) => { - // we're already running so push ourselves to the queue - const queue = this.queue[key] = this.queue[key] || []; - queue.push({ factory: factory, resolve: resolve, reject: reject }); + //init & create cacheFolder, tempFolder + this.cacheFolder = path.join(this._cacheRootFolder, 'v' + String((_constants || _load_constants()).CACHE_VERSION)); + this.tempFolder = opts.tempFolder || path.join(this.cacheFolder, '.tmp'); + yield (_fs || _load_fs()).mkdirp(this.cacheFolder); + yield (_fs || _load_fs()).mkdirp(this.tempFolder); - if (!this.running[key]) { - this.shift(key); + if (opts.production !== undefined) { + this.production = Boolean(opts.production); + } else { + this.production = Boolean(this.getOption('production')) || process.env.NODE_ENV === 'production' && process.env.NPM_CONFIG_PRODUCTION !== 'false' && process.env.YARN_PRODUCTION !== 'false'; } - }); - } - - shift(key) { - if (this.running[key]) { - delete this.running[key]; - this.runningCount--; - clearTimeout(this.stuckTimer); - if (this.warnedStuck) { - this.warnedStuck = false; - debug(`${(0, (_stringify || _load_stringify()).default)(this.alias)} blocking queue finally resolved. Nothing to worry about.`); + if (this.workspaceRootFolder && !this.workspacesEnabled) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesDisabled')); } - } + }); - const queue = this.queue[key]; - if (!queue) { - return; + function init() { + return _ref.apply(this, arguments); } - var _queue$shift = queue.shift(); - - const resolve = _queue$shift.resolve, - reject = _queue$shift.reject, - factory = _queue$shift.factory; - - if (!queue.length) { - delete this.queue[key]; - } + return init; + }(); - const next = () => { - this.shift(key); - this.shiftConcurrencyQueue(); - }; + Config.prototype._init = function _init(opts) { + this.rootModuleFolders = []; + this.registryFolders = []; + this.linkedModules = []; - const run = () => { - this.running[key] = true; - this.runningCount++; + this.registries = (0, (_map || _load_map()).default)(); + this.cache = (0, (_map || _load_map()).default)(); - factory().then(function (val) { - resolve(val); - next(); - return null; - }).catch(function (err) { - reject(err); - next(); - }); - }; + // Ensure the cwd is always an absolute path. + this.cwd = path.resolve(opts.cwd || this.cwd || process.cwd()); - this.maybePushConcurrencyQueue(run); - } + this.looseSemver = opts.looseSemver == undefined ? true : opts.looseSemver; - maybePushConcurrencyQueue(run) { - if (this.runningCount < this.maxConcurrency) { - run(); - } else { - this.concurrencyQueue.push(run); - } - } + this.commandName = opts.commandName || ''; - shiftConcurrencyQueue() { - if (this.runningCount < this.maxConcurrency) { - const fn = this.concurrencyQueue.shift(); - if (fn) { - fn(); - } - } - } -} -exports.default = BlockingQueue; + this.preferOffline = !!opts.preferOffline; + this.modulesFolder = opts.modulesFolder; + this.globalFolder = opts.globalFolder || (_constants || _load_constants()).GLOBAL_MODULE_DIRECTORY; + this.linkFolder = opts.linkFolder || (_constants || _load_constants()).LINK_REGISTRY_DIRECTORY; + this.offline = !!opts.offline; + this.binLinks = !!opts.binLinks; + this.updateChecksums = !!opts.updateChecksums; -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { + this.ignorePlatform = !!opts.ignorePlatform; + this.ignoreScripts = !!opts.ignoreScripts; -"use strict"; + this.disablePrepublish = !!opts.disablePrepublish; + // $FlowFixMe$ + this.nonInteractive = !!opts.nonInteractive || isCi || !process.stdout.isTTY; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hash = hash; -const crypto = __webpack_require__(9); -const stream = __webpack_require__(25); + this.requestManager.setOptions({ + offline: !!opts.offline && !opts.preferOffline, + captureHar: !!opts.captureHar + }); -function hash(content) { - let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md5'; + if (this.modulesFolder) { + this.rootModuleFolders.push(this.modulesFolder); + } + }; - return crypto.createHash(type).update(content).digest('hex'); -} + /** + * Generate an absolute module path. + */ -class HashStream extends stream.Transform { - constructor(options) { - super(options); - this._hash = crypto.createHash('sha1'); - this._updated = false; - } + Config.prototype.generateHardModulePath = function generateHardModulePath(pkg, ignoreLocation) { + invariant(this.cacheFolder, 'No package root'); + invariant(pkg, 'Undefined package'); - _transform(chunk, encoding, callback) { - this._updated = true; - this._hash.update(chunk); - callback(null, chunk); - } + if (pkg.location && !ignoreLocation) { + return pkg.location; + } - getHash() { - return this._hash.digest('hex'); - } + var name = pkg.name; + var uid = pkg.uid; + if (pkg.registry) { + name = `${pkg.registry}-${name}`; + } - test(sum) { - return this._updated && sum === this.getHash(); - } -} -exports.HashStream = HashStream; + var hash = pkg.remote.hash; -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { -// Load modules + if (pkg.version && pkg.version !== pkg.uid) { + uid = `${pkg.version}-${uid}`; + } else if (hash) { + uid += `-${hash}`; + } -var Http = __webpack_require__(45); -var Hoek = __webpack_require__(115); + return path.join(this.cacheFolder, `${name}-${uid}`); + }; + /** + * Execute lifecycle scripts in the specified directory. Ignoring when the --ignore-scripts flag has been + * passed. + */ -// Declare internals + Config.prototype.executeLifecycleScript = function executeLifecycleScript(commandName, cwd) { + if (this.ignoreScripts) { + return (_promise || _load_promise()).default.resolve(); + } else { + return (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execFromManifest)(this, commandName, cwd || this.cwd); + } + }; -var internals = {}; + /** + * Generate an absolute temporary filename location based on the input filename. + */ -exports.wrap = function (error, statusCode, message) { + Config.prototype.getTemp = function getTemp(filename) { + invariant(this.tempFolder, 'No temp folder'); + return path.join(this.tempFolder, filename); + }; - Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object'); - return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message)); -}; + /** + * Remote packages may be cached in a file system to be available for offline installation. + * Second time the same package needs to be installed it will be loaded from there. + * Given a package's filename, return a path in the offline mirror location. + */ + Config.prototype.getOfflineMirrorPath = function getOfflineMirrorPath(packageFilename) { + var mirrorPath = void 0; -exports.create = function (statusCode, message, data) { + var _arr = ['npm', 'yarn']; + for (var _i4 = 0; _i4 < _arr.length; _i4++) { + var _key2 = _arr[_i4]; + var _registry2 = this.registries[_key2]; - return internals.create(statusCode, message, data, exports.create); -}; + if (_registry2 == null) { + continue; + } -internals.create = function (statusCode, message, data, ctor) { + var registryMirrorPath = _registry2.config['yarn-offline-mirror']; - var error = new Error(message ? message : undefined); // Avoids settings null message - Error.captureStackTrace(error, ctor); // Filter the stack to our external API - error.data = data || null; - internals.initialize(error, statusCode); - return error; -}; + if (registryMirrorPath === false) { + return null; + } -internals.initialize = function (error, statusCode, message) { + if (registryMirrorPath == null) { + continue; + } - var numberCode = parseInt(statusCode, 10); - Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode); + mirrorPath = registryMirrorPath; + } - error.isBoom = true; - error.isServer = numberCode >= 500; + if (mirrorPath == null) { + return null; + } - if (!error.hasOwnProperty('data')) { - error.data = null; + if (packageFilename == null) { + return mirrorPath; } - error.output = { - statusCode: numberCode, - payload: {}, - headers: {} - }; + return path.join(mirrorPath, path.basename(packageFilename)); + }; - error.reformat = internals.reformat; - error.reformat(); + /** + * Checker whether the folder input is a valid module folder. We output a yarn metadata + * file when we've successfully setup a folder so use this as a marker. + */ - if (!message && - !error.message) { + Config.prototype.isValidModuleDest = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) { + if (!(yield (_fs || _load_fs()).exists(dest))) { + return false; + } - message = error.output.payload.error; - } + if (!(yield (_fs || _load_fs()).exists(path.join(dest, (_constants || _load_constants()).METADATA_FILENAME)))) { + return false; + } - if (message) { - error.message = (message + (error.message ? ': ' + error.message : '')); - } + return true; + }); - return error; -}; + function isValidModuleDest(_x3) { + return _ref5.apply(this, arguments); + } + return isValidModuleDest; + }(); -internals.reformat = function () { + /** + * Read package metadata and normalized package info. + */ - this.output.payload.statusCode = this.output.statusCode; - this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown'; + Config.prototype.readPackageMetadata = function readPackageMetadata(dir) { + var _this3 = this; - if (this.output.statusCode === 500) { - this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user - } - else if (this.message) { - this.output.payload.message = this.message; - } -}; + return this.getCache(`metadata-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var metadata = yield _this3.readJson(path.join(dir, (_constants || _load_constants()).METADATA_FILENAME)); + var pkg = yield _this3.readManifest(dir, metadata.registry); + return { + package: pkg, + artifacts: metadata.artifacts || [], + hash: metadata.hash, + remote: metadata.remote, + registry: metadata.registry + }; + })); + }; -// 4xx Client Errors + /** + * Read normalized package info according yarn-metadata.json + * throw an error if package.json was not found + */ -exports.badRequest = function (message, data) { + Config.prototype.readManifest = function readManifest(dir, priorityRegistry) { + var _this4 = this; - return internals.create(400, message, data, exports.badRequest); -}; + var isRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + return this.getCache(`manifest-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var manifest = yield _this4.maybeReadManifest(dir, priorityRegistry, isRoot); -exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) + if (manifest) { + return manifest; + } else { + throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('couldntFindPackagejson', dir), 'ENOENT'); + } + })); + }; - var err = internals.create(401, message, undefined, exports.unauthorized); + /** + * try get the manifest file by looking + * 1. manifest file in cache + * 2. manifest file in registry + */ - if (!scheme) { - return err; - } - var wwwAuthenticate = ''; - var i = 0; - var il = 0; + Config.prototype.maybeReadManifest = function () { + var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, priorityRegistry) { + var isRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - if (typeof scheme === 'string') { + var metadataLoc = path.join(dir, (_constants || _load_constants()).METADATA_FILENAME); - // function (message, scheme, attributes) + if (yield (_fs || _load_fs()).exists(metadataLoc)) { + var metadata = yield this.readJson(metadataLoc); - wwwAuthenticate = scheme; + if (!priorityRegistry) { + priorityRegistry = metadata.priorityRegistry; + } - if (attributes || message) { - err.output.payload.attributes = {}; + if (typeof metadata.manifest !== 'undefined') { + return metadata.manifest; } + } - if (attributes) { - var names = Object.keys(attributes); - for (i = 0, il = names.length; i < il; ++i) { - var name = names[i]; - if (i) { - wwwAuthenticate += ','; - } + if (priorityRegistry) { + var file = yield this.tryManifest(dir, priorityRegistry, isRoot); + if (file) { + return file; + } + } - var value = attributes[name]; - if (value === null || - value === undefined) { // Value can be zero + for (var _iterator4 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref9; - value = ''; - } - wwwAuthenticate += ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; - err.output.payload.attributes[name] = value; - } + if (_isArray4) { + if (_i5 >= _iterator4.length) break; + _ref9 = _iterator4[_i5++]; + } else { + _i5 = _iterator4.next(); + if (_i5.done) break; + _ref9 = _i5.value; } - if (message) { - if (attributes) { - wwwAuthenticate += ','; - } - wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; - err.output.payload.attributes.error = message; + var _registry3 = _ref9; + + if (priorityRegistry === _registry3) { + continue; } - else { - err.isMissing = true; + + var _file = yield this.tryManifest(dir, _registry3, isRoot); + if (_file) { + return _file; } + } + + return null; + }); + + function maybeReadManifest(_x5, _x6) { + return _ref8.apply(this, arguments); } - else { - // function (message, wwwAuthenticate[]) + return maybeReadManifest; + }(); - var wwwArray = scheme; - for (i = 0, il = wwwArray.length; i < il; ++i) { - if (i) { - wwwAuthenticate += ', '; - } + /** + * Read the root manifest. + */ - wwwAuthenticate += wwwArray[i]; - } - } + Config.prototype.readRootManifest = function readRootManifest() { + return this.readManifest(this.cwd, 'npm', true); + }; - err.output.headers['WWW-Authenticate'] = wwwAuthenticate; + /** + * Try and find package info with the input directory and registry. + */ - return err; -}; + Config.prototype.tryManifest = function () { + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, registry, isRoot) { + var filename = (_index2 || _load_index2()).registries[registry].filename; + + var loc = path.join(dir, filename); + if (yield (_fs || _load_fs()).exists(loc)) { + var data = yield this.readJson(loc); + data._registry = registry; + data._loc = loc; + return (0, (_index || _load_index()).default)(data, dir, this, isRoot); + } else { + return null; + } + }); + function tryManifest(_x8, _x9, _x10) { + return _ref10.apply(this, arguments); + } -exports.forbidden = function (message, data) { + return tryManifest; + }(); - return internals.create(403, message, data, exports.forbidden); -}; + Config.prototype.findManifest = function () { + var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, isRoot) { + for (var _iterator5 = (_index2 || _load_index2()).registryNames, _isArray5 = Array.isArray(_iterator5), _i6 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref12; + if (_isArray5) { + if (_i6 >= _iterator5.length) break; + _ref12 = _iterator5[_i6++]; + } else { + _i6 = _iterator5.next(); + if (_i6.done) break; + _ref12 = _i6.value; + } -exports.notFound = function (message, data) { + var _registry4 = _ref12; - return internals.create(404, message, data, exports.notFound); -}; + var manifest = yield this.tryManifest(dir, _registry4, isRoot); + if (manifest) { + return manifest; + } + } -exports.methodNotAllowed = function (message, data) { + return null; + }); - return internals.create(405, message, data, exports.methodNotAllowed); -}; + function findManifest(_x11, _x12) { + return _ref11.apply(this, arguments); + } + return findManifest; + }(); -exports.notAcceptable = function (message, data) { + Config.prototype.findWorkspaceRoot = function () { + var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (initial) { + var previous = null; + var current = path.normalize(initial); + if (!(yield (_fs || _load_fs()).exists(current))) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('folderMissing', current)); + } - return internals.create(406, message, data, exports.notAcceptable); -}; + do { + var manifest = yield this.findManifest(current, true); + var ws = extractWorkspaces(manifest); + if (ws && ws.packages) { + var relativePath = path.relative(current, initial); + if (relativePath === '' || micromatch([relativePath], ws.packages).length > 0) { + return current; + } else { + return null; + } + } + previous = current; + current = path.dirname(current); + } while (current !== previous); -exports.proxyAuthRequired = function (message, data) { + return null; + }); - return internals.create(407, message, data, exports.proxyAuthRequired); -}; + function findWorkspaceRoot(_x13) { + return _ref13.apply(this, arguments); + } + return findWorkspaceRoot; + }(); -exports.clientTimeout = function (message, data) { + Config.prototype.resolveWorkspaces = function () { + var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (root, rootManifest) { + var _this5 = this; - return internals.create(408, message, data, exports.clientTimeout); -}; + var workspaces = {}; + if (!this.workspacesEnabled) { + return workspaces; + } + var ws = this.getWorkspaces(rootManifest, true); + var patterns = ws && ws.packages ? ws.packages : []; -exports.conflict = function (message, data) { + if (!Array.isArray(patterns)) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesSettingMustBeArray')); + } - return internals.create(409, message, data, exports.conflict); -}; + var registryFilenames = (_index2 || _load_index2()).registryNames.map(function (registryName) { + return _this5.registries[registryName].constructor.filename; + }).join('|'); + var trailingPattern = `/+(${registryFilenames})`; + var ignorePatterns = this.registryFolders.map(function (folder) { + return `/${folder}/*/+(${registryFilenames})`; + }); + var files = yield (_promise || _load_promise()).default.all(patterns.map(function (pattern) { + return (_fs || _load_fs()).glob(pattern.replace(/\/?$/, trailingPattern), { + cwd: root, + ignore: ignorePatterns.map(function (ignorePattern) { + return pattern.replace(/\/?$/, ignorePattern); + }) + }); + })); -exports.resourceGone = function (message, data) { + for (var _iterator6 = new (_set || _load_set()).default((_ref16 = []).concat.apply(_ref16, files)), _isArray6 = Array.isArray(_iterator6), _i7 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref16; - return internals.create(410, message, data, exports.resourceGone); -}; + var _ref15; + if (_isArray6) { + if (_i7 >= _iterator6.length) break; + _ref15 = _iterator6[_i7++]; + } else { + _i7 = _iterator6.next(); + if (_i7.done) break; + _ref15 = _i7.value; + } -exports.lengthRequired = function (message, data) { + var file = _ref15; - return internals.create(411, message, data, exports.lengthRequired); -}; + var _loc = path.join(root, path.dirname(file)); + var manifest = yield this.findManifest(_loc, false); + if (!manifest) { + continue; + } -exports.preconditionFailed = function (message, data) { + if (!manifest.name) { + this.reporter.warn(this.reporter.lang('workspaceNameMandatory', _loc)); + continue; + } + if (!manifest.version) { + this.reporter.warn(this.reporter.lang('workspaceVersionMandatory', _loc)); + continue; + } - return internals.create(412, message, data, exports.preconditionFailed); -}; + if (Object.prototype.hasOwnProperty.call(workspaces, manifest.name)) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspaceNameDuplicate', manifest.name)); + } + workspaces[manifest.name] = { loc: _loc, manifest }; + } -exports.entityTooLarge = function (message, data) { + return workspaces; + }); - return internals.create(413, message, data, exports.entityTooLarge); -}; + function resolveWorkspaces(_x14, _x15) { + return _ref14.apply(this, arguments); + } + return resolveWorkspaces; + }(); -exports.uriTooLong = function (message, data) { + // workspaces functions - return internals.create(414, message, data, exports.uriTooLong); -}; + Config.prototype.getWorkspaces = function getWorkspaces(manifest) { + var shouldThrow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; -exports.unsupportedMediaType = function (message, data) { + if (!manifest || !this.workspacesEnabled) { + return undefined; + } - return internals.create(415, message, data, exports.unsupportedMediaType); -}; + var ws = extractWorkspaces(manifest); + if (!ws) { + return ws; + } -exports.rangeNotSatisfiable = function (message, data) { + // validate eligibility + var wsCopy = (0, (_extends2 || _load_extends()).default)({}, ws); + var warnings = []; - return internals.create(416, message, data, exports.rangeNotSatisfiable); -}; + // packages + if (wsCopy.packages && wsCopy.packages.length > 0 && !manifest.private) { + warnings.push(this.reporter.lang('workspacesRequirePrivateProjects')); + wsCopy = undefined; + } + // nohoist + if (wsCopy && wsCopy.nohoist && wsCopy.nohoist.length > 0) { + if (!this.workspacesNohoistEnabled) { + warnings.push(this.reporter.lang('workspacesNohoistDisabled', manifest.name)); + wsCopy.nohoist = undefined; + } else if (!manifest.private) { + warnings.push(this.reporter.lang('workspacesNohoistRequirePrivatePackages', manifest.name)); + wsCopy.nohoist = undefined; + } + } + if (warnings.length > 0) { + var msg = warnings.join('\n'); + if (shouldThrow) { + throw new (_errors || _load_errors()).MessageError(msg); + } else { + this.reporter.warn(msg); + } + } + return wsCopy; + }; -exports.expectationFailed = function (message, data) { + /** + * Description + */ - return internals.create(417, message, data, exports.expectationFailed); -}; + Config.prototype.getFolder = function getFolder(pkg) { + var registryName = pkg._registry; + if (!registryName) { + var ref = pkg._reference; + invariant(ref, 'expected reference'); + registryName = ref.registry; + } + return this.registries[registryName].folder; + }; -exports.badData = function (message, data) { + /** + * Get root manifests. + */ - return internals.create(422, message, data, exports.badData); -}; + Config.prototype.getRootManifests = function () { + var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var manifests = {}; + for (var _iterator7 = (_index2 || _load_index2()).registryNames, _isArray7 = Array.isArray(_iterator7), _i8 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { + var _ref18; + if (_isArray7) { + if (_i8 >= _iterator7.length) break; + _ref18 = _iterator7[_i8++]; + } else { + _i8 = _iterator7.next(); + if (_i8.done) break; + _ref18 = _i8.value; + } -exports.preconditionRequired = function (message, data) { + var _registryName = _ref18; - return internals.create(428, message, data, exports.preconditionRequired); -}; + var _registry5 = (_index2 || _load_index2()).registries[_registryName]; + var jsonLoc = path.join(this.cwd, _registry5.filename); + var _object = {}; + var _exists = false; + var _indent = void 0; + if (yield (_fs || _load_fs()).exists(jsonLoc)) { + _exists = true; -exports.tooManyRequests = function (message, data) { + var info = yield this.readJson(jsonLoc, (_fs || _load_fs()).readJsonAndFile); + _object = info.object; + _indent = detectIndent(info.content).indent || undefined; + } + manifests[_registryName] = { loc: jsonLoc, object: _object, exists: _exists, indent: _indent }; + } + return manifests; + }); - return internals.create(429, message, data, exports.tooManyRequests); -}; + function getRootManifests() { + return _ref17.apply(this, arguments); + } + return getRootManifests; + }(); -// 5xx Server Errors + /** + * Save root manifests. + */ -exports.internal = function (message, data, statusCode) { + Config.prototype.saveRootManifests = function () { + var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (manifests) { + for (var _iterator8 = (_index2 || _load_index2()).registryNames, _isArray8 = Array.isArray(_iterator8), _i9 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { + var _ref20; - return internals.serverError(message, data, statusCode, exports.internal); -}; + if (_isArray8) { + if (_i9 >= _iterator8.length) break; + _ref20 = _iterator8[_i9++]; + } else { + _i9 = _iterator8.next(); + if (_i9.done) break; + _ref20 = _i9.value; + } -internals.serverError = function (message, data, statusCode, ctor) { + var _registryName2 = _ref20; + var _manifests$_registryN = manifests[_registryName2], + _loc2 = _manifests$_registryN.loc, + _object2 = _manifests$_registryN.object, + _exists2 = _manifests$_registryN.exists, + _indent2 = _manifests$_registryN.indent; - var error; - if (data instanceof Error) { - error = exports.wrap(data, statusCode, message); - } else { - error = internals.create(statusCode || 500, message, undefined, ctor); - error.data = data; - } + if (!_exists2 && !(0, (_keys || _load_keys()).default)(_object2).length) { + continue; + } - return error; -}; + for (var _iterator9 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray9 = Array.isArray(_iterator9), _i10 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { + var _ref21; + if (_isArray9) { + if (_i10 >= _iterator9.length) break; + _ref21 = _iterator9[_i10++]; + } else { + _i10 = _iterator9.next(); + if (_i10.done) break; + _ref21 = _i10.value; + } -exports.notImplemented = function (message, data) { + var field = _ref21; - return internals.serverError(message, data, 501, exports.notImplemented); -}; + if (_object2[field]) { + _object2[field] = sortObject(_object2[field]); + } + } + yield (_fs || _load_fs()).writeFilePreservingEol(_loc2, (0, (_stringify || _load_stringify()).default)(_object2, null, _indent2 || (_constants || _load_constants()).DEFAULT_INDENT) + '\n'); + } + }); -exports.badGateway = function (message, data) { + function saveRootManifests(_x17) { + return _ref19.apply(this, arguments); + } - return internals.serverError(message, data, 502, exports.badGateway); -}; + return saveRootManifests; + }(); + /** + * Call the passed factory (defaults to fs.readJson) and rethrow a pretty error message if it was the result + * of a syntax error. + */ -exports.serverTimeout = function (message, data) { + Config.prototype.readJson = function readJson(loc) { + var factory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_fs || _load_fs()).readJson; - return internals.serverError(message, data, 503, exports.serverTimeout); -}; + try { + return factory(loc); + } catch (err) { + if (err instanceof SyntaxError) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('jsonError', loc, err.message)); + } else { + throw err; + } + } + }; + Config.create = function () { + var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var reporter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new (_index3 || _load_index3()).NoopReporter(); -exports.gatewayTimeout = function (message, data) { + var config = new Config(reporter); + yield config.init(opts); + return config; + }); - return internals.serverError(message, data, 504, exports.gatewayTimeout); -}; + function create() { + return _ref22.apply(this, arguments); + } + return create; + }(); -exports.badImplementation = function (message, data) { + return Config; +}(); - var err = internals.serverError(message, data, 500, exports.badImplementation); - err.isDeveloperError = true; - return err; -}; +exports.default = Config; +function extractWorkspaces(manifest) { + if (!manifest || !manifest.workspaces) { + return undefined; + } + + if (Array.isArray(manifest.workspaces)) { + return { packages: manifest.workspaces }; + } + + if (manifest.workspaces.packages && Array.isArray(manifest.workspaces.packages) || manifest.workspaces.nohoist && Array.isArray(manifest.workspaces.nohoist)) { + return manifest.workspaces; + } + return undefined; +} /***/ }), -/* 105 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const escapeStringRegexp = __webpack_require__(167); -const ansiStyles = __webpack_require__(355); -const supportsColor = __webpack_require__(445); -const template = __webpack_require__(446); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.Add = undefined; -const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); +var _keys; -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); +} -// `color-convert` models to exclude from the Chalk API due to conflicts and such -const skipModels = new Set(['gray']); +var _set; -const styles = Object.create(null); +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); +} -function applyOptions(obj, options) { - options = options || {}; +var _asyncToGenerator2; - // Detect level if not set manually - const scLevel = supportsColor ? supportsColor.level : 0; - obj.level = options.level === undefined ? scLevel : options.level; - obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -function Chalk(options) { - // We check for this.template here since calling `chalk.constructor()` - // by itself will have a `this` of a previously constructed chalk object - if (!this || !(this instanceof Chalk) || this.template) { - const chalk = {}; - applyOptions(chalk, options); +var _getIterator2; - chalk.template = function () { - const args = [].slice.call(arguments); - return chalkTag.apply(null, [chalk.template].concat(args)); - }; +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); +var _extends2; - chalk.template.constructor = Chalk; +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(25)); +} - return chalk.template; - } +var _classCallCheck2; - applyOptions(this, options); +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } -// Use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001B[94m'; +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); } -for (const key of Object.keys(ansiStyles)) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); +var _inherits2; - styles[key] = { - get() { - const codes = ansiStyles[key]; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], key); - } - }; +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); } -ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); -for (const model of Object.keys(ansiStyles.color.ansi)) { - if (skipModels.has(model)) { - continue; - } +var run = exports.run = function () { + var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (!args.length) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('missingAddDependencies')); + } - styles[model] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.color.close, - closeRe: ansiStyles.color.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model); - }; - } - }; -} + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); -ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); -for (const model of Object.keys(ansiStyles.bgColor.ansi)) { - if (skipModels.has(model)) { - continue; - } + yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var install = new Add(args, flags, config, reporter, lockfile); + yield install.init(); + })); + }); - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.bgColor.close, - closeRe: ansiStyles.bgColor.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model); - }; - } - }; -} + return function run(_x4, _x5, _x6, _x7) { + return _ref12.apply(this, arguments); + }; +}(); -const proto = Object.defineProperties(() => {}, styles); +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; -function build(_styles, key) { - const builder = function () { - return applyStyle.apply(builder, arguments); - }; +var _lockfile; - builder._styles = _styles; +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(20)); +} - const self = this; +var _normalizePattern2; - Object.defineProperty(builder, 'level', { - enumerable: true, - get() { - return self.level; - }, - set(level) { - self.level = level; - } - }); +function _load_normalizePattern() { + return _normalizePattern2 = __webpack_require__(42); +} - Object.defineProperty(builder, 'enabled', { - enumerable: true, - get() { - return self.enabled; - }, - set(enabled) { - self.enabled = enabled; - } - }); +var _workspaceLayout; - // See below for fix regarding invisible grey/dim combination on Windows - builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; +function _load_workspaceLayout() { + return _workspaceLayout = _interopRequireDefault(__webpack_require__(74)); +} - // `__proto__` is used because we must return a function, but there is - // no way to create a function with a different prototype - builder.__proto__ = proto; // eslint-disable-line no-proto +var _index; - return builder; +function _load_index() { + return _index = __webpack_require__(41); } -function applyStyle() { - // Support varags, but simply cast to string in case there's only one arg - const args = arguments; - const argsLen = args.length; - let str = String(arguments[0]); - - if (argsLen === 0) { - return ''; - } +var _list; - if (argsLen > 1) { - // Don't slice `arguments`, it prevents V8 optimizations - for (let a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } +function _load_list() { + return _list = __webpack_require__(227); +} - if (!this.enabled || this.level <= 0 || !str) { - return str; - } +var _install; - // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, - // see https://github.com/chalk/chalk/issues/58 - // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. - const originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && this.hasGrey) { - ansiStyles.dim.open = ''; - } +function _load_install() { + return _install = __webpack_require__(33); +} - for (const code of this._styles.slice().reverse()) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - str = code.open + str.replace(code.closeRe, code.open) + code.close; +var _errors; - // Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS - // https://github.com/chalk/chalk/pull/92 - str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); - } +function _load_errors() { + return _errors = __webpack_require__(5); +} - // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue - ansiStyles.dim.open = originalDim; +var _constants; - return str; +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); } -function chalkTag(chalk, strings) { - if (!Array.isArray(strings)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return [].slice.call(arguments, 1).join(' '); - } +var _fs; - const args = [].slice.call(arguments, 2); - const parts = [strings.raw[0]]; +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(7)); +} - for (let i = 1; i < strings.length; i++) { - parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); - parts.push(String(strings.raw[i])); - } +var _invariant; - return template(chalk, parts.join('')); +function _load_invariant() { + return _invariant = _interopRequireDefault(__webpack_require__(9)); } -Object.defineProperties(Chalk.prototype, styles); +var _path; -module.exports = Chalk(); // eslint-disable-line new-cap -module.exports.supportsColor = supportsColor; +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); +} +var _semver; -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { +function _load_semver() { + return _semver = _interopRequireDefault(__webpack_require__(21)); +} -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = __webpack_require__(89) - , TAG = __webpack_require__(30)('toStringTag') - // ES3 wrong here - , ARG = cof(function(){ return arguments; }()) == 'Arguments'; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -// fallback for IE11 Script Access Denied error -var tryGet = function(it, key){ - try { - return it[key]; - } catch(e){ /* empty */ } -}; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -module.exports = function(it){ - var O, T, B; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T - // builtinTag case - : ARG ? cof(O) - // ES3 arguments fallback - : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; -}; +var Add = exports.Add = function (_Install) { + (0, (_inherits2 || _load_inherits()).default)(Add, _Install); -/***/ }), -/* 107 */ -/***/ (function(module, exports) { + function Add(args, flags, config, reporter, lockfile) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Add); -// 7.2.1 RequireObjectCoercible(argument) -module.exports = function(it){ - if(it == undefined)throw TypeError("Can't call method on " + it); - return it; -}; + var workspaceRootIsCwd = config.cwd === config.lockfileFolder; + var _flags = flags ? (0, (_extends2 || _load_extends()).default)({}, flags, { workspaceRootIsCwd }) : { workspaceRootIsCwd }; -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Install.call(this, _flags, config, reporter, lockfile)); -var ctx = __webpack_require__(50) - , call = __webpack_require__(251) - , isArrayIter = __webpack_require__(250) - , anObject = __webpack_require__(49) - , toLength = __webpack_require__(112) - , getIterFn = __webpack_require__(165) - , BREAK = {} - , RETURN = {}; -var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ - var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) - , f = ctx(fn, that, entries ? 2 : 1) - , index = 0 - , length, step, iterator, result; - if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); - // fast case for arrays with default iterator - if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ - result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); - if(result === BREAK || result === RETURN)return result; - } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ - result = call(iterator, f, step.value, entries); - if(result === BREAK || result === RETURN)return result; + _this.args = args; + // only one flag is supported, so we can figure out which one was passed to `yarn add` + _this.flagToOrigin = [flags.dev && 'devDependencies', flags.optional && 'optionalDependencies', flags.peer && 'peerDependencies', 'dependencies'].filter(Boolean).shift(); + return _this; } -}; -exports.BREAK = BREAK; -exports.RETURN = RETURN; -/***/ }), -/* 109 */ -/***/ (function(module, exports) { + /** + * TODO + */ -module.exports = function(bitmap, value){ - return { - enumerable : !(bitmap & 1), - configurable: !(bitmap & 2), - writable : !(bitmap & 4), - value : value - }; -}; + Add.prototype.prepareRequests = function prepareRequests(requests) { + var requestsWithArgs = requests.slice(); -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { + for (var _iterator = this.args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; -var def = __webpack_require__(53).f - , has = __webpack_require__(69) - , TAG = __webpack_require__(30)('toStringTag'); + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } -module.exports = function(it, tag, stat){ - if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); -}; + var _pattern = _ref; -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { + requestsWithArgs.push({ + pattern: _pattern, + registry: 'npm', + optional: false + }); + } + return requestsWithArgs; + }; -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(158) - , defined = __webpack_require__(107); -module.exports = function(it){ - return IObject(defined(it)); -}; + /** + * returns version for a pattern based on Manifest + */ -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { -// 7.1.15 ToLength -var toInteger = __webpack_require__(163) - , min = Math.min; -module.exports = function(it){ - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; + Add.prototype.getPatternVersion = function getPatternVersion(pattern, pkg) { + var tilde = this.flags.tilde; + var configPrefix = String(this.config.getOption('save-prefix')); + var exact = this.flags.exact || Boolean(this.config.getOption('save-exact')) || configPrefix === ''; -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern), + hasVersion = _normalizePattern.hasVersion, + range = _normalizePattern.range; -// Basic Javascript Elliptic Curve implementation -// Ported loosely from BouncyCastle's Java EC code -// Only Fp curves implemented for now + var version = void 0; -// Requires jsbn.js and jsbn2.js -var BigInteger = __webpack_require__(57).BigInteger -var Barrett = BigInteger.prototype.Barrett + if ((0, (_index || _load_index()).getExoticResolver)(pattern)) { + // wasn't a name/range tuple so this is just a raw exotic pattern + version = pattern; + } else if (hasVersion && range && ((_semver || _load_semver()).default.satisfies(pkg.version, range) || (0, (_index || _load_index()).getExoticResolver)(range))) { + // if the user specified a range then use it verbatim + version = range; + } -// ---------------- -// ECFieldElementFp + if (!version || (_semver || _load_semver()).default.valid(version)) { + var prefix = configPrefix || '^'; -// constructor -function ECFieldElementFp(q,x) { - this.x = x; - // TODO if(x.compareTo(q) >= 0) error - this.q = q; -} + if (tilde) { + prefix = '~'; + } else if (version || exact) { + prefix = ''; + } + version = `${prefix}${pkg.version}`; + } -function feFpEquals(other) { - if(other == this) return true; - return (this.q.equals(other.q) && this.x.equals(other.x)); -} + return version; + }; -function feFpToBigInteger() { - return this.x; -} + Add.prototype.preparePatterns = function preparePatterns(patterns) { + var preparedPatterns = patterns.slice(); + for (var _iterator2 = this.resolver.dedupePatterns(this.args), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref2; -function feFpNegate() { - return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); -} + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } -function feFpAdd(b) { - return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); -} + var _pattern2 = _ref2; -function feFpSubtract(b) { - return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); -} + var pkg = this.resolver.getResolvedPattern(_pattern2); + (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${_pattern2}`); + var _version = this.getPatternVersion(_pattern2, pkg); + var newPattern = `${pkg.name}@${_version}`; + preparedPatterns.push(newPattern); + this.addedPatterns.push(newPattern); + if (newPattern === _pattern2) { + continue; + } + this.resolver.replacePattern(_pattern2, newPattern); + } + return preparedPatterns; + }; -function feFpMultiply(b) { - return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); -} + Add.prototype.preparePatternsForLinking = function preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { + // remove the newly added patterns if cwd != root and update the in-memory package dependency instead + if (cwdIsRoot) { + return patterns; + } -function feFpSquare() { - return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); -} + var manifest = void 0; + var cwdPackage = `${cwdManifest.name}@${cwdManifest.version}`; + try { + manifest = this.resolver.getStrictResolvedPattern(cwdPackage); + } catch (e) { + this.reporter.warn(this.reporter.lang('unknownPackage', cwdPackage)); + return patterns; + } -function feFpDivide(b) { - return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); -} + var newPatterns = patterns; + this._iterateAddedPackages(function (pattern, registry, dependencyType, pkgName, version) { + // remove added package from patterns list + var filtered = newPatterns.filter(function (p) { + return p !== pattern; + }); + (0, (_invariant || _load_invariant()).default)(newPatterns.length - filtered.length > 0, `expect added pattern '${pattern}' in the list: ${patterns.toString()}`); + newPatterns = filtered; -ECFieldElementFp.prototype.equals = feFpEquals; -ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger; -ECFieldElementFp.prototype.negate = feFpNegate; -ECFieldElementFp.prototype.add = feFpAdd; -ECFieldElementFp.prototype.subtract = feFpSubtract; -ECFieldElementFp.prototype.multiply = feFpMultiply; -ECFieldElementFp.prototype.square = feFpSquare; -ECFieldElementFp.prototype.divide = feFpDivide; + // add new package into in-memory manifest so they can be linked properly + manifest[dependencyType] = manifest[dependencyType] || {}; + if (manifest[dependencyType][pkgName] === version) { + // package already existed + return; + } -// ---------------- -// ECPointFp + // update dependencies in the manifest + (0, (_invariant || _load_invariant()).default)(manifest._reference, 'manifest._reference should not be null'); + var ref = manifest._reference; -// constructor -function ECPointFp(curve,x,y,z) { - this.curve = curve; - this.x = x; - this.y = y; - // Projective coordinates: either zinv == null or z * zinv == 1 - // z and zinv are just BigIntegers, not fieldElements - if(z == null) { - this.z = BigInteger.ONE; - } - else { - this.z = z; - } - this.zinv = null; - //TODO: compression flag -} + ref['dependencies'] = ref['dependencies'] || []; + ref['dependencies'].push(pattern); + }); -function pointFpGetX() { - if(this.zinv == null) { - this.zinv = this.z.modInverse(this.curve.q); - } - var r = this.x.toBigInteger().multiply(this.zinv); - this.curve.reduce(r); - return this.curve.fromBigInteger(r); -} + return newPatterns; + }; -function pointFpGetY() { - if(this.zinv == null) { - this.zinv = this.z.modInverse(this.curve.q); + Add.prototype.bailout = function () { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) { + var lockfileCache = this.lockfile.cache; + if (!lockfileCache) { + return false; + } + var match = yield this.integrityChecker.check(patterns, lockfileCache, this.flags, workspaceLayout); + var haveLockfile = yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); + if (match.integrityFileMissing && haveLockfile) { + // Integrity file missing, force script installations + this.scripts.setForce(true); + } + return false; + }); + + function bailout(_x, _x2) { + return _ref3.apply(this, arguments); } - var r = this.y.toBigInteger().multiply(this.zinv); - this.curve.reduce(r); - return this.curve.fromBigInteger(r); -} -function pointFpEquals(other) { - if(other == this) return true; - if(this.isInfinity()) return other.isInfinity(); - if(other.isInfinity()) return this.isInfinity(); - var u, v; - // u = Y2 * Z1 - Y1 * Z2 - u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q); - if(!u.equals(BigInteger.ZERO)) return false; - // v = X2 * Z1 - X1 * Z2 - v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q); - return v.equals(BigInteger.ZERO); -} + return bailout; + }(); -function pointFpIsInfinity() { - if((this.x == null) && (this.y == null)) return true; - return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); -} + /** + * Description + */ -function pointFpNegate() { - return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); -} + Add.prototype.init = function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var isWorkspaceRoot = this.config.workspaceRootFolder && this.config.cwd === this.config.workspaceRootFolder; -function pointFpAdd(b) { - if(this.isInfinity()) return b; - if(b.isInfinity()) return this; + // running "yarn add something" in a workspace root is often a mistake + if (isWorkspaceRoot && !this.flags.ignoreWorkspaceRootCheck) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesAddRootCheck')); + } - // u = Y2 * Z1 - Y1 * Z2 - var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q); - // v = X2 * Z1 - X1 * Z2 - var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); + this.addedPatterns = []; + var patterns = yield (_install || _load_install()).Install.prototype.init.call(this); + yield this.maybeOutputSaveTree(patterns); + yield this.savePackages(); + return patterns; + }); - if(BigInteger.ZERO.equals(v)) { - if(BigInteger.ZERO.equals(u)) { - return this.twice(); // this == b, so double - } - return this.curve.getInfinity(); // this = -b, so infinity + function init() { + return _ref4.apply(this, arguments); } - var THREE = new BigInteger("3"); - var x1 = this.x.toBigInteger(); - var y1 = this.y.toBigInteger(); - var x2 = b.x.toBigInteger(); - var y2 = b.y.toBigInteger(); + return init; + }(); - var v2 = v.square(); - var v3 = v2.multiply(v); - var x1v2 = x1.multiply(v2); - var zu2 = u.square().multiply(this.z); + /** + * Description + */ - // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3) - var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q); - // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3 - var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q); - // z3 = v^3 * z1 * z2 - var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q); + Add.prototype.fetchRequestFromCwd = function fetchRequestFromCwd() { + return (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this, this.args); + }; - return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); -} + /** + * Output a tree of any newly added dependencies. + */ -function pointFpTwice() { - if(this.isInfinity()) return this; - if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity(); + Add.prototype.maybeOutputSaveTree = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns) { + // don't limit the shown tree depth + var opts = { + reqDepth: 0 + }; - // TODO: optimized handling of constants - var THREE = new BigInteger("3"); - var x1 = this.x.toBigInteger(); - var y1 = this.y.toBigInteger(); + // restore the original patterns + var merged = [].concat(patterns, this.addedPatterns); - var y1z1 = y1.multiply(this.z); - var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q); - var a = this.curve.a.toBigInteger(); + var _ref6 = yield (0, (_list || _load_list()).buildTree)(this.resolver, this.linker, merged, opts, true, true), + trees = _ref6.trees, + count = _ref6.count; - // w = 3 * x1^2 + a * z1^2 - var w = x1.square().multiply(THREE); - if(!BigInteger.ZERO.equals(a)) { - w = w.add(this.z.square().multiply(a)); - } - w = w.mod(this.curve.q); - //this.curve.reduce(w); - // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1) - var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q); - // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3 - var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q); - // z3 = 8 * (y1 * z1)^3 - var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q); + if (count === 1) { + this.reporter.success(this.reporter.lang('savedNewDependency')); + } else { + this.reporter.success(this.reporter.lang('savedNewDependencies', count)); + } - return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); -} + if (!count) { + return; + } -// Simple NAF (Non-Adjacent Form) multiplication algorithm -// TODO: modularize the multiplication algorithm -function pointFpMultiply(k) { - if(this.isInfinity()) return this; - if(k.signum() == 0) return this.curve.getInfinity(); + var resolverPatterns = new (_set || _load_set()).default(); + for (var _iterator3 = patterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref7; - var e = k; - var h = e.multiply(new BigInteger("3")); + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref7 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref7 = _i3.value; + } - var neg = this.negate(); - var R = this; + var _pattern3 = _ref7; - var i; - for(i = h.bitLength() - 2; i > 0; --i) { - R = R.twice(); + var _ref9 = this.resolver.getResolvedPattern(_pattern3) || {}, + _version2 = _ref9.version, + name = _ref9.name; - var hBit = h.testBit(i); - var eBit = e.testBit(i); + resolverPatterns.add(`${name}@${_version2}`); + } + var directRequireDependencies = trees.filter(function (_ref8) { + var name = _ref8.name; + return resolverPatterns.has(name); + }); - if (hBit != eBit) { - R = R.add(hBit ? this : neg); - } + this.reporter.info(this.reporter.lang('directDependencies')); + this.reporter.tree('newDirectDependencies', directRequireDependencies); + this.reporter.info(this.reporter.lang('allDependencies')); + this.reporter.tree('newAllDependencies', trees); + }); + + function maybeOutputSaveTree(_x3) { + return _ref5.apply(this, arguments); } - return R; -} + return maybeOutputSaveTree; + }(); -// Compute this*j + x*k (simultaneous multiplication) -function pointFpMultiplyTwo(j,x,k) { - var i; - if(j.bitLength() > k.bitLength()) - i = j.bitLength() - 1; - else - i = k.bitLength() - 1; + /** + * Save added packages to manifest if any of the --save flags were used. + */ - var R = this.curve.getInfinity(); - var both = this.add(x); - while(i >= 0) { - R = R.twice(); - if(j.testBit(i)) { - if(k.testBit(i)) { - R = R.add(both); - } - else { - R = R.add(this); - } + Add.prototype.savePackages = function () { + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _this2 = this; + + // fill rootPatternsToOrigin without `excludePatterns` + yield (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this); + // // get all the different registry manifests in this folder + var manifests = yield this.config.getRootManifests(); + + this._iterateAddedPackages(function (pattern, registry, dependencyType, pkgName, version) { + // add it to manifest + var object = manifests[registry].object; + + + object[dependencyType] = object[dependencyType] || {}; + object[dependencyType][pkgName] = version; + + if (dependencyType !== _this2.flagToOrigin) { + _this2.reporter.warn(_this2.reporter.lang('moduleAlreadyInManifest', pkgName, dependencyType, _this2.flagToOrigin)); + } + }); + + yield this.config.saveRootManifests(manifests); + }); + + function savePackages() { + return _ref10.apply(this, arguments); } - else { - if(k.testBit(i)) { - R = R.add(x); + + return savePackages; + }(); + + Add.prototype._iterateAddedPackages = function _iterateAddedPackages(f) { + var _this3 = this; + + var patternOrigins = (0, (_keys || _load_keys()).default)(this.rootPatternsToOrigin); + + // add new patterns to their appropriate registry manifest + + var _loop = function _loop(_pattern4) { + var pkg = _this3.resolver.getResolvedPattern(_pattern4); + (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${_pattern4}`); + var version = _this3.getPatternVersion(_pattern4, pkg); + var ref = pkg._reference; + (0, (_invariant || _load_invariant()).default)(ref, 'expected package reference'); + // lookup the package to determine dependency type; used during `yarn upgrade` + var depType = patternOrigins.reduce(function (acc, prev) { + if (prev.indexOf(`${pkg.name}@`) === 0) { + return _this3.rootPatternsToOrigin[prev]; + } + return acc; + }, null); + + // depType is calculated when `yarn upgrade` command is used + var target = depType || _this3.flagToOrigin; + + f(_pattern4, ref.registry, target, pkg.name, version); + }; + + for (var _iterator4 = this.addedPatterns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref11; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref11 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref11 = _i4.value; } - } - --i; - } - return R; -} + var _pattern4 = _ref11; -ECPointFp.prototype.getX = pointFpGetX; -ECPointFp.prototype.getY = pointFpGetY; -ECPointFp.prototype.equals = pointFpEquals; -ECPointFp.prototype.isInfinity = pointFpIsInfinity; -ECPointFp.prototype.negate = pointFpNegate; -ECPointFp.prototype.add = pointFpAdd; -ECPointFp.prototype.twice = pointFpTwice; -ECPointFp.prototype.multiply = pointFpMultiply; -ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo; + _loop(_pattern4); + } + }; -// ---------------- -// ECCurveFp + return Add; +}((_install || _load_install()).Install); -// constructor -function ECCurveFp(q,a,b) { - this.q = q; - this.a = this.fromBigInteger(a); - this.b = this.fromBigInteger(b); - this.infinity = new ECPointFp(this, null, null); - this.reducer = new Barrett(this.q); +function hasWrapper(commander) { + return true; } -function curveFpGetQ() { - return this.q; +function setFlags(commander) { + commander.description('Installs a package and any packages that it depends on.'); + commander.usage('add [packages ...] [flags]'); + commander.option('-W, --ignore-workspace-root-check', 'required to run yarn add inside a workspace root'); + commander.option('-D, --dev', 'save package to your `devDependencies`'); + commander.option('-P, --peer', 'save package to your `peerDependencies`'); + commander.option('-O, --optional', 'save package to your `optionalDependencies`'); + commander.option('-E, --exact', 'install exact version'); + commander.option('-T, --tilde', 'install most recent release with the same minor version'); } -function curveFpGetA() { - return this.a; -} +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { -function curveFpGetB() { - return this.b; +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.pack = exports.packTarball = undefined; + +var _promise; + +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); } -function curveFpEquals(other) { - if(other == this) return true; - return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b)); +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } -function curveFpGetInfinity() { - return this.infinity; +var _from; + +function _load_from() { + return _from = _interopRequireDefault(__webpack_require__(92)); } -function curveFpFromBigInteger(x) { - return new ECFieldElementFp(this.q, x); +var _set; + +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); } -function curveReduce(x) { - this.reducer.reduce(x); +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -// for now, work with hex strings because they're easier in JS -function curveFpDecodePointHex(s) { - switch(parseInt(s.substr(0,2), 16)) { // first byte - case 0: - return this.infinity; - case 2: - case 3: - // point compression not supported yet - return null; - case 4: - case 6: - case 7: - var len = (s.length - 2) / 2; - var xHex = s.substr(2, len); - var yHex = s.substr(len+2, len); +var packTarball = exports.packTarball = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { + var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + mapHeader = _ref2.mapHeader; - return new ECPointFp(this, - this.fromBigInteger(new BigInteger(xHex, 16)), - this.fromBigInteger(new BigInteger(yHex, 16))); + var pkg = yield config.readRootManifest(); + var bundledDependencies = pkg.bundledDependencies, + main = pkg.main, + onlyFiles = pkg.files; - default: // unsupported - return null; + // include required files + + var filters = NEVER_IGNORE.slice(); + // include default filters unless `files` is used + if (!onlyFiles) { + filters = filters.concat(DEFAULT_IGNORE); + } + if (main) { + filters = filters.concat((0, (_filter || _load_filter()).ignoreLinesToRegex)(['!/' + main])); } -} -function curveFpEncodePointHex(p) { - if (p.isInfinity()) return "00"; - var xHex = p.getX().toBigInteger().toString(16); - var yHex = p.getY().toBigInteger().toString(16); - var oLen = this.getQ().toString(16).length; - if ((oLen % 2) != 0) oLen++; - while (xHex.length < oLen) { - xHex = "0" + xHex; - } - while (yHex.length < oLen) { - yHex = "0" + yHex; - } - return "04" + xHex + yHex; -} + // include bundledDependencies + if (bundledDependencies) { + var folder = config.getFolder(pkg); + filters = (0, (_filter || _load_filter()).ignoreLinesToRegex)(bundledDependencies.map(function (name) { + return `!${folder}/${name}`; + }), '.'); + } -ECCurveFp.prototype.getQ = curveFpGetQ; -ECCurveFp.prototype.getA = curveFpGetA; -ECCurveFp.prototype.getB = curveFpGetB; -ECCurveFp.prototype.equals = curveFpEquals; -ECCurveFp.prototype.getInfinity = curveFpGetInfinity; -ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger; -ECCurveFp.prototype.reduce = curveReduce; -//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex; -ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex; + // `files` field + if (onlyFiles) { + var lines = ['*']; + lines = lines.concat(onlyFiles.map(function (filename) { + return `!${filename}`; + }), onlyFiles.map(function (filename) { + return `!${path.join(filename, '**')}`; + })); + var regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, '.'); + filters = filters.concat(regexes); + } -// from: https://github.com/kaielvin/jsbn-ec-point-compression -ECCurveFp.prototype.decodePointHex = function(s) -{ - var yIsEven; - switch(parseInt(s.substr(0,2), 16)) { // first byte - case 0: - return this.infinity; - case 2: - yIsEven = false; - case 3: - if(yIsEven == undefined) yIsEven = true; - var len = s.length - 2; - var xHex = s.substr(2, len); - var x = this.fromBigInteger(new BigInteger(xHex,16)); - var alpha = x.multiply(x.square().add(this.getA())).add(this.getB()); - var beta = alpha.sqrt(); + var files = yield (_fs || _load_fs()).walk(config.cwd, null, new (_set || _load_set()).default(FOLDERS_IGNORE)); + var dotIgnoreFiles = (0, (_filter || _load_filter()).filterOverridenGitignores)(files); - if (beta == null) throw "Invalid point compression"; + // create ignores + for (var _iterator = dotIgnoreFiles, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref3; - var betaValue = beta.toBigInteger(); - if (betaValue.testBit(0) != yIsEven) - { - // Use the other root - beta = this.fromBigInteger(this.getQ().subtract(betaValue)); - } - return new ECPointFp(this,x,beta); - case 4: - case 6: - case 7: - var len = (s.length - 2) / 2; - var xHex = s.substr(2, len); - var yHex = s.substr(len+2, len); + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } - return new ECPointFp(this, - this.fromBigInteger(new BigInteger(xHex, 16)), - this.fromBigInteger(new BigInteger(yHex, 16))); + var file = _ref3; - default: // unsupported - return null; + var raw = yield (_fs || _load_fs()).readFile(file.absolute); + var _lines = raw.split('\n'); + + var _regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(_lines, path.dirname(file.relative)); + filters = filters.concat(_regexes); } -} -ECCurveFp.prototype.encodeCompressedPointHex = function(p) -{ - if (p.isInfinity()) return "00"; - var xHex = p.getX().toBigInteger().toString(16); - var oLen = this.getQ().toString(16).length; - if ((oLen % 2) != 0) oLen++; - while (xHex.length < oLen) - xHex = "0" + xHex; - var yPrefix; - if(p.getY().toBigInteger().isEven()) yPrefix = "02"; - else yPrefix = "03"; - return yPrefix + xHex; -} + // files to definitely keep, takes precedence over ignore filter + var keepFiles = new (_set || _load_set()).default(); + // files to definitely ignore + var ignoredFiles = new (_set || _load_set()).default(); -ECFieldElementFp.prototype.getR = function() -{ - if(this.r != undefined) return this.r; + // list of files that didn't match any of our patterns, if a directory in the chain above was matched + // then we should inherit it + var possibleKeepFiles = new (_set || _load_set()).default(); - this.r = null; - var bitLength = this.q.bitLength(); - if (bitLength > 128) - { - var firstWord = this.q.shiftRight(bitLength - 64); - if (firstWord.intValue() == -1) - { - this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q); + // apply filters + (0, (_filter || _load_filter()).sortFilter)(files, filters, keepFiles, possibleKeepFiles, ignoredFiles); + + var packer = tar.pack(config.cwd, { + ignore: function ignore(name) { + var relative = path.relative(config.cwd, name); + // Don't ignore directories, since we need to recurse inside them to check for unignored files. + if (fs2.lstatSync(name).isDirectory()) { + var isParentOfKeptFile = (0, (_from || _load_from()).default)(keepFiles).some(function (name) { + return !path.relative(relative, name).startsWith('..'); + }); + return !isParentOfKeptFile; } + // Otherwise, ignore a file if we're not supposed to keep it. + return !keepFiles.has(relative); + }, + map: function map(header) { + var suffix = header.name === '.' ? '' : `/${header.name}`; + header.name = `package${suffix}`; + delete header.uid; + delete header.gid; + return mapHeader ? mapHeader(header) : header; + } + }); + + return packer; + }); + + return function packTarball(_x) { + return _ref.apply(this, arguments); + }; +}(); + +var pack = exports.pack = function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, dir) { + var packer = yield packTarball(config); + var compressor = packer.pipe(new zlib.Gzip()); + + return compressor; + }); + + return function pack(_x3, _x4) { + return _ref4.apply(this, arguments); + }; +}(); + +var run = exports.run = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var pkg = yield config.readRootManifest(); + if (!pkg.name) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); } - return this.r; + if (!pkg.version) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion')); + } + + var normaliseScope = function normaliseScope(name) { + return name[0] === '@' ? name.substr(1).replace('/', '-') : name; + }; + var filename = flags.filename || path.join(config.cwd, `${normaliseScope(pkg.name)}-v${pkg.version}.tgz`); + + yield config.executeLifecycleScript('prepack'); + + var stream = yield pack(config, config.cwd); + + yield new (_promise || _load_promise()).default(function (resolve, reject) { + stream.pipe(fs2.createWriteStream(filename)); + stream.on('error', reject); + stream.on('close', resolve); + }); + + yield config.executeLifecycleScript('postpack'); + + reporter.success(reporter.lang('packWroteTarball', filename)); + }); + + return function run(_x5, _x6, _x7, _x8) { + return _ref5.apply(this, arguments); + }; +}(); + +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(7)); } -ECFieldElementFp.prototype.modMult = function(x1,x2) -{ - return this.modReduce(x1.multiply(x2)); + +var _filter; + +function _load_filter() { + return _filter = __webpack_require__(245); } -ECFieldElementFp.prototype.modReduce = function(x) -{ - if (this.getR() != null) - { - var qLen = q.bitLength(); - while (x.bitLength() > (qLen + 1)) - { - var u = x.shiftRight(qLen); - var v = x.subtract(u.shiftLeft(qLen)); - if (!this.getR().equals(BigInteger.ONE)) - { - u = u.multiply(this.getR()); - } - x = u.add(v); - } - while (x.compareTo(q) >= 0) - { - x = x.subtract(q); - } - } - else - { - x = x.mod(q); - } - return x; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); } -ECFieldElementFp.prototype.sqrt = function() -{ - if (!this.q.testBit(0)) throw "unsupported"; - // p mod 4 == 3 - if (this.q.testBit(1)) - { - var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); - return z.square().equals(this) ? z : null; - } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - // p mod 4 == 1 - var qMinusOne = this.q.subtract(BigInteger.ONE); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var legendreExponent = qMinusOne.shiftRight(1); - if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE))) - { - return null; - } +var zlib = __webpack_require__(201); +var path = __webpack_require__(0); +var tar = __webpack_require__(138); +var fs2 = __webpack_require__(10); - var u = qMinusOne.shiftRight(2); - var k = u.shiftLeft(1).add(BigInteger.ONE); +var FOLDERS_IGNORE = [ +// never allow version control folders +'.git', 'CVS', '.svn', '.hg', 'node_modules']; - var Q = this.x; - var fourQ = modDouble(modDouble(Q)); +var DEFAULT_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([].concat(FOLDERS_IGNORE, [ - var U, V; - do - { - var P; - do - { - P = new BigInteger(this.q.bitLength(), new SecureRandom()); - } - while (P.compareTo(this.q) >= 0 - || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne))); +// ignore cruft +'yarn.lock', '.lock-wscript', '.wafpickle-{0..9}', '*.swp', '._*', 'npm-debug.log', 'yarn-error.log', '.npmrc', '.yarnrc', '.npmignore', '.gitignore', '.DS_Store'])); - var result = this.lucasSequence(P, Q, k); - U = result[0]; - V = result[1]; +var NEVER_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([ +// never ignore these files +'!/package.json', '!/readme*', '!/+(license|licence)*', '!/+(changes|changelog|history)*']); - if (this.modMult(V, V).equals(fourQ)) - { - // Integer division by 2, mod q - if (V.testBit(0)) - { - V = V.add(q); - } +function setFlags(commander) { + commander.description('Creates a compressed gzip archive of package dependencies.'); + commander.option('-f, --filename ', 'filename'); +} - V = V.shiftRight(1); +function hasWrapper(commander, args) { + return true; +} - return new ECFieldElementFp(q,V); - } - } - while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { - return null; +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _stringify; + +function _load_stringify() { + return _stringify = _interopRequireDefault(__webpack_require__(32)); } -ECFieldElementFp.prototype.lucasSequence = function(P,Q,k) -{ - var n = k.bitLength(); - var s = k.getLowestSetBit(); - var Uh = BigInteger.ONE; - var Vl = BigInteger.TWO; - var Vh = P; - var Ql = BigInteger.ONE; - var Qh = BigInteger.ONE; +var _asyncToGenerator2; - for (var j = n - 1; j >= s + 1; --j) - { - Ql = this.modMult(Ql, Qh); +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} - if (k.testBit(j)) - { - Qh = this.modMult(Ql, Q); - Uh = this.modMult(Uh, Vh); - Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); - Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1))); - } - else - { - Qh = Ql; - Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); - Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); - Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); - } - } +var _promise; - Ql = this.modMult(Ql, Qh); - Qh = this.modMult(Ql, Q); - Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); - Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); - Ql = this.modMult(Ql, Qh); +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} - for (var j = 1; j <= s; ++j) - { - Uh = this.modMult(Uh, Vl); - Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); - Ql = this.modMult(Ql, Ql); - } +var _classCallCheck2; - return [ Uh, Vl ]; +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } -var exports = { - ECCurveFp: ECCurveFp, - ECPointFp: ECPointFp, - ECFieldElementFp: ECFieldElementFp +var _index; + +function _load_index() { + return _index = _interopRequireDefault(__webpack_require__(156)); } -module.exports = exports +var _constants; +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { +var _fs; -// Load modules - -var Sntp = __webpack_require__(297); -var Boom = __webpack_require__(104); - - -// Declare internals - -var internals = {}; - - -exports.version = function () { - - return __webpack_require__(560).version; -}; - - -exports.limits = { - maxMatchLength: 4096 // Limit the length of uris and headers to avoid a DoS attack on string matching -}; - - -// Extract host and port from request - -// $1 $2 -internals.hostHeaderRegex = /^(?:(?:\r\n)?\s)*((?:[^:]+)|(?:\[[^\]]+\]))(?::(\d+))?(?:(?:\r\n)?\s)*$/; // (IPv4, hostname)|(IPv6) - - -exports.parseHost = function (req, hostHeaderName) { - - hostHeaderName = (hostHeaderName ? hostHeaderName.toLowerCase() : 'host'); - var hostHeader = req.headers[hostHeaderName]; - if (!hostHeader) { - return null; - } - - if (hostHeader.length > exports.limits.maxMatchLength) { - return null; - } - - var hostParts = hostHeader.match(internals.hostHeaderRegex); - if (!hostParts) { - return null; - } - - return { - name: hostParts[1], - port: (hostParts[2] ? hostParts[2] : (req.connection && req.connection.encrypted ? 443 : 80)) - }; -}; - - -// Parse Content-Type header content - -exports.parseContentType = function (header) { - - if (!header) { - return ''; - } - - return header.split(';')[0].trim().toLowerCase(); -}; - - -// Convert node's to request configuration object - -exports.parseRequest = function (req, options) { - - if (!req.headers) { - return req; - } - - // Obtain host and port information - - var host; - if (!options.host || - !options.port) { - - host = exports.parseHost(req, options.hostHeaderName); - if (!host) { - return new Error('Invalid Host header'); - } - } - - var request = { - method: req.method, - url: req.url, - host: options.host || host.name, - port: options.port || host.port, - authorization: req.headers.authorization, - contentType: req.headers['content-type'] || '' - }; - - return request; -}; - - -exports.now = function (localtimeOffsetMsec) { - - return Sntp.now() + (localtimeOffsetMsec || 0); -}; - - -exports.nowSecs = function (localtimeOffsetMsec) { - - return Math.floor(exports.now(localtimeOffsetMsec) / 1000); -}; - - -internals.authHeaderRegex = /^(\w+)(?:\s+(.*))?$/; // Header: scheme[ something] -internals.attributeRegex = /^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/; // !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9 - - -// Parse Hawk HTTP Authorization header - -exports.parseAuthorizationHeader = function (header, keys) { - - keys = keys || ['id', 'ts', 'nonce', 'hash', 'ext', 'mac', 'app', 'dlg']; - - if (!header) { - return Boom.unauthorized(null, 'Hawk'); - } - - if (header.length > exports.limits.maxMatchLength) { - return Boom.badRequest('Header length too long'); - } - - var headerParts = header.match(internals.authHeaderRegex); - if (!headerParts) { - return Boom.badRequest('Invalid header syntax'); - } - - var scheme = headerParts[1]; - if (scheme.toLowerCase() !== 'hawk') { - return Boom.unauthorized(null, 'Hawk'); - } - - var attributesString = headerParts[2]; - if (!attributesString) { - return Boom.badRequest('Invalid header syntax'); - } - - var attributes = {}; - var errorMessage = ''; - var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) { - - // Check valid attribute names - - if (keys.indexOf($1) === -1) { - errorMessage = 'Unknown attribute: ' + $1; - return; - } - - // Allowed attribute value characters - - if ($2.match(internals.attributeRegex) === null) { - errorMessage = 'Bad attribute value: ' + $1; - return; - } - - // Check for duplicates - - if (attributes.hasOwnProperty($1)) { - errorMessage = 'Duplicate attribute: ' + $1; - return; - } - - attributes[$1] = $2; - return ''; - }); - - if (verify !== '') { - return Boom.badRequest(errorMessage || 'Bad header format'); - } - - return attributes; -}; - - -exports.unauthorized = function (message, attributes) { - - return Boom.unauthorized(message, 'Hawk', attributes); -}; - - - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(7)); +} -// Load modules +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -var Crypto = __webpack_require__(9); -var Path = __webpack_require__(1); -var Util = __webpack_require__(2); -var Escape = __webpack_require__(561); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var path = __webpack_require__(0); +/* eslint no-unused-vars: 0 */ -// Declare internals +var BaseFetcher = function () { + function BaseFetcher(dest, remote, config) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseFetcher); -var internals = {}; + this.reporter = config.reporter; + this.packageName = remote.packageName; + this.reference = remote.reference; + this.registry = remote.registry; + this.hash = remote.hash; + this.remote = remote; + this.config = config; + this.dest = dest; + } + BaseFetcher.prototype.setupMirrorFromCache = function setupMirrorFromCache() { + // fetcher subclasses may use this to perform actions such as copying over a cached tarball to the offline + // mirror etc + return (_promise || _load_promise()).default.resolve(); + }; -// Clone object or array + BaseFetcher.prototype._fetch = function _fetch() { + return (_promise || _load_promise()).default.reject(new Error('Not implemented')); + }; -exports.clone = function (obj, seen) { + BaseFetcher.prototype.fetch = function fetch(defaultManifest) { + var _this = this; - if (typeof obj !== 'object' || - obj === null) { + return (_fs || _load_fs()).lockQueue.push(this.dest, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield (_fs || _load_fs()).mkdirp(_this.dest); - return obj; - } + // fetch package and get the hash - seen = seen || { orig: [], copy: [] }; + var _ref2 = yield _this._fetch(), + hash = _ref2.hash; - var lookup = seen.orig.indexOf(obj); - if (lookup !== -1) { - return seen.copy[lookup]; - } + var pkg = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // load the new normalized manifest + try { + return yield _this.config.readManifest(_this.dest, _this.registry); + } catch (e) { + if (e.code === 'ENOENT' && defaultManifest) { + return (0, (_index || _load_index()).default)(defaultManifest, _this.dest, _this.config, false); + } else { + throw e; + } + } + })(); - var newObj; - var cloneDeep = false; + yield (_fs || _load_fs()).writeFile(path.join(_this.dest, (_constants || _load_constants()).METADATA_FILENAME), (0, (_stringify || _load_stringify()).default)({ + manifest: pkg, + artifacts: [], + remote: _this.remote, + registry: _this.registry, + hash + }, null, ' ')); - if (!Array.isArray(obj)) { - if (Buffer.isBuffer(obj)) { - newObj = new Buffer(obj); - } - else if (obj instanceof Date) { - newObj = new Date(obj.getTime()); - } - else if (obj instanceof RegExp) { - newObj = new RegExp(obj); - } - else { - var proto = Object.getPrototypeOf(obj); - if (proto && - proto.isImmutable) { + return { + hash, + dest: _this.dest, + package: pkg, + cached: false + }; + })); + }; - newObj = obj; - } - else { - newObj = Object.create(proto); - cloneDeep = true; - } - } - } - else { - newObj = []; - cloneDeep = true; - } + return BaseFetcher; +}(); - seen.orig.push(obj); - seen.copy.push(newObj); +exports.default = BaseFetcher; - if (cloneDeep) { - var keys = Object.getOwnPropertyNames(obj); - for (var i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - var descriptor = Object.getOwnPropertyDescriptor(obj, key); - if (descriptor && - (descriptor.get || - descriptor.set)) { +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { - Object.defineProperty(newObj, key, descriptor); - } - else { - newObj[key] = exports.clone(obj[key], seen); - } - } - } +"use strict"; - return newObj; -}; +Object.defineProperty(exports, "__esModule", { + value: true +}); -// Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied -/*eslint-disable */ -exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) { -/*eslint-enable */ - exports.assert(target && typeof target === 'object', 'Invalid target value: must be an object'); - exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object'); +var _promise; - if (!source) { - return target; - } +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} - if (Array.isArray(source)) { - exports.assert(Array.isArray(target), 'Cannot merge array onto an object'); - if (isMergeArrays === false) { // isMergeArrays defaults to true - target.length = 0; // Must not change target assignment - } +var _keys; - for (var i = 0, il = source.length; i < il; ++i) { - target.push(exports.clone(source[i])); - } +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); +} - return target; - } +var _stringify; - var keys = Object.keys(source); - for (var k = 0, kl = keys.length; k < kl; ++k) { - var key = keys[k]; - var value = source[key]; - if (value && - typeof value === 'object') { +function _load_stringify() { + return _stringify = _interopRequireDefault(__webpack_require__(32)); +} - if (!target[key] || - typeof target[key] !== 'object' || - (Array.isArray(target[key]) ^ Array.isArray(value)) || - value instanceof Date || - Buffer.isBuffer(value) || - value instanceof RegExp) { +var _classCallCheck2; - target[key] = exports.clone(value); - } - else { - exports.merge(target[key], value, isNullOverride, isMergeArrays); - } - } - else { - if (value !== null && - value !== undefined) { // Explicit to preserve empty strings +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} - target[key] = value; - } - else if (isNullOverride !== false) { // Defaults to true - target[key] = value; - } - } - } +var _map; - return target; -}; +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(34)); +} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -// Apply options to a copy of the defaults +var debug = __webpack_require__(523)('yarn'); -exports.applyToDefaults = function (defaults, options, isNullOverride) { +var BlockingQueue = function () { + function BlockingQueue(alias) { + var maxConcurrency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BlockingQueue); - exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object'); - exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object'); + this.concurrencyQueue = []; + this.maxConcurrency = maxConcurrency; + this.runningCount = 0; + this.warnedStuck = false; + this.alias = alias; + this.first = true; - if (!options) { // If no options, return null - return null; - } + this.running = (0, (_map || _load_map()).default)(); + this.queue = (0, (_map || _load_map()).default)(); - var copy = exports.clone(defaults); + this.stuckTick = this.stuckTick.bind(this); + } - if (options === true) { // If options is set to true, use defaults - return copy; + BlockingQueue.prototype.stillActive = function stillActive() { + if (this.stuckTimer) { + clearTimeout(this.stuckTimer); } - return exports.merge(copy, options, isNullOverride === true, false); -}; - + this.stuckTimer = setTimeout(this.stuckTick, 5000); -// Clone an object except for the listed keys which are shallow copied + // We need to check the existense of unref because of https://github.com/facebook/jest/issues/4559 + // $FlowFixMe: Node's setInterval returns a Timeout, not a Number + this.stuckTimer.unref && this.stuckTimer.unref(); + }; -exports.cloneWithShallow = function (source, keys) { + BlockingQueue.prototype.stuckTick = function stuckTick() { + if (this.runningCount === 1) { + this.warnedStuck = true; + debug(`The ${(0, (_stringify || _load_stringify()).default)(this.alias)} blocking queue may be stuck. 5 seconds ` + `without any activity with 1 worker: ${(0, (_keys || _load_keys()).default)(this.running)[0]}`); + } + }; - if (!source || - typeof source !== 'object') { + BlockingQueue.prototype.push = function push(key, factory) { + var _this = this; - return source; + if (this.first) { + this.first = false; + } else { + this.stillActive(); } - var storage = internals.store(source, keys); // Move shallow copy items to storage - var copy = exports.clone(source); // Deep copy the rest - internals.restore(copy, source, storage); // Shallow copy the stored items and restore - return copy; -}; + return new (_promise || _load_promise()).default(function (resolve, reject) { + // we're already running so push ourselves to the queue + var queue = _this.queue[key] = _this.queue[key] || []; + queue.push({ factory, resolve, reject }); + if (!_this.running[key]) { + _this.shift(key); + } + }); + }; -internals.store = function (source, keys) { + BlockingQueue.prototype.shift = function shift(key) { + var _this2 = this; - var storage = {}; - for (var i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - var value = exports.reach(source, key); - if (value !== undefined) { - storage[key] = value; - internals.reachSet(source, key, undefined); - } - } + if (this.running[key]) { + delete this.running[key]; + this.runningCount--; + clearTimeout(this.stuckTimer); - return storage; -}; + if (this.warnedStuck) { + this.warnedStuck = false; + debug(`${(0, (_stringify || _load_stringify()).default)(this.alias)} blocking queue finally resolved. Nothing to worry about.`); + } + } + var queue = this.queue[key]; + if (!queue) { + return; + } -internals.restore = function (copy, source, storage) { + var _queue$shift = queue.shift(), + resolve = _queue$shift.resolve, + reject = _queue$shift.reject, + factory = _queue$shift.factory; - var keys = Object.keys(storage); - for (var i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - internals.reachSet(copy, key, storage[key]); - internals.reachSet(source, key, storage[key]); + if (!queue.length) { + delete this.queue[key]; } -}; + var next = function next() { + _this2.shift(key); + _this2.shiftConcurrencyQueue(); + }; -internals.reachSet = function (obj, key, value) { + var run = function run() { + _this2.running[key] = true; + _this2.runningCount++; - var path = key.split('.'); - var ref = obj; - for (var i = 0, il = path.length; i < il; ++i) { - var segment = path[i]; - if (i + 1 === il) { - ref[segment] = value; - } + factory().then(function (val) { + resolve(val); + next(); + return null; + }).catch(function (err) { + reject(err); + next(); + }); + }; - ref = ref[segment]; + this.maybePushConcurrencyQueue(run); + }; + + BlockingQueue.prototype.maybePushConcurrencyQueue = function maybePushConcurrencyQueue(run) { + if (this.runningCount < this.maxConcurrency) { + run(); + } else { + this.concurrencyQueue.push(run); } -}; + }; + BlockingQueue.prototype.shiftConcurrencyQueue = function shiftConcurrencyQueue() { + if (this.runningCount < this.maxConcurrency) { + var fn = this.concurrencyQueue.shift(); + if (fn) { + fn(); + } + } + }; -// Apply options to defaults except for the listed keys which are shallow copied from option without merging + return BlockingQueue; +}(); -exports.applyToDefaultsWithShallow = function (defaults, options, keys) { +exports.default = BlockingQueue; - exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object'); - exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object'); - exports.assert(keys && Array.isArray(keys), 'Invalid keys'); +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { - if (!options) { // If no options, return null - return null; - } +"use strict"; - var copy = exports.cloneWithShallow(defaults, keys); - if (options === true) { // If options is set to true, use defaults - return copy; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - var storage = internals.store(options, keys); // Move shallow copy items to storage - exports.merge(copy, options, false, false); // Deep copy the rest - internals.restore(copy, options, storage); // Shallow copy the stored items and restore - return copy; -}; +var _getIterator2; +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} -// Deep object or array comparison +exports.default = guessName; -exports.deepEqual = function (obj, ref, options, seen) { +var _url; - options = options || { prototype: true }; +function _load_url() { + return _url = _interopRequireDefault(__webpack_require__(18)); +} - var type = typeof obj; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - if (type !== typeof ref) { - return false; - } +function cleanup(name) { + name = name.replace(/-\d+\.\d+\.\d+/, ''); + return name.replace(/\.git$|\.zip$|\.tar\.gz$|\.tar\.bz2$/, ''); +} - if (type !== 'object' || - obj === null || - ref === null) { +function guessNameFallback(source) { + // If cannot parse as url, just return cleaned up last part + var parts = source.split('/'); + return cleanup(parts[parts.length - 1]); +} - if (obj === ref) { // Copied from Deep-eql, copyright(c) 2013 Jake Luer, jake@alogicalparadox.com, MIT Licensed, https://github.com/chaijs/deep-eql - return obj !== 0 || 1 / obj === 1 / ref; // -0 / +0 - } +function guessName(source) { + try { + var parsed = (_url || _load_url()).default.parse(source); - return obj !== obj && ref !== ref; // NaN + if (!parsed.pathname) { + return guessNameFallback(source); } - seen = seen || []; - if (seen.indexOf(obj) !== -1) { - return true; // If previous comparison failed, it would have stopped execution - } + var parts = parsed.pathname.split('/'); - seen.push(obj); + // Priority goes to part that ends with .git + for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; - if (Array.isArray(obj)) { - if (!Array.isArray(ref)) { - return false; - } + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } - if (!options.part && obj.length !== ref.length) { - return false; - } + var part = _ref; - for (var i = 0, il = obj.length; i < il; ++i) { - if (options.part) { - var found = false; - for (var r = 0, rl = ref.length; r < rl; ++r) { - if (exports.deepEqual(obj[i], ref[r], options, seen)) { - found = true; - break; - } - } + if (part.match(/\.git$/)) { + return cleanup(part); + } + } - return found; - } + // Most likely a directory + if (parsed.host == null) { + return cleanup(parts[parts.length - 1]); + } - if (!exports.deepEqual(obj[i], ref[i], options, seen)) { - return false; - } - } + // A site like github or gitlab + if (parts.length > 2) { + return cleanup(parts[2]); + } - return true; + // Privately hosted package? + if (parts.length > 1) { + return cleanup(parts[1]); } - if (Buffer.isBuffer(obj)) { - if (!Buffer.isBuffer(ref)) { - return false; - } + return guessNameFallback(source); + } catch (e) { + return guessNameFallback(source); + } +} - if (obj.length !== ref.length) { - return false; - } +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { - for (var j = 0, jl = obj.length; j < jl; ++j) { - if (obj[j] !== ref[j]) { - return false; - } - } +// Load modules - return true; - } +var Http = __webpack_require__(51); +var Hoek = __webpack_require__(456); - if (obj instanceof Date) { - return (ref instanceof Date && obj.getTime() === ref.getTime()); - } - if (obj instanceof RegExp) { - return (ref instanceof RegExp && obj.toString() === ref.toString()); - } +// Declare internals - if (options.prototype) { - if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) { - return false; - } - } +var internals = {}; - var keys = Object.getOwnPropertyNames(obj); +exports.wrap = function (error, statusCode, message) { - if (!options.part && keys.length !== Object.getOwnPropertyNames(ref).length) { - return false; - } + Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object'); + return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message)); +}; - for (var k = 0, kl = keys.length; k < kl; ++k) { - var key = keys[k]; - var descriptor = Object.getOwnPropertyDescriptor(obj, key); - if (descriptor.get) { - if (!exports.deepEqual(descriptor, Object.getOwnPropertyDescriptor(ref, key), options, seen)) { - return false; - } - } - else if (!exports.deepEqual(obj[key], ref[key], options, seen)) { - return false; - } - } - return true; +exports.create = function (statusCode, message, data) { + + return internals.create(statusCode, message, data, exports.create); }; +internals.create = function (statusCode, message, data, ctor) { -// Remove duplicate items from array + var error = new Error(message ? message : undefined); // Avoids settings null message + Error.captureStackTrace(error, ctor); // Filter the stack to our external API + error.data = data || null; + internals.initialize(error, statusCode); + return error; +}; -exports.unique = function (array, key) { +internals.initialize = function (error, statusCode, message) { - var index = {}; - var result = []; + var numberCode = parseInt(statusCode, 10); + Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode); - for (var i = 0, il = array.length; i < il; ++i) { - var id = (key ? array[i][key] : array[i]); - if (index[id] !== true) { + error.isBoom = true; + error.isServer = numberCode >= 500; - result.push(array[i]); - index[id] = true; - } + if (!error.hasOwnProperty('data')) { + error.data = null; } - return result; -}; - + error.output = { + statusCode: numberCode, + payload: {}, + headers: {} + }; -// Convert array into object + error.reformat = internals.reformat; + error.reformat(); -exports.mapToObject = function (array, key) { + if (!message && + !error.message) { - if (!array) { - return null; + message = error.output.payload.error; } - var obj = {}; - for (var i = 0, il = array.length; i < il; ++i) { - if (key) { - if (array[i][key]) { - obj[array[i][key]] = true; - } - } - else { - obj[array[i]] = true; - } + if (message) { + error.message = (message + (error.message ? ': ' + error.message : '')); } - return obj; + return error; }; -// Find the common unique items in two arrays +internals.reformat = function () { -exports.intersect = function (array1, array2, justFirst) { + this.output.payload.statusCode = this.output.statusCode; + this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown'; - if (!array1 || !array2) { - return []; + if (this.output.statusCode === 500) { + this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user } - - var common = []; - var hash = (Array.isArray(array1) ? exports.mapToObject(array1) : array1); - var found = {}; - for (var i = 0, il = array2.length; i < il; ++i) { - if (hash[array2[i]] && !found[array2[i]]) { - if (justFirst) { - return array2[i]; - } - - common.push(array2[i]); - found[array2[i]] = true; - } + else if (this.message) { + this.output.payload.message = this.message; } - - return (justFirst ? null : common); }; -// Test if the reference contains the values - -exports.contain = function (ref, values, options) { +// 4xx Client Errors - /* - string -> string(s) - array -> item(s) - object -> key(s) - object -> object (key:value) - */ +exports.badRequest = function (message, data) { - var valuePairs = null; - if (typeof ref === 'object' && - typeof values === 'object' && - !Array.isArray(ref) && - !Array.isArray(values)) { + return internals.create(400, message, data, exports.badRequest); +}; - valuePairs = values; - values = Object.keys(values); - } - else { - values = [].concat(values); - } - options = options || {}; // deep, once, only, part +exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) - exports.assert(arguments.length >= 2, 'Insufficient arguments'); - exports.assert(typeof ref === 'string' || typeof ref === 'object', 'Reference must be string or an object'); - exports.assert(values.length, 'Values array cannot be empty'); + var err = internals.create(401, message, undefined, exports.unauthorized); - var compare, compareFlags; - if (options.deep) { - compare = exports.deepEqual; + if (!scheme) { + return err; + } - var hasOnly = options.hasOwnProperty('only'), hasPart = options.hasOwnProperty('part'); + var wwwAuthenticate = ''; + var i = 0; + var il = 0; - compareFlags = { - prototype: hasOnly ? options.only : hasPart ? !options.part : false, - part: hasOnly ? !options.only : hasPart ? options.part : true - }; - } - else { - compare = function (a, b) { + if (typeof scheme === 'string') { - return a === b; - }; - } + // function (message, scheme, attributes) - var misses = false; - var matches = new Array(values.length); - for (var i = 0, il = matches.length; i < il; ++i) { - matches[i] = 0; - } + wwwAuthenticate = scheme; - if (typeof ref === 'string') { - var pattern = '('; - for (i = 0, il = values.length; i < il; ++i) { - var value = values[i]; - exports.assert(typeof value === 'string', 'Cannot compare string reference to non-string value'); - pattern += (i ? '|' : '') + exports.escapeRegex(value); + if (attributes || message) { + err.output.payload.attributes = {}; } - var regex = new RegExp(pattern + ')', 'g'); - var leftovers = ref.replace(regex, function ($0, $1) { + if (attributes) { + var names = Object.keys(attributes); + for (i = 0, il = names.length; i < il; ++i) { + var name = names[i]; + if (i) { + wwwAuthenticate += ','; + } - var index = values.indexOf($1); - ++matches[index]; - return ''; // Remove from string - }); + var value = attributes[name]; + if (value === null || + value === undefined) { // Value can be zero - misses = !!leftovers; - } - else if (Array.isArray(ref)) { - for (i = 0, il = ref.length; i < il; ++i) { - for (var j = 0, jl = values.length, matched = false; j < jl && matched === false; ++j) { - matched = compare(values[j], ref[i], compareFlags) && j; + value = ''; + } + wwwAuthenticate += ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; + err.output.payload.attributes[name] = value; } + } - if (matched !== false) { - ++matches[matched]; - } - else { - misses = true; + if (message) { + if (attributes) { + wwwAuthenticate += ','; } + wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; + err.output.payload.attributes.error = message; + } + else { + err.isMissing = true; } } else { - var keys = Object.keys(ref); - for (i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - var pos = values.indexOf(key); - if (pos !== -1) { - if (valuePairs && - !compare(valuePairs[key], ref[key], compareFlags)) { - return false; - } + // function (message, wwwAuthenticate[]) - ++matches[pos]; - } - else { - misses = true; + var wwwArray = scheme; + for (i = 0, il = wwwArray.length; i < il; ++i) { + if (i) { + wwwAuthenticate += ', '; } + + wwwAuthenticate += wwwArray[i]; } } - var result = false; - for (i = 0, il = matches.length; i < il; ++i) { - result = result || !!matches[i]; - if ((options.once && matches[i] > 1) || - (!options.part && !matches[i])) { + err.output.headers['WWW-Authenticate'] = wwwAuthenticate; - return false; - } - } + return err; +}; - if (options.only && - misses) { - return false; - } +exports.forbidden = function (message, data) { - return result; + return internals.create(403, message, data, exports.forbidden); }; -// Flatten array +exports.notFound = function (message, data) { -exports.flatten = function (array, target) { + return internals.create(404, message, data, exports.notFound); +}; - var result = target || []; - for (var i = 0, il = array.length; i < il; ++i) { - if (Array.isArray(array[i])) { - exports.flatten(array[i], result); - } - else { - result.push(array[i]); - } - } +exports.methodNotAllowed = function (message, data) { - return result; + return internals.create(405, message, data, exports.methodNotAllowed); }; -// Convert an object key chain string ('a.b.c') to reference (object[a][b][c]) +exports.notAcceptable = function (message, data) { -exports.reach = function (obj, chain, options) { + return internals.create(406, message, data, exports.notAcceptable); +}; - if (chain === false || - chain === null || - typeof chain === 'undefined') { - return obj; - } +exports.proxyAuthRequired = function (message, data) { - options = options || {}; - if (typeof options === 'string') { - options = { separator: options }; - } + return internals.create(407, message, data, exports.proxyAuthRequired); +}; - var path = chain.split(options.separator || '.'); - var ref = obj; - for (var i = 0, il = path.length; i < il; ++i) { - var key = path[i]; - if (key[0] === '-' && Array.isArray(ref)) { - key = key.slice(1, key.length); - key = ref.length - key; - } - if (!ref || - !ref.hasOwnProperty(key) || - (typeof ref !== 'object' && options.functions === false)) { // Only object and function can have properties +exports.clientTimeout = function (message, data) { - exports.assert(!options.strict || i + 1 === il, 'Missing segment', key, 'in reach path ', chain); - exports.assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain); - ref = options.default; - break; - } + return internals.create(408, message, data, exports.clientTimeout); +}; - ref = ref[key]; - } - return ref; -}; +exports.conflict = function (message, data) { + return internals.create(409, message, data, exports.conflict); +}; -exports.reachTemplate = function (obj, template, options) { - return template.replace(/{([^}]+)}/g, function ($0, chain) { +exports.resourceGone = function (message, data) { - var value = exports.reach(obj, chain, options); - return (value === undefined || value === null ? '' : value); - }); + return internals.create(410, message, data, exports.resourceGone); }; -exports.formatStack = function (stack) { - - var trace = []; - for (var i = 0, il = stack.length; i < il; ++i) { - var item = stack[i]; - trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]); - } +exports.lengthRequired = function (message, data) { - return trace; + return internals.create(411, message, data, exports.lengthRequired); }; -exports.formatTrace = function (trace) { +exports.preconditionFailed = function (message, data) { - var display = []; + return internals.create(412, message, data, exports.preconditionFailed); +}; - for (var i = 0, il = trace.length; i < il; ++i) { - var row = trace[i]; - display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')'); - } - return display; -}; +exports.entityTooLarge = function (message, data) { + return internals.create(413, message, data, exports.entityTooLarge); +}; -exports.callStack = function (slice) { - // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi +exports.uriTooLong = function (message, data) { - var v8 = Error.prepareStackTrace; - Error.prepareStackTrace = function (err, stack) { + return internals.create(414, message, data, exports.uriTooLong); +}; - return stack; - }; - var capture = {}; - Error.captureStackTrace(capture, arguments.callee); /*eslint no-caller:0 */ - var stack = capture.stack; +exports.unsupportedMediaType = function (message, data) { - Error.prepareStackTrace = v8; + return internals.create(415, message, data, exports.unsupportedMediaType); +}; - var trace = exports.formatStack(stack); - if (slice) { - return trace.slice(slice); - } +exports.rangeNotSatisfiable = function (message, data) { - return trace; + return internals.create(416, message, data, exports.rangeNotSatisfiable); }; -exports.displayStack = function (slice) { - - var trace = exports.callStack(slice === undefined ? 1 : slice + 1); +exports.expectationFailed = function (message, data) { - return exports.formatTrace(trace); + return internals.create(417, message, data, exports.expectationFailed); }; +exports.badData = function (message, data) { -exports.abortThrow = false; - + return internals.create(422, message, data, exports.badData); +}; -exports.abort = function (message, hideStack) { - if (process.env.NODE_ENV === 'test' || exports.abortThrow === true) { - throw new Error(message || 'Unknown error'); - } +exports.preconditionRequired = function (message, data) { - var stack = ''; - if (!hideStack) { - stack = exports.displayStack(1).join('\n\t'); - } - console.log('ABORT: ' + message + '\n\t' + stack); - process.exit(1); + return internals.create(428, message, data, exports.preconditionRequired); }; -exports.assert = function (condition /*, msg1, msg2, msg3 */) { +exports.tooManyRequests = function (message, data) { - if (condition) { - return; - } + return internals.create(429, message, data, exports.tooManyRequests); +}; - if (arguments.length === 2 && arguments[1] instanceof Error) { - throw arguments[1]; - } - var msgs = []; - for (var i = 1, il = arguments.length; i < il; ++i) { - if (arguments[i] !== '') { - msgs.push(arguments[i]); // Avoids Array.slice arguments leak, allowing for V8 optimizations - } - } +// 5xx Server Errors - msgs = msgs.map(function (msg) { +exports.internal = function (message, data, statusCode) { - return typeof msg === 'string' ? msg : msg instanceof Error ? msg.message : exports.stringify(msg); - }); - throw new Error(msgs.join(' ') || 'Unknown error'); + return internals.serverError(message, data, statusCode, exports.internal); }; +internals.serverError = function (message, data, statusCode, ctor) { -exports.Timer = function () { + var error; + if (data instanceof Error) { + error = exports.wrap(data, statusCode, message); + } else { + error = internals.create(statusCode || 500, message, undefined, ctor); + error.data = data; + } - this.ts = 0; - this.reset(); + return error; }; -exports.Timer.prototype.reset = function () { +exports.notImplemented = function (message, data) { - this.ts = Date.now(); + return internals.serverError(message, data, 501, exports.notImplemented); }; -exports.Timer.prototype.elapsed = function () { +exports.badGateway = function (message, data) { - return Date.now() - this.ts; + return internals.serverError(message, data, 502, exports.badGateway); }; -exports.Bench = function () { +exports.serverTimeout = function (message, data) { - this.ts = 0; - this.reset(); + return internals.serverError(message, data, 503, exports.serverTimeout); }; -exports.Bench.prototype.reset = function () { +exports.gatewayTimeout = function (message, data) { - this.ts = exports.Bench.now(); + return internals.serverError(message, data, 504, exports.gatewayTimeout); }; -exports.Bench.prototype.elapsed = function () { +exports.badImplementation = function (message, data) { - return exports.Bench.now() - this.ts; + var err = internals.serverError(message, data, 500, exports.badImplementation); + err.isDeveloperError = true; + return err; }; -exports.Bench.now = function () { +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { - var ts = process.hrtime(); - return (ts[0] * 1e3) + (ts[1] / 1e6); -}; +"use strict"; +const escapeStringRegexp = __webpack_require__(179); +const ansiStyles = __webpack_require__(368); +const supportsColor = __webpack_require__(462); -// Escape string for Regex construction +const template = __webpack_require__(463); -exports.escapeRegex = function (string) { +const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); - // Escape ^$.*+-?=!:|\/()[]{}, - return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&'); -}; +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; +// `color-convert` models to exclude from the Chalk API due to conflicts and such +const skipModels = new Set(['gray']); -// Base64url (RFC 4648) encode +const styles = Object.create(null); -exports.base64urlEncode = function (value, encoding) { +function applyOptions(obj, options) { + options = options || {}; - var buf = (Buffer.isBuffer(value) ? value : new Buffer(value, encoding || 'binary')); - return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); -}; + // Detect level if not set manually + const scLevel = supportsColor ? supportsColor.level : 0; + obj.level = options.level === undefined ? scLevel : options.level; + obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; +} +function Chalk(options) { + // We check for this.template here since calling `chalk.constructor()` + // by itself will have a `this` of a previously constructed chalk object + if (!this || !(this instanceof Chalk) || this.template) { + const chalk = {}; + applyOptions(chalk, options); -// Base64url (RFC 4648) decode + chalk.template = function () { + const args = [].slice.call(arguments); + return chalkTag.apply(null, [chalk.template].concat(args)); + }; -exports.base64urlDecode = function (value, encoding) { + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); - if (value && - !/^[\w\-]*$/.test(value)) { + chalk.template.constructor = Chalk; - return new Error('Invalid character'); - } + return chalk.template; + } - try { - var buf = new Buffer(value, 'base64'); - return (encoding === 'buffer' ? buf : buf.toString(encoding || 'binary')); - } - catch (err) { - return err; - } -}; + applyOptions(this, options); +} +// Use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001B[94m'; +} -// Escape attribute value for use in HTTP header +for (const key of Object.keys(ansiStyles)) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); -exports.escapeHeaderAttribute = function (attribute) { + styles[key] = { + get() { + const codes = ansiStyles[key]; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], key); + } + }; +} - // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, " +ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); +for (const model of Object.keys(ansiStyles.color.ansi)) { + if (skipModels.has(model)) { + continue; + } - exports.assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')'); + styles[model] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.color.close, + closeRe: ansiStyles.color.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model); + }; + } + }; +} - return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash -}; +ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); +for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + if (skipModels.has(model)) { + continue; + } + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.bgColor.close, + closeRe: ansiStyles.bgColor.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model); + }; + } + }; +} -exports.escapeHtml = function (string) { +const proto = Object.defineProperties(() => {}, styles); - return Escape.escapeHtml(string); -}; +function build(_styles, key) { + const builder = function () { + return applyStyle.apply(builder, arguments); + }; + builder._styles = _styles; -exports.escapeJavaScript = function (string) { + const self = this; - return Escape.escapeJavaScript(string); -}; + Object.defineProperty(builder, 'level', { + enumerable: true, + get() { + return self.level; + }, + set(level) { + self.level = level; + } + }); + Object.defineProperty(builder, 'enabled', { + enumerable: true, + get() { + return self.enabled; + }, + set(enabled) { + self.enabled = enabled; + } + }); -exports.nextTick = function (callback) { + // See below for fix regarding invisible grey/dim combination on Windows + builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; - return function () { + // `__proto__` is used because we must return a function, but there is + // no way to create a function with a different prototype + builder.__proto__ = proto; // eslint-disable-line no-proto - var args = arguments; - process.nextTick(function () { + return builder; +} - callback.apply(null, args); - }); - }; -}; +function applyStyle() { + // Support varags, but simply cast to string in case there's only one arg + const args = arguments; + const argsLen = args.length; + let str = String(arguments[0]); + if (argsLen === 0) { + return ''; + } -exports.once = function (method) { + if (argsLen > 1) { + // Don't slice `arguments`, it prevents V8 optimizations + for (let a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } - if (method._hoekOnce) { - return method; - } + if (!this.enabled || this.level <= 0 || !str) { + return str; + } - var once = false; - var wrapped = function () { + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + const originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && this.hasGrey) { + ansiStyles.dim.open = ''; + } - if (!once) { - once = true; - method.apply(null, arguments); - } - }; + for (const code of this._styles.slice().reverse()) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; - wrapped._hoekOnce = true; + // Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS + // https://github.com/chalk/chalk/pull/92 + str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); + } - return wrapped; -}; + // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue + ansiStyles.dim.open = originalDim; + return str; +} -exports.isAbsolutePath = function (path, platform) { +function chalkTag(chalk, strings) { + if (!Array.isArray(strings)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return [].slice.call(arguments, 1).join(' '); + } - if (!path) { - return false; - } + const args = [].slice.call(arguments, 2); + const parts = [strings.raw[0]]; - if (Path.isAbsolute) { // node >= 0.11 - return Path.isAbsolute(path); - } + for (let i = 1; i < strings.length; i++) { + parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); + parts.push(String(strings.raw[i])); + } - platform = platform || process.platform; + return template(chalk, parts.join('')); +} - // Unix +Object.defineProperties(Chalk.prototype, styles); - if (platform !== 'win32') { - return path[0] === '/'; - } +module.exports = Chalk(); // eslint-disable-line new-cap +module.exports.supportsColor = supportsColor; - // Windows - return !!/^(?:[a-zA-Z]:[\\\/])|(?:[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/])/.test(path); // C:\ or \\something\something -}; +/***/ }), +/* 114 */ +/***/ (function(module, exports) { +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; +}; -exports.isInteger = function (value) { +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { - return (typeof value === 'number' && - parseFloat(value) === parseInt(value, 10) && - !isNaN(value)); +var ctx = __webpack_require__(54) + , call = __webpack_require__(265) + , isArrayIter = __webpack_require__(263) + , anObject = __webpack_require__(47) + , toLength = __webpack_require__(119) + , getIterFn = __webpack_require__(178) + , BREAK = {} + , RETURN = {}; +var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ + var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator, result; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if(result === BREAK || result === RETURN)return result; + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + result = call(iterator, f, step.value, entries); + if(result === BREAK || result === RETURN)return result; + } }; +exports.BREAK = BREAK; +exports.RETURN = RETURN; +/***/ }), +/* 116 */ +/***/ (function(module, exports) { -exports.ignore = function () { }; +module.exports = true; +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { -exports.inherits = Util.inherits; +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(47) + , dPs = __webpack_require__(497) + , enumBugKeys = __webpack_require__(166) + , IE_PROTO = __webpack_require__(172)('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(165)('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(261).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; -exports.format = Util.format; +module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; -exports.transform = function (source, transform, options) { +/***/ }), +/* 118 */ +/***/ (function(module, exports) { - exports.assert(source === null || source === undefined || typeof source === 'object' || Array.isArray(source), 'Invalid source object: must be null, undefined, an object, or an array'); +exports.f = {}.propertyIsEnumerable; - if (Array.isArray(source)) { - var results = []; - for (var i = 0, il = source.length; i < il; ++i) { - results.push(exports.transform(source[i], transform, options)); - } - return results; - } +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { - var result = {}; - var keys = Object.keys(transform); +// 7.1.15 ToLength +var toInteger = __webpack_require__(174) + , min = Math.min; +module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; - for (var k = 0, kl = keys.length; k < kl; ++k) { - var key = keys[k]; - var path = key.split('.'); - var sourcePath = transform[key]; +/***/ }), +/* 120 */ +/***/ (function(module, exports) { - exports.assert(typeof sourcePath === 'string', 'All mappings must be "." delineated strings'); +var id = 0 + , px = Math.random(); +module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; - var segment; - var res = result; +/***/ }), +/* 121 */ +/***/ (function(module, exports) { - while (path.length > 1) { - segment = path.shift(); - if (!res[segment]) { - res[segment] = {}; - } - res = res[segment]; - } - segment = path.shift(); - res[segment] = exports.reach(source, sourcePath, options); - } - return result; -}; +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { -exports.uniqueFilename = function (path, extension) { +// Basic Javascript Elliptic Curve implementation +// Ported loosely from BouncyCastle's Java EC code +// Only Fp curves implemented for now - if (extension) { - extension = extension[0] !== '.' ? '.' + extension : extension; - } - else { - extension = ''; - } +// Requires jsbn.js and jsbn2.js +var BigInteger = __webpack_require__(60).BigInteger +var Barrett = BigInteger.prototype.Barrett - path = Path.resolve(path); - var name = [Date.now(), process.pid, Crypto.randomBytes(8).toString('hex')].join('-') + extension; - return Path.join(path, name); -}; +// ---------------- +// ECFieldElementFp +// constructor +function ECFieldElementFp(q,x) { + this.x = x; + // TODO if(x.compareTo(q) >= 0) error + this.q = q; +} -exports.stringify = function () { +function feFpEquals(other) { + if(other == this) return true; + return (this.q.equals(other.q) && this.x.equals(other.x)); +} - try { - return JSON.stringify.apply(null, arguments); - } - catch (err) { - return '[Cannot display object: ' + err.message + ']'; - } -}; +function feFpToBigInteger() { + return this.x; +} +function feFpNegate() { + return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); +} -exports.shallow = function (source) { +function feFpAdd(b) { + return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); +} - var target = {}; - var keys = Object.keys(source); - for (var i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - target[key] = source[key]; - } +function feFpSubtract(b) { + return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); +} - return target; -}; +function feFpMultiply(b) { + return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); +} +function feFpSquare() { + return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); +} -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { +function feFpDivide(b) { + return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); +} -// Copyright 2012 Joyent, Inc. All rights reserved. +ECFieldElementFp.prototype.equals = feFpEquals; +ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger; +ECFieldElementFp.prototype.negate = feFpNegate; +ECFieldElementFp.prototype.add = feFpAdd; +ECFieldElementFp.prototype.subtract = feFpSubtract; +ECFieldElementFp.prototype.multiply = feFpMultiply; +ECFieldElementFp.prototype.square = feFpSquare; +ECFieldElementFp.prototype.divide = feFpDivide; -var assert = __webpack_require__(117); -var sshpk = __webpack_require__(185); -var util = __webpack_require__(2); +// ---------------- +// ECPointFp -var HASH_ALGOS = { - 'sha1': true, - 'sha256': true, - 'sha512': true -}; +// constructor +function ECPointFp(curve,x,y,z) { + this.curve = curve; + this.x = x; + this.y = y; + // Projective coordinates: either zinv == null or z * zinv == 1 + // z and zinv are just BigIntegers, not fieldElements + if(z == null) { + this.z = BigInteger.ONE; + } + else { + this.z = z; + } + this.zinv = null; + //TODO: compression flag +} -var PK_ALGOS = { - 'rsa': true, - 'dsa': true, - 'ecdsa': true -}; +function pointFpGetX() { + if(this.zinv == null) { + this.zinv = this.z.modInverse(this.curve.q); + } + var r = this.x.toBigInteger().multiply(this.zinv); + this.curve.reduce(r); + return this.curve.fromBigInteger(r); +} -function HttpSignatureError(message, caller) { - if (Error.captureStackTrace) - Error.captureStackTrace(this, caller || HttpSignatureError); +function pointFpGetY() { + if(this.zinv == null) { + this.zinv = this.z.modInverse(this.curve.q); + } + var r = this.y.toBigInteger().multiply(this.zinv); + this.curve.reduce(r); + return this.curve.fromBigInteger(r); +} - this.message = message; - this.name = caller.name; +function pointFpEquals(other) { + if(other == this) return true; + if(this.isInfinity()) return other.isInfinity(); + if(other.isInfinity()) return this.isInfinity(); + var u, v; + // u = Y2 * Z1 - Y1 * Z2 + u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q); + if(!u.equals(BigInteger.ZERO)) return false; + // v = X2 * Z1 - X1 * Z2 + v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q); + return v.equals(BigInteger.ZERO); } -util.inherits(HttpSignatureError, Error); -function InvalidAlgorithmError(message) { - HttpSignatureError.call(this, message, InvalidAlgorithmError); +function pointFpIsInfinity() { + if((this.x == null) && (this.y == null)) return true; + return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); } -util.inherits(InvalidAlgorithmError, HttpSignatureError); -function validateAlgorithm(algorithm) { - var alg = algorithm.toLowerCase().split('-'); +function pointFpNegate() { + return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); +} - if (alg.length !== 2) { - throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' + - 'valid algorithm')); - } +function pointFpAdd(b) { + if(this.isInfinity()) return b; + if(b.isInfinity()) return this; - if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) { - throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' + - 'are not supported')); - } + // u = Y2 * Z1 - Y1 * Z2 + var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q); + // v = X2 * Z1 - X1 * Z2 + var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); - if (!HASH_ALGOS[alg[1]]) { - throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' + - 'supported hash algorithm')); - } + if(BigInteger.ZERO.equals(v)) { + if(BigInteger.ZERO.equals(u)) { + return this.twice(); // this == b, so double + } + return this.curve.getInfinity(); // this = -b, so infinity + } - return (alg); + var THREE = new BigInteger("3"); + var x1 = this.x.toBigInteger(); + var y1 = this.y.toBigInteger(); + var x2 = b.x.toBigInteger(); + var y2 = b.y.toBigInteger(); + + var v2 = v.square(); + var v3 = v2.multiply(v); + var x1v2 = x1.multiply(v2); + var zu2 = u.square().multiply(this.z); + + // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3) + var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q); + // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3 + var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q); + // z3 = v^3 * z1 * z2 + var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q); + + return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); } -///--- API +function pointFpTwice() { + if(this.isInfinity()) return this; + if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity(); -module.exports = { + // TODO: optimized handling of constants + var THREE = new BigInteger("3"); + var x1 = this.x.toBigInteger(); + var y1 = this.y.toBigInteger(); - HASH_ALGOS: HASH_ALGOS, - PK_ALGOS: PK_ALGOS, + var y1z1 = y1.multiply(this.z); + var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q); + var a = this.curve.a.toBigInteger(); - HttpSignatureError: HttpSignatureError, - InvalidAlgorithmError: InvalidAlgorithmError, + // w = 3 * x1^2 + a * z1^2 + var w = x1.square().multiply(THREE); + if(!BigInteger.ZERO.equals(a)) { + w = w.add(this.z.square().multiply(a)); + } + w = w.mod(this.curve.q); + //this.curve.reduce(w); + // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1) + var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q); + // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3 + var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q); + // z3 = 8 * (y1 * z1)^3 + var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q); - validateAlgorithm: validateAlgorithm, + return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); +} - /** - * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file. - * - * The intent of this module is to interoperate with OpenSSL only, - * specifically the node crypto module's `verify` method. - * - * @param {String} key an OpenSSH public key. - * @return {String} PEM encoded form of the RSA public key. - * @throws {TypeError} on bad input. - * @throws {Error} on invalid ssh key formatted data. - */ - sshKeyToPEM: function sshKeyToPEM(key) { - assert.string(key, 'ssh_key'); +// Simple NAF (Non-Adjacent Form) multiplication algorithm +// TODO: modularize the multiplication algorithm +function pointFpMultiply(k) { + if(this.isInfinity()) return this; + if(k.signum() == 0) return this.curve.getInfinity(); - var k = sshpk.parseKey(key, 'ssh'); - return (k.toString('pem')); - }, + var e = k; + var h = e.multiply(new BigInteger("3")); + var neg = this.negate(); + var R = this; - /** - * Generates an OpenSSH fingerprint from an ssh public key. - * - * @param {String} key an OpenSSH public key. - * @return {String} key fingerprint. - * @throws {TypeError} on bad input. - * @throws {Error} if what you passed doesn't look like an ssh public key. - */ - fingerprint: function fingerprint(key) { - assert.string(key, 'ssh_key'); + var i; + for(i = h.bitLength() - 2; i > 0; --i) { + R = R.twice(); - var k = sshpk.parseKey(key, 'ssh'); - return (k.fingerprint('md5').toString('hex')); - }, + var hBit = h.testBit(i); + var eBit = e.testBit(i); - /** - * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa) - * - * The reverse of the above function. - */ - pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) { - assert.equal('string', typeof (pem), 'typeof pem'); + if (hBit != eBit) { + R = R.add(hBit ? this : neg); + } + } - var k = sshpk.parseKey(pem, 'pem'); - k.comment = comment; - return (k.toString('ssh')); + return R; +} + +// Compute this*j + x*k (simultaneous multiplication) +function pointFpMultiplyTwo(j,x,k) { + var i; + if(j.bitLength() > k.bitLength()) + i = j.bitLength() - 1; + else + i = k.bitLength() - 1; + + var R = this.curve.getInfinity(); + var both = this.add(x); + while(i >= 0) { + R = R.twice(); + if(j.testBit(i)) { + if(k.testBit(i)) { + R = R.add(both); + } + else { + R = R.add(this); + } + } + else { + if(k.testBit(i)) { + R = R.add(x); + } + } + --i; } -}; + return R; +} -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { +ECPointFp.prototype.getX = pointFpGetX; +ECPointFp.prototype.getY = pointFpGetY; +ECPointFp.prototype.equals = pointFpEquals; +ECPointFp.prototype.isInfinity = pointFpIsInfinity; +ECPointFp.prototype.negate = pointFpNegate; +ECPointFp.prototype.add = pointFpAdd; +ECPointFp.prototype.twice = pointFpTwice; +ECPointFp.prototype.multiply = pointFpMultiply; +ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo; -// Copyright (c) 2012, Mark Cavage. All rights reserved. -// Copyright 2015 Joyent, Inc. +// ---------------- +// ECCurveFp -var assert = __webpack_require__(31); -var Stream = __webpack_require__(25).Stream; -var util = __webpack_require__(2); +// constructor +function ECCurveFp(q,a,b) { + this.q = q; + this.a = this.fromBigInteger(a); + this.b = this.fromBigInteger(b); + this.infinity = new ECPointFp(this, null, null); + this.reducer = new Barrett(this.q); +} +function curveFpGetQ() { + return this.q; +} -///--- Globals +function curveFpGetA() { + return this.a; +} -/* JSSTYLED */ -var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; +function curveFpGetB() { + return this.b; +} +function curveFpEquals(other) { + if(other == this) return true; + return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b)); +} -///--- Internal +function curveFpGetInfinity() { + return this.infinity; +} -function _capitalize(str) { - return (str.charAt(0).toUpperCase() + str.slice(1)); +function curveFpFromBigInteger(x) { + return new ECFieldElementFp(this.q, x); } -function _toss(name, expected, oper, arg, actual) { - throw new assert.AssertionError({ - message: util.format('%s (%s) is required', name, expected), - actual: (actual === undefined) ? typeof (arg) : actual(arg), - expected: expected, - operator: oper || '===', - stackStartFunction: _toss.caller - }); +function curveReduce(x) { + this.reducer.reduce(x); } -function _getClass(arg) { - return (Object.prototype.toString.call(arg).slice(8, -1)); +// for now, work with hex strings because they're easier in JS +function curveFpDecodePointHex(s) { + switch(parseInt(s.substr(0,2), 16)) { // first byte + case 0: + return this.infinity; + case 2: + case 3: + // point compression not supported yet + return null; + case 4: + case 6: + case 7: + var len = (s.length - 2) / 2; + var xHex = s.substr(2, len); + var yHex = s.substr(len+2, len); + + return new ECPointFp(this, + this.fromBigInteger(new BigInteger(xHex, 16)), + this.fromBigInteger(new BigInteger(yHex, 16))); + + default: // unsupported + return null; + } } -function noop() { - // Why even bother with asserts? +function curveFpEncodePointHex(p) { + if (p.isInfinity()) return "00"; + var xHex = p.getX().toBigInteger().toString(16); + var yHex = p.getY().toBigInteger().toString(16); + var oLen = this.getQ().toString(16).length; + if ((oLen % 2) != 0) oLen++; + while (xHex.length < oLen) { + xHex = "0" + xHex; + } + while (yHex.length < oLen) { + yHex = "0" + yHex; + } + return "04" + xHex + yHex; } +ECCurveFp.prototype.getQ = curveFpGetQ; +ECCurveFp.prototype.getA = curveFpGetA; +ECCurveFp.prototype.getB = curveFpGetB; +ECCurveFp.prototype.equals = curveFpEquals; +ECCurveFp.prototype.getInfinity = curveFpGetInfinity; +ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger; +ECCurveFp.prototype.reduce = curveReduce; +//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex; +ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex; -///--- Exports +// from: https://github.com/kaielvin/jsbn-ec-point-compression +ECCurveFp.prototype.decodePointHex = function(s) +{ + var yIsEven; + switch(parseInt(s.substr(0,2), 16)) { // first byte + case 0: + return this.infinity; + case 2: + yIsEven = false; + case 3: + if(yIsEven == undefined) yIsEven = true; + var len = s.length - 2; + var xHex = s.substr(2, len); + var x = this.fromBigInteger(new BigInteger(xHex,16)); + var alpha = x.multiply(x.square().add(this.getA())).add(this.getB()); + var beta = alpha.sqrt(); -var types = { - bool: { - check: function (arg) { return typeof (arg) === 'boolean'; } - }, - func: { - check: function (arg) { return typeof (arg) === 'function'; } - }, - string: { - check: function (arg) { return typeof (arg) === 'string'; } - }, - object: { - check: function (arg) { - return typeof (arg) === 'object' && arg !== null; - } - }, - number: { - check: function (arg) { - return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); - } - }, - buffer: { - check: function (arg) { return Buffer.isBuffer(arg); }, - operator: 'Buffer.isBuffer' - }, - array: { - check: function (arg) { return Array.isArray(arg); }, - operator: 'Array.isArray' - }, - stream: { - check: function (arg) { return arg instanceof Stream; }, - operator: 'instanceof', - actual: _getClass - }, - date: { - check: function (arg) { return arg instanceof Date; }, - operator: 'instanceof', - actual: _getClass - }, - regexp: { - check: function (arg) { return arg instanceof RegExp; }, - operator: 'instanceof', - actual: _getClass - }, - uuid: { - check: function (arg) { - return typeof (arg) === 'string' && UUID_REGEXP.test(arg); - }, - operator: 'isUUID' + if (beta == null) throw "Invalid point compression"; + + var betaValue = beta.toBigInteger(); + if (betaValue.testBit(0) != yIsEven) + { + // Use the other root + beta = this.fromBigInteger(this.getQ().subtract(betaValue)); } -}; + return new ECPointFp(this,x,beta); + case 4: + case 6: + case 7: + var len = (s.length - 2) / 2; + var xHex = s.substr(2, len); + var yHex = s.substr(len+2, len); -function _setExports(ndebug) { - var keys = Object.keys(types); - var out; + return new ECPointFp(this, + this.fromBigInteger(new BigInteger(xHex, 16)), + this.fromBigInteger(new BigInteger(yHex, 16))); - /* re-export standard assert */ - if (process.env.NODE_NDEBUG) { - out = noop; - } else { - out = function (arg, msg) { - if (!arg) { - _toss(msg, 'true', arg); - } - }; + default: // unsupported + return null; } +} +ECCurveFp.prototype.encodeCompressedPointHex = function(p) +{ + if (p.isInfinity()) return "00"; + var xHex = p.getX().toBigInteger().toString(16); + var oLen = this.getQ().toString(16).length; + if ((oLen % 2) != 0) oLen++; + while (xHex.length < oLen) + xHex = "0" + xHex; + var yPrefix; + if(p.getY().toBigInteger().isEven()) yPrefix = "02"; + else yPrefix = "03"; - /* standard checks */ - keys.forEach(function (k) { - if (ndebug) { - out[k] = noop; - return; - } - var type = types[k]; - out[k] = function (arg, msg) { - if (!type.check(arg)) { - _toss(msg, k, type.operator, arg, type.actual); - } - }; - }); + return yPrefix + xHex; +} - /* optional checks */ - keys.forEach(function (k) { - var name = 'optional' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - out[name] = function (arg, msg) { - if (arg === undefined || arg === null) { - return; - } - if (!type.check(arg)) { - _toss(msg, k, type.operator, arg, type.actual); - } - }; - }); - /* arrayOf checks */ - keys.forEach(function (k) { - var name = 'arrayOf' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - var expected = '[' + k + ']'; - out[name] = function (arg, msg) { - if (!Array.isArray(arg)) { - _toss(msg, expected, type.operator, arg, type.actual); - } - var i; - for (i = 0; i < arg.length; i++) { - if (!type.check(arg[i])) { - _toss(msg, expected, type.operator, arg, type.actual); - } - } - }; - }); +ECFieldElementFp.prototype.getR = function() +{ + if(this.r != undefined) return this.r; - /* optionalArrayOf checks */ - keys.forEach(function (k) { - var name = 'optionalArrayOf' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; + this.r = null; + var bitLength = this.q.bitLength(); + if (bitLength > 128) + { + var firstWord = this.q.shiftRight(bitLength - 64); + if (firstWord.intValue() == -1) + { + this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q); } - var type = types[k]; - var expected = '[' + k + ']'; - out[name] = function (arg, msg) { + } + return this.r; +} +ECFieldElementFp.prototype.modMult = function(x1,x2) +{ + return this.modReduce(x1.multiply(x2)); +} +ECFieldElementFp.prototype.modReduce = function(x) +{ + if (this.getR() != null) + { + var qLen = q.bitLength(); + while (x.bitLength() > (qLen + 1)) + { + var u = x.shiftRight(qLen); + var v = x.subtract(u.shiftLeft(qLen)); + if (!this.getR().equals(BigInteger.ONE)) + { + u = u.multiply(this.getR()); + } + x = u.add(v); + } + while (x.compareTo(q) >= 0) + { + x = x.subtract(q); + } + } + else + { + x = x.mod(q); + } + return x; +} +ECFieldElementFp.prototype.sqrt = function() +{ + if (!this.q.testBit(0)) throw "unsupported"; + + // p mod 4 == 3 + if (this.q.testBit(1)) + { + var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); + return z.square().equals(this) ? z : null; + } + + // p mod 4 == 1 + var qMinusOne = this.q.subtract(BigInteger.ONE); + + var legendreExponent = qMinusOne.shiftRight(1); + if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE))) + { + return null; + } + + var u = qMinusOne.shiftRight(2); + var k = u.shiftLeft(1).add(BigInteger.ONE); + + var Q = this.x; + var fourQ = modDouble(modDouble(Q)); + + var U, V; + do + { + var P; + do + { + P = new BigInteger(this.q.bitLength(), new SecureRandom()); + } + while (P.compareTo(this.q) >= 0 + || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne))); + + var result = this.lucasSequence(P, Q, k); + U = result[0]; + V = result[1]; + + if (this.modMult(V, V).equals(fourQ)) + { + // Integer division by 2, mod q + if (V.testBit(0)) + { + V = V.add(q); + } + + V = V.shiftRight(1); + + return new ECFieldElementFp(q,V); + } + } + while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); + + return null; +} +ECFieldElementFp.prototype.lucasSequence = function(P,Q,k) +{ + var n = k.bitLength(); + var s = k.getLowestSetBit(); + + var Uh = BigInteger.ONE; + var Vl = BigInteger.TWO; + var Vh = P; + var Ql = BigInteger.ONE; + var Qh = BigInteger.ONE; + + for (var j = n - 1; j >= s + 1; --j) + { + Ql = this.modMult(Ql, Qh); + + if (k.testBit(j)) + { + Qh = this.modMult(Ql, Q); + Uh = this.modMult(Uh, Vh); + Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); + Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1))); + } + else + { + Qh = Ql; + Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); + Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); + Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); + } + } + + Ql = this.modMult(Ql, Qh); + Qh = this.modMult(Ql, Q); + Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); + Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); + Ql = this.modMult(Ql, Qh); + + for (var j = 1; j <= s; ++j) + { + Uh = this.modMult(Uh, Vl); + Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); + Ql = this.modMult(Ql, Ql); + } + + return [ Uh, Vl ]; +} + +var exports = { + ECCurveFp: ECCurveFp, + ECPointFp: ECPointFp, + ECFieldElementFp: ECFieldElementFp +} + +module.exports = exports + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +// Load modules + +var Sntp = __webpack_require__(314); +var Boom = __webpack_require__(112); + + +// Declare internals + +var internals = {}; + + +exports.version = function () { + + return __webpack_require__(583).version; +}; + + +exports.limits = { + maxMatchLength: 4096 // Limit the length of uris and headers to avoid a DoS attack on string matching +}; + + +// Extract host and port from request + +// $1 $2 +internals.hostHeaderRegex = /^(?:(?:\r\n)?\s)*((?:[^:]+)|(?:\[[^\]]+\]))(?::(\d+))?(?:(?:\r\n)?\s)*$/; // (IPv4, hostname)|(IPv6) + + +exports.parseHost = function (req, hostHeaderName) { + + hostHeaderName = (hostHeaderName ? hostHeaderName.toLowerCase() : 'host'); + var hostHeader = req.headers[hostHeaderName]; + if (!hostHeader) { + return null; + } + + if (hostHeader.length > exports.limits.maxMatchLength) { + return null; + } + + var hostParts = hostHeader.match(internals.hostHeaderRegex); + if (!hostParts) { + return null; + } + + return { + name: hostParts[1], + port: (hostParts[2] ? hostParts[2] : (req.connection && req.connection.encrypted ? 443 : 80)) + }; +}; + + +// Parse Content-Type header content + +exports.parseContentType = function (header) { + + if (!header) { + return ''; + } + + return header.split(';')[0].trim().toLowerCase(); +}; + + +// Convert node's to request configuration object + +exports.parseRequest = function (req, options) { + + if (!req.headers) { + return req; + } + + // Obtain host and port information + + var host; + if (!options.host || + !options.port) { + + host = exports.parseHost(req, options.hostHeaderName); + if (!host) { + return new Error('Invalid Host header'); + } + } + + var request = { + method: req.method, + url: req.url, + host: options.host || host.name, + port: options.port || host.port, + authorization: req.headers.authorization, + contentType: req.headers['content-type'] || '' + }; + + return request; +}; + + +exports.now = function (localtimeOffsetMsec) { + + return Sntp.now() + (localtimeOffsetMsec || 0); +}; + + +exports.nowSecs = function (localtimeOffsetMsec) { + + return Math.floor(exports.now(localtimeOffsetMsec) / 1000); +}; + + +internals.authHeaderRegex = /^(\w+)(?:\s+(.*))?$/; // Header: scheme[ something] +internals.attributeRegex = /^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/; // !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9 + + +// Parse Hawk HTTP Authorization header + +exports.parseAuthorizationHeader = function (header, keys) { + + keys = keys || ['id', 'ts', 'nonce', 'hash', 'ext', 'mac', 'app', 'dlg']; + + if (!header) { + return Boom.unauthorized(null, 'Hawk'); + } + + if (header.length > exports.limits.maxMatchLength) { + return Boom.badRequest('Header length too long'); + } + + var headerParts = header.match(internals.authHeaderRegex); + if (!headerParts) { + return Boom.badRequest('Invalid header syntax'); + } + + var scheme = headerParts[1]; + if (scheme.toLowerCase() !== 'hawk') { + return Boom.unauthorized(null, 'Hawk'); + } + + var attributesString = headerParts[2]; + if (!attributesString) { + return Boom.badRequest('Invalid header syntax'); + } + + var attributes = {}; + var errorMessage = ''; + var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) { + + // Check valid attribute names + + if (keys.indexOf($1) === -1) { + errorMessage = 'Unknown attribute: ' + $1; + return; + } + + // Allowed attribute value characters + + if ($2.match(internals.attributeRegex) === null) { + errorMessage = 'Bad attribute value: ' + $1; + return; + } + + // Check for duplicates + + if (attributes.hasOwnProperty($1)) { + errorMessage = 'Duplicate attribute: ' + $1; + return; + } + + attributes[$1] = $2; + return ''; + }); + + if (verify !== '') { + return Boom.badRequest(errorMessage || 'Bad header format'); + } + + return attributes; +}; + + +exports.unauthorized = function (message, attributes) { + + return Boom.unauthorized(message, 'Hawk', attributes); +}; + + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2012 Joyent, Inc. All rights reserved. + +var assert = __webpack_require__(125); +var sshpk = __webpack_require__(197); +var util = __webpack_require__(4); + +var HASH_ALGOS = { + 'sha1': true, + 'sha256': true, + 'sha512': true +}; + +var PK_ALGOS = { + 'rsa': true, + 'dsa': true, + 'ecdsa': true +}; + +function HttpSignatureError(message, caller) { + if (Error.captureStackTrace) + Error.captureStackTrace(this, caller || HttpSignatureError); + + this.message = message; + this.name = caller.name; +} +util.inherits(HttpSignatureError, Error); + +function InvalidAlgorithmError(message) { + HttpSignatureError.call(this, message, InvalidAlgorithmError); +} +util.inherits(InvalidAlgorithmError, HttpSignatureError); + +function validateAlgorithm(algorithm) { + var alg = algorithm.toLowerCase().split('-'); + + if (alg.length !== 2) { + throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' + + 'valid algorithm')); + } + + if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) { + throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' + + 'are not supported')); + } + + if (!HASH_ALGOS[alg[1]]) { + throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' + + 'supported hash algorithm')); + } + + return (alg); +} + +///--- API + +module.exports = { + + HASH_ALGOS: HASH_ALGOS, + PK_ALGOS: PK_ALGOS, + + HttpSignatureError: HttpSignatureError, + InvalidAlgorithmError: InvalidAlgorithmError, + + validateAlgorithm: validateAlgorithm, + + /** + * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file. + * + * The intent of this module is to interoperate with OpenSSL only, + * specifically the node crypto module's `verify` method. + * + * @param {String} key an OpenSSH public key. + * @return {String} PEM encoded form of the RSA public key. + * @throws {TypeError} on bad input. + * @throws {Error} on invalid ssh key formatted data. + */ + sshKeyToPEM: function sshKeyToPEM(key) { + assert.string(key, 'ssh_key'); + + var k = sshpk.parseKey(key, 'ssh'); + return (k.toString('pem')); + }, + + + /** + * Generates an OpenSSH fingerprint from an ssh public key. + * + * @param {String} key an OpenSSH public key. + * @return {String} key fingerprint. + * @throws {TypeError} on bad input. + * @throws {Error} if what you passed doesn't look like an ssh public key. + */ + fingerprint: function fingerprint(key) { + assert.string(key, 'ssh_key'); + + var k = sshpk.parseKey(key, 'ssh'); + return (k.fingerprint('md5').toString('hex')); + }, + + /** + * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa) + * + * The reverse of the above function. + */ + pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) { + assert.equal('string', typeof (pem), 'typeof pem'); + + var k = sshpk.parseKey(pem, 'pem'); + k.comment = comment; + return (k.toString('ssh')); + } +}; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright (c) 2012, Mark Cavage. All rights reserved. +// Copyright 2015 Joyent, Inc. + +var assert = __webpack_require__(36); +var Stream = __webpack_require__(29).Stream; +var util = __webpack_require__(4); + + +///--- Globals + +/* JSSTYLED */ +var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; + + +///--- Internal + +function _capitalize(str) { + return (str.charAt(0).toUpperCase() + str.slice(1)); +} + +function _toss(name, expected, oper, arg, actual) { + throw new assert.AssertionError({ + message: util.format('%s (%s) is required', name, expected), + actual: (actual === undefined) ? typeof (arg) : actual(arg), + expected: expected, + operator: oper || '===', + stackStartFunction: _toss.caller + }); +} + +function _getClass(arg) { + return (Object.prototype.toString.call(arg).slice(8, -1)); +} + +function noop() { + // Why even bother with asserts? +} + + +///--- Exports + +var types = { + bool: { + check: function (arg) { return typeof (arg) === 'boolean'; } + }, + func: { + check: function (arg) { return typeof (arg) === 'function'; } + }, + string: { + check: function (arg) { return typeof (arg) === 'string'; } + }, + object: { + check: function (arg) { + return typeof (arg) === 'object' && arg !== null; + } + }, + number: { + check: function (arg) { + return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); + } + }, + buffer: { + check: function (arg) { return Buffer.isBuffer(arg); }, + operator: 'Buffer.isBuffer' + }, + array: { + check: function (arg) { return Array.isArray(arg); }, + operator: 'Array.isArray' + }, + stream: { + check: function (arg) { return arg instanceof Stream; }, + operator: 'instanceof', + actual: _getClass + }, + date: { + check: function (arg) { return arg instanceof Date; }, + operator: 'instanceof', + actual: _getClass + }, + regexp: { + check: function (arg) { return arg instanceof RegExp; }, + operator: 'instanceof', + actual: _getClass + }, + uuid: { + check: function (arg) { + return typeof (arg) === 'string' && UUID_REGEXP.test(arg); + }, + operator: 'isUUID' + } +}; + +function _setExports(ndebug) { + var keys = Object.keys(types); + var out; + + /* re-export standard assert */ + if (process.env.NODE_NDEBUG) { + out = noop; + } else { + out = function (arg, msg) { + if (!arg) { + _toss(msg, 'true', arg); + } + }; + } + + /* standard checks */ + keys.forEach(function (k) { + if (ndebug) { + out[k] = noop; + return; + } + var type = types[k]; + out[k] = function (arg, msg) { + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* optional checks */ + keys.forEach(function (k) { + var name = 'optional' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* arrayOf checks */ + keys.forEach(function (k) { + var name = 'arrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* optionalArrayOf checks */ + keys.forEach(function (k) { + var name = 'optionalArrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { if (arg === undefined || arg === null) { return; } @@ -41429,13 +43468,13 @@ module.exports = _setExports(process.env.NODE_NDEBUG); /***/ }), -/* 118 */ +/* 126 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var chalk = __webpack_require__(36); -var figures = __webpack_require__(169); +var chalk = __webpack_require__(39); +var figures = __webpack_require__(181); /** * Separator object @@ -41470,14 +43509,14 @@ Separator.prototype.toString = function () { /***/ }), -/* 119 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _ = __webpack_require__(26); -var chalk = __webpack_require__(36); +var _ = __webpack_require__(31); +var chalk = __webpack_require__(39); /** * The paginator keep trakcs of a pointer index in a list and return @@ -41515,7 +43554,7 @@ Paginator.prototype.paginate = function (output, active, pageSize) { /***/ }), -/* 120 */ +/* 128 */ /***/ (function(module, exports) { /*! @@ -41532,7 +43571,7 @@ module.exports = function isExtglob(str) { /***/ }), -/* 121 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -41542,7 +43581,7 @@ module.exports = function isExtglob(str) { * Licensed under the MIT License. */ -var isExtglob = __webpack_require__(120); +var isExtglob = __webpack_require__(128); module.exports = function isGlob(str) { return typeof str === 'string' @@ -41551,7 +43590,7 @@ module.exports = function isGlob(str) { }; /***/ }), -/* 122 */ +/* 130 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41571,7 +43610,7 @@ module.exports = function isGlob(str) { * You should have received a copy of the license along with this program. */ -var crypto = __webpack_require__(9); +var crypto = __webpack_require__(13); /** * @exports jodid25519/core @@ -42039,7 +44078,7 @@ module.exports = ns; /***/ }), -/* 123 */ +/* 131 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42060,7 +44099,7 @@ module.exports = ns; * You should have received a copy of the license along with this program. */ -var core = __webpack_require__(122); +var core = __webpack_require__(130); /** * @exports jodid25519/utils @@ -42244,7 +44283,7 @@ module.exports = ns; /***/ }), -/* 124 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { module.exports = minimatch @@ -42252,11 +44291,11 @@ minimatch.Minimatch = Minimatch var path = { sep: '/' } try { - path = __webpack_require__(1) + path = __webpack_require__(0) } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(439) +var expand = __webpack_require__(457) var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, @@ -43173,10 +45212,10 @@ function regExpEscape (s) { /***/ }), -/* 125 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { -var wrappy = __webpack_require__(186) +var wrappy = __webpack_require__(198) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) @@ -43221,13 +45260,13 @@ function onceStrict (fn) { /***/ }), -/* 126 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isPromise = __webpack_require__(596); +var isPromise = __webpack_require__(620); /** * Return a function that will run a function asynchronously or synchronously @@ -43289,27 +45328,27 @@ runAsync.cb = function (func, cb) { /***/ }), -/* 127 */ +/* 135 */ /***/ (function(module, exports, __webpack_require__) { -var Rx = __webpack_require__(40); -__webpack_require__(663); -__webpack_require__(664); -__webpack_require__(665); -__webpack_require__(294); -__webpack_require__(666); -__webpack_require__(667); -__webpack_require__(668); -__webpack_require__(669); -__webpack_require__(295); -__webpack_require__(670); -__webpack_require__(671); +var Rx = __webpack_require__(44); +__webpack_require__(690); +__webpack_require__(691); +__webpack_require__(692); +__webpack_require__(311); +__webpack_require__(693); +__webpack_require__(694); +__webpack_require__(695); +__webpack_require__(696); +__webpack_require__(312); +__webpack_require__(697); +__webpack_require__(698); module.exports = Rx; /***/ }), -/* 128 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -43320,18 +45359,18 @@ module.exports = { write: write }; -var assert = __webpack_require__(12); -var asn1 = __webpack_require__(46); -var algs = __webpack_require__(22); -var utils = __webpack_require__(20); -var crypto = __webpack_require__(9); +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(52); +var algs = __webpack_require__(26); +var utils = __webpack_require__(24); +var crypto = __webpack_require__(13); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var pem = __webpack_require__(58); -var rfc4253 = __webpack_require__(63); -var SSHBuffer = __webpack_require__(129); -var errors = __webpack_require__(42); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(28); +var pem = __webpack_require__(61); +var rfc4253 = __webpack_require__(68); +var SSHBuffer = __webpack_require__(137); +var errors = __webpack_require__(49); var bcrypt; @@ -43380,7 +45419,7 @@ function readSSHPrivate(type, buf, options) { var rounds = kdfOptsBuf.readInt(); var cinf = utils.opensshCipherInfo(cipher); if (bcrypt === undefined) { - bcrypt = __webpack_require__(239); + bcrypt = __webpack_require__(253); } if (typeof (options.passphrase) === 'string') { @@ -43501,7 +45540,7 @@ function write(key, options) { kdfopts = kdfssh.toBuffer(); if (bcrypt === undefined) { - bcrypt = __webpack_require__(239); + bcrypt = __webpack_require__(253); } var pass = new Uint8Array(passphrase); var salti = new Uint8Array(salt); @@ -43576,14 +45615,14 @@ function write(key, options) { /***/ }), -/* 129 */ +/* 137 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = SSHBuffer; -var assert = __webpack_require__(12); +var assert = __webpack_require__(16); function SSHBuffer(opts) { assert.object(opts, 'options'); @@ -43730,16 +45769,16 @@ SSHBuffer.prototype.write = function (buf) { /***/ }), -/* 130 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { -var chownr = __webpack_require__(447) -var tar = __webpack_require__(305) -var pump = __webpack_require__(283) -var mkdirp = __webpack_require__(180) -var fs = __webpack_require__(8) -var path = __webpack_require__(1) -var os = __webpack_require__(75) +var chownr = __webpack_require__(464) +var tar = __webpack_require__(322) +var pump = __webpack_require__(296) +var mkdirp = __webpack_require__(192) +var fs = __webpack_require__(10) +var path = __webpack_require__(0) +var os = __webpack_require__(70) var win32 = os.platform() === 'win32' @@ -44059,7 +46098,7 @@ function mkdirfix (name, opts, cb) { /***/ }), -/* 131 */ +/* 139 */ /***/ (function(module, exports, __webpack_require__) { (function(nacl) { @@ -46438,7 +48477,7 @@ nacl.setPRNG = function(fn) { }); } else if (true) { // Node.js. - crypto = __webpack_require__(9); + crypto = __webpack_require__(13); if (crypto && crypto.randomBytes) { nacl.setPRNG(function(x, n) { var i, v = crypto.randomBytes(n); @@ -46453,31 +48492,31 @@ nacl.setPRNG = function(fn) { /***/ }), -/* 132 */ +/* 140 */ /***/ (function(module, exports) { module.exports = require("child_process"); /***/ }), -/* 133 */ +/* 141 */ /***/ (function(module, exports) { module.exports = require("https"); /***/ }), -/* 134 */ +/* 142 */ /***/ (function(module, exports) { module.exports = require("querystring"); /***/ }), -/* 135 */ +/* 143 */ /***/ (function(module, exports) { module.exports = require("readline"); /***/ }), -/* 136 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46490,7 +48529,7 @@ Object.defineProperty(exports, "__esModule", { var _consoleReporter; function _load_consoleReporter() { - return _consoleReporter = __webpack_require__(408); + return _consoleReporter = __webpack_require__(423); } Object.defineProperty(exports, 'ConsoleReporter', { @@ -46503,7 +48542,7 @@ Object.defineProperty(exports, 'ConsoleReporter', { var _bufferReporter; function _load_bufferReporter() { - return _bufferReporter = __webpack_require__(407); + return _bufferReporter = __webpack_require__(422); } Object.defineProperty(exports, 'BufferReporter', { @@ -46516,7 +48555,7 @@ Object.defineProperty(exports, 'BufferReporter', { var _eventReporter; function _load_eventReporter() { - return _eventReporter = __webpack_require__(412); + return _eventReporter = __webpack_require__(427); } Object.defineProperty(exports, 'EventReporter', { @@ -46529,7 +48568,7 @@ Object.defineProperty(exports, 'EventReporter', { var _jsonReporter; function _load_jsonReporter() { - return _jsonReporter = __webpack_require__(144); + return _jsonReporter = __webpack_require__(151); } Object.defineProperty(exports, 'JSONReporter', { @@ -46542,7 +48581,7 @@ Object.defineProperty(exports, 'JSONReporter', { var _noopReporter; function _load_noopReporter() { - return _noopReporter = __webpack_require__(414); + return _noopReporter = __webpack_require__(429); } Object.defineProperty(exports, 'NoopReporter', { @@ -46555,7 +48594,7 @@ Object.defineProperty(exports, 'NoopReporter', { var _baseReporter; function _load_baseReporter() { - return _baseReporter = __webpack_require__(65); + return _baseReporter = __webpack_require__(71); } Object.defineProperty(exports, 'Reporter', { @@ -46568,7 +48607,7 @@ Object.defineProperty(exports, 'Reporter', { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/* 137 */ +/* 145 */ /***/ (function(module, exports) { // Copyright 2011 Mark Cavage All rights reserved. @@ -46587,7 +48626,7 @@ module.exports = { /***/ }), -/* 138 */ +/* 146 */ /***/ (function(module, exports) { // Copyright 2011 Mark Cavage All rights reserved. @@ -46629,240 +48668,7 @@ module.exports = { /***/ }), -/* 139 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.pack = exports.packTarball = undefined; - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); -} - -var _from; - -function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(87)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); -} - -let packTarball = exports.packTarball = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let mapHeader = _ref2.mapHeader; - - const pkg = yield config.readRootManifest(); - const bundledDependencies = pkg.bundledDependencies, - main = pkg.main, - onlyFiles = pkg.files; - - // include required files - - let filters = NEVER_IGNORE.slice(); - // include default filters unless `files` is used - if (!onlyFiles) { - filters = filters.concat(DEFAULT_IGNORE); - } - if (main) { - filters = filters.concat((0, (_filter || _load_filter()).ignoreLinesToRegex)(['!/' + main])); - } - - // include bundledDependencies - if (bundledDependencies) { - const folder = config.getFolder(pkg); - filters = (0, (_filter || _load_filter()).ignoreLinesToRegex)(bundledDependencies.map(function (name) { - return `!${folder}/${name}`; - }), '.'); - } - - // `files` field - if (onlyFiles) { - let lines = ['*', // ignore all files except those that are explicitly included with a negation filter - '.*']; - lines = lines.concat(onlyFiles.map(function (filename) { - return `!${filename}`; - }), onlyFiles.map(function (filename) { - return `!${path.join(filename, '**')}`; - })); - const regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, '.'); - filters = filters.concat(regexes); - } - - const files = yield (_fs || _load_fs()).walk(config.cwd, null, new (_set || _load_set()).default(FOLDERS_IGNORE)); - const dotIgnoreFiles = (0, (_filter || _load_filter()).filterOverridenGitignores)(files); - - // create ignores - for (const file of dotIgnoreFiles) { - const raw = yield (_fs || _load_fs()).readFile(file.absolute); - const lines = raw.split('\n'); - - const regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, path.dirname(file.relative)); - filters = filters.concat(regexes); - } - - // files to definitely keep, takes precedence over ignore filter - const keepFiles = new (_set || _load_set()).default(); - - // files to definitely ignore - const ignoredFiles = new (_set || _load_set()).default(); - - // list of files that didn't match any of our patterns, if a directory in the chain above was matched - // then we should inherit it - const possibleKeepFiles = new (_set || _load_set()).default(); - - // apply filters - (0, (_filter || _load_filter()).sortFilter)(files, filters, keepFiles, possibleKeepFiles, ignoredFiles); - - const packer = tar.pack(config.cwd, { - ignore: function ignore(name) { - const relative = path.relative(config.cwd, name); - // Don't ignore directories, since we need to recurse inside them to check for unignored files. - if (fs2.lstatSync(name).isDirectory()) { - const isParentOfKeptFile = (0, (_from || _load_from()).default)(keepFiles).some(function (name) { - return !path.relative(relative, name).startsWith('..'); - }); - return !isParentOfKeptFile; - } - // Otherwise, ignore a file if we're not supposed to keep it. - return !keepFiles.has(relative); - }, - map: function map(header) { - const suffix = header.name === '.' ? '' : `/${header.name}`; - header.name = `package${suffix}`; - delete header.uid; - delete header.gid; - return mapHeader ? mapHeader(header) : header; - } - }); - - return packer; - }); - - return function packTarball(_x2) { - return _ref.apply(this, arguments); - }; -})(); - -let pack = exports.pack = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, dir) { - const packer = yield packTarball(config); - const compressor = packer.pipe(new zlib.Gzip()); - - return compressor; - }); - - return function pack(_x3, _x4) { - return _ref3.apply(this, arguments); - }; -})(); - -let run = exports.run = (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const pkg = yield config.readRootManifest(); - if (!pkg.name) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); - } - if (!pkg.version) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion')); - } - - const normaliseScope = function normaliseScope(name) { - return name[0] === '@' ? name.substr(1).replace('/', '-') : name; - }; - const filename = flags.filename || path.join(config.cwd, `${normaliseScope(pkg.name)}-v${pkg.version}.tgz`); - - yield config.executeLifecycleScript('prepack'); - - const stream = yield pack(config, config.cwd); - - yield new (_promise || _load_promise()).default(function (resolve, reject) { - stream.pipe(fs2.createWriteStream(filename)); - stream.on('error', reject); - stream.on('close', resolve); - }); - - yield config.executeLifecycleScript('postpack'); - - reporter.success(reporter.lang('packWroteTarball', filename)); - }); - - return function run(_x5, _x6, _x7, _x8) { - return _ref4.apply(this, arguments); - }; -})(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); -} - -var _filter; - -function _load_filter() { - return _filter = __webpack_require__(234); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const zlib = __webpack_require__(189); -const path = __webpack_require__(1); -const tar = __webpack_require__(130); -const fs2 = __webpack_require__(8); - -const FOLDERS_IGNORE = [ -// never allow version control folders -'.git', 'CVS', '.svn', '.hg', 'node_modules']; - -const DEFAULT_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([].concat(FOLDERS_IGNORE, [ - -// ignore cruft -'yarn.lock', '.lock-wscript', '.wafpickle-{0..9}', '*.swp', '._*', 'npm-debug.log', 'yarn-error.log', '.npmrc', '.yarnrc', '.npmignore', '.gitignore', '.DS_Store'])); - -const NEVER_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([ -// never ignore these files -'!/package.json', '!/readme*', '!/+(license|licence)*', '!/+(changes|changelog|history)*']); - -function setFlags(commander) { - commander.option('-f, --filename ', 'filename'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 140 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46876,38 +48682,36 @@ exports.getOutdated = exports.run = exports.requireLockfile = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); + return _keys = _interopRequireDefault(__webpack_require__(14)); } var _assign; function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); + return _assign = _interopRequireDefault(__webpack_require__(17)); } -let run = exports.run = (() => { +var run = exports.run = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - let addArgs = []; - const upgradeAll = args.length === 0; - const addFlags = (0, (_assign || _load_assign()).default)({}, flags, { + var addArgs = []; + var upgradeAll = args.length === 0 && typeof flags.scope === 'undefined' && typeof flags.pattern === 'undefined'; + var addFlags = (0, (_assign || _load_assign()).default)({}, flags, { force: true, ignoreWorkspaceRootCheck: true, workspaceRootIsCwd: config.cwd === config.lockfileFolder }); - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - const deps = yield getOutdated(config, reporter, flags, lockfile, args); - const install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - - var _ref2 = yield install.fetchRequestFromCwd(); - - const packagePatterns = _ref2.requests; + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); + var deps = yield getOutdated(config, reporter, flags, lockfile, args); + var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); + var _ref2 = yield install.fetchRequestFromCwd(), + packagePatterns = _ref2.requests; setUserRequestedPackageVersions(deps, args, flags.latest, packagePatterns, reporter); cleanLockfile(lockfile, deps, packagePatterns, reporter); @@ -46921,22 +48725,22 @@ let run = exports.run = (() => { }); } - const add = new (_add || _load_add()).Add(addArgs, addFlags, config, reporter, upgradeAll ? new (_lockfile || _load_lockfile()).default() : lockfile); + var add = new (_add || _load_add()).Add(addArgs, addFlags, config, reporter, upgradeAll ? new (_lockfile || _load_lockfile()).default() : lockfile); yield add.init(); }); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; -})(); +}(); -let getOutdated = exports.getOutdated = (() => { +var getOutdated = exports.getOutdated = function () { var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile, patterns) { - const install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - const outdatedFieldName = flags.latest ? 'latest' : 'wanted'; + var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); + var outdatedFieldName = flags.latest ? 'latest' : 'wanted'; // ensure scope is of the form `@scope/` - const normalizeScope = function normalizeScope() { + var normalizeScope = function normalizeScope() { if (flags.scope) { if (!flags.scope.startsWith('@')) { flags.scope = '@' + flags.scope; @@ -46948,7 +48752,7 @@ let getOutdated = exports.getOutdated = (() => { } }; - const versionFilter = function versionFilter(dep) { + var versionFilter = function versionFilter(dep) { return dep.current !== dep[outdatedFieldName]; }; @@ -46961,7 +48765,7 @@ let getOutdated = exports.getOutdated = (() => { normalizeScope(); - const deps = (yield (_packageRequest || _load_packageRequest()).default.getOutdatedPackages(lockfile, install, config, reporter, patterns, flags)).filter(versionFilter).filter(scopeFilter.bind(this, flags)); + var deps = (yield (_packageRequest || _load_packageRequest()).default.getOutdatedPackages(lockfile, install, config, reporter, patterns, flags)).filter(versionFilter).filter(scopeFilter.bind(this, flags)); deps.forEach(function (dep) { dep.upgradeTo = buildPatternToUpgradeTo(dep, flags); reporter.verbose(reporter.lang('verboseUpgradeBecauseOutdated', dep.name, dep.upgradeTo)); @@ -46973,7 +48777,7 @@ let getOutdated = exports.getOutdated = (() => { return function getOutdated(_x5, _x6, _x7, _x8, _x9) { return _ref3.apply(this, arguments); }; -})(); +}(); exports.cleanLockfile = cleanLockfile; exports.setFlags = setFlags; @@ -46982,67 +48786,67 @@ exports.hasWrapper = hasWrapper; var _add; function _load_add() { - return _add = __webpack_require__(100); + return _add = __webpack_require__(107); } var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(16)); + return _lockfile = _interopRequireDefault(__webpack_require__(20)); } var _packageRequest; function _load_packageRequest() { - return _packageRequest = _interopRequireDefault(__webpack_require__(80)); + return _packageRequest = _interopRequireDefault(__webpack_require__(85)); } var _normalizePattern; function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(39); + return _normalizePattern = __webpack_require__(42); } var _install; function _load_install() { - return _install = __webpack_require__(27); + return _install = __webpack_require__(33); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // used to detect whether a semver range is simple enough to preserve when doing a --latest upgrade. // when not matched, the upgraded version range will default to `^` the same as the `add` command would. -const basicSemverOperatorRegex = new RegExp('^(\\^|~|>|<=|>=)?[^ |&,]+$'); +var basicSemverOperatorRegex = new RegExp('^(\\^|~|>|<=|>=)?[^ |&,]+$'); // used to detect if a passed parameter is a scope or a package name. -const validScopeRegex = /^@[a-zA-Z0-9-][a-zA-Z0-9_.-]*\/$/; +var validScopeRegex = /^@[a-zA-Z0-9-][a-zA-Z0-9_.-]*\/$/; // If specific versions were requested for packages, override what getOutdated reported as the latest to install // Also add ones that are missing, since the requested packages may not have been outdated at all. function setUserRequestedPackageVersions(deps, args, latest, packagePatterns, reporter) { - args.forEach(requestedPattern => { - let found = false; - let normalized = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(requestedPattern); + args.forEach(function (requestedPattern) { + var found = false; + var normalized = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(requestedPattern); // if the user specified a package name without a version range, then that implies "latest" // but if the latest flag is not passed then we need to use the version range from package.json if (!normalized.hasVersion && !latest) { - packagePatterns.forEach(packagePattern => { - const packageNormalized = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(packagePattern.pattern); + packagePatterns.forEach(function (packagePattern) { + var packageNormalized = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(packagePattern.pattern); if (packageNormalized.name === normalized.name) { normalized = packageNormalized; } }); } - const newPattern = `${normalized.name}@${normalized.range}`; + var newPattern = `${normalized.name}@${normalized.range}`; // if this dependency is already in the outdated list, // just update the upgradeTo to whatever version the user requested. - deps.forEach(dep => { + deps.forEach(function (dep) { if (normalized.hasVersion && dep.name === normalized.name) { found = true; dep.upgradeTo = newPattern; @@ -47074,7 +48878,7 @@ function setUserRequestedPackageVersions(deps, args, latest, packagePatterns, re // this will only handle the simple cases of a semver starting with '^', '~', '>', '>=', '<=', or an exact version. // "exotic" semver ranges will not be handled. function getRangeOperator(version) { - const result = basicSemverOperatorRegex.exec(version); + var result = basicSemverOperatorRegex.exec(version); return result ? result[1] || '' : '^'; } @@ -47085,9 +48889,9 @@ function buildPatternToUpgradeTo(dep, flags) { return dep.url; } - const toLatest = flags.latest; - const toVersion = toLatest ? dep.latest : dep.range; - let rangeOperator = ''; + var toLatest = flags.latest; + var toVersion = toLatest ? dep.latest : dep.range; + var rangeOperator = ''; if (toLatest) { if (flags.caret) { @@ -47118,24 +48922,35 @@ function scopeFilter(flags, dep) { // Transitive dependencies that are also a direct dependency are skipped. function cleanLockfile(lockfile, deps, packagePatterns, reporter) { function cleanDepFromLockfile(pattern, depth) { - const lockManifest = lockfile.getLocked(pattern); - if (!lockManifest || depth > 1 && packagePatterns.some(packagePattern => packagePattern.pattern === pattern)) { + var lockManifest = lockfile.getLocked(pattern); + if (!lockManifest || depth > 1 && packagePatterns.some(function (packagePattern) { + return packagePattern.pattern === pattern; + })) { reporter.verbose(reporter.lang('verboseUpgradeNotUnlocking', pattern)); return; } - const dependencies = (0, (_assign || _load_assign()).default)({}, lockManifest.dependencies || {}, lockManifest.optionalDependencies || {}); - const depPatterns = (0, (_keys || _load_keys()).default)(dependencies).map(key => `${key}@${dependencies[key]}`); + var dependencies = (0, (_assign || _load_assign()).default)({}, lockManifest.dependencies || {}, lockManifest.optionalDependencies || {}); + var depPatterns = (0, (_keys || _load_keys()).default)(dependencies).map(function (key) { + return `${key}@${dependencies[key]}`; + }); reporter.verbose(reporter.lang('verboseUpgradeUnlocking', pattern)); lockfile.removePattern(pattern); - depPatterns.forEach(pattern => cleanDepFromLockfile(pattern, depth + 1)); + depPatterns.forEach(function (pattern) { + return cleanDepFromLockfile(pattern, depth + 1); + }); } - const patterns = deps.map(dep => dep.upgradeTo); - patterns.forEach(pattern => cleanDepFromLockfile(pattern, 1)); + var patterns = deps.map(function (dep) { + return dep.upgradeTo; + }); + patterns.forEach(function (pattern) { + return cleanDepFromLockfile(pattern, 1); + }); } function setFlags(commander) { + commander.description('Upgrades packages to their latest version based on the specified range.'); commander.usage('upgrade [flags]'); commander.option('-S, --scope ', 'upgrade packages under the specified scope'); commander.option('-L, --latest', 'list the latest version of packages, ignoring version ranges in package.json'); @@ -47149,10 +48964,10 @@ function hasWrapper(commander, args) { return true; } -const requireLockfile = exports.requireLockfile = true; +var requireLockfile = exports.requireLockfile = true; /***/ }), -/* 141 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47166,59 +48981,78 @@ exports.integrityErrors = undefined; var _stringify; function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(34)); + return _stringify = _interopRequireDefault(__webpack_require__(32)); } var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); + return _extends2 = _interopRequireDefault(__webpack_require__(25)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); + return _keys = _interopRequireDefault(__webpack_require__(14)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _misc; function _load_misc() { - return _misc = __webpack_require__(15); + return _misc = __webpack_require__(19); +} + +var _packageNameUtils; + +function _load_packageNameUtils() { + return _packageNameUtils = __webpack_require__(158); } var _workspaceLayout; function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(67)); + return _workspaceLayout = _interopRequireDefault(__webpack_require__(74)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); -const path = __webpack_require__(1); +var invariant = __webpack_require__(9); + +var path = __webpack_require__(0); -const integrityErrors = exports.integrityErrors = { +var integrityErrors = exports.integrityErrors = { EXPECTED_IS_NOT_A_JSON: 'integrityFailedExpectedIsNotAJSON', FILES_MISSING: 'integrityFailedFilesMissing', LOCKFILE_DONT_MATCH: 'integrityLockfilesDontMatch', @@ -47226,24 +49060,29 @@ const integrityErrors = exports.integrityErrors = { LINKED_MODULES_DONT_MATCH: 'integrityCheckLinkedModulesDontMatch', PATTERNS_DONT_MATCH: 'integrityPatternsDontMatch', MODULES_FOLDERS_MISSING: 'integrityModulesFoldersMissing', - NODE_VERSION_DOESNT_MATCH: 'integrityNodeDoesntMatch' + SYSTEM_PARAMS_DONT_MATCH: 'integritySystemParamsDontMatch' }; -const INTEGRITY_FILE_DEFAULTS = () => ({ - nodeVersion: process.version, - modulesFolders: [], - flags: [], - linkedModules: [], - topLevelPatterns: [], - lockfileEntries: {}, - files: [] -}); +var INTEGRITY_FILE_DEFAULTS = function INTEGRITY_FILE_DEFAULTS() { + return { + systemParams: (0, (_packageNameUtils || _load_packageNameUtils()).getSystemParams)(), + modulesFolders: [], + flags: [], + linkedModules: [], + topLevelPatterns: [], + lockfileEntries: {}, + files: [] + }; +}; /** * */ -class InstallationIntegrityChecker { - constructor(config) { + +var InstallationIntegrityChecker = function () { + function InstallationIntegrityChecker(config) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, InstallationIntegrityChecker); + this.config = config; } @@ -47251,7 +49090,7 @@ class InstallationIntegrityChecker { * Get the common ancestor of every node_modules - it may be a node_modules directory itself, but isn't required to. */ - _getModulesRootFolder() { + InstallationIntegrityChecker.prototype._getModulesRootFolder = function _getModulesRootFolder() { if (this.config.modulesFolder) { return this.config.modulesFolder; } else if (this.config.workspaceRootFolder) { @@ -47259,13 +49098,13 @@ class InstallationIntegrityChecker { } else { return path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER); } - } + }; /** * Get the directory in which the yarn-integrity file should be written. */ - _getIntegrityFileFolder() { + InstallationIntegrityChecker.prototype._getIntegrityFileFolder = function _getIntegrityFileFolder() { if (this.config.modulesFolder) { return this.config.modulesFolder; } else if (this.config.enableMetaFolder) { @@ -47273,39 +49112,42 @@ class InstallationIntegrityChecker { } else { return path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER); } - } + }; /** * Get the full path of the yarn-integrity file. */ - _getIntegrityFileLocation() { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const locationFolder = _this._getIntegrityFileFolder(); - const locationPath = path.join(locationFolder, (_constants || _load_constants()).INTEGRITY_FILENAME); + InstallationIntegrityChecker.prototype._getIntegrityFileLocation = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var locationFolder = this._getIntegrityFileFolder(); + var locationPath = path.join(locationFolder, (_constants || _load_constants()).INTEGRITY_FILENAME); - const exists = yield (_fs || _load_fs()).exists(locationPath); + var exists = yield (_fs || _load_fs()).exists(locationPath); return { - locationFolder: locationFolder, - locationPath: locationPath, - exists: exists + locationFolder, + locationPath, + exists }; - })(); - } + }); + + function _getIntegrityFileLocation() { + return _ref.apply(this, arguments); + } + + return _getIntegrityFileLocation; + }(); /** * Get the list of the directories that contain our modules (there might be multiple such folders b/c of workspaces). */ - _getModulesFolders() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + InstallationIntegrityChecker.prototype._getModulesFolders = function _getModulesFolders() { + var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + workspaceLayout = _ref2.workspaceLayout; - let workspaceLayout = _ref.workspaceLayout; - - const locations = []; + var locations = []; if (this.config.modulesFolder) { locations.push(this.config.modulesFolder); @@ -47314,8 +49156,21 @@ class InstallationIntegrityChecker { } if (workspaceLayout) { - for (const workspaceName of (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces)) { - const loc = workspaceLayout.workspaces[workspaceName].loc; + for (var _iterator = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref3; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } + + var workspaceName = _ref3; + + var loc = workspaceLayout.workspaces[workspaceName].loc; if (loc) { locations.push(path.join(loc, (_constants || _load_constants()).NODE_MODULES_FOLDER)); @@ -47324,27 +49179,38 @@ class InstallationIntegrityChecker { } return locations.sort((_misc || _load_misc()).sortAlpha); - } + }; /** * Get a list of the files that are located inside our module folders. */ - _getIntegrityListing() { - var _this2 = this, - _arguments = arguments; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref2 = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : {}; - let workspaceLayout = _ref2.workspaceLayout; + InstallationIntegrityChecker.prototype._getIntegrityListing = function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + workspaceLayout = _ref5.workspaceLayout; + + var files = []; + + var recurse = function () { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { + for (var _iterator2 = yield (_fs || _load_fs()).readdir(dir), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref7; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref7 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref7 = _i2.value; + } - const files = []; + var file = _ref7; - const recurse = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { - for (const file of yield (_fs || _load_fs()).readdir(dir)) { - const entry = path.join(dir, file); - const stat = yield (_fs || _load_fs()).lstat(entry); + var entry = path.join(dir, file); + var stat = yield (_fs || _load_fs()).lstat(entry); if (stat.isDirectory()) { yield recurse(entry); @@ -47355,30 +49221,47 @@ class InstallationIntegrityChecker { }); return function recurse(_x3) { - return _ref3.apply(this, arguments); + return _ref6.apply(this, arguments); }; - })(); + }(); + + for (var _iterator3 = this._getModulesFolders({ workspaceLayout }), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref8; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref8 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref8 = _i3.value; + } + + var modulesFolder = _ref8; - for (const modulesFolder of _this2._getModulesFolders({ workspaceLayout: workspaceLayout })) { if (yield (_fs || _load_fs()).exists(modulesFolder)) { yield recurse(modulesFolder); } } return files; - })(); - } + }); + + function _getIntegrityListing() { + return _ref4.apply(this, arguments); + } + + return _getIntegrityListing; + }(); /** * Generate integrity hash of input lockfile. */ - _generateIntegrityFile(lockfile, patterns, flags, workspaceLayout, artifacts) { - var _this3 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const result = (0, (_extends2 || _load_extends()).default)({}, INTEGRITY_FILE_DEFAULTS(), { - artifacts: artifacts + InstallationIntegrityChecker.prototype._generateIntegrityFile = function () { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile, patterns, flags, workspaceLayout, artifacts) { + var result = (0, (_extends2 || _load_extends()).default)({}, INTEGRITY_FILE_DEFAULTS(), { + artifacts }); result.topLevelPatterns = patterns; @@ -47395,22 +49278,61 @@ class InstallationIntegrityChecker { return !workspaceLayout.getManifestByPattern(p); }); - for (const name of (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces)) { + for (var _iterator4 = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref10; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref10 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref10 = _i4.value; + } + + var name = _ref10; + if (!workspaceLayout.workspaces[name].loc) { continue; } - const manifest = workspaceLayout.workspaces[name].manifest; + var manifest = workspaceLayout.workspaces[name].manifest; if (manifest) { - for (const dependencyType of (_constants || _load_constants()).DEPENDENCY_TYPES) { - const dependencies = manifest[dependencyType]; + for (var _iterator5 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref11; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref11 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref11 = _i5.value; + } + + var dependencyType = _ref11; + + var dependencies = manifest[dependencyType]; if (!dependencies) { continue; } - for (const dep of (0, (_keys || _load_keys()).default)(dependencies)) { + for (var _iterator6 = (0, (_keys || _load_keys()).default)(dependencies), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref12; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref12 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref12 = _i6.value; + } + + var dep = _ref12; + result.topLevelPatterns.push(`${dep}@${dependencies[dep]}`); } } @@ -47431,51 +49353,89 @@ class InstallationIntegrityChecker { result.flags.push('ignoreScripts'); } - if (_this3.config.production) { + if (this.config.production) { result.flags.push('production'); } - const linkedModules = _this3.config.linkedModules; + var linkedModules = this.config.linkedModules; if (linkedModules.length) { result.linkedModules = linkedModules.sort((_misc || _load_misc()).sortAlpha); } - for (const key of (0, (_keys || _load_keys()).default)(lockfile)) { - result.lockfileEntries[key] = lockfile[key].resolved || ''; + for (var _iterator7 = (0, (_keys || _load_keys()).default)(lockfile), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { + var _ref13; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref13 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref13 = _i7.value; + } + + var _key = _ref13; + + result.lockfileEntries[_key] = lockfile[_key].resolved || ''; } - for (const modulesFolder of _this3._getModulesFolders({ workspaceLayout: workspaceLayout })) { + for (var _iterator8 = this._getModulesFolders({ workspaceLayout }), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { + var _ref14; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref14 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref14 = _i8.value; + } + + var modulesFolder = _ref14; + if (yield (_fs || _load_fs()).exists(modulesFolder)) { - result.modulesFolders.push(path.relative(_this3.config.lockfileFolder, modulesFolder)); + result.modulesFolders.push(path.relative(this.config.lockfileFolder, modulesFolder)); } } if (flags.checkFiles) { - const modulesRoot = _this3._getModulesRootFolder(); + var modulesRoot = this._getModulesRootFolder(); - result.files = (yield _this3._getIntegrityListing({ workspaceLayout: workspaceLayout })).map(function (entry) { + result.files = (yield this._getIntegrityListing({ workspaceLayout })).map(function (entry) { return path.relative(modulesRoot, entry); }).sort((_misc || _load_misc()).sortAlpha); } return result; - })(); - } + }); - _getIntegrityFile(locationPath) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const expectedRaw = yield (_fs || _load_fs()).readFile(locationPath); + function _generateIntegrityFile(_x4, _x5, _x6, _x7, _x8) { + return _ref9.apply(this, arguments); + } + + return _generateIntegrityFile; + }(); + + InstallationIntegrityChecker.prototype._getIntegrityFile = function () { + var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (locationPath) { + var expectedRaw = yield (_fs || _load_fs()).readFile(locationPath); try { return (0, (_extends2 || _load_extends()).default)({}, INTEGRITY_FILE_DEFAULTS(), JSON.parse(expectedRaw)); } catch (e) { // ignore JSON parsing for legacy text integrity files compatibility } return null; - })(); - } + }); - _compareIntegrityFiles(actual, expected, checkFiles, workspaceLayout) { + function _getIntegrityFile(_x9) { + return _ref15.apply(this, arguments); + } + + return _getIntegrityFile; + }(); + + InstallationIntegrityChecker.prototype._compareIntegrityFiles = function _compareIntegrityFiles(actual, expected, checkFiles, workspaceLayout) { if (!expected) { return 'EXPECTED_IS_NOT_A_JSON'; } @@ -47484,15 +49444,17 @@ class InstallationIntegrityChecker { return 'LINKED_MODULES_DONT_MATCH'; } - if (actual.nodeVersion !== expected.nodeVersion) { - return 'NODE_VERSION_DOESNT_MATCH'; + if (actual.systemParams !== expected.systemParams) { + return 'SYSTEM_PARAMS_DONT_MATCH'; } - let relevantExpectedFlags = expected.flags.slice(); + var relevantExpectedFlags = expected.flags.slice(); // If we run "yarn" after "yarn --check-files", we shouldn't fail the less strict validation if (actual.flags.indexOf('checkFiles') === -1) { - relevantExpectedFlags = relevantExpectedFlags.filter(flag => flag !== 'checkFiles'); + relevantExpectedFlags = relevantExpectedFlags.filter(function (flag) { + return flag !== 'checkFiles'; + }); } if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.flags, relevantExpectedFlags)) { @@ -47503,14 +49465,40 @@ class InstallationIntegrityChecker { return 'PATTERNS_DONT_MATCH'; } - for (const key of (0, (_keys || _load_keys()).default)(actual.lockfileEntries)) { - if (actual.lockfileEntries[key] !== expected.lockfileEntries[key]) { + for (var _iterator9 = (0, (_keys || _load_keys()).default)(actual.lockfileEntries), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { + var _ref16; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref16 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref16 = _i9.value; + } + + var _key2 = _ref16; + + if (actual.lockfileEntries[_key2] !== expected.lockfileEntries[_key2]) { return 'LOCKFILE_DONT_MATCH'; } } - for (const key of (0, (_keys || _load_keys()).default)(expected.lockfileEntries)) { - if (actual.lockfileEntries[key] !== expected.lockfileEntries[key]) { + for (var _iterator10 = (0, (_keys || _load_keys()).default)(expected.lockfileEntries), _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { + var _ref17; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref17 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref17 = _i10.value; + } + + var _key3 = _ref17; + + if (actual.lockfileEntries[_key3] !== expected.lockfileEntries[_key3]) { return 'LOCKFILE_DONT_MATCH'; } } @@ -47523,9 +49511,9 @@ class InstallationIntegrityChecker { // Since we know the "files" array is sorted (alphabetically), we can optimize the thing // Instead of storing the files in a Set, we can just iterate both arrays at once. O(n)! - for (let u = 0, v = 0; u < expected.files.length; ++u) { + for (var u = 0, v = 0; u < expected.files.length; ++u) { // Index that, if reached, means that we won't have enough food to match the remaining expected entries anyway - const max = v + (actual.files.length - v) - (expected.files.length - u) + 1; + var max = v + (actual.files.length - v) - (expected.files.length - u) + 1; // Skip over files that have been added (ie not present in 'expected') while (v < max && actual.files[v] !== expected.files[u]) { @@ -47539,34 +49527,45 @@ class InstallationIntegrityChecker { } } return 'OK'; - } - - check(patterns, lockfile, flags, workspaceLayout) { - var _this4 = this; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + InstallationIntegrityChecker.prototype.check = function () { + var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, lockfile, flags, workspaceLayout) { // check if patterns exist in lockfile - const missingPatterns = patterns.filter(function (p) { + var missingPatterns = patterns.filter(function (p) { return !lockfile[p] && (!workspaceLayout || !workspaceLayout.getManifestByPattern(p)); }); - const loc = yield _this4._getIntegrityFileLocation(); + var loc = yield this._getIntegrityFileLocation(); if (missingPatterns.length || !loc.exists) { return { integrityFileMissing: !loc.exists, - missingPatterns: missingPatterns + missingPatterns }; } - const actual = yield _this4._generateIntegrityFile(lockfile, patterns, flags, workspaceLayout); + var actual = yield this._generateIntegrityFile(lockfile, patterns, flags, workspaceLayout); - const expected = yield _this4._getIntegrityFile(loc.locationPath); - let integrityMatches = _this4._compareIntegrityFiles(actual, expected, flags.checkFiles, workspaceLayout); + var expected = yield this._getIntegrityFile(loc.locationPath); + var integrityMatches = this._compareIntegrityFiles(actual, expected, flags.checkFiles, workspaceLayout); if (integrityMatches === 'OK') { invariant(expected, "The integrity shouldn't pass without integrity file"); - for (const modulesFolder of expected.modulesFolders) { - if (!(yield (_fs || _load_fs()).exists(path.join(_this4.config.lockfileFolder, modulesFolder)))) { + for (var _iterator11 = expected.modulesFolders, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) { + var _ref19; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref19 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref19 = _i11.value; + } + + var modulesFolder = _ref19; + + if (!(yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, modulesFolder)))) { integrityMatches = 'MODULES_FOLDERS_MISSING'; } } @@ -47576,26 +49575,32 @@ class InstallationIntegrityChecker { integrityFileMissing: false, integrityMatches: integrityMatches === 'OK', integrityError: integrityMatches === 'OK' ? undefined : integrityMatches, - missingPatterns: missingPatterns, - hardRefreshRequired: integrityMatches === 'NODE_VERSION_DOESNT_MATCH' + missingPatterns, + hardRefreshRequired: integrityMatches === 'SYSTEM_PARAMS_DONT_MATCH' }; - })(); - } + }); + + function check(_x10, _x11, _x12, _x13) { + return _ref18.apply(this, arguments); + } + + return check; + }(); /** * Get artifacts from integrity file if it exists. */ - getArtifacts() { - var _this5 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const loc = yield _this5._getIntegrityFileLocation(); + + InstallationIntegrityChecker.prototype.getArtifacts = function () { + var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var loc = yield this._getIntegrityFileLocation(); if (!loc.exists) { return null; } - const expectedRaw = yield (_fs || _load_fs()).readFile(loc.locationPath); - let expected; + var expectedRaw = yield (_fs || _load_fs()).readFile(loc.locationPath); + var expected = void 0; try { expected = JSON.parse(expectedRaw); } catch (e) { @@ -47603,41 +49608,60 @@ class InstallationIntegrityChecker { } return expected ? expected.artifacts : null; - })(); - } + }); + + function getArtifacts() { + return _ref20.apply(this, arguments); + } + + return getArtifacts; + }(); /** * Write the integrity hash of the current install to disk. */ - save(patterns, lockfile, flags, workspaceLayout, artifacts) { - var _this6 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const integrityFile = yield _this6._generateIntegrityFile(lockfile, patterns, flags, workspaceLayout, artifacts); - const loc = yield _this6._getIntegrityFileLocation(); + InstallationIntegrityChecker.prototype.save = function () { + var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, lockfile, flags, workspaceLayout, artifacts) { + var integrityFile = yield this._generateIntegrityFile(lockfile, patterns, flags, workspaceLayout, artifacts); + + var loc = yield this._getIntegrityFileLocation(); invariant(loc.locationPath, 'expected integrity hash location'); yield (_fs || _load_fs()).mkdirp(path.dirname(loc.locationPath)); yield (_fs || _load_fs()).writeFile(loc.locationPath, (0, (_stringify || _load_stringify()).default)(integrityFile, null, 2)); - })(); - } + }); - removeIntegrityFile() { - var _this7 = this; + function save(_x14, _x15, _x16, _x17, _x18) { + return _ref21.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const loc = yield _this7._getIntegrityFileLocation(); + return save; + }(); + + InstallationIntegrityChecker.prototype.removeIntegrityFile = function () { + var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var loc = yield this._getIntegrityFileLocation(); if (loc.exists) { yield (_fs || _load_fs()).unlink(loc.locationPath); } - })(); - } -} + }); + + function removeIntegrityFile() { + return _ref22.apply(this, arguments); + } + + return removeIntegrityFile; + }(); + + return InstallationIntegrityChecker; +}(); + exports.default = InstallationIntegrityChecker; /***/ }), -/* 142 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47651,43 +49675,49 @@ exports.linkBin = undefined; var _from; function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(87)); + return _from = _interopRequireDefault(__webpack_require__(92)); } var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); + return _set = _interopRequireDefault(__webpack_require__(15)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(33)); + return _map = _interopRequireDefault(__webpack_require__(37)); } var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); + return _keys = _interopRequireDefault(__webpack_require__(14)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } -var _slicedToArray2; +var _classCallCheck2; -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(17)); +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let linkBin = exports.linkBin = (() => { +var linkBin = exports.linkBin = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { if (process.platform === 'win32') { - const unlockMutex = yield (0, (_mutex || _load_mutex()).default)(src); + var unlockMutex = yield (0, (_mutex || _load_mutex()).default)(src); try { yield cmdShim(src, dest); } finally { @@ -47703,69 +49733,71 @@ let linkBin = exports.linkBin = (() => { return function linkBin(_x, _x2) { return _ref.apply(this, arguments); }; -})(); +}(); var _packageHoister; function _load_packageHoister() { - return _packageHoister = _interopRequireDefault(__webpack_require__(402)); + return _packageHoister = _interopRequireDefault(__webpack_require__(417)); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _promise; function _load_promise() { - return _promise = _interopRequireWildcard(__webpack_require__(85)); + return _promise = _interopRequireWildcard(__webpack_require__(91)); } var _misc; function _load_misc() { - return _misc = __webpack_require__(15); + return _misc = __webpack_require__(19); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _mutex; function _load_mutex() { - return _mutex = _interopRequireDefault(__webpack_require__(424)); + return _mutex = _interopRequireDefault(__webpack_require__(440)); } var _semver; function _load_semver() { - return _semver = __webpack_require__(433); + return _semver = __webpack_require__(250); } var _workspaceLayout; function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(67)); + return _workspaceLayout = _interopRequireDefault(__webpack_require__(74)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); +var invariant = __webpack_require__(9); -const cmdShim = (_promise || _load_promise()).promisify(__webpack_require__(450)); -const path = __webpack_require__(1); +var cmdShim = (_promise || _load_promise()).promisify(__webpack_require__(467)); +var path = __webpack_require__(0); // Concurrency for creating bin links disabled because of the issue #1961 -const linkBinConcurrency = 1; +var linkBinConcurrency = 1; + +var PackageLinker = function () { + function PackageLinker(config, resolver) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageLinker); -class PackageLinker { - constructor(config, resolver) { this.resolver = resolver; this.reporter = config.reporter; this.config = config; @@ -47773,71 +49805,111 @@ class PackageLinker { this.topLevelBinLinking = true; } - setArtifacts(artifacts) { + PackageLinker.prototype.setArtifacts = function setArtifacts(artifacts) { this.artifacts = artifacts; - } + }; - setTopLevelBinLinking(topLevelBinLinking) { + PackageLinker.prototype.setTopLevelBinLinking = function setTopLevelBinLinking(topLevelBinLinking) { this.topLevelBinLinking = topLevelBinLinking; - } + }; - linkSelfDependencies(pkg, pkgLoc, targetBinLoc) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + PackageLinker.prototype.linkSelfDependencies = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, pkgLoc, targetBinLoc) { targetBinLoc = path.join(targetBinLoc, '.bin'); yield (_fs || _load_fs()).mkdirp(targetBinLoc); targetBinLoc = yield (_fs || _load_fs()).realpath(targetBinLoc); pkgLoc = yield (_fs || _load_fs()).realpath(pkgLoc); - for (const _ref2 of (0, (_misc || _load_misc()).entries)(pkg.bin)) { - var _ref3 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref2, 2); + for (var _iterator = (0, (_misc || _load_misc()).entries)(pkg.bin), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref4; - const scriptName = _ref3[0]; - const scriptCmd = _ref3[1]; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } + + var _ref3 = _ref4; + var scriptName = _ref3[0]; + var scriptCmd = _ref3[1]; - const dest = path.join(targetBinLoc, scriptName); - const src = path.join(pkgLoc, scriptCmd); + var dest = path.join(targetBinLoc, scriptName); + var src = path.join(pkgLoc, scriptCmd); if (!(yield (_fs || _load_fs()).exists(src))) { // TODO maybe throw an error continue; } yield linkBin(src, dest); } - })(); - } + }); - linkBinDependencies(pkg, dir) { - var _this = this; + function linkSelfDependencies(_x3, _x4, _x5) { + return _ref2.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const deps = []; + return linkSelfDependencies; + }(); + + PackageLinker.prototype.linkBinDependencies = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, dir) { + var deps = []; - const ref = pkg._reference; + var ref = pkg._reference; invariant(ref, 'Package reference is missing'); - const remote = pkg._remote; + var remote = pkg._remote; invariant(remote, 'Package remote is missing'); // link up `bin scripts` in `dependencies` - for (const pattern of ref.dependencies) { - const dep = _this.resolver.getStrictResolvedPattern(pattern); + for (var _iterator2 = ref.dependencies, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref6; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref6 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref6 = _i2.value; + } + + var pattern = _ref6; + + var _dep = this.resolver.getStrictResolvedPattern(pattern); if ( // Missing location means not installed inside node_modules - dep._reference && dep._reference.location && dep.bin && (0, (_keys || _load_keys()).default)(dep.bin).length) { + _dep._reference && _dep._reference.location && _dep.bin && (0, (_keys || _load_keys()).default)(_dep.bin).length) { deps.push({ - dep: dep, - loc: _this.config.generateHardModulePath(dep._reference) + dep: _dep, + loc: this.config.generateHardModulePath(_dep._reference) }); } } // link up the `bin` scripts in bundled dependencies if (pkg.bundleDependencies) { - for (const depName of pkg.bundleDependencies) { - const loc = path.join(_this.config.generateHardModulePath(ref), _this.config.getFolder(pkg), depName); + for (var _iterator3 = pkg.bundleDependencies, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref7; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref7 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref7 = _i3.value; + } + + var depName = _ref7; + + var _loc = path.join(this.config.generateHardModulePath(ref), this.config.getFolder(pkg), depName); try { - const dep = yield _this.config.readManifest(loc, remote.registry); + var _dep2 = yield this.config.readManifest(_loc, remote.registry); - if (dep.bin && (0, (_keys || _load_keys()).default)(dep.bin).length) { - deps.push({ dep: dep, loc: loc }); + if (_dep2.bin && (0, (_keys || _load_keys()).default)(_dep2.bin).length) { + deps.push({ dep: _dep2, loc: _loc }); } } catch (ex) { if (ex.code !== 'ENOENT') { @@ -47855,67 +49927,76 @@ class PackageLinker { } // write the executables - for (const _ref4 of deps) { - const dep = _ref4.dep; - const loc = _ref4.loc; + for (var _iterator4 = deps, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref9; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref9 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref9 = _i4.value; + } - if (dep._reference && dep._reference.location) { - yield _this.linkSelfDependencies(dep, loc, dir); + var _ref8 = _ref9; + var _dep3 = _ref8.dep, + _loc2 = _ref8.loc; + + if (_dep3._reference && _dep3._reference.location) { + yield this.linkSelfDependencies(_dep3, _loc2, dir); } } - })(); - } + }); + + function linkBinDependencies(_x6, _x7) { + return _ref5.apply(this, arguments); + } - getFlatHoistedTree(patterns) { - var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return linkBinDependencies; + }(); - let ignoreOptional = _ref5.ignoreOptional; + PackageLinker.prototype.getFlatHoistedTree = function getFlatHoistedTree(patterns) { + var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + ignoreOptional = _ref10.ignoreOptional; - const hoister = new (_packageHoister || _load_packageHoister()).default(this.config, this.resolver, { ignoreOptional: ignoreOptional }); + var hoister = new (_packageHoister || _load_packageHoister()).default(this.config, this.resolver, { ignoreOptional }); hoister.seed(patterns); return hoister.init(); - } - - copyModules(patterns, workspaceLayout) { - var _this2 = this, - _arguments = arguments; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref6 = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : {}; + PackageLinker.prototype.copyModules = function () { + var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) { + var _this = this; - let linkDuplicates = _ref6.linkDuplicates, - ignoreOptional = _ref6.ignoreOptional; + var _ref12 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + linkDuplicates = _ref12.linkDuplicates, + ignoreOptional = _ref12.ignoreOptional; - let flatTree = _this2.getFlatHoistedTree(patterns, { ignoreOptional: ignoreOptional }); + var flatTree = this.getFlatHoistedTree(patterns, { ignoreOptional }); // sorted tree makes file creation and copying not to interfere with each other flatTree = flatTree.sort(function (dep1, dep2) { return dep1[0].localeCompare(dep2[0]); }); // list of artifacts in modules to remove from extraneous removal - const artifactFiles = []; + var artifactFiles = []; - const copyQueue = new (_map || _load_map()).default(); - const hardlinkQueue = new (_map || _load_map()).default(); - const hardlinksEnabled = linkDuplicates && (yield (_fs || _load_fs()).hardlinksWork(_this2.config.cwd)); + var copyQueue = new (_map || _load_map()).default(); + var hardlinkQueue = new (_map || _load_map()).default(); + var hardlinksEnabled = linkDuplicates && (yield (_fs || _load_fs()).hardlinksWork(this.config.cwd)); - const copiedSrcs = new (_map || _load_map()).default(); - const symlinkPaths = new (_map || _load_map()).default(); - for (const _ref7 of flatTree) { - var _ref8 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref7, 2); + var copiedSrcs = new (_map || _load_map()).default(); + var symlinkPaths = new (_map || _load_map()).default(); - const folder = _ref8[0]; - var _ref8$ = _ref8[1]; - const pkg = _ref8$.pkg; - const loc = _ref8$.loc; - - const remote = pkg._remote || { type: '' }; - const ref = pkg._reference; - let dest = folder; + var _loop = function* _loop(folder, pkg, _loc3) { + var remote = pkg._remote || { type: '' }; + var ref = pkg._reference; + var dest = folder; invariant(ref, 'expected package reference'); - let src = loc; - let type = ''; + var src = _loc3; + var type = ''; if (remote.type === 'link') { // replace package source from incorrect cache location (workspaces and link: are not cached) // with a symlink source @@ -47926,24 +50007,47 @@ class PackageLinker { type = 'symlink'; if (dest.indexOf(workspaceLayout.virtualManifestName) !== -1) { // we don't need to install virtual manifest - continue; + return 'continue'; } // to get real path for non hoisted dependencies symlinkPaths.set(dest, src); } else { // backwards compatibility: get build artifacts from metadata // does not apply to symlinked dependencies - const metadata = yield _this2.config.readPackageMetadata(src); - for (const file of metadata.artifacts) { + var metadata = yield _this.config.readPackageMetadata(src); + for (var _iterator15 = metadata.artifacts, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) { + var _ref30; + + if (_isArray15) { + if (_i15 >= _iterator15.length) break; + _ref30 = _iterator15[_i15++]; + } else { + _i15 = _iterator15.next(); + if (_i15.done) break; + _ref30 = _i15.value; + } + + var file = _ref30; + artifactFiles.push(path.join(dest, file)); } } - for (const _ref9 of symlinkPaths.entries()) { - var _ref10 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref9, 2); + for (var _iterator16 = symlinkPaths.entries(), _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) { + var _ref32; + + if (_isArray16) { + if (_i16 >= _iterator16.length) break; + _ref32 = _iterator16[_i16++]; + } else { + _i16 = _iterator16.next(); + if (_i16.done) break; + _ref32 = _i16.value; + } - const symlink = _ref10[0]; - const realpath = _ref10[1]; + var _ref31 = _ref32; + var symlink = _ref31[0]; + var realpath = _ref31[1]; if (dest.indexOf(symlink + path.sep) === 0) { // after hoisting we end up with this structure @@ -47956,23 +50060,36 @@ class PackageLinker { ref.setLocation(dest); - const integrityArtifacts = _this2.artifacts[`${pkg.name}@${pkg.version}`]; + var integrityArtifacts = _this.artifacts[`${pkg.name}@${pkg.version}`]; if (integrityArtifacts) { - for (const file of integrityArtifacts) { - artifactFiles.push(path.join(dest, file)); + for (var _iterator17 = integrityArtifacts, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator17);;) { + var _ref33; + + if (_isArray17) { + if (_i17 >= _iterator17.length) break; + _ref33 = _iterator17[_i17++]; + } else { + _i17 = _iterator17.next(); + if (_i17.done) break; + _ref33 = _i17.value; + } + + var _file = _ref33; + + artifactFiles.push(path.join(dest, _file)); } } - const copiedDest = copiedSrcs.get(src); + var copiedDest = copiedSrcs.get(src); if (!copiedDest) { if (hardlinksEnabled) { copiedSrcs.set(src, dest); } copyQueue.set(dest, { - src: src, - dest: dest, - type: type, - onFresh: function onFresh() { + src, + dest, + type, + onFresh() { if (ref) { ref.setFresh(true); } @@ -47981,35 +50098,97 @@ class PackageLinker { } else { hardlinkQueue.set(dest, { src: copiedDest, - dest: dest, - onFresh: function onFresh() { + dest, + onFresh() { if (ref) { ref.setFresh(true); } } }); } + }; + + for (var _iterator5 = flatTree, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref14; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref14 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref14 = _i5.value; + } + + var _ref13 = _ref14; + var folder = _ref13[0]; + var _ref13$ = _ref13[1]; + var pkg = _ref13$.pkg; + var _loc3 = _ref13$.loc; + + var _ret = yield* _loop(folder, pkg, _loc3); + + if (_ret === 'continue') continue; } - const possibleExtraneous = new (_set || _load_set()).default(); - const scopedPaths = new (_set || _load_set()).default(); + var possibleExtraneous = new (_set || _load_set()).default(); + var scopedPaths = new (_set || _load_set()).default(); + + var findExtraneousFiles = function () { + var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (basePath) { + for (var _iterator6 = _this.config.registryFolders, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref16; - const findExtraneousFiles = (() => { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (basePath) { - for (const folder of _this2.config.registryFolders) { - const loc = path.join(basePath, folder); + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref16 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref16 = _i6.value; + } + + var folder = _ref16; + + var _loc4 = path.join(basePath, folder); + + if (yield (_fs || _load_fs()).exists(_loc4)) { + var files = yield (_fs || _load_fs()).readdir(_loc4); + + for (var _iterator7 = files, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { + var _ref17; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref17 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref17 = _i7.value; + } - if (yield (_fs || _load_fs()).exists(loc)) { - const files = yield (_fs || _load_fs()).readdir(loc); + var file = _ref17; - for (const file of files) { - const filepath = path.join(loc, file); + var filepath = path.join(_loc4, file); // it's a scope, not a package if (file[0] === '@') { scopedPaths.add(filepath); - for (const subfile of yield (_fs || _load_fs()).readdir(filepath)) { + for (var _iterator8 = yield (_fs || _load_fs()).readdir(filepath), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { + var _ref18; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref18 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref18 = _i8.value; + } + + var subfile = _ref18; + possibleExtraneous.add(path.join(filepath, subfile)); } } else { @@ -48020,14 +50199,27 @@ class PackageLinker { } }); - return function findExtraneousFiles(_x5) { - return _ref11.apply(this, arguments); + return function findExtraneousFiles(_x12) { + return _ref15.apply(this, arguments); }; - })(); + }(); - yield findExtraneousFiles(_this2.config.lockfileFolder); + yield findExtraneousFiles(this.config.lockfileFolder); if (workspaceLayout) { - for (const workspaceName of (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces)) { + for (var _iterator9 = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { + var _ref19; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref19 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref19 = _i9.value; + } + + var workspaceName = _ref19; + yield findExtraneousFiles(workspaceLayout.workspaces[workspaceName].loc); } } @@ -48038,11 +50230,11 @@ class PackageLinker { // which also creates symlinks :( a somewhat weak fix is to check if the symlink target is registered // inside the linkFolder, in which case we assume it has been created via "yarn link". Otherwise, we // assume it's a link:-managed dependency, and overwrite it as usual. - const linkTargets = new (_map || _load_map()).default(); + var linkTargets = new (_map || _load_map()).default(); - let linkedModules; + var linkedModules = void 0; try { - linkedModules = yield (_fs || _load_fs()).readdir(_this2.config.linkFolder); + linkedModules = yield (_fs || _load_fs()).readdir(this.config.linkFolder); } catch (err) { if (err.code === 'ENOENT') { linkedModules = []; @@ -48052,34 +50244,60 @@ class PackageLinker { } // TODO: Consolidate this logic with `this.config.linkedModules` logic - for (const entry of linkedModules) { - const entryPath = path.join(_this2.config.linkFolder, entry); - const stat = yield (_fs || _load_fs()).lstat(entryPath); + for (var _iterator10 = linkedModules, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { + var _ref20; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref20 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref20 = _i10.value; + } + + var entry = _ref20; + + var entryPath = path.join(this.config.linkFolder, entry); + var stat = yield (_fs || _load_fs()).lstat(entryPath); if (stat.isSymbolicLink()) { try { - const entryTarget = yield (_fs || _load_fs()).realpath(entryPath); + var entryTarget = yield (_fs || _load_fs()).realpath(entryPath); linkTargets.set(entry, entryTarget); } catch (err) { - _this2.reporter.warn(_this2.reporter.lang('linkTargetMissing', entry)); + this.reporter.warn(this.reporter.lang('linkTargetMissing', entry)); yield (_fs || _load_fs()).unlink(entryPath); } } else if (stat.isDirectory() && entry[0] === '@') { // if the entry is directory beginning with '@', then we're dealing with a package scope, which // means we must iterate inside to retrieve the package names it contains - const scopeName = entry; + var scopeName = entry; - for (const entry2 of yield (_fs || _load_fs()).readdir(entryPath)) { - const entryPath2 = path.join(entryPath, entry2); - const stat2 = yield (_fs || _load_fs()).lstat(entryPath2); + for (var _iterator18 = yield (_fs || _load_fs()).readdir(entryPath), _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator18);;) { + var _ref34; + + if (_isArray18) { + if (_i18 >= _iterator18.length) break; + _ref34 = _iterator18[_i18++]; + } else { + _i18 = _iterator18.next(); + if (_i18.done) break; + _ref34 = _i18.value; + } + + var entry2 = _ref34; + + var entryPath2 = path.join(entryPath, entry2); + var stat2 = yield (_fs || _load_fs()).lstat(entryPath2); if (stat2.isSymbolicLink()) { - const packageName = `${scopeName}/${entry2}`; + var packageName = `${scopeName}/${entry2}`; try { - const entryTarget = yield (_fs || _load_fs()).realpath(entryPath2); - linkTargets.set(packageName, entryTarget); + var _entryTarget = yield (_fs || _load_fs()).realpath(entryPath2); + linkTargets.set(packageName, _entryTarget); } catch (err) { - _this2.reporter.warn(_this2.reporter.lang('linkTargetMissing', packageName)); + this.reporter.warn(this.reporter.lang('linkTargetMissing', packageName)); yield (_fs || _load_fs()).unlink(entryPath2); } } @@ -48087,47 +50305,60 @@ class PackageLinker { } } - for (const loc of possibleExtraneous) { - let packageName = path.basename(loc); - const scopeName = path.basename(path.dirname(loc)); + for (var _iterator11 = possibleExtraneous, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) { + var _ref21; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref21 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref21 = _i11.value; + } + + var _loc5 = _ref21; + + var packageName = path.basename(_loc5); + var scopeName = path.basename(path.dirname(_loc5)); if (scopeName[0] === `@`) { packageName = `${scopeName}/${packageName}`; } - if ((yield (_fs || _load_fs()).lstat(loc)).isSymbolicLink() && linkTargets.has(packageName) && linkTargets.get(packageName) === (yield (_fs || _load_fs()).realpath(loc))) { - possibleExtraneous.delete(loc); - copyQueue.delete(loc); + if ((yield (_fs || _load_fs()).lstat(_loc5)).isSymbolicLink() && linkTargets.has(packageName) && linkTargets.get(packageName) === (yield (_fs || _load_fs()).realpath(_loc5))) { + possibleExtraneous.delete(_loc5); + copyQueue.delete(_loc5); } } // - let tick; - yield (_fs || _load_fs()).copyBulk((0, (_from || _load_from()).default)(copyQueue.values()), _this2.reporter, { - possibleExtraneous: possibleExtraneous, - artifactFiles: artifactFiles, + var tick = void 0; + yield (_fs || _load_fs()).copyBulk((0, (_from || _load_from()).default)(copyQueue.values()), this.reporter, { + possibleExtraneous, + artifactFiles, ignoreBasenames: [(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME], onStart: function onStart(num) { - tick = _this2.reporter.progress(num); + tick = _this.reporter.progress(num); }, - onProgress: function onProgress(src) { + onProgress(src) { if (tick) { tick(); } } }); - yield (_fs || _load_fs()).hardlinkBulk((0, (_from || _load_from()).default)(hardlinkQueue.values()), _this2.reporter, { - possibleExtraneous: possibleExtraneous, - artifactFiles: artifactFiles, + yield (_fs || _load_fs()).hardlinkBulk((0, (_from || _load_from()).default)(hardlinkQueue.values()), this.reporter, { + possibleExtraneous, + artifactFiles, onStart: function onStart(num) { - tick = _this2.reporter.progress(num); + tick = _this.reporter.progress(num); }, - onProgress: function onProgress(src) { + onProgress(src) { if (tick) { tick(); } @@ -48135,112 +50366,208 @@ class PackageLinker { }); // remove all extraneous files that weren't in the tree - for (const loc of possibleExtraneous) { - _this2.reporter.verbose(_this2.reporter.lang('verboseFileRemoveExtraneous', loc)); - yield (_fs || _load_fs()).unlink(loc); + for (var _iterator12 = possibleExtraneous, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) { + var _ref22; + + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref22 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref22 = _i12.value; + } + + var _loc6 = _ref22; + + this.reporter.verbose(this.reporter.lang('verboseFileRemoveExtraneous', _loc6)); + yield (_fs || _load_fs()).unlink(_loc6); } // remove any empty scoped directories - for (const scopedPath of scopedPaths) { - const files = yield (_fs || _load_fs()).readdir(scopedPath); + for (var _iterator13 = scopedPaths, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) { + var _ref23; + + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref23 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref23 = _i13.value; + } + + var scopedPath = _ref23; + + var files = yield (_fs || _load_fs()).readdir(scopedPath); if (files.length === 0) { yield (_fs || _load_fs()).unlink(scopedPath); } } // create binary links - if (_this2.config.binLinks) { - const topLevelDependencies = _this2.determineTopLevelBinLinks(flatTree); - const tickBin = _this2.reporter.progress(flatTree.length + topLevelDependencies.length); + if (this.config.binLinks) { + var topLevelDependencies = this.determineTopLevelBinLinkOrder(flatTree); + var tickBin = this.reporter.progress(flatTree.length + topLevelDependencies.length); // create links in transient dependencies - yield (_promise || _load_promise()).queue(flatTree, (() => { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref12) { - var _ref14 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref12, 2); - - let dest = _ref14[0], - pkg = _ref14[1].pkg; + yield (_promise || _load_promise()).queue(flatTree, function () { + var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref25) { + var dest = _ref25[0], + pkg = _ref25[1].pkg; if (pkg._reference && pkg._reference.location) { - const binLoc = path.join(dest, _this2.config.getFolder(pkg)); - yield _this2.linkBinDependencies(pkg, binLoc); + var binLoc = path.join(dest, _this.config.getFolder(pkg)); + yield _this.linkBinDependencies(pkg, binLoc); tickBin(); } }); - return function (_x6) { - return _ref13.apply(this, arguments); + return function (_x13) { + return _ref24.apply(this, arguments); }; - })(), linkBinConcurrency); + }(), linkBinConcurrency); // create links at top level for all dependencies. - yield (_promise || _load_promise()).queue(topLevelDependencies, (() => { - var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref15) { - var _ref17 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref15, 2); - - let dest = _ref17[0], - pkg = _ref17[1]; + yield (_promise || _load_promise()).queue(topLevelDependencies, function () { + var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref27) { + var dest = _ref27[0], + pkg = _ref27[1].pkg; if (pkg._reference && pkg._reference.location && pkg.bin && (0, (_keys || _load_keys()).default)(pkg.bin).length) { - const binLoc = path.join(_this2.config.lockfileFolder, _this2.config.getFolder(pkg)); - yield _this2.linkSelfDependencies(pkg, dest, binLoc); + var binLoc = path.join(_this.config.lockfileFolder, _this.config.getFolder(pkg)); + yield _this.linkSelfDependencies(pkg, dest, binLoc); tickBin(); } }); - return function (_x7) { - return _ref16.apply(this, arguments); + return function (_x14) { + return _ref26.apply(this, arguments); }; - })(), linkBinConcurrency); + }(), linkBinConcurrency); } - for (const _ref18 of flatTree) { - var _ref19 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref18, 2); + for (var _iterator14 = flatTree, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) { + var _ref29; - const pkg = _ref19[1].pkg; + if (_isArray14) { + if (_i14 >= _iterator14.length) break; + _ref29 = _iterator14[_i14++]; + } else { + _i14 = _iterator14.next(); + if (_i14.done) break; + _ref29 = _i14.value; + } - yield _this2._warnForMissingBundledDependencies(pkg); + var _ref28 = _ref29; + var pkg = _ref28[1].pkg; + + yield this._warnForMissingBundledDependencies(pkg); } - })(); - } + }); + + function copyModules(_x9, _x10) { + return _ref11.apply(this, arguments); + } - determineTopLevelBinLinks(flatTree) { - const linksToCreate = new (_map || _load_map()).default(); - for (const _ref20 of flatTree) { - var _ref21 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref20, 2); + return copyModules; + }(); + + PackageLinker.prototype.determineTopLevelBinLinkOrder = function determineTopLevelBinLinkOrder(flatTree) { + var linksToCreate = new (_map || _load_map()).default(); + for (var _iterator19 = flatTree, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator19);;) { + var _ref36; + + if (_isArray19) { + if (_i19 >= _iterator19.length) break; + _ref36 = _iterator19[_i19++]; + } else { + _i19 = _iterator19.next(); + if (_i19.done) break; + _ref36 = _i19.value; + } - const dest = _ref21[0]; - var _ref21$ = _ref21[1]; - const pkg = _ref21$.pkg; - const isDirectRequire = _ref21$.isDirectRequire; - const name = pkg.name; + var _ref35 = _ref36; + var _dest = _ref35[0]; + var hoistManifest = _ref35[1]; + var pkg = hoistManifest.pkg, + isDirectRequire = hoistManifest.isDirectRequire; + var name = pkg.name; if (isDirectRequire || this.topLevelBinLinking && !linksToCreate.has(name)) { - linksToCreate.set(name, [dest, pkg]); + linksToCreate.set(name, [_dest, hoistManifest]); } } - return (0, (_from || _load_from()).default)(linksToCreate.values()); - } + // Sort the array so that direct dependencies will be linked last. + // Bin links are overwritten if they already exist, so this will cause direct deps to take precedence. + // If someone finds this to be incorrect later, you could also consider sorting descending by + // `linkToCreate.level` which is the dependency tree depth. Direct deps will have level 0 and transitive + // deps will have level > 0. + var transientBins = []; + var topLevelBins = []; + for (var _iterator20 = (0, (_from || _load_from()).default)(linksToCreate.values()), _isArray20 = Array.isArray(_iterator20), _i20 = 0, _iterator20 = _isArray20 ? _iterator20 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator20);;) { + var _ref37; + + if (_isArray20) { + if (_i20 >= _iterator20.length) break; + _ref37 = _iterator20[_i20++]; + } else { + _i20 = _iterator20.next(); + if (_i20.done) break; + _ref37 = _i20.value; + } + + var linkToCreate = _ref37; + + if (linkToCreate[1].isDirectRequire) { + topLevelBins.push(linkToCreate); + } else { + transientBins.push(linkToCreate); + } + } + return [].concat(transientBins, topLevelBins); + }; - resolvePeerModules() { - for (const pkg of this.resolver.getManifests()) { - const peerDeps = pkg.peerDependencies; + PackageLinker.prototype.resolvePeerModules = function resolvePeerModules() { + var _this2 = this; + + var _loop2 = function _loop2(pkg) { + var peerDeps = pkg.peerDependencies; if (!peerDeps) { - continue; + return 'continue'; } - const ref = pkg._reference; + var ref = pkg._reference; invariant(ref, 'Package reference is missing'); // TODO: We are taking the "shortest" ref tree but there may be multiple ref trees with the same length - const refTree = ref.requests.map(req => req.parentNames).sort((arr1, arr2) => arr1.length - arr2.length)[0]; + var refTree = ref.requests.map(function (req) { + return req.parentNames; + }).sort(function (arr1, arr2) { + return arr1.length - arr2.length; + })[0]; + + var getLevelDistance = function getLevelDistance(pkgRef) { + var minDistance = Infinity; + for (var _iterator22 = pkgRef.requests, _isArray22 = Array.isArray(_iterator22), _i22 = 0, _iterator22 = _isArray22 ? _iterator22 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator22);;) { + var _ref39; + + if (_isArray22) { + if (_i22 >= _iterator22.length) break; + _ref39 = _iterator22[_i22++]; + } else { + _i22 = _iterator22.next(); + if (_i22.done) break; + _ref39 = _i22.value; + } - const getLevelDistance = pkgRef => { - let minDistance = Infinity; - for (const req of pkgRef.requests) { - const distance = refTree.length - req.parentNames.length; + var req = _ref39; - if (distance >= 0 && distance < minDistance && req.parentNames.every((name, idx) => name === refTree[idx])) { + var distance = refTree.length - req.parentNames.length; + + if (distance >= 0 && distance < minDistance && req.parentNames.every(function (name, idx) { + return name === refTree[idx]; + })) { minDistance = distance; } } @@ -48248,21 +50575,34 @@ class PackageLinker { return minDistance; }; - for (const peerDepName in peerDeps) { - const range = peerDeps[peerDepName]; - const peerPkgs = this.resolver.getAllInfoForPackageName(peerDepName); + for (var peerDepName in peerDeps) { + var range = peerDeps[peerDepName]; + var peerPkgs = _this2.resolver.getAllInfoForPackageName(peerDepName); - let peerError = 'unmetPeer'; - let resolvedLevelDistance = Infinity; - let resolvedPeerPkg; - for (const peerPkg of peerPkgs) { - const peerPkgRef = peerPkg._reference; + var peerError = 'unmetPeer'; + var resolvedLevelDistance = Infinity; + var resolvedPeerPkg = void 0; + for (var _iterator23 = peerPkgs, _isArray23 = Array.isArray(_iterator23), _i23 = 0, _iterator23 = _isArray23 ? _iterator23 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator23);;) { + var _ref40; + + if (_isArray23) { + if (_i23 >= _iterator23.length) break; + _ref40 = _iterator23[_i23++]; + } else { + _i23 = _iterator23.next(); + if (_i23.done) break; + _ref40 = _i23.value; + } + + var peerPkg = _ref40; + + var peerPkgRef = peerPkg._reference; if (!(peerPkgRef && peerPkgRef.patterns)) { continue; } - const levelDistance = getLevelDistance(peerPkgRef); + var levelDistance = getLevelDistance(peerPkgRef); if (isFinite(levelDistance) && levelDistance < resolvedLevelDistance) { - if (this._satisfiesPeerDependency(range, peerPkgRef.version)) { + if (_this2._satisfiesPeerDependency(range, peerPkgRef.version)) { resolvedLevelDistance = levelDistance; resolvedPeerPkg = peerPkgRef; } else { @@ -48273,55 +50613,96 @@ class PackageLinker { if (resolvedPeerPkg) { ref.addDependencies(resolvedPeerPkg.patterns); - this.reporter.verbose(this.reporter.lang('selectedPeer', `${pkg.name}@${pkg.version}`, `${peerDepName}@${resolvedPeerPkg.version}`, resolvedPeerPkg.level)); + _this2.reporter.verbose(_this2.reporter.lang('selectedPeer', `${pkg.name}@${pkg.version}`, `${peerDepName}@${resolvedPeerPkg.version}`, resolvedPeerPkg.level)); } else { - this.reporter.warn(this.reporter.lang(peerError, `${refTree.join(' > ')} > ${pkg.name}@${pkg.version}`, `${peerDepName}@${range}`)); + _this2.reporter.warn(_this2.reporter.lang(peerError, `${refTree.join(' > ')} > ${pkg.name}@${pkg.version}`, `${peerDepName}@${range}`)); } } + }; + + for (var _iterator21 = this.resolver.getManifests(), _isArray21 = Array.isArray(_iterator21), _i21 = 0, _iterator21 = _isArray21 ? _iterator21 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator21);;) { + var _ref38; + + if (_isArray21) { + if (_i21 >= _iterator21.length) break; + _ref38 = _iterator21[_i21++]; + } else { + _i21 = _iterator21.next(); + if (_i21.done) break; + _ref38 = _i21.value; + } + + var pkg = _ref38; + + var _ret2 = _loop2(pkg); + + if (_ret2 === 'continue') continue; } - } + }; - _satisfiesPeerDependency(range, version) { + PackageLinker.prototype._satisfiesPeerDependency = function _satisfiesPeerDependency(range, version) { return range === '*' || (0, (_semver || _load_semver()).satisfiesWithPreleases)(version, range, this.config.looseSemver); - } - - _warnForMissingBundledDependencies(pkg) { - var _this3 = this; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const ref = pkg._reference; + PackageLinker.prototype._warnForMissingBundledDependencies = function () { + var _ref41 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg) { + var ref = pkg._reference; if (pkg.bundleDependencies) { - for (const depName of pkg.bundleDependencies) { - const loc = path.join(_this3.config.generateHardModulePath(ref), _this3.config.getFolder(pkg), depName); - if (!(yield (_fs || _load_fs()).exists(loc))) { - const pkgHuman = `${pkg.name}@${pkg.version}`; - _this3.reporter.warn(_this3.reporter.lang('missingBundledDependency', pkgHuman, depName)); + for (var _iterator24 = pkg.bundleDependencies, _isArray24 = Array.isArray(_iterator24), _i24 = 0, _iterator24 = _isArray24 ? _iterator24 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator24);;) { + var _ref42; + + if (_isArray24) { + if (_i24 >= _iterator24.length) break; + _ref42 = _iterator24[_i24++]; + } else { + _i24 = _iterator24.next(); + if (_i24.done) break; + _ref42 = _i24.value; + } + + var depName = _ref42; + + var _loc7 = path.join(this.config.generateHardModulePath(ref), this.config.getFolder(pkg), depName); + if (!(yield (_fs || _load_fs()).exists(_loc7))) { + var pkgHuman = `${pkg.name}@${pkg.version}`; + this.reporter.warn(this.reporter.lang('missingBundledDependency', pkgHuman, depName)); } } } - })(); - } + }); - init(patterns, workspaceLayout) { - var _this4 = this, - _arguments2 = arguments; + function _warnForMissingBundledDependencies(_x15) { + return _ref41.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref22 = _arguments2.length > 2 && _arguments2[2] !== undefined ? _arguments2[2] : {}; + return _warnForMissingBundledDependencies; + }(); - let linkDuplicates = _ref22.linkDuplicates, - ignoreOptional = _ref22.ignoreOptional; + PackageLinker.prototype.init = function () { + var _ref43 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) { + var _ref44 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + linkDuplicates = _ref44.linkDuplicates, + ignoreOptional = _ref44.ignoreOptional; + + this.resolvePeerModules(); + yield this.copyModules(patterns, workspaceLayout, { linkDuplicates, ignoreOptional }); + }); + + function init(_x16, _x17) { + return _ref43.apply(this, arguments); + } + + return init; + }(); + + return PackageLinker; +}(); - _this4.resolvePeerModules(); - yield _this4.copyModules(patterns, workspaceLayout, { linkDuplicates: linkDuplicates, ignoreOptional: ignoreOptional }); - })(); - } -} exports.default = PackageLinker; /***/ }), -/* 143 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48338,20 +50719,18 @@ exports.clearNthLine = clearNthLine; var _tty; function _load_tty() { - return _tty = _interopRequireDefault(__webpack_require__(99)); + return _tty = _interopRequireDefault(__webpack_require__(105)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const readline = __webpack_require__(135); +var readline = __webpack_require__(143); -var _require = __webpack_require__(105); +var _require = __webpack_require__(113), + supportsColor = _require.supportsColor; -const supportsColor = _require.supportsColor; - - -const CLEAR_WHOLE_LINE = 0; -const CLEAR_RIGHT_OF_CURSOR = 1; +var CLEAR_WHOLE_LINE = 0; +var CLEAR_RIGHT_OF_CURSOR = 1; function clearLine(stdout) { if (!supportsColor) { @@ -48412,7 +50791,7 @@ function clearNthLine(stdout, n) { } /***/ }), -/* 144 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48425,183 +50804,219 @@ Object.defineProperty(exports, "__esModule", { var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); + return _extends2 = _interopRequireDefault(__webpack_require__(25)); } var _stringify; function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(34)); + return _stringify = _interopRequireDefault(__webpack_require__(32)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); } var _baseReporter; function _load_baseReporter() { - return _baseReporter = _interopRequireDefault(__webpack_require__(65)); + return _baseReporter = _interopRequireDefault(__webpack_require__(71)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -class JSONReporter extends (_baseReporter || _load_baseReporter()).default { - constructor(opts) { - super(opts); +var JSONReporter = function (_BaseReporter) { + (0, (_inherits2 || _load_inherits()).default)(JSONReporter, _BaseReporter); + + function JSONReporter(opts) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, JSONReporter); + + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseReporter.call(this, opts)); - this._activityId = 0; - this._progressId = 0; + _this._activityId = 0; + _this._progressId = 0; + return _this; } - _dump(type, data, error) { - let stdout = this.stdout; + JSONReporter.prototype._dump = function _dump(type, data, error) { + var stdout = this.stdout; if (error) { stdout = this.stderr; } - stdout.write(`${(0, (_stringify || _load_stringify()).default)({ type: type, data: data })}\n`); - } + stdout.write(`${(0, (_stringify || _load_stringify()).default)({ type, data })}\n`); + }; - _verbose(msg) { + JSONReporter.prototype._verbose = function _verbose(msg) { this._dump('verbose', msg); - } + }; - list(type, items, hints) { - this._dump('list', { type: type, items: items, hints: hints }); - } + JSONReporter.prototype.list = function list(type, items, hints) { + this._dump('list', { type, items, hints }); + }; - tree(type, trees) { - this._dump('tree', { type: type, trees: trees }); - } + JSONReporter.prototype.tree = function tree(type, trees) { + this._dump('tree', { type, trees }); + }; - step(current, total, message) { - this._dump('step', { message: message, current: current, total: total }); - } + JSONReporter.prototype.step = function step(current, total, message) { + this._dump('step', { message, current, total }); + }; - inspect(value) { + JSONReporter.prototype.inspect = function inspect(value) { this._dump('inspect', value); - } + }; - footer(showPeakMemory) { + JSONReporter.prototype.footer = function footer(showPeakMemory) { this._dump('finished', this.getTotalTime()); - } + }; - log(msg) { + JSONReporter.prototype.log = function log(msg) { this._dump('log', msg); - } + }; - command(msg) { + JSONReporter.prototype.command = function command(msg) { this._dump('command', msg); - } + }; - table(head, body) { - this._dump('table', { head: head, body: body }); - } + JSONReporter.prototype.table = function table(head, body) { + this._dump('table', { head, body }); + }; - success(msg) { + JSONReporter.prototype.success = function success(msg) { this._dump('success', msg); - } + }; - error(msg) { + JSONReporter.prototype.error = function error(msg) { this._dump('error', msg, true); - } + }; - warn(msg) { + JSONReporter.prototype.warn = function warn(msg) { this._dump('warning', msg, true); - } + }; - info(msg) { + JSONReporter.prototype.info = function info(msg) { this._dump('info', msg); - } + }; + + JSONReporter.prototype.activitySet = function activitySet(total, workers) { + var _this2 = this; - activitySet(total, workers) { if (!this.isTTY || this.noProgress) { - return super.activitySet(total, workers); + return _BaseReporter.prototype.activitySet.call(this, total, workers); } - const id = this._activityId++; - this._dump('activitySetStart', { id: id, total: total, workers: workers }); + var id = this._activityId++; + this._dump('activitySetStart', { id, total, workers }); - const spinners = []; - for (let i = 0; i < workers; i++) { - let current = 0; - let header = ''; + var spinners = []; + + var _loop = function _loop(i) { + var current = 0; + var header = ''; spinners.push({ - clear: function clear() {}, - setPrefix: function setPrefix(_current, _header) { + clear() {}, + setPrefix(_current, _header) { current = _current; header = _header; }, - - tick: msg => { - this._dump('activitySetTick', { - id: id, - header: header, - current: current, + tick: function tick(msg) { + _this2._dump('activitySetTick', { + id, + header, + current, worker: i, message: msg }); }, - end: function end() {} + end() {} }); + }; + + for (var i = 0; i < workers; i++) { + _loop(i); } return { - spinners: spinners, - end: () => { - this._dump('activitySetEnd', { id: id }); + spinners, + end: function end() { + _this2._dump('activitySetEnd', { id }); } }; - } + }; - activity() { + JSONReporter.prototype.activity = function activity() { return this._activity({}); - } + }; + + JSONReporter.prototype._activity = function _activity(data) { + var _this3 = this; - _activity(data) { if (!this.isTTY || this.noProgress) { return { - tick: function tick() {}, - end: function end() {} + tick() {}, + end() {} }; } - const id = this._activityId++; - this._dump('activityStart', (0, (_extends2 || _load_extends()).default)({ id: id }, data)); + var id = this._activityId++; + this._dump('activityStart', (0, (_extends2 || _load_extends()).default)({ id }, data)); return { - tick: name => { - this._dump('activityTick', { id: id, name: name }); + tick: function tick(name) { + _this3._dump('activityTick', { id, name }); }, - end: () => { - this._dump('activityEnd', { id: id }); + end: function end() { + _this3._dump('activityEnd', { id }); } }; - } + }; + + JSONReporter.prototype.progress = function progress(total) { + var _this4 = this; - progress(total) { if (this.noProgress) { return function () { // noop }; } - const id = this._progressId++; - let current = 0; - this._dump('progressStart', { id: id, total: total }); + var id = this._progressId++; + var current = 0; + this._dump('progressStart', { id, total }); - return () => { + return function () { current++; - this._dump('progressTick', { id: id, current: current }); + _this4._dump('progressTick', { id, current }); if (current === total) { - this._dump('progressFinish', { id: id }); + _this4._dump('progressFinish', { id }); } }; - } -} + }; + + return JSONReporter; +}((_baseReporter || _load_baseReporter()).default); + exports.default = JSONReporter; /***/ }), -/* 145 */ +/* 152 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48615,95 +51030,119 @@ exports.FILE_PROTOCOL_PREFIX = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); } var _path; function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); + return _path = _interopRequireDefault(__webpack_require__(0)); } var _invariant; function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); + return _invariant = _interopRequireDefault(__webpack_require__(9)); } var _uuid; function _load_uuid() { - return _uuid = _interopRequireDefault(__webpack_require__(74)); + return _uuid = _interopRequireDefault(__webpack_require__(80)); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _exoticResolver; function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(60)); + return _exoticResolver = _interopRequireDefault(__webpack_require__(63)); } var _misc; function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(15)); + return _misc = _interopRequireWildcard(__webpack_require__(19)); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const FILE_PROTOCOL_PREFIX = exports.FILE_PROTOCOL_PREFIX = 'file:'; +var FILE_PROTOCOL_PREFIX = exports.FILE_PROTOCOL_PREFIX = 'file:'; -class FileResolver extends (_exoticResolver || _load_exoticResolver()).default { - constructor(request, fragment) { - super(request, fragment); - this.loc = (_misc || _load_misc()).removePrefix(fragment, FILE_PROTOCOL_PREFIX); - } +var FileResolver = function (_ExoticResolver) { + (0, (_inherits2 || _load_inherits()).default)(FileResolver, _ExoticResolver); + + function FileResolver(request, fragment) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, FileResolver); - static isVersion(pattern) { - return super.isVersion.call(this, pattern) || this.prefixMatcher.test(pattern) || (_path || _load_path()).default.isAbsolute(pattern); + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment)); + + _this.loc = (_misc || _load_misc()).removePrefix(fragment, FILE_PROTOCOL_PREFIX); + return _this; } - resolve() { - var _this = this; + FileResolver.isVersion = function isVersion(pattern) { + return _ExoticResolver.isVersion.call(this, pattern) || this.prefixMatcher.test(pattern) || (_path || _load_path()).default.isAbsolute(pattern); + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let loc = _this.loc; + FileResolver.prototype.resolve = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _this2 = this; + + var loc = this.loc; if (!(_path || _load_path()).default.isAbsolute(loc)) { - loc = (_path || _load_path()).default.resolve(_this.config.lockfileFolder, loc); + loc = (_path || _load_path()).default.resolve(this.config.lockfileFolder, loc); } - if (_this.config.linkFileDependencies) { - const registry = 'npm'; - const manifest = { _uid: '', name: '', version: '0.0.0', _registry: registry }; - manifest._remote = { + if (this.config.linkFileDependencies) { + var _registry = 'npm'; + var _manifest = { _uid: '', name: '', version: '0.0.0', _registry: _registry }; + _manifest._remote = { type: 'link', - registry: registry, + registry: _registry, hash: null, reference: loc }; - manifest._uid = manifest.version; - return manifest; + _manifest._uid = _manifest.version; + return _manifest; } if (!(yield (_fs || _load_fs()).exists(loc))) { - throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('doesntExist', loc)); + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('doesntExist', loc, this.pattern.split('@')[0])); } - const manifest = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var manifest = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { try { - return yield _this.config.readManifest(loc, _this.registry); + return yield _this2.config.readManifest(loc, _this2.registry); } catch (e) { if (e.code === 'ENOENT') { return { @@ -48718,12 +51157,12 @@ class FileResolver extends (_exoticResolver || _load_exoticResolver()).default { throw e; } })(); - const registry = manifest._registry; + var registry = manifest._registry; (0, (_invariant || _load_invariant()).default)(registry, 'expected registry'); manifest._remote = { type: 'copy', - registry: registry, + registry, hash: `${(_uuid || _load_uuid()).default.v4()}-${new Date().getTime()}`, reference: loc }; @@ -48731,15 +51170,24 @@ class FileResolver extends (_exoticResolver || _load_exoticResolver()).default { manifest._uid = manifest.version; return manifest; - })(); - } -} -exports.default = FileResolver; + }); + + function resolve() { + return _ref.apply(this, arguments); + } + + return resolve; + }(); + + return FileResolver; +}((_exoticResolver || _load_exoticResolver()).default); + FileResolver.protocol = 'file'; FileResolver.prefixMatcher = /^\.{1,2}\//; +exports.default = FileResolver; /***/ }), -/* 146 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48748,30 +51196,49 @@ FileResolver.prefixMatcher = /^\.{1,2}\//; Object.defineProperty(exports, "__esModule", { value: true }); + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); +} + exports.explodeGistFragment = explodeGistFragment; var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _gitResolver; function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(82)); + return _gitResolver = _interopRequireDefault(__webpack_require__(87)); } var _exoticResolver; function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(60)); + return _exoticResolver = _interopRequireDefault(__webpack_require__(63)); } var _misc; function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(15)); + return _misc = _interopRequireWildcard(__webpack_require__(19)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -48781,7 +51248,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function explodeGistFragment(fragment, reporter) { fragment = (_misc || _load_misc()).removePrefix(fragment, 'gist:'); - const parts = fragment.split('#'); + var parts = fragment.split('#'); if (parts.length <= 2) { return { @@ -48793,29 +51260,35 @@ function explodeGistFragment(fragment, reporter) { } } -class GistResolver extends (_exoticResolver || _load_exoticResolver()).default { +var GistResolver = function (_ExoticResolver) { + (0, (_inherits2 || _load_inherits()).default)(GistResolver, _ExoticResolver); - constructor(request, fragment) { - super(request, fragment); + function GistResolver(request, fragment) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GistResolver); - var _explodeGistFragment = explodeGistFragment(fragment, this.reporter); + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment)); - const id = _explodeGistFragment.id, - hash = _explodeGistFragment.hash; + var _explodeGistFragment = explodeGistFragment(fragment, _this.reporter), + id = _explodeGistFragment.id, + hash = _explodeGistFragment.hash; - this.id = id; - this.hash = hash; + _this.id = id; + _this.hash = hash; + return _this; } - resolve() { + GistResolver.prototype.resolve = function resolve() { return this.fork((_gitResolver || _load_gitResolver()).default, false, `https://gist.github.com/${this.id}.git#${this.hash}`); - } -} -exports.default = GistResolver; + }; + + return GistResolver; +}((_exoticResolver || _load_exoticResolver()).default); + GistResolver.protocol = 'gist'; +exports.default = GistResolver; /***/ }), -/* 147 */ +/* 154 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48828,82 +51301,121 @@ Object.defineProperty(exports, "__esModule", { var _assign; function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); + return _assign = _interopRequireDefault(__webpack_require__(17)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); + return _keys = _interopRequireDefault(__webpack_require__(14)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _registryResolver; function _load_registryResolver() { - return _registryResolver = _interopRequireDefault(__webpack_require__(420)); + return _registryResolver = _interopRequireDefault(__webpack_require__(435)); } var _npmRegistry; function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(48)); + return _npmRegistry = _interopRequireDefault(__webpack_require__(53)); } var _npmRegistry2; function _load_npmRegistry2() { - return _npmRegistry2 = __webpack_require__(48); + return _npmRegistry2 = __webpack_require__(53); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); + return _map = _interopRequireDefault(__webpack_require__(34)); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); +} + +var _packageNameUtils; + +function _load_packageNameUtils() { + return _packageNameUtils = __webpack_require__(158); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const inquirer = __webpack_require__(172); +var inquirer = __webpack_require__(184); +var tty = __webpack_require__(105); +var invariant = __webpack_require__(9); +var path = __webpack_require__(0); +var semver = __webpack_require__(21); + +var NPM_REGISTRY = /http[s]:\/\/registry.npmjs.org/g; +var NPM_REGISTRY_ID = 'npm'; -const tty = __webpack_require__(99); -const invariant = __webpack_require__(6); -const path = __webpack_require__(1); -const semver = __webpack_require__(19); +var NpmResolver = function (_RegistryResolver) { + (0, (_inherits2 || _load_inherits()).default)(NpmResolver, _RegistryResolver); -const NPM_REGISTRY = /http[s]:\/\/registry.npmjs.org/g; -const NPM_REGISTRY_ID = 'npm'; + function NpmResolver() { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NpmResolver); + return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _RegistryResolver.apply(this, arguments)); + } -class NpmResolver extends (_registryResolver || _load_registryResolver()).default { + NpmResolver.findVersionInRegistryResponse = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, range, body, request) { + if (body.versions && (0, (_keys || _load_keys()).default)(body.versions).length === 0) { + throw new (_errors || _load_errors()).MessageError(config.reporter.lang('registryNoVersions', body.name)); + } - static findVersionInRegistryResponse(config, range, body, request) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (!body['dist-tags']) { + if (!body['dist-tags'] || !body.versions) { throw new (_errors || _load_errors()).MessageError(config.reporter.lang('malformedRegistryResponse', body.name)); } @@ -48914,12 +51426,12 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul // If the latest tag in the registry satisfies the requested range, then use that. // Otherwise we will fall back to semver maxSatisfying. // This mimics logic in NPM. See issue #3560 - const latestVersion = body['dist-tags'] ? body['dist-tags'].latest : undefined; + var latestVersion = body['dist-tags'] ? body['dist-tags'].latest : undefined; if (latestVersion && semver.satisfies(latestVersion, range)) { return body.versions[latestVersion]; } - const satisfied = yield config.resolveConstraints((0, (_keys || _load_keys()).default)(body.versions), range); + var satisfied = yield config.resolveConstraints((0, (_keys || _load_keys()).default)(body.versions), range); if (satisfied) { return body.versions[satisfied]; } else if (request && !config.nonInteractive) { @@ -48927,97 +51439,133 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul request.resolver.activity.end(); } config.reporter.log(config.reporter.lang('couldntFindVersionThatMatchesRange', body.name, range)); - let pageSize; + var pageSize = void 0; if (process.stdout instanceof tty.WriteStream) { pageSize = process.stdout.rows - 2; } - const response = yield inquirer.prompt([{ + var response = yield inquirer.prompt([{ name: 'package', type: 'list', message: config.reporter.lang('chooseVersionFromList', body.name), - choices: (0, (_keys || _load_keys()).default)(body.versions).reverse(), - pageSize: pageSize + choices: semver.rsort((0, (_keys || _load_keys()).default)(body.versions)), + pageSize }]); if (response && response.package) { return body.versions[response.package]; } } throw new (_errors || _load_errors()).MessageError(config.reporter.lang('couldntFindVersionThatMatchesRange', body.name, range)); - })(); - } + }); - resolveRequest() { - var _this = this; + function findVersionInRegistryResponse(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (_this.config.offline) { - const res = yield _this.resolveRequestOffline(); + return findVersionInRegistryResponse; + }(); + + NpmResolver.prototype.resolveRequest = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (this.config.offline) { + var res = yield this.resolveRequestOffline(); if (res != null) { return res; } } - const body = yield _this.config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(_this.name)); + var body = yield this.config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(this.name)); if (body) { - return NpmResolver.findVersionInRegistryResponse(_this.config, _this.range, body, _this.request); + return NpmResolver.findVersionInRegistryResponse(this.config, this.range, body, this.request); } else { return null; } - })(); - } + }); - resolveRequestOffline() { - var _this2 = this; + function resolveRequest() { + return _ref2.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const escapedName = (_npmRegistry || _load_npmRegistry()).default.escapeName(_this2.name); - const scope = _this2.config.registries.npm.getScope(escapedName); + return resolveRequest; + }(); + + NpmResolver.prototype.resolveRequestOffline = function () { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _this2 = this; + + var escapedName = (_npmRegistry || _load_npmRegistry()).default.escapeName(this.name); + var scope = this.config.registries.npm.getScope(escapedName); // find modules of this name - const prefix = scope ? escapedName.split((_npmRegistry2 || _load_npmRegistry2()).SCOPE_SEPARATOR)[1] : `${NPM_REGISTRY_ID}-${_this2.name}-`; + var prefix = scope ? escapedName.split((_npmRegistry2 || _load_npmRegistry2()).SCOPE_SEPARATOR)[1] : `${NPM_REGISTRY_ID}-${this.name}-`; + + invariant(this.config.cacheFolder, 'expected packages root'); + var cacheFolder = path.join(this.config.cacheFolder, scope ? `${NPM_REGISTRY_ID}-${scope}` : ''); + + var files = yield this.config.getCache('cachedPackages', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var files = yield (_fs || _load_fs()).readdir(cacheFolder); + var validFiles = []; - invariant(_this2.config.cacheFolder, 'expected packages root'); - const cacheFolder = path.join(_this2.config.cacheFolder, scope ? `${NPM_REGISTRY_ID}-${scope}` : ''); + for (var _iterator = files, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref5; - const files = yield _this2.config.getCache('cachedPackages', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const files = yield (_fs || _load_fs()).readdir(cacheFolder); - const validFiles = []; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref5 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref5 = _i.value; + } + + var _name = _ref5; - for (const name of files) { // no hidden files - if (name[0] === '.') { + if (_name[0] === '.') { continue; } // ensure valid module cache - const dir = path.join(cacheFolder, name); + var dir = path.join(cacheFolder, _name); if (yield _this2.config.isValidModuleDest(dir)) { - validFiles.push(name); + validFiles.push(_name); } } return validFiles; })); - const versions = (0, (_map || _load_map()).default)(); + var versions = (0, (_map || _load_map()).default)(); + + for (var _iterator2 = files, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref6; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref6 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref6 = _i2.value; + } + + var _name2 = _ref6; - for (const name of files) { // check if folder starts with our prefix - if (name.indexOf(prefix) !== 0) { + if (_name2.indexOf(prefix) !== 0) { continue; } - const dir = path.join(cacheFolder, name); + var dir = path.join(cacheFolder, _name2); // read manifest and validate correct name - const pkg = yield _this2.config.readManifest(dir, NPM_REGISTRY_ID); - if (pkg.name !== _this2.name) { + var pkg = yield this.config.readManifest(dir, NPM_REGISTRY_ID); + if (pkg.name !== this.name) { continue; } // read package metadata - const metadata = yield _this2.config.readPackageMetadata(dir); + var metadata = yield this.config.readPackageMetadata(dir); if (!metadata.remote) { continue; // old yarn metadata } @@ -49027,57 +51575,73 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul }); } - const satisfied = yield _this2.config.resolveConstraints((0, (_keys || _load_keys()).default)(versions), _this2.range); + var satisfied = yield this.config.resolveConstraints((0, (_keys || _load_keys()).default)(versions), this.range); if (satisfied) { return versions[satisfied]; - } else if (!_this2.config.preferOffline) { - throw new (_errors || _load_errors()).MessageError(_this2.reporter.lang('couldntFindPackageInCache', _this2.name, _this2.range, (0, (_keys || _load_keys()).default)(versions).join(', '))); + } else if (!this.config.preferOffline) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('couldntFindPackageInCache', this.name, this.range, (0, (_keys || _load_keys()).default)(versions).join(', '))); } else { return null; } - })(); - } + }); - cleanRegistry(url) { + function resolveRequestOffline() { + return _ref3.apply(this, arguments); + } + + return resolveRequestOffline; + }(); + + NpmResolver.prototype.cleanRegistry = function cleanRegistry(url) { if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) { return url.replace(NPM_REGISTRY, (_constants || _load_constants()).YARN_REGISTRY); } else { return url; } - } - - resolve() { - var _this3 = this; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + NpmResolver.prototype.resolve = function () { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // lockfile - const shrunk = _this3.request.getLocked('tarball'); + var shrunk = this.request.getLocked('tarball'); if (shrunk) { + if (this.config.packBuiltPackages && shrunk.prebuiltVariants && shrunk._remote) { + var prebuiltVariants = shrunk.prebuiltVariants; + var prebuiltName = (0, (_packageNameUtils || _load_packageNameUtils()).getPlatformSpecificPackageFilename)(shrunk); + var offlineMirrorPath = this.config.getOfflineMirrorPath(); + if (prebuiltVariants[prebuiltName] && offlineMirrorPath) { + var filename = path.join(offlineMirrorPath, 'prebuilt', prebuiltName + '.tgz'); + if (shrunk._remote && (yield (_fs || _load_fs()).exists(filename))) { + shrunk._remote.reference = `file:${filename}`; + shrunk._remote.hash = prebuiltVariants[prebuiltName]; + } + } + } return shrunk; } - const info = yield _this3.resolveRequest(); + var info = yield this.resolveRequest(); if (info == null) { - throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('packageNotFoundRegistry', _this3.name, NPM_REGISTRY_ID)); + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('packageNotFoundRegistry', this.name, NPM_REGISTRY_ID)); } - const deprecated = info.deprecated, - dist = info.dist; + var deprecated = info.deprecated, + dist = info.dist; if (typeof deprecated === 'string') { - let human = `${info.name}@${info.version}`; - const parentNames = _this3.request.parentNames; + var human = `${info.name}@${info.version}`; + var parentNames = this.request.parentNames; if (parentNames.length) { human = parentNames.concat(human).join(' > '); } - _this3.reporter.warn(`${human}: ${deprecated}`); + this.reporter.warn(`${human}: ${deprecated}`); } if (dist != null && dist.tarball) { info._remote = { - resolved: `${_this3.cleanRegistry(dist.tarball)}#${dist.shasum}`, + resolved: `${this.cleanRegistry(dist.tarball)}#${dist.shasum}`, type: 'tarball', - reference: _this3.cleanRegistry(dist.tarball), + reference: this.cleanRegistry(dist.tarball), hash: dist.shasum, registry: NPM_REGISTRY_ID, packageName: info.name @@ -49087,14 +51651,23 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul info._uid = info.version; return info; - })(); - } -} -exports.default = NpmResolver; + }); + + function resolve() { + return _ref7.apply(this, arguments); + } + + return resolve; + }(); + + return NpmResolver; +}((_registryResolver || _load_registryResolver()).default); + NpmResolver.registry = NPM_REGISTRY_ID; +exports.default = NpmResolver; /***/ }), -/* 148 */ +/* 155 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49104,140 +51677,152 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _keys; +var _from; -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); +function _load_from() { + return _from = _interopRequireDefault(__webpack_require__(92)); } -var _slicedToArray2; +var _asyncToGenerator2; -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(17)); +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -var _asyncToGenerator2; +var _classCallCheck2; -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); + return _extends2 = _interopRequireDefault(__webpack_require__(25)); } var _invariant; function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); + return _invariant = _interopRequireDefault(__webpack_require__(9)); } var _string_decoder; function _load_string_decoder() { - return _string_decoder = __webpack_require__(188); + return _string_decoder = __webpack_require__(200); } var _tarFs; function _load_tarFs() { - return _tarFs = _interopRequireDefault(__webpack_require__(130)); + return _tarFs = _interopRequireDefault(__webpack_require__(138)); } var _tarStream; function _load_tarStream() { - return _tarStream = _interopRequireDefault(__webpack_require__(305)); + return _tarStream = _interopRequireDefault(__webpack_require__(322)); } var _url; function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(14)); + return _url = _interopRequireDefault(__webpack_require__(18)); } var _fs; function _load_fs() { - return _fs = __webpack_require__(8); + return _fs = __webpack_require__(10); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _gitSpawn; function _load_gitSpawn() { - return _gitSpawn = __webpack_require__(235); + return _gitSpawn = __webpack_require__(246); } var _gitRefResolver; function _load_gitRefResolver() { - return _gitRefResolver = __webpack_require__(423); + return _gitRefResolver = __webpack_require__(438); } var _crypto; function _load_crypto() { - return _crypto = _interopRequireWildcard(__webpack_require__(103)); + return _crypto = _interopRequireWildcard(__webpack_require__(88)); } var _fs2; function _load_fs2() { - return _fs2 = _interopRequireWildcard(__webpack_require__(5)); + return _fs2 = _interopRequireWildcard(__webpack_require__(7)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); + return _map = _interopRequireDefault(__webpack_require__(34)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const GIT_PROTOCOL_PREFIX = 'git+'; -const SSH_PROTOCOL = 'ssh:'; -const SCP_PATH_PREFIX = '/:'; +var GIT_PROTOCOL_PREFIX = 'git+'; +var SSH_PROTOCOL = 'ssh:'; +var SCP_PATH_PREFIX = '/:'; +var GIT_VALID_REF_LINE_REGEXP = /^([a-fA-F0-9]+|ref)/; -const supportsArchiveCache = (0, (_map || _load_map()).default)({ - 'github.com': false }); +var validRef = function validRef(line) { + return GIT_VALID_REF_LINE_REGEXP.exec(line); +}; -const handleSpawnError = err => { +var supportsArchiveCache = (0, (_map || _load_map()).default)({ + 'github.com': false // not support, doubt they will ever support it +}); + +var handleSpawnError = function handleSpawnError(err) { if (err instanceof (_errors || _load_errors()).ProcessSpawnError) { throw err; } }; -const SHORTHAND_SERVICES = (0, (_map || _load_map()).default)({ - 'github:': parsedUrl => (0, (_extends2 || _load_extends()).default)({}, parsedUrl, { - slashes: true, - auth: 'git', - protocol: SSH_PROTOCOL, - host: 'github.com', - hostname: 'github.com', - pathname: `/${parsedUrl.hostname}${parsedUrl.pathname}` - }), - 'bitbucket:': parsedUrl => (0, (_extends2 || _load_extends()).default)({}, parsedUrl, { - slashes: true, - auth: 'git', - protocol: SSH_PROTOCOL, - host: 'bitbucket.com', - hostname: 'bitbucket.com', - pathname: `/${parsedUrl.hostname}${parsedUrl.pathname}` - }) +var SHORTHAND_SERVICES = (0, (_map || _load_map()).default)({ + 'github:': function github(parsedUrl) { + return (0, (_extends2 || _load_extends()).default)({}, parsedUrl, { + slashes: true, + auth: 'git', + protocol: SSH_PROTOCOL, + host: 'github.com', + hostname: 'github.com', + pathname: `/${parsedUrl.hostname}${parsedUrl.pathname}` + }); + }, + 'bitbucket:': function bitbucket(parsedUrl) { + return (0, (_extends2 || _load_extends()).default)({}, parsedUrl, { + slashes: true, + auth: 'git', + protocol: SSH_PROTOCOL, + host: 'bitbucket.com', + hostname: 'bitbucket.com', + pathname: `/${parsedUrl.hostname}${parsedUrl.pathname}` + }); + } }); -class Git { - constructor(config, gitUrl, hash) { +var Git = function () { + function Git(config, gitUrl, hash) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Git); + this.supportsArchive = false; this.fetched = false; this.config = config; @@ -49252,10 +51837,10 @@ class Git { * npm URLs contain a 'git+' scheme prefix, which is not understood by git. * git "URLs" also allow an alternative scp-like syntax, so they're not standard URLs. */ - static npmUrlToGitUrl(npmUrl) { + Git.npmUrlToGitUrl = function npmUrlToGitUrl(npmUrl) { // Expand shortened format first if needed - let parsed = (_url || _load_url()).default.parse(npmUrl); - const expander = parsed.protocol && SHORTHAND_SERVICES[parsed.protocol]; + var parsed = (_url || _load_url()).default.parse(npmUrl); + var expander = parsed.protocol && SHORTHAND_SERVICES[parsed.protocol]; if (expander) { parsed = expander(parsed); } @@ -49268,8 +51853,8 @@ class Git { // which in git works as remote path only if there are no slashes before ':'. // See #3146. if (parsed.protocol === SSH_PROTOCOL && parsed.hostname && parsed.path && parsed.path.startsWith(SCP_PATH_PREFIX) && parsed.port === null) { - const auth = parsed.auth ? parsed.auth + '@' : ''; - const pathname = parsed.path.slice(SCP_PATH_PREFIX.length); + var auth = parsed.auth ? parsed.auth + '@' : ''; + var pathname = parsed.path.slice(SCP_PATH_PREFIX.length); return { hostname: parsed.hostname, protocol: parsed.protocol, @@ -49282,15 +51867,15 @@ class Git { protocol: parsed.protocol || 'file:', repository: (_url || _load_url()).default.format((0, (_extends2 || _load_extends()).default)({}, parsed, { hash: '' })) }; - } + }; /** * Check if the host specified in the input `gitUrl` has archive capability. */ - static hasArchiveCapability(ref) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const hostname = ref.hostname; + Git.hasArchiveCapability = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref) { + var hostname = ref.hostname; if (ref.protocol !== 'ssh:' || hostname == null) { return false; } @@ -49304,18 +51889,24 @@ class Git { throw new Error(); } catch (err) { handleSpawnError(err); - const supports = err.message.indexOf('did not match any files') >= 0; + var supports = err.message.indexOf('did not match any files') >= 0; return supportsArchiveCache[hostname] = supports; } - })(); - } + }); + + function hasArchiveCapability(_x) { + return _ref.apply(this, arguments); + } + + return hasArchiveCapability; + }(); /** * Check if the input `target` is a 5-40 character hex commit hash. */ - static repoExists(ref) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + Git.repoExists = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref) { try { yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '-t', ref.repository]); return true; @@ -49323,29 +51914,37 @@ class Git { handleSpawnError(err); return false; } - })(); - } + }); + + function repoExists(_x2) { + return _ref2.apply(this, arguments); + } - static replaceProtocol(ref, protocol) { + return repoExists; + }(); + + Git.replaceProtocol = function replaceProtocol(ref, protocol) { return { hostname: ref.hostname, - protocol: protocol, + protocol, repository: ref.repository.replace(/^(?:git|http):/, protocol) }; - } + }; /** * Attempt to upgrade insecure protocols to secure protocol */ - static secureGitUrl(ref, hash, reporter) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + + + Git.secureGitUrl = function () { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref, hash, reporter) { if ((0, (_gitRefResolver || _load_gitRefResolver()).isCommitSha)(hash)) { // this is cryptographically secure return ref; } if (ref.protocol === 'git:') { - const secureUrl = Git.replaceProtocol(ref, 'https:'); + var secureUrl = Git.replaceProtocol(ref, 'https:'); if (yield Git.repoExists(secureUrl)) { return secureUrl; } else { @@ -49354,7 +51953,7 @@ class Git { } if (ref.protocol === 'http:') { - const secureRef = Git.replaceProtocol(ref, 'https:'); + var secureRef = Git.replaceProtocol(ref, 'https:'); if (yield Git.repoExists(secureRef)) { return secureRef; } else { @@ -49375,29 +51974,33 @@ class Git { } return ref; - })(); - } + }); + + function secureGitUrl(_x3, _x4, _x5) { + return _ref3.apply(this, arguments); + } + + return secureGitUrl; + }(); /** * Archive a repo to destination */ - archive(dest) { + Git.prototype.archive = function archive(dest) { if (this.supportsArchive) { return this._archiveViaRemoteArchive(dest); } else { return this._archiveViaLocalFetched(dest); } - } - - _archiveViaRemoteArchive(dest) { - var _this = this; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const hashStream = new (_crypto || _load_crypto()).HashStream(); - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${_this.gitUrl.repository}`, _this.ref], { - process: function process(proc, resolve, reject, done) { - const writeStream = (0, (_fs || _load_fs()).createWriteStream)(dest); + Git.prototype._archiveViaRemoteArchive = function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) { + var hashStream = new (_crypto || _load_crypto()).HashStream(); + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref], { + process(proc, resolve, reject, done) { + var writeStream = (0, (_fs || _load_fs()).createWriteStream)(dest); proc.on('error', reject); writeStream.on('error', reject); writeStream.on('end', done); @@ -49408,18 +52011,22 @@ class Git { } }); return hashStream.getHash(); - })(); - } + }); - _archiveViaLocalFetched(dest) { - var _this2 = this; + function _archiveViaRemoteArchive(_x6) { + return _ref4.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const hashStream = new (_crypto || _load_crypto()).HashStream(); - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', _this2.hash], { - cwd: _this2.cwd, - process: function process(proc, resolve, reject, done) { - const writeStream = (0, (_fs || _load_fs()).createWriteStream)(dest); + return _archiveViaRemoteArchive; + }(); + + Git.prototype._archiveViaLocalFetched = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) { + var hashStream = new (_crypto || _load_crypto()).HashStream(); + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', this.hash], { + cwd: this.cwd, + process(proc, resolve, reject, done) { + var writeStream = (0, (_fs || _load_fs()).createWriteStream)(dest); proc.on('error', reject); writeStream.on('error', reject); writeStream.on('open', function () { @@ -49429,31 +52036,36 @@ class Git { } }); return hashStream.getHash(); - })(); - } + }); + + function _archiveViaLocalFetched(_x7) { + return _ref5.apply(this, arguments); + } + + return _archiveViaLocalFetched; + }(); /** * Clone a repo to the input `dest`. Use `git archive` if it's available, otherwise fall * back to `git clone`. */ - clone(dest) { + Git.prototype.clone = function clone(dest) { if (this.supportsArchive) { return this._cloneViaRemoteArchive(dest); } else { return this._cloneViaLocalFetched(dest); } - } - - _cloneViaRemoteArchive(dest) { - var _this3 = this; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${_this3.gitUrl.repository}`, _this3.ref], { - process: function process(proc, update, reject, done) { - const extractor = (_tarFs || _load_tarFs()).default.extract(dest, { + Git.prototype._cloneViaRemoteArchive = function () { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) { + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref], { + process(proc, update, reject, done) { + var extractor = (_tarFs || _load_tarFs()).default.extract(dest, { dmode: 0o555, // all dirs should be readable - fmode: 0o444 }); + fmode: 0o444 // all files should be readable + }); extractor.on('error', reject); extractor.on('finish', done); @@ -49461,19 +52073,24 @@ class Git { proc.on('error', reject); } }); - })(); - } + }); - _cloneViaLocalFetched(dest) { - var _this4 = this; + function _cloneViaRemoteArchive(_x8) { + return _ref6.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', _this4.hash], { - cwd: _this4.cwd, - process: function process(proc, resolve, reject, done) { - const extractor = (_tarFs || _load_tarFs()).default.extract(dest, { + return _cloneViaRemoteArchive; + }(); + + Git.prototype._cloneViaLocalFetched = function () { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) { + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', this.hash], { + cwd: this.cwd, + process(proc, resolve, reject, done) { + var extractor = (_tarFs || _load_tarFs()).default.extract(dest, { dmode: 0o555, // all dirs should be readable - fmode: 0o444 }); + fmode: 0o444 // all files should be readable + }); extractor.on('error', reject); extractor.on('finish', done); @@ -49481,64 +52098,68 @@ class Git { proc.stdout.pipe(extractor); } }); - })(); - } + }); + + function _cloneViaLocalFetched(_x9) { + return _ref7.apply(this, arguments); + } + + return _cloneViaLocalFetched; + }(); /** * Clone this repo. */ - fetch() { - var _this5 = this; + Git.prototype.fetch = function fetch() { + var _this = this; - const gitUrl = this.gitUrl, - cwd = this.cwd; + var gitUrl = this.gitUrl, + cwd = this.cwd; return (_fs2 || _load_fs2()).lockQueue.push(gitUrl.repository, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { if (yield (_fs2 || _load_fs2()).exists(cwd)) { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['pull'], { cwd: cwd }); + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['pull'], { cwd }); } else { yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['clone', gitUrl.repository, cwd]); } - _this5.fetched = true; + _this.fetched = true; })); - } + }; /** * Fetch the file by cloning the repo and reading it. */ - getFile(filename) { + Git.prototype.getFile = function getFile(filename) { if (this.supportsArchive) { return this._getFileFromArchive(filename); } else { return this._getFileFromClone(filename); } - } - - _getFileFromArchive(filename) { - var _this6 = this; + }; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + Git.prototype._getFileFromArchive = function () { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename) { try { - return yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${_this6.gitUrl.repository}`, _this6.ref, filename], { - process: function process(proc, update, reject, done) { - const parser = (_tarStream || _load_tarStream()).default.extract(); + return yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref, filename], { + process(proc, update, reject, done) { + var parser = (_tarStream || _load_tarStream()).default.extract(); parser.on('error', reject); parser.on('finish', done); - parser.on('entry', (header, stream, next) => { - const decoder = new (_string_decoder || _load_string_decoder()).StringDecoder('utf8'); - let fileContent = ''; + parser.on('entry', function (header, stream, next) { + var decoder = new (_string_decoder || _load_string_decoder()).StringDecoder('utf8'); + var fileContent = ''; - stream.on('data', buffer => { + stream.on('data', function (buffer) { fileContent += decoder.write(buffer); }); - stream.on('end', () => { - const remaining = decoder.end(); + stream.on('end', function () { + var remaining = decoder.end(); update(fileContent + remaining); next(); }); @@ -49555,233 +52176,192 @@ class Git { throw err; } } - })(); - } + }); - _getFileFromClone(filename) { - var _this7 = this; + function _getFileFromArchive(_x10) { + return _ref9.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - (0, (_invariant || _load_invariant()).default)(_this7.fetched, 'Repo not fetched'); + return _getFileFromArchive; + }(); + + Git.prototype._getFileFromClone = function () { + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename) { + (0, (_invariant || _load_invariant()).default)(this.fetched, 'Repo not fetched'); try { - return yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show', `${_this7.hash}:${filename}`], { - cwd: _this7.cwd + return yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show', `${this.hash}:${filename}`], { + cwd: this.cwd }); } catch (err) { handleSpawnError(err); // file doesn't exist return false; } - })(); - } + }); + + function _getFileFromClone(_x11) { + return _ref10.apply(this, arguments); + } + + return _getFileFromClone; + }(); /** * Initialize the repo, find a secure url to use and * set the ref to match an input `target`. */ - init() { - var _this8 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this8.gitUrl = yield Git.secureGitUrl(_this8.gitUrl, _this8.hash, _this8.reporter); - yield _this8.setRefRemote(); + Git.prototype.init = function () { + var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + this.gitUrl = yield Git.secureGitUrl(this.gitUrl, this.hash, this.reporter); + + yield this.setRefRemote(); // check capabilities - if (_this8.ref !== '' && (yield Git.hasArchiveCapability(_this8.gitUrl))) { - _this8.supportsArchive = true; + if (this.ref !== '' && (yield Git.hasArchiveCapability(this.gitUrl))) { + this.supportsArchive = true; } else { - yield _this8.fetch(); + yield this.fetch(); } - return _this8.hash; - })(); - } + return this.hash; + }); - setRefRemote() { - var _this9 = this; + function init() { + return _ref11.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--tags', '--heads', _this9.gitUrl.repository]); - const refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout); - return _this9.setRef(refs); - })(); - } + return init; + }(); + + Git.prototype.setRefRemote = function () { + var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--tags', '--heads', this.gitUrl.repository]); + var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout); + return this.setRef(refs); + }); + + function setRefRemote() { + return _ref12.apply(this, arguments); + } - setRefHosted(hostedRefsList) { - const refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(hostedRefsList); + return setRefRemote; + }(); + + Git.prototype.setRefHosted = function setRefHosted(hostedRefsList) { + var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(hostedRefsList); return this.setRef(refs); - } + }; /** * Resolves the default branch of a remote repository (not always "master") */ - resolveDefaultBranch() { - var _this10 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + Git.prototype.resolveDefaultBranch = function () { + var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { try { - const stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--symref', _this10.gitUrl.repository, 'HEAD']); - const lines = stdout.split('\n'); + var stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--symref', this.gitUrl.repository, 'HEAD']); + var lines = stdout.split('\n').filter(validRef); var _lines$0$split = lines[0].split(/\s+/), - _lines$0$split2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_lines$0$split, 2); - - const ref = _lines$0$split2[1]; + ref = _lines$0$split[1]; var _lines$1$split = lines[1].split(/\s+/), - _lines$1$split2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_lines$1$split, 1); - - const sha = _lines$1$split2[0]; + sha = _lines$1$split[0]; - return { sha: sha, ref: ref }; + return { sha, ref }; } catch (err) { handleSpawnError(err); // older versions of git don't support "--symref" - const stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', _this10.gitUrl.repository, 'HEAD']); + var _stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', this.gitUrl.repository, 'HEAD']); + var _lines = _stdout.split('\n').filter(validRef); - var _stdout$split = stdout.split(/\s+/), - _stdout$split2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_stdout$split, 1); + var _lines$0$split2 = _lines[0].split(/\s+/), + _sha = _lines$0$split2[0]; - const sha = _stdout$split2[0]; - - return { sha: sha, ref: undefined }; + return { sha: _sha, ref: undefined }; } - })(); - } + }); + + function resolveDefaultBranch() { + return _ref13.apply(this, arguments); + } + + return resolveDefaultBranch; + }(); /** * Resolve a git commit to it's 40-chars format and ensure it exists in the repository * We need to use the 40-chars format to avoid multiple folders in the cache */ - resolveCommit(shaToResolve) { - var _this11 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + Git.prototype.resolveCommit = function () { + var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (shaToResolve) { try { - yield _this11.fetch(); - const revListArgs = ['rev-list', '-n', '1', '--no-abbrev-commit', '--format=oneline', shaToResolve]; - const stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(revListArgs, { cwd: _this11.cwd }); + yield this.fetch(); + var revListArgs = ['rev-list', '-n', '1', '--no-abbrev-commit', '--format=oneline', shaToResolve]; + var stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(revListArgs, { cwd: this.cwd }); - var _stdout$split3 = stdout.split(/\s+/), - _stdout$split4 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_stdout$split3, 1); - - const sha = _stdout$split4[0]; + var _stdout$split = stdout.split(/\s+/), + sha = _stdout$split[0]; - return { sha: sha, ref: undefined }; + return { sha, ref: undefined }; } catch (err) { handleSpawnError(err); // assuming commit not found, let's try something else return null; } - })(); - } + }); + + function resolveCommit(_x12) { + return _ref14.apply(this, arguments); + } + + return resolveCommit; + }(); /** * Resolves the input hash / ref / semver range to a valid commit sha * If possible also resolves the sha to a valid ref in order to use "git archive" */ - setRef(refs) { - var _this12 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + Git.prototype.setRef = function () { + var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (refs) { // get commit ref - const version = _this12.hash; + var version = this.hash; - const resolvedResult = yield (0, (_gitRefResolver || _load_gitRefResolver()).resolveVersion)({ - config: _this12.config, - git: _this12, - version: version, - refs: refs + var resolvedResult = yield (0, (_gitRefResolver || _load_gitRefResolver()).resolveVersion)({ + config: this.config, + git: this, + version, + refs }); if (!resolvedResult) { - throw new (_errors || _load_errors()).MessageError(_this12.reporter.lang('couldntFindMatch', version, (0, (_keys || _load_keys()).default)(refs).join(','), _this12.gitUrl.repository)); + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('couldntFindMatch', version, (0, (_from || _load_from()).default)(refs.keys()).join(','), this.gitUrl.repository)); } - _this12.hash = resolvedResult.sha; - _this12.ref = resolvedResult.ref || ''; - return _this12.hash; - })(); - } -} -exports.default = Git; - -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = guessName; - -var _url; - -function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(14)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function cleanup(name) { - name = name.replace(/-\d+\.\d+\.\d+/, ''); - return name.split('.')[0]; -} - -function guessNameFallback(source) { - // If cannot parse as url, just return cleaned up last part - const parts = source.split('/'); - return cleanup(parts[parts.length - 1]); -} - -function guessName(source) { - try { - const parsed = (_url || _load_url()).default.parse(source); - - if (!parsed.pathname) { - return guessNameFallback(source); - } - - const parts = parsed.pathname.split('/'); - - // Priority goes to part that ends with .git - for (const part of parts) { - if (part.match(/\.git$/)) { - return cleanup(part); - } - } + this.hash = resolvedResult.sha; + this.ref = resolvedResult.ref || ''; + return this.hash; + }); - // Most likely a directory - if (parsed.host == null) { - return cleanup(parts[parts.length - 1]); + function setRef(_x13) { + return _ref15.apply(this, arguments); } - // A site like github or gitlab - if (parts.length > 2) { - return cleanup(parts[2]); - } + return setRef; + }(); - // Privately hosted package? - if (parts.length > 1) { - return cleanup(parts[1]); - } + return Git; +}(); - return guessNameFallback(source); - } catch (e) { - return guessNameFallback(source); - } -} +exports.default = Git; /***/ }), -/* 150 */ +/* 156 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49794,38 +52374,38 @@ Object.defineProperty(exports, "__esModule", { var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } var _resolveRelative; function _load_resolveRelative() { - return _resolveRelative = _interopRequireDefault(__webpack_require__(428)); + return _resolveRelative = _interopRequireDefault(__webpack_require__(444)); } var _validate; function _load_validate() { - return _validate = _interopRequireDefault(__webpack_require__(84)); + return _validate = _interopRequireDefault(__webpack_require__(90)); } var _fix; function _load_fix() { - return _fix = _interopRequireDefault(__webpack_require__(425)); + return _fix = _interopRequireDefault(__webpack_require__(441)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const path = __webpack_require__(1); +var path = __webpack_require__(0); -exports.default = (() => { +exports.default = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (info, moduleLoc, config, isRoot) { // create human readable name - const name = info.name, - version = info.version; + var name = info.name, + version = info.version; - let human; + var human = void 0; if (typeof name === 'string') { human = name; } @@ -49865,10 +52445,10 @@ exports.default = (() => { return function (_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; -})(); +}(); /***/ }), -/* 151 */ +/* 157 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49885,7 +52465,7 @@ exports.extractDescription = extractDescription; exports.extractRepositoryUrl = extractRepositoryUrl; -const validateLicense = __webpack_require__(698); +var validateLicense = __webpack_require__(724); function isValidLicense(license) { return !!license && validateLicense(license).validForNewPackages; @@ -49896,17 +52476,17 @@ function stringifyPerson(person) { return person; } - const parts = []; + var parts = []; if (person.name) { parts.push(person.name); } - const email = person.email || person.mail; + var email = person.email || person.mail; if (typeof email === 'string') { parts.push(`<${email}>`); } - const url = person.url || person.web; + var url = person.url || person.web; if (typeof url === 'string') { parts.push(`(${url})`); } @@ -49920,9 +52500,9 @@ function parsePerson(person) { } // format: name (url) - const obj = {}; + var obj = {}; - let name = person.match(/^([^\(<]+)/); + var name = person.match(/^([^\(<]+)/); if (name) { name = name[0].trim(); if (name) { @@ -49930,12 +52510,12 @@ function parsePerson(person) { } } - const email = person.match(/<([^>]+)>/); + var email = person.match(/<([^>]+)>/); if (email) { obj.email = email[1]; } - const url = person.match(/\(([^\)]+)\)/); + var url = person.match(/\(([^\)]+)\)/); if (url) { obj.url = url[1]; } @@ -49953,12 +52533,14 @@ function extractDescription(readme) { } // split into lines - const lines = readme.trim().split('\n').map(line => line.trim()); + var lines = readme.trim().split('\n').map(function (line) { + return line.trim(); + }); // find the start of the first paragraph, ignore headings - let start = 0; + var start = 0; for (; start < lines.length; start++) { - const line = lines[start]; + var line = lines[start]; if (line && line.match(/^(#|$)/)) { // line isn't empty and isn't a heading so this is the start of a paragraph start++; @@ -49972,7 +52554,7 @@ function extractDescription(readme) { } // continue to the first non empty line - let end = start; + var end = start; while (end < lines.length && lines[end]) { end++; } @@ -49988,7 +52570,33 @@ function extractRepositoryUrl(repository) { } /***/ }), -/* 152 */ +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getPlatformSpecificPackageFilename = getPlatformSpecificPackageFilename; +exports.getSystemParams = getSystemParams; +function getPlatformSpecificPackageFilename(pkg) { + // TODO support hash for all subdependencies that have installs scripts + var normalizeScope = function normalizeScope(name) { + return name[0] === '@' ? name.substr(1).replace('/', '-') : name; + }; + var suffix = getSystemParams(); + return `${normalizeScope(pkg.name)}-v${pkg.version}-${suffix}`; +} + +function getSystemParams() { + // TODO support platform variant for linux + return `${process.platform}-${process.arch}-${process.versions.modules || ''}`; +} + +/***/ }), +/* 159 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49999,7 +52607,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.explodeHashedUrl = explodeHashedUrl; function explodeHashedUrl(url) { - const parts = url.split('#'); + var parts = url.split('#'); return { hash: parts[1] || '', @@ -50008,13 +52616,13 @@ function explodeHashedUrl(url) { } /***/ }), -/* 153 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var buffer = __webpack_require__(98); +var buffer = __webpack_require__(104); var Buffer = buffer.Buffer; var SlowBuffer = buffer.SlowBuffer; var MAX_LEN = buffer.kMaxLength || 2147483647; @@ -50123,7 +52731,7 @@ exports.allocUnsafeSlow = function allocUnsafeSlow(size) { /***/ }), -/* 154 */ +/* 161 */ /***/ (function(module, exports) { function Caseless (dict) { @@ -50196,7 +52804,7 @@ module.exports.httpify = function (resp, headers) { /***/ }), -/* 155 */ +/* 162 */ /***/ (function(module, exports) { module.exports = function(it){ @@ -50205,7 +52813,7 @@ module.exports = function(it){ }; /***/ }), -/* 156 */ +/* 163 */ /***/ (function(module, exports) { module.exports = function(it, Constructor, name, forbiddenField){ @@ -50215,10 +52823,38 @@ module.exports = function(it, Constructor, name, forbiddenField){ }; /***/ }), -/* 157 */ +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(93) + , TAG = __webpack_require__(30)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } +}; + +module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; + +/***/ }), +/* 165 */ /***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(52) +var isObject = __webpack_require__(56) , document = __webpack_require__(35).document // in old IE typeof document.createElement is 'object' , is = isObject(document) && isObject(document.createElement); @@ -50227,30 +52863,39 @@ module.exports = function(it){ }; /***/ }), -/* 158 */ +/* 166 */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + +/***/ }), +/* 167 */ /***/ (function(module, exports, __webpack_require__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __webpack_require__(89); +var cof = __webpack_require__(93); module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; /***/ }), -/* 159 */ +/* 168 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var LIBRARY = __webpack_require__(254) - , $export = __webpack_require__(41) - , redefine = __webpack_require__(483) - , hide = __webpack_require__(61) - , has = __webpack_require__(69) - , Iterators = __webpack_require__(70) - , $iterCreate = __webpack_require__(474) - , setToStringTag = __webpack_require__(110) - , getPrototypeOf = __webpack_require__(480) +var LIBRARY = __webpack_require__(116) + , $export = __webpack_require__(38) + , redefine = __webpack_require__(271) + , hide = __webpack_require__(55) + , has = __webpack_require__(65) + , Iterators = __webpack_require__(94) + , $iterCreate = __webpack_require__(493) + , setToStringTag = __webpack_require__(96) + , getPrototypeOf = __webpack_require__(499) , ITERATOR = __webpack_require__(30)('iterator') , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` , FF_ITERATOR = '@@iterator' @@ -50313,22 +52958,74 @@ module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED }; /***/ }), -/* 160 */ +/* 169 */ /***/ (function(module, exports, __webpack_require__) { -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(481) - , enumBugKeys = __webpack_require__(247); - -module.exports = Object.keys || function keys(O){ - return $keys(O, enumBugKeys); +var META = __webpack_require__(120)('meta') + , isObject = __webpack_require__(56) + , has = __webpack_require__(65) + , setDesc = __webpack_require__(43).f + , id = 0; +var isExtensible = Object.isExtensible || function(){ + return true; +}; +var FREEZE = !__webpack_require__(64)(function(){ + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); +}; +var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze }; /***/ }), -/* 161 */ +/* 170 */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + +/***/ }), +/* 171 */ /***/ (function(module, exports, __webpack_require__) { -var hide = __webpack_require__(61); +var hide = __webpack_require__(55); module.exports = function(target, src, safe){ for(var key in src){ if(safe && target[key])target[key] = src[key]; @@ -50337,17 +53034,28 @@ module.exports = function(target, src, safe){ }; /***/ }), -/* 162 */ +/* 172 */ /***/ (function(module, exports, __webpack_require__) { -var shared = __webpack_require__(259)('keys') - , uid = __webpack_require__(164); +var shared = __webpack_require__(173)('keys') + , uid = __webpack_require__(120); module.exports = function(key){ return shared[key] || (shared[key] = uid(key)); }; /***/ }), -/* 163 */ +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(35) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); +module.exports = function(key){ + return store[key] || (store[key] = {}); +}; + +/***/ }), +/* 174 */ /***/ (function(module, exports) { // 7.1.4 ToInteger @@ -50358,36 +53066,57 @@ module.exports = function(it){ }; /***/ }), -/* 164 */ -/***/ (function(module, exports) { +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { -var id = 0 - , px = Math.random(); -module.exports = function(key){ - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(56); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); }; /***/ }), -/* 165 */ +/* 176 */ /***/ (function(module, exports, __webpack_require__) { -var classof = __webpack_require__(106) - , ITERATOR = __webpack_require__(30)('iterator') - , Iterators = __webpack_require__(70); -module.exports = __webpack_require__(21).getIteratorMethod = function(it){ - if(it != undefined)return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; +var global = __webpack_require__(35) + , core = __webpack_require__(23) + , LIBRARY = __webpack_require__(116) + , wksExt = __webpack_require__(177) + , defineProperty = __webpack_require__(43).f; +module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); }; /***/ }), -/* 166 */ -/***/ (function(module, exports) { +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { +exports.f = __webpack_require__(30); +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(164) + , ITERATOR = __webpack_require__(30)('iterator') + , Iterators = __webpack_require__(94); +module.exports = __webpack_require__(23).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; /***/ }), -/* 167 */ +/* 179 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50405,7 +53134,7 @@ module.exports = function (str) { /***/ }), -/* 168 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50498,12 +53227,12 @@ module.exports = function extend() { /***/ }), -/* 169 */ +/* 181 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const escapeStringRegexp = __webpack_require__(167); +const escapeStringRegexp = __webpack_require__(179); const platform = process.platform; @@ -50652,7 +53381,7 @@ module.exports = Object.assign(fn, figures); /***/ }), -/* 170 */ +/* 182 */ /***/ (function(module, exports, __webpack_require__) { // Approach: @@ -50697,27 +53426,27 @@ module.exports = Object.assign(fn, figures); module.exports = glob -var fs = __webpack_require__(8) -var rp = __webpack_require__(268) -var minimatch = __webpack_require__(124) +var fs = __webpack_require__(10) +var rp = __webpack_require__(280) +var minimatch = __webpack_require__(132) var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(54) -var EE = __webpack_require__(64).EventEmitter -var path = __webpack_require__(1) -var assert = __webpack_require__(31) -var isAbsolute = __webpack_require__(181) -var globSync = __webpack_require__(530) -var common = __webpack_require__(269) +var inherits = __webpack_require__(57) +var EE = __webpack_require__(69).EventEmitter +var path = __webpack_require__(0) +var assert = __webpack_require__(36) +var isAbsolute = __webpack_require__(193) +var globSync = __webpack_require__(552) +var common = __webpack_require__(281) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp -var inflight = __webpack_require__(566) -var util = __webpack_require__(2) +var inflight = __webpack_require__(588) +var util = __webpack_require__(4) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored -var once = __webpack_require__(125) +var once = __webpack_require__(133) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} @@ -51448,14 +54177,14 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { /***/ }), -/* 171 */ +/* 183 */ /***/ (function(module, exports, __webpack_require__) { // Load modules -var Crypto = __webpack_require__(9); -var Url = __webpack_require__(14); -var Utils = __webpack_require__(114); +var Crypto = __webpack_require__(13); +var Url = __webpack_require__(18); +var Utils = __webpack_require__(123); // Declare internals @@ -51580,7 +54309,7 @@ exports.timestampMessage = function (credentials, localtimeOffsetMsec) { /***/ }), -/* 172 */ +/* 184 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51596,11 +54325,11 @@ var inquirer = module.exports; inquirer.prompts = {}; -inquirer.Separator = __webpack_require__(118); +inquirer.Separator = __webpack_require__(126); inquirer.ui = { - BottomBar: __webpack_require__(579), - Prompt: __webpack_require__(580) + BottomBar: __webpack_require__(601), + Prompt: __webpack_require__(602) }; /** @@ -51636,14 +54365,14 @@ inquirer.createPromptModule = function (opt) { */ promptModule.restoreDefaultPrompts = function () { - this.registerPrompt('list', __webpack_require__(576)); - this.registerPrompt('input', __webpack_require__(575)); - this.registerPrompt('confirm', __webpack_require__(572)); - this.registerPrompt('rawlist', __webpack_require__(578)); - this.registerPrompt('expand', __webpack_require__(574)); - this.registerPrompt('checkbox', __webpack_require__(571)); - this.registerPrompt('password', __webpack_require__(577)); - this.registerPrompt('editor', __webpack_require__(573)); + this.registerPrompt('list', __webpack_require__(598)); + this.registerPrompt('input', __webpack_require__(597)); + this.registerPrompt('confirm', __webpack_require__(594)); + this.registerPrompt('rawlist', __webpack_require__(600)); + this.registerPrompt('expand', __webpack_require__(596)); + this.registerPrompt('checkbox', __webpack_require__(593)); + this.registerPrompt('password', __webpack_require__(599)); + this.registerPrompt('editor', __webpack_require__(595)); }; promptModule.restoreDefaultPrompts(); @@ -51670,12 +54399,12 @@ inquirer.restoreDefaultPrompts = function () { /***/ }), -/* 173 */ +/* 185 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ansiRegex = __webpack_require__(205)(); +var ansiRegex = __webpack_require__(216)(); module.exports = function (str) { return typeof str === 'string' ? str.replace(ansiRegex, '') : str; @@ -51683,17 +54412,17 @@ module.exports = function (str) { /***/ }), -/* 174 */ +/* 186 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = __webpack_require__(448).isCI +module.exports = __webpack_require__(465).isCI /***/ }), -/* 175 */ +/* 187 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51708,10 +54437,10 @@ module.exports = __webpack_require__(448).isCI * You should have received a copy of the license along with this program. */ -var dh = __webpack_require__(600); -var eddsa = __webpack_require__(601); -var curve255 = __webpack_require__(176); -var utils = __webpack_require__(123); +var dh = __webpack_require__(624); +var eddsa = __webpack_require__(625); +var curve255 = __webpack_require__(188); +var utils = __webpack_require__(131); /** * @exports jodid25519 @@ -51735,7 +54464,7 @@ module.exports = ns; /***/ }), -/* 176 */ +/* 188 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51755,8 +54484,8 @@ module.exports = ns; * You should have received a copy of the license along with this program. */ -var core = __webpack_require__(122); -var utils = __webpack_require__(123); +var core = __webpack_require__(130); +var utils = __webpack_require__(131); /** * @exports jodid25519/curve255 @@ -51963,10 +54692,10 @@ module.exports = ns; /***/ }), -/* 177 */ +/* 189 */ /***/ (function(module, exports, __webpack_require__) { -var json = typeof JSON !== 'undefined' ? JSON : __webpack_require__(604); +var json = typeof JSON !== 'undefined' ? JSON : __webpack_require__(628); module.exports = function (obj, opts) { if (!opts) opts = {}; @@ -52053,10 +54782,10 @@ var objectKeys = Object.keys || function (obj) { /***/ }), -/* 178 */ +/* 190 */ /***/ (function(module, exports, __webpack_require__) { -var isBuffer = __webpack_require__(587); +var isBuffer = __webpack_require__(610); var toString = Object.prototype.toString; /** @@ -52175,33 +54904,33 @@ module.exports = function kindOf(val) { /***/ }), -/* 179 */ +/* 191 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var win32 = process && process.platform === 'win32'; -var path = __webpack_require__(1); -var fileRe = __webpack_require__(520); +var path = __webpack_require__(0); +var fileRe = __webpack_require__(542); var utils = module.exports; /** * Module dependencies */ -utils.diff = __webpack_require__(356); -utils.unique = __webpack_require__(359); -utils.braces = __webpack_require__(440); -utils.brackets = __webpack_require__(512); -utils.extglob = __webpack_require__(519); -utils.isExtglob = __webpack_require__(120); -utils.isGlob = __webpack_require__(121); -utils.typeOf = __webpack_require__(178); -utils.normalize = __webpack_require__(620); -utils.omit = __webpack_require__(623); -utils.parseGlob = __webpack_require__(626); -utils.cache = __webpack_require__(643); +utils.diff = __webpack_require__(369); +utils.unique = __webpack_require__(372); +utils.braces = __webpack_require__(458); +utils.brackets = __webpack_require__(533); +utils.extglob = __webpack_require__(540); +utils.isExtglob = __webpack_require__(128); +utils.isGlob = __webpack_require__(129); +utils.typeOf = __webpack_require__(190); +utils.normalize = __webpack_require__(644); +utils.omit = __webpack_require__(647); +utils.parseGlob = __webpack_require__(650); +utils.cache = __webpack_require__(667); /** * Get the filename of a filepath @@ -52331,11 +55060,11 @@ module.exports = utils; /***/ }), -/* 180 */ +/* 192 */ /***/ (function(module, exports, __webpack_require__) { -var path = __webpack_require__(1); -var fs = __webpack_require__(8); +var path = __webpack_require__(0); +var fs = __webpack_require__(10); var _0777 = parseInt('0777', 8); module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; @@ -52435,7 +55164,7 @@ mkdirP.sync = function sync (p, opts, made) { /***/ }), -/* 181 */ +/* 193 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52462,7 +55191,7 @@ module.exports.win32 = win32; /***/ }), -/* 182 */ +/* 194 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52512,15 +55241,15 @@ function nextTick(fn, arg1, arg2, arg3) { /***/ }), -/* 183 */ +/* 195 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var jsonSafeStringify = __webpack_require__(603) - , crypto = __webpack_require__(9) - , Buffer = __webpack_require__(73).Buffer +var jsonSafeStringify = __webpack_require__(627) + , crypto = __webpack_require__(13) + , Buffer = __webpack_require__(79).Buffer var defer = typeof setImmediate === 'undefined' ? process.nextTick @@ -52585,7 +55314,7 @@ exports.defer = defer /***/ }), -/* 184 */ +/* 196 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -52597,16 +55326,16 @@ module.exports = { writePkcs1: writePkcs1 }; -var assert = __webpack_require__(12); -var asn1 = __webpack_require__(46); -var algs = __webpack_require__(22); -var utils = __webpack_require__(20); +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(52); +var algs = __webpack_require__(26); +var utils = __webpack_require__(24); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var pem = __webpack_require__(58); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(28); +var pem = __webpack_require__(61); -var pkcs8 = __webpack_require__(96); +var pkcs8 = __webpack_require__(102); var readECDSACurve = pkcs8.readECDSACurve; function read(buf, options) { @@ -52911,18 +55640,18 @@ function writePkcs1ECDSAPrivate(der, key) { /***/ }), -/* 185 */ +/* 197 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. -var Key = __webpack_require__(23); -var Fingerprint = __webpack_require__(95); -var Signature = __webpack_require__(43); -var PrivateKey = __webpack_require__(24); -var Certificate = __webpack_require__(94); -var Identity = __webpack_require__(97); -var errs = __webpack_require__(42); +var Key = __webpack_require__(27); +var Fingerprint = __webpack_require__(101); +var Signature = __webpack_require__(50); +var PrivateKey = __webpack_require__(28); +var Certificate = __webpack_require__(100); +var Identity = __webpack_require__(103); +var errs = __webpack_require__(49); module.exports = { /* top-level classes */ @@ -52956,7 +55685,7 @@ module.exports = { /***/ }), -/* 186 */ +/* 198 */ /***/ (function(module, exports) { // Returns a wrapper function that returns a wrapped callback @@ -52995,25 +55724,25 @@ function wrappy (fn, cb) { /***/ }), -/* 187 */ +/* 199 */ /***/ (function(module, exports) { module.exports = require("punycode"); /***/ }), -/* 188 */ +/* 200 */ /***/ (function(module, exports) { module.exports = require("string_decoder"); /***/ }), -/* 189 */ +/* 201 */ /***/ (function(module, exports) { module.exports = require("zlib"); /***/ }), -/* 190 */ +/* 202 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -53026,248 +55755,264 @@ Object.defineProperty(exports, "__esModule", { var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _access; function _load_access() { - return _access = _interopRequireWildcard(__webpack_require__(373)); + return _access = _interopRequireWildcard(__webpack_require__(386)); } var _add; function _load_add() { - return _add = _interopRequireWildcard(__webpack_require__(100)); + return _add = _interopRequireWildcard(__webpack_require__(107)); } var _autoclean; function _load_autoclean() { - return _autoclean = _interopRequireWildcard(__webpack_require__(213)); + return _autoclean = _interopRequireWildcard(__webpack_require__(224)); } var _bin; function _load_bin() { - return _bin = _interopRequireWildcard(__webpack_require__(374)); + return _bin = _interopRequireWildcard(__webpack_require__(387)); } var _cache; function _load_cache() { - return _cache = _interopRequireWildcard(__webpack_require__(375)); + return _cache = _interopRequireWildcard(__webpack_require__(388)); } var _check; function _load_check() { - return _check = _interopRequireWildcard(__webpack_require__(214)); + return _check = _interopRequireWildcard(__webpack_require__(225)); } var _config; function _load_config() { - return _config = _interopRequireWildcard(__webpack_require__(376)); + return _config = _interopRequireWildcard(__webpack_require__(389)); } var _create; function _load_create() { - return _create = _interopRequireWildcard(__webpack_require__(377)); + return _create = _interopRequireWildcard(__webpack_require__(390)); } var _exec; function _load_exec() { - return _exec = _interopRequireWildcard(__webpack_require__(378)); + return _exec = _interopRequireWildcard(__webpack_require__(391)); } var _generateLockEntry; function _load_generateLockEntry() { - return _generateLockEntry = _interopRequireWildcard(__webpack_require__(379)); + return _generateLockEntry = _interopRequireWildcard(__webpack_require__(392)); } var _global; function _load_global() { - return _global = _interopRequireWildcard(__webpack_require__(78)); + return _global = _interopRequireWildcard(__webpack_require__(83)); } var _help; function _load_help() { - return _help = _interopRequireWildcard(__webpack_require__(380)); + return _help = _interopRequireWildcard(__webpack_require__(393)); } var _import; function _load_import() { - return _import = _interopRequireWildcard(__webpack_require__(381)); + return _import = _interopRequireWildcard(__webpack_require__(394)); } var _info; function _load_info() { - return _info = _interopRequireWildcard(__webpack_require__(382)); + return _info = _interopRequireWildcard(__webpack_require__(395)); } var _init; function _load_init() { - return _init = _interopRequireWildcard(__webpack_require__(383)); + return _init = _interopRequireWildcard(__webpack_require__(396)); } var _install; function _load_install() { - return _install = _interopRequireWildcard(__webpack_require__(27)); + return _install = _interopRequireWildcard(__webpack_require__(33)); } var _licenses; function _load_licenses() { - return _licenses = _interopRequireWildcard(__webpack_require__(384)); + return _licenses = _interopRequireWildcard(__webpack_require__(397)); } var _link; function _load_link() { - return _link = _interopRequireWildcard(__webpack_require__(215)); + return _link = _interopRequireWildcard(__webpack_require__(226)); } var _login; function _load_login() { - return _login = _interopRequireWildcard(__webpack_require__(79)); + return _login = _interopRequireWildcard(__webpack_require__(84)); } var _logout; function _load_logout() { - return _logout = _interopRequireWildcard(__webpack_require__(385)); + return _logout = _interopRequireWildcard(__webpack_require__(398)); } var _list; function _load_list() { - return _list = _interopRequireWildcard(__webpack_require__(216)); + return _list = _interopRequireWildcard(__webpack_require__(227)); +} + +var _node; + +function _load_node() { + return _node = _interopRequireWildcard(__webpack_require__(399)); } var _outdated; function _load_outdated() { - return _outdated = _interopRequireWildcard(__webpack_require__(386)); + return _outdated = _interopRequireWildcard(__webpack_require__(400)); } var _owner; function _load_owner() { - return _owner = _interopRequireWildcard(__webpack_require__(387)); + return _owner = _interopRequireWildcard(__webpack_require__(401)); } var _pack; function _load_pack() { - return _pack = _interopRequireWildcard(__webpack_require__(139)); + return _pack = _interopRequireWildcard(__webpack_require__(108)); } var _publish; function _load_publish() { - return _publish = _interopRequireWildcard(__webpack_require__(388)); + return _publish = _interopRequireWildcard(__webpack_require__(402)); } var _remove; function _load_remove() { - return _remove = _interopRequireWildcard(__webpack_require__(217)); + return _remove = _interopRequireWildcard(__webpack_require__(228)); } var _run; function _load_run() { - return _run = _interopRequireWildcard(__webpack_require__(389)); + return _run = _interopRequireWildcard(__webpack_require__(403)); } var _tag; function _load_tag() { - return _tag = _interopRequireWildcard(__webpack_require__(218)); + return _tag = _interopRequireWildcard(__webpack_require__(229)); } var _team; function _load_team() { - return _team = _interopRequireWildcard(__webpack_require__(390)); + return _team = _interopRequireWildcard(__webpack_require__(404)); } var _unlink; function _load_unlink() { - return _unlink = _interopRequireWildcard(__webpack_require__(391)); + return _unlink = _interopRequireWildcard(__webpack_require__(405)); } var _upgrade; function _load_upgrade() { - return _upgrade = _interopRequireWildcard(__webpack_require__(140)); + return _upgrade = _interopRequireWildcard(__webpack_require__(147)); } var _version; function _load_version() { - return _version = _interopRequireWildcard(__webpack_require__(220)); + return _version = _interopRequireWildcard(__webpack_require__(231)); } var _versions; function _load_versions() { - return _versions = _interopRequireWildcard(__webpack_require__(392)); + return _versions = _interopRequireWildcard(__webpack_require__(406)); } var _why; function _load_why() { - return _why = _interopRequireWildcard(__webpack_require__(393)); + return _why = _interopRequireWildcard(__webpack_require__(407)); +} + +var _workspaces; + +function _load_workspaces() { + return _workspaces = _interopRequireWildcard(__webpack_require__(409)); } var _workspace; function _load_workspace() { - return _workspace = _interopRequireWildcard(__webpack_require__(394)); + return _workspace = _interopRequireWildcard(__webpack_require__(408)); } var _upgradeInteractive; function _load_upgradeInteractive() { - return _upgradeInteractive = _interopRequireWildcard(__webpack_require__(219)); + return _upgradeInteractive = _interopRequireWildcard(__webpack_require__(230)); } var _useless; function _load_useless() { - return _useless = _interopRequireDefault(__webpack_require__(372)); + return _useless = _interopRequireDefault(__webpack_require__(385)); } var _aliases; function _load_aliases() { - return _aliases = _interopRequireDefault(__webpack_require__(212)); + return _aliases = _interopRequireDefault(__webpack_require__(223)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -const chalk = __webpack_require__(105); +var chalk = __webpack_require__(113); -const getDocsLink = name => `${(_constants || _load_constants()).YARN_DOCS}${name || ''}`; -const getDocsInfo = name => 'Visit ' + chalk.bold(getDocsLink(name)) + ' for documentation about this command.'; +var getDocsLink = function getDocsLink(name) { + return `${(_constants || _load_constants()).YARN_DOCS}${name || ''}`; +}; +var getDocsInfo = function getDocsInfo(name) { + return 'Visit ' + chalk.bold(getDocsLink(name)) + ' for documentation about this command.'; +}; -const commands = { +var commands = { access: _access || _load_access(), add: _add || _load_add(), autoclean: _autoclean || _load_autoclean(), @@ -53291,6 +56036,7 @@ const commands = { login: _login || _load_login(), logout: _logout || _load_logout(), list: _list || _load_list(), + node: _node || _load_node(), outdated: _outdated || _load_outdated(), owner: _owner || _load_owner(), pack: _pack || _load_pack(), @@ -53305,23 +56051,24 @@ const commands = { version: _version || _load_version(), versions: _versions || _load_versions(), why: _why || _load_why(), + workspaces: _workspaces || _load_workspaces(), workspace: _workspace || _load_workspace(), upgradeInteractive: _upgradeInteractive || _load_upgradeInteractive() }; -for (const key in commands) { +for (var key in commands) { commands[key].getDocsInfo = getDocsInfo(key); } -for (const key in (_aliases || _load_aliases()).default) { - commands[key] = commands[(_aliases || _load_aliases()).default[key]]; - commands[key].getDocsInfo = getDocsInfo(key); +for (var _key in (_aliases || _load_aliases()).default) { + commands[_key] = commands[(_aliases || _load_aliases()).default[_key]]; + commands[_key].getDocsInfo = getDocsInfo(_key); } exports.default = commands; /***/ }), -/* 191 */ +/* 203 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -53331,857 +56078,23 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(34)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); -} - -var _toConsumableArray2; - -function _load_toConsumableArray() { - return _toConsumableArray2 = _interopRequireDefault(__webpack_require__(32)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); -} - -var _keys; +var _getIterator2; -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } -var _executeLifecycleScript; - -function _load_executeLifecycleScript() { - return _executeLifecycleScript = __webpack_require__(83); -} - -var _path; - -function _load_path() { - return _path = __webpack_require__(237); -} - -var _index; - -function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(150)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); -} - -var _packageConstraintResolver; - -function _load_packageConstraintResolver() { - return _packageConstraintResolver = _interopRequireDefault(__webpack_require__(401)); -} - -var _requestManager; - -function _load_requestManager() { - return _requestManager = _interopRequireDefault(__webpack_require__(238)); -} - -var _index2; - -function _load_index2() { - return _index2 = __webpack_require__(37); -} - -var _index3; - -function _load_index3() { - return _index3 = __webpack_require__(136); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +exports.isOffline = isOffline; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const detectIndent = __webpack_require__(506); - -const invariant = __webpack_require__(6); -const path = __webpack_require__(1); -const micromatch = __webpack_require__(93); -const isCi = __webpack_require__(174); - -function sortObject(object) { - const sortedObject = {}; - (0, (_keys || _load_keys()).default)(object).sort().forEach(item => { - sortedObject[item] = object[item]; - }); - return sortedObject; -} - -class Config { - constructor(reporter) { - this.constraintResolver = new (_packageConstraintResolver || _load_packageConstraintResolver()).default(this, reporter); - this.requestManager = new (_requestManager || _load_requestManager()).default(reporter); - this.reporter = reporter; - this._init({}); - } - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // Whether we should ignore executing lifecycle scripts - - - // - - - // - - - // - - - // - - - /** - * Execute a promise produced by factory if it doesn't exist in our cache with - * the associated key. - */ - - getCache(key, factory) { - const cached = this.cache[key]; - if (cached) { - return cached; - } - - return this.cache[key] = factory().catch(err => { - this.cache[key] = null; - throw err; - }); - } - - /** - * Get a config option from our yarn config. - */ - - getOption(key) { - let resolve = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - const value = this.registries.yarn.getOption(key); - - if (resolve && typeof value === 'string' && value.length) { - return (0, (_path || _load_path()).resolveWithHome)(value); - } - - return value; - } - - /** - * Reduce a list of versions to a single one based on an input range. - */ - - resolveConstraints(versions, range) { - return this.constraintResolver.reduce(versions, range); - } - - /** - * Initialise config. Fetch registry options, find package roots. - */ +var os = __webpack_require__(70); - init() { - var _arguments = arguments, - _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let opts = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : {}; - - _this._init(opts); - - _this.workspaceRootFolder = yield _this.findWorkspaceRoot(_this.cwd); - _this.lockfileFolder = _this.workspaceRootFolder || _this.cwd; - - _this.linkedModules = []; - - let linkedModules; - try { - linkedModules = yield (_fs || _load_fs()).readdir(_this.linkFolder); - } catch (err) { - if (err.code === 'ENOENT') { - linkedModules = []; - } else { - throw err; - } - } - - for (const dir of linkedModules) { - const linkedPath = path.join(_this.linkFolder, dir); - - if (dir[0] === '@') { - var _linkedModules; - - // it's a scope, not a package - const scopedLinked = yield (_fs || _load_fs()).readdir(linkedPath); - (_linkedModules = _this.linkedModules).push.apply(_linkedModules, (0, (_toConsumableArray2 || _load_toConsumableArray()).default)(scopedLinked.map(function (scopedDir) { - return path.join(dir, scopedDir); - }))); - } else { - _this.linkedModules.push(dir); - } - } - - for (const key of (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries)) { - const Registry = (_index2 || _load_index2()).registries[key]; - - // instantiate registry - const registry = new Registry(_this.cwd, _this.registries, _this.requestManager, _this.reporter); - yield registry.init({ - registry: opts.registry - }); - - _this.registries[key] = registry; - _this.registryFolders.push(registry.folder); - const rootModuleFolder = path.join(_this.cwd, registry.folder); - if (_this.rootModuleFolders.indexOf(rootModuleFolder) < 0) { - _this.rootModuleFolders.push(rootModuleFolder); - } - } - - _this.networkConcurrency = opts.networkConcurrency || Number(_this.getOption('network-concurrency')) || (_constants || _load_constants()).NETWORK_CONCURRENCY; - - _this.childConcurrency = opts.childConcurrency || Number(_this.getOption('child-concurrency')) || Number(process.env.CHILD_CONCURRENCY) || (_constants || _load_constants()).CHILD_CONCURRENCY; - - _this.networkTimeout = opts.networkTimeout || Number(_this.getOption('network-timeout')) || (_constants || _load_constants()).NETWORK_TIMEOUT; - - const httpProxy = opts.httpProxy || _this.getOption('proxy'); - const httpsProxy = opts.httpsProxy || _this.getOption('https-proxy'); - _this.requestManager.setOptions({ - userAgent: String(_this.getOption('user-agent')), - httpProxy: httpProxy === false ? false : String(httpProxy || ''), - httpsProxy: httpsProxy === false ? false : String(httpsProxy || ''), - strictSSL: Boolean(_this.getOption('strict-ssl')), - ca: Array.prototype.concat(opts.ca || _this.getOption('ca') || []).map(String), - cafile: String(opts.cafile || _this.getOption('cafile', true) || ''), - cert: String(opts.cert || _this.getOption('cert') || ''), - key: String(opts.key || _this.getOption('key') || ''), - networkConcurrency: _this.networkConcurrency, - networkTimeout: _this.networkTimeout - }); - - let cacheRootFolder = opts.cacheFolder || _this.getOption('cache-folder', true); - - if (!cacheRootFolder) { - let preferredCacheFolders = (_constants || _load_constants()).PREFERRED_MODULE_CACHE_DIRECTORIES; - const preferredCacheFolder = opts.preferredCacheFolder || _this.getOption('preferred-cache-folder', true); - - if (preferredCacheFolder) { - preferredCacheFolders = [String(preferredCacheFolder)].concat(preferredCacheFolders); - } - - const cacheFolderQuery = yield (_fs || _load_fs()).getFirstSuitableFolder(preferredCacheFolders, (_fs || _load_fs()).constants.W_OK | (_fs || _load_fs()).constants.X_OK | (_fs || _load_fs()).constants.R_OK); - for (const skippedEntry of cacheFolderQuery.skipped) { - _this.reporter.warn(_this.reporter.lang('cacheFolderSkipped', skippedEntry.folder)); - } - - cacheRootFolder = cacheFolderQuery.folder; - if (cacheRootFolder && cacheFolderQuery.skipped.length > 0) { - _this.reporter.warn(_this.reporter.lang('cacheFolderSelected', cacheRootFolder)); - } - } - - if (!cacheRootFolder) { - throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('cacheFolderMissing')); - } else { - _this._cacheRootFolder = String(cacheRootFolder); - } - _this.workspacesEnabled = _this.getOption('workspaces-experimental') !== false; - - _this.pruneOfflineMirror = Boolean(_this.getOption('yarn-offline-mirror-pruning')); - _this.enableMetaFolder = Boolean(_this.getOption('enable-meta-folder')); - _this.enableLockfileVersions = Boolean(_this.getOption('yarn-enable-lockfile-versions')); - _this.linkFileDependencies = Boolean(_this.getOption('yarn-link-file-dependencies')); - - //init & create cacheFolder, tempFolder - _this.cacheFolder = path.join(_this._cacheRootFolder, 'v' + String((_constants || _load_constants()).CACHE_VERSION)); - _this.tempFolder = opts.tempFolder || path.join(_this.cacheFolder, '.tmp'); - yield (_fs || _load_fs()).mkdirp(_this.cacheFolder); - yield (_fs || _load_fs()).mkdirp(_this.tempFolder); - - if (opts.production !== undefined) { - _this.production = Boolean(opts.production); - } else { - _this.production = Boolean(_this.getOption('production')) || process.env.NODE_ENV === 'production' && process.env.NPM_CONFIG_PRODUCTION !== 'false' && process.env.YARN_PRODUCTION !== 'false'; - } - - if (_this.workspaceRootFolder && !_this.workspacesEnabled) { - throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('workspacesDisabled')); - } - })(); - } - - _init(opts) { - this.rootModuleFolders = []; - this.registryFolders = []; - this.linkedModules = []; - - this.registries = (0, (_map || _load_map()).default)(); - this.cache = (0, (_map || _load_map()).default)(); - this.cwd = opts.cwd || this.cwd || process.cwd(); - - this.looseSemver = opts.looseSemver == undefined ? true : opts.looseSemver; - - this.commandName = opts.commandName || ''; - - this.preferOffline = !!opts.preferOffline; - this.modulesFolder = opts.modulesFolder; - this.globalFolder = opts.globalFolder || (_constants || _load_constants()).GLOBAL_MODULE_DIRECTORY; - this.linkFolder = opts.linkFolder || (_constants || _load_constants()).LINK_REGISTRY_DIRECTORY; - this.offline = !!opts.offline; - this.binLinks = !!opts.binLinks; - - this.ignorePlatform = !!opts.ignorePlatform; - this.ignoreScripts = !!opts.ignoreScripts; - - this.disablePrepublish = !!opts.disablePrepublish; - - // $FlowFixMe$ - this.nonInteractive = !!opts.nonInteractive || isCi || !process.stdout.isTTY; - - this.requestManager.setOptions({ - offline: !!opts.offline && !opts.preferOffline, - captureHar: !!opts.captureHar - }); - - if (this.modulesFolder) { - this.rootModuleFolders.push(this.modulesFolder); - } - } - - /** - * Generate an absolute module path. - */ - - generateHardModulePath(pkg, ignoreLocation) { - invariant(this.cacheFolder, 'No package root'); - invariant(pkg, 'Undefined package'); - - if (pkg.location && !ignoreLocation) { - return pkg.location; - } - - let name = pkg.name; - let uid = pkg.uid; - if (pkg.registry) { - name = `${pkg.registry}-${name}`; - } - - const hash = pkg.remote.hash; - - - if (pkg.version && pkg.version !== pkg.uid) { - uid = `${pkg.version}-${uid}`; - } else if (hash) { - uid += `-${hash}`; - } - - return path.join(this.cacheFolder, `${name}-${uid}`); - } - - /** - * Execute lifecycle scripts in the specified directory. Ignoring when the --ignore-scripts flag has been - * passed. - */ - - executeLifecycleScript(commandName, cwd) { - if (this.ignoreScripts) { - return (_promise || _load_promise()).default.resolve(); - } else { - return (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execFromManifest)(this, commandName, cwd || this.cwd); - } - } - - /** - * Generate an absolute temporary filename location based on the input filename. - */ - - getTemp(filename) { - invariant(this.tempFolder, 'No temp folder'); - return path.join(this.tempFolder, filename); - } - - /** - * Remote packages may be cached in a file system to be available for offline installation. - * Second time the same package needs to be installed it will be loaded from there. - * Given a package's filename, return a path in the offline mirror location. - */ - - getOfflineMirrorPath(packageFilename) { - let mirrorPath; - - for (const key of ['npm', 'yarn']) { - const registry = this.registries[key]; - - if (registry == null) { - continue; - } - - const registryMirrorPath = registry.config['yarn-offline-mirror']; - - if (registryMirrorPath === false) { - return null; - } - - if (registryMirrorPath == null) { - continue; - } - - mirrorPath = registryMirrorPath; - } - - if (mirrorPath == null) { - return null; - } - - if (packageFilename == null) { - return mirrorPath; - } - - return path.join(mirrorPath, path.basename(packageFilename)); - } - - /** - * Checker whether the folder input is a valid module folder. We output a yarn metadata - * file when we've successfully setup a folder so use this as a marker. - */ - - isValidModuleDest(dest) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (!(yield (_fs || _load_fs()).exists(dest))) { - return false; - } - - if (!(yield (_fs || _load_fs()).exists(path.join(dest, (_constants || _load_constants()).METADATA_FILENAME)))) { - return false; - } - - return true; - })(); - } - - /** - * Read package metadata and normalized package info. - */ - - readPackageMetadata(dir) { - var _this2 = this; - - return this.getCache(`metadata-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const metadata = yield _this2.readJson(path.join(dir, (_constants || _load_constants()).METADATA_FILENAME)); - const pkg = yield _this2.readManifest(dir, metadata.registry); - - return { - package: pkg, - artifacts: metadata.artifacts || [], - hash: metadata.hash, - remote: metadata.remote, - registry: metadata.registry - }; - })); - } - - /** - * Read normalized package info according yarn-metadata.json - * throw an error if package.json was not found - */ - - readManifest(dir, priorityRegistry) { - var _this3 = this; - - let isRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - return this.getCache(`manifest-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const manifest = yield _this3.maybeReadManifest(dir, priorityRegistry, isRoot); - - if (manifest) { - return manifest; - } else { - throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('couldntFindPackagejson', dir), 'ENOENT'); - } - })); - } - - /** - * try get the manifest file by looking - * 1. manifest file in cache - * 2. manifest file in registry - */ - maybeReadManifest(dir, priorityRegistry) { - var _arguments2 = arguments, - _this4 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let isRoot = _arguments2.length > 2 && _arguments2[2] !== undefined ? _arguments2[2] : false; - - const metadataLoc = path.join(dir, (_constants || _load_constants()).METADATA_FILENAME); - - if (yield (_fs || _load_fs()).exists(metadataLoc)) { - const metadata = yield _this4.readJson(metadataLoc); - - if (!priorityRegistry) { - priorityRegistry = metadata.priorityRegistry; - } - - if (typeof metadata.manifest !== 'undefined') { - return metadata.manifest; - } - } - - if (priorityRegistry) { - const file = yield _this4.tryManifest(dir, priorityRegistry, isRoot); - if (file) { - return file; - } - } - - for (const registry of (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries)) { - if (priorityRegistry === registry) { - continue; - } - - const file = yield _this4.tryManifest(dir, registry, isRoot); - if (file) { - return file; - } - } - - return null; - })(); - } - - /** - * Read the root manifest. - */ - - readRootManifest() { - return this.readManifest(this.cwd, 'npm', true); - } - - /** - * Try and find package info with the input directory and registry. - */ - - tryManifest(dir, registry, isRoot) { - var _this5 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const filename = (_index2 || _load_index2()).registries[registry].filename; - - const loc = path.join(dir, filename); - if (yield (_fs || _load_fs()).exists(loc)) { - const data = yield _this5.readJson(loc); - data._registry = registry; - data._loc = loc; - return (0, (_index || _load_index()).default)(data, dir, _this5, isRoot); - } else { - return null; - } - })(); - } - - findManifest(dir, isRoot) { - var _this6 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - for (const registry of (_index2 || _load_index2()).registryNames) { - const manifest = yield _this6.tryManifest(dir, registry, isRoot); - - if (manifest) { - return manifest; - } - } - - return null; - })(); - } - - findWorkspaceRoot(initial) { - var _this7 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let previous = null; - let current = path.normalize(initial); - - do { - const manifest = yield _this7.findManifest(current, true); - if (manifest && manifest.workspaces) { - const relativePath = path.relative(current, initial); - if (relativePath === '' || micromatch([relativePath], manifest.workspaces).length > 0) { - return current; - } else { - return null; - } - } - - previous = current; - current = path.dirname(current); - } while (current !== previous); - - return null; - })(); - } - - resolveWorkspaces(root, rootManifest) { - var _this8 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const workspaces = {}; - const patterns = rootManifest.workspaces || []; - if (!_this8.workspacesEnabled) { - return workspaces; - } - if (!rootManifest.private && patterns.length > 0) { - throw new (_errors || _load_errors()).MessageError(_this8.reporter.lang('workspacesRequirePrivateProjects')); - } - - const registryFilenames = (_index2 || _load_index2()).registryNames.map(function (registryName) { - return _this8.registries[registryName].constructor.filename; - }).join('|'); - const trailingPattern = `/+(${registryFilenames})`; - const ignorePatterns = _this8.registryFolders.map(function (folder) { - return `/${folder}/*/+(${registryFilenames})`; - }); - - const files = yield (_promise || _load_promise()).default.all(patterns.map(function (pattern) { - return (_fs || _load_fs()).glob(pattern.replace(/\/?$/, trailingPattern), { - cwd: root, - ignore: ignorePatterns.map(function (ignorePattern) { - return pattern.replace(/\/?$/, ignorePattern); - }) - }); - })); - - for (const file of new (_set || _load_set()).default((_ref3 = []).concat.apply(_ref3, (0, (_toConsumableArray2 || _load_toConsumableArray()).default)(files)))) { - var _ref3; - - const loc = path.join(root, path.dirname(file)); - const manifest = yield _this8.findManifest(loc, false); - - if (!manifest) { - continue; - } - - if (!manifest.name) { - _this8.reporter.warn(_this8.reporter.lang('workspaceNameMandatory', loc)); - continue; - } - if (!manifest.version) { - _this8.reporter.warn(_this8.reporter.lang('workspaceVersionMandatory', loc)); - continue; - } - - if (Object.prototype.hasOwnProperty.call(workspaces, manifest.name)) { - throw new (_errors || _load_errors()).MessageError(_this8.reporter.lang('workspaceNameDuplicate', manifest.name)); - } - - workspaces[manifest.name] = { loc: loc, manifest: manifest }; - } - - return workspaces; - })(); - } - - /** - * Description - */ - - getFolder(pkg) { - let registryName = pkg._registry; - if (!registryName) { - const ref = pkg._reference; - invariant(ref, 'expected reference'); - registryName = ref.registry; - } - return this.registries[registryName].folder; - } - - /** - * Get root manifests. - */ - - getRootManifests() { - var _this9 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const manifests = {}; - for (const registryName of (_index2 || _load_index2()).registryNames) { - const registry = (_index2 || _load_index2()).registries[registryName]; - const jsonLoc = path.join(_this9.cwd, registry.filename); - - let object = {}; - let exists = false; - let indent; - if (yield (_fs || _load_fs()).exists(jsonLoc)) { - exists = true; - - const info = yield _this9.readJson(jsonLoc, (_fs || _load_fs()).readJsonAndFile); - object = info.object; - indent = detectIndent(info.content).indent || undefined; - } - manifests[registryName] = { loc: jsonLoc, object: object, exists: exists, indent: indent }; - } - return manifests; - })(); - } - - /** - * Save root manifests. - */ - - saveRootManifests(manifests) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - for (const registryName of (_index2 || _load_index2()).registryNames) { - var _manifests$registryNa = manifests[registryName]; - const loc = _manifests$registryNa.loc, - object = _manifests$registryNa.object, - exists = _manifests$registryNa.exists, - indent = _manifests$registryNa.indent; - - if (!exists && !(0, (_keys || _load_keys()).default)(object).length) { - continue; - } - - for (const field of (_constants || _load_constants()).DEPENDENCY_TYPES) { - if (object[field]) { - object[field] = sortObject(object[field]); - } - } - - yield (_fs || _load_fs()).writeFilePreservingEol(loc, (0, (_stringify || _load_stringify()).default)(object, null, indent || (_constants || _load_constants()).DEFAULT_INDENT) + '\n'); - } - })(); - } - - /** - * Call the passed factory (defaults to fs.readJson) and rethrow a pretty error message if it was the result - * of a syntax error. - */ - - readJson(loc) { - let factory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_fs || _load_fs()).readJson; - - try { - return factory(loc); - } catch (err) { - if (err instanceof SyntaxError) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('jsonError', loc, err.message)); - } else { - throw err; - } - } - } - - static create() { - var _arguments3 = arguments; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let opts = _arguments3.length > 0 && _arguments3[0] !== undefined ? _arguments3[0] : {}; - let reporter = _arguments3.length > 1 && _arguments3[1] !== undefined ? _arguments3[1] : new (_index3 || _load_index3()).NoopReporter(); - - const config = new Config(reporter); - yield config.init(opts); - return config; - })(); - } -} -exports.default = Config; - -/***/ }), -/* 192 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isOffline = isOffline; -const os = __webpack_require__(75); - -const IGNORE_INTERFACES = ['lo0', 'awdl0', 'bridge0']; -const LOCAL_IPS = ['127.0.0.1', '::1']; +var IGNORE_INTERFACES = ['lo0', 'awdl0', 'bridge0']; +var LOCAL_IPS = ['127.0.0.1', '::1']; function isOffline() { - let interfaces; + var interfaces = void 0; try { interfaces = os.networkInterfaces(); @@ -54196,13 +56109,26 @@ function isOffline() { } } - for (const name in interfaces) { + for (var name in interfaces) { if (IGNORE_INTERFACES.indexOf(name) >= 0) { continue; } - const addrs = interfaces[name]; - for (const addr of addrs) { + var addrs = interfaces[name]; + for (var _iterator = addrs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var addr = _ref; + if (LOCAL_IPS.indexOf(addr.address) < 0) { // found a possible remote ip return false; @@ -54214,20 +56140,20 @@ function isOffline() { } /***/ }), -/* 193 */ +/* 204 */ /***/ (function(module, exports, __webpack_require__) { /** * Module dependencies. */ -var EventEmitter = __webpack_require__(64).EventEmitter; -var spawn = __webpack_require__(132).spawn; -var readlink = __webpack_require__(533).readlinkSync; -var path = __webpack_require__(1); +var EventEmitter = __webpack_require__(69).EventEmitter; +var spawn = __webpack_require__(140).spawn; +var readlink = __webpack_require__(555).readlinkSync; +var path = __webpack_require__(0); var dirname = path.dirname; var basename = path.basename; -var fs = __webpack_require__(8); +var fs = __webpack_require__(10); /** * Expose the root command. @@ -55330,7 +57256,7 @@ function exists(file) { /***/ }), -/* 194 */ +/* 205 */ /***/ (function(module, exports) { function webpackEmptyContext(req) { @@ -55339,10 +57265,10 @@ function webpackEmptyContext(req) { webpackEmptyContext.keys = function() { return []; }; webpackEmptyContext.resolve = webpackEmptyContext; module.exports = webpackEmptyContext; -webpackEmptyContext.id = 194; +webpackEmptyContext.id = 205; /***/ }), -/* 195 */ +/* 206 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55354,7 +57280,7 @@ module.exports = { }; -var util = __webpack_require__(59); +var util = __webpack_require__(62); var ASYNC = { '*': checkGenerators, @@ -55567,7 +57493,7 @@ function compileAsync(schema, callback) { /***/ }), -/* 196 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55619,16 +57545,16 @@ module.exports = function equal(a, b) { /***/ }), -/* 197 */ +/* 208 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var url = __webpack_require__(14) - , equal = __webpack_require__(196) - , util = __webpack_require__(59) - , SchemaObject = __webpack_require__(198); +var url = __webpack_require__(18) + , equal = __webpack_require__(207) + , util = __webpack_require__(62) + , SchemaObject = __webpack_require__(209); module.exports = resolve; @@ -55893,13 +57819,13 @@ function resolveIds(schema) { /***/ }), -/* 198 */ +/* 209 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(59); +var util = __webpack_require__(62); module.exports = SchemaObject; @@ -55909,7 +57835,7 @@ function SchemaObject(obj) { /***/ }), -/* 199 */ +/* 210 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55930,7 +57856,7 @@ ValidationError.prototype.constructor = ValidationError; /***/ }), -/* 200 */ +/* 211 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56061,7 +57987,7 @@ module.exports = function generate__limit(it, $keyword) { /***/ }), -/* 201 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56144,7 +58070,7 @@ module.exports = function generate__limitItems(it, $keyword) { /***/ }), -/* 202 */ +/* 213 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56232,7 +58158,7 @@ module.exports = function generate__limitLength(it, $keyword) { /***/ }), -/* 203 */ +/* 214 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56315,7 +58241,7 @@ module.exports = function generate__limitProperties(it, $keyword) { /***/ }), -/* 204 */ +/* 215 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56697,7 +58623,7 @@ module.exports = function generate_validate(it, $keyword) { /***/ }), -/* 205 */ +/* 216 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56708,7 +58634,7 @@ module.exports = function () { /***/ }), -/* 206 */ +/* 217 */ /***/ (function(module, exports) { // API @@ -56743,10 +58669,10 @@ function clean(key) /***/ }), -/* 207 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { -var defer = __webpack_require__(366); +var defer = __webpack_require__(379); // API module.exports = async; @@ -56783,11 +58709,11 @@ function async(callback) /***/ }), -/* 208 */ +/* 219 */ /***/ (function(module, exports, __webpack_require__) { -var async = __webpack_require__(207) - , abort = __webpack_require__(206) +var async = __webpack_require__(218) + , abort = __webpack_require__(217) ; // API @@ -56864,7 +58790,7 @@ function runJob(iterator, key, item, callback) /***/ }), -/* 209 */ +/* 220 */ /***/ (function(module, exports) { // API @@ -56907,11 +58833,11 @@ function state(list, sortMethod) /***/ }), -/* 210 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { -var abort = __webpack_require__(206) - , async = __webpack_require__(207) +var abort = __webpack_require__(217) + , async = __webpack_require__(218) ; // API @@ -56942,12 +58868,12 @@ function terminator(callback) /***/ }), -/* 211 */ +/* 222 */ /***/ (function(module, exports, __webpack_require__) { -var iterate = __webpack_require__(208) - , initState = __webpack_require__(209) - , terminator = __webpack_require__(210) +var iterate = __webpack_require__(219) + , initState = __webpack_require__(220) + , terminator = __webpack_require__(221) ; // Public API @@ -57023,7 +58949,7 @@ function descending(a, b) /***/ }), -/* 212 */ +/* 223 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57038,7 +58964,7 @@ exports.default = { }; /***/ }), -/* 213 */ +/* 224 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57049,123 +58975,179 @@ Object.defineProperty(exports, "__esModule", { }); exports.run = exports.clean = exports.noArguments = exports.requireLockfile = undefined; +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); + return _set = _interopRequireDefault(__webpack_require__(15)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let clean = exports.clean = (() => { +var clean = exports.clean = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { - const loc = path.join(config.cwd, (_constants || _load_constants()).CLEAN_FILENAME); - const file = yield (_fs || _load_fs()).readFile(loc); - const lines = file.split('\n'); - const filters = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines); + var loc = path.join(config.cwd, (_constants || _load_constants()).CLEAN_FILENAME); + var file = yield (_fs || _load_fs()).readFile(loc); + var lines = file.split('\n'); + var filters = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines); - let removedFiles = 0; - let removedSize = 0; + var removedFiles = 0; + var removedSize = 0; // build list of possible module folders - const locs = new (_set || _load_set()).default(); + var locs = new (_set || _load_set()).default(); if (config.modulesFolder) { locs.add(config.modulesFolder); } - for (const name of (_index || _load_index()).registryNames) { - const registry = config.registries[name]; + for (var _iterator = (_index || _load_index()).registryNames, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var name = _ref2; + + var registry = config.registries[name]; locs.add(path.join(config.cwd, registry.folder)); } - for (const folder of locs) { + for (var _iterator2 = locs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var folder = _ref3; + if (!(yield (_fs || _load_fs()).exists(folder))) { continue; } - const spinner = reporter.activity(); - const files = yield (_fs || _load_fs()).walk(folder); - - var _sortFilter = (0, (_filter || _load_filter()).sortFilter)(files, filters); + var spinner = reporter.activity(); + var files = yield (_fs || _load_fs()).walk(folder); - const ignoreFiles = _sortFilter.ignoreFiles; + var _sortFilter = (0, (_filter || _load_filter()).sortFilter)(files, filters), + ignoreFiles = _sortFilter.ignoreFiles; spinner.end(); - const tick = reporter.progress(ignoreFiles.size); + var tick = reporter.progress(ignoreFiles.size); // TODO make sure `main` field of all modules isn't ignored - for (const file of ignoreFiles) { - const loc = path.join(folder, file); - const stat = yield (_fs || _load_fs()).lstat(loc); + for (var _iterator3 = ignoreFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + var _file = _ref4; + + var _loc = path.join(folder, _file); + var stat = yield (_fs || _load_fs()).lstat(_loc); removedSize += stat.size; removedFiles++; } - for (const file of ignoreFiles) { - const loc = path.join(folder, file); - yield (_fs || _load_fs()).unlink(loc); + for (var _iterator4 = ignoreFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref5; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } + + var _file2 = _ref5; + + var _loc2 = path.join(folder, _file2); + yield (_fs || _load_fs()).unlink(_loc2); tick(); } } - return { removedFiles: removedFiles, removedSize: removedSize }; + return { removedFiles, removedSize }; }); return function clean(_x, _x2) { return _ref.apply(this, arguments); }; -})(); +}(); -let runInit = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cwd, reporter) { +var runInit = function () { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cwd, reporter) { reporter.step(1, 1, reporter.lang('cleanCreatingFile', (_constants || _load_constants()).CLEAN_FILENAME)); - const cleanLoc = path.join(cwd, (_constants || _load_constants()).CLEAN_FILENAME); + var cleanLoc = path.join(cwd, (_constants || _load_constants()).CLEAN_FILENAME); yield (_fs || _load_fs()).writeFile(cleanLoc, `${DEFAULT_FILTER}\n`, { flag: 'wx' }); reporter.info(reporter.lang('cleanCreatedFile', (_constants || _load_constants()).CLEAN_FILENAME)); }); return function runInit(_x3, _x4) { - return _ref2.apply(this, arguments); + return _ref6.apply(this, arguments); }; -})(); +}(); -let runAutoClean = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { +var runAutoClean = function () { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { reporter.step(1, 1, reporter.lang('cleaning')); - var _ref4 = yield clean(config, reporter); - - const removedFiles = _ref4.removedFiles, - removedSize = _ref4.removedSize; + var _ref8 = yield clean(config, reporter), + removedFiles = _ref8.removedFiles, + removedSize = _ref8.removedSize; reporter.info(reporter.lang('cleanRemovedFiles', removedFiles)); reporter.info(reporter.lang('cleanSavedSize', Number((removedSize / 1024 / 1024).toFixed(2)))); }); return function runAutoClean(_x5, _x6) { - return _ref3.apply(this, arguments); + return _ref7.apply(this, arguments); }; -})(); +}(); -let checkForCleanFile = (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cwd) { - const cleanLoc = path.join(cwd, (_constants || _load_constants()).CLEAN_FILENAME); - const exists = yield (_fs || _load_fs()).exists(cleanLoc); +var checkForCleanFile = function () { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cwd) { + var cleanLoc = path.join(cwd, (_constants || _load_constants()).CLEAN_FILENAME); + var exists = yield (_fs || _load_fs()).exists(cleanLoc); return exists; }); return function checkForCleanFile(_x7) { - return _ref5.apply(this, arguments); + return _ref9.apply(this, arguments); }; -})(); +}(); -let run = exports.run = (() => { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const cleanFileExists = yield checkForCleanFile(config.cwd); +var run = exports.run = function () { + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var cleanFileExists = yield checkForCleanFile(config.cwd); if (flags.init && cleanFileExists) { reporter.info(reporter.lang('cleanAlreadyExists', (_constants || _load_constants()).CLEAN_FILENAME)); @@ -57181,9 +59163,9 @@ let run = exports.run = (() => { }); return function run(_x8, _x9, _x10, _x11) { - return _ref6.apply(this, arguments); + return _ref10.apply(this, arguments); }; -})(); +}(); exports.setFlags = setFlags; exports.hasWrapper = hasWrapper; @@ -57191,37 +59173,37 @@ exports.hasWrapper = hasWrapper; var _index; function _load_index() { - return _index = __webpack_require__(37); + return _index = __webpack_require__(40); } var _filter; function _load_filter() { - return _filter = __webpack_require__(234); + return _filter = __webpack_require__(245); } var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const path = __webpack_require__(1); +var path = __webpack_require__(0); -const requireLockfile = exports.requireLockfile = true; -const noArguments = exports.noArguments = true; +var requireLockfile = exports.requireLockfile = true; +var noArguments = exports.noArguments = true; -const DEFAULT_FILTER = ` +var DEFAULT_FILTER = ` # test directories __tests__ test @@ -57270,6 +59252,7 @@ wercker.yml `.trim(); function setFlags(commander) { + commander.description('Cleans and removes unnecessary files from package dependencies.'); commander.usage('autoclean [flags]'); commander.option('-I, --init', `Create "${(_constants || _load_constants()).CLEAN_FILENAME}" file with the default entries.`); commander.option('-F, --force', `Run autoclean using the existing "${(_constants || _load_constants()).CLEAN_FILENAME}" file.`); @@ -57280,7 +59263,7 @@ function hasWrapper(commander) { } /***/ }), -/* 214 */ +/* 225 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57294,30 +59277,30 @@ exports.run = exports.verifyTreeCheck = exports.noArguments = exports.requireLoc var _assign; function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); + return _assign = _interopRequireDefault(__webpack_require__(17)); } -var _slicedToArray2; +var _getIterator2; -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(17)); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); + return _set = _interopRequireDefault(__webpack_require__(15)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let verifyTreeCheck = exports.verifyTreeCheck = (() => { +var verifyTreeCheck = exports.verifyTreeCheck = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - let errCount = 0; + var errCount = 0; function reportError(msg) { for (var _len = arguments.length, vars = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { vars[_key - 1] = arguments[_key]; @@ -57327,48 +59310,48 @@ let verifyTreeCheck = exports.verifyTreeCheck = (() => { errCount++; } // check all dependencies recursively without relying on internal resolver - const registryName = 'yarn'; - const registry = config.registries[registryName]; - const rootManifest = yield config.readManifest(registry.cwd, registryName); + var registryName = 'yarn'; + var registry = config.registries[registryName]; + var rootManifest = yield config.readManifest(registry.cwd, registryName); - const dependenciesToCheckVersion = []; + var dependenciesToCheckVersion = []; if (rootManifest.dependencies) { - for (const name in rootManifest.dependencies) { - const version = rootManifest.dependencies[name]; + for (var _name in rootManifest.dependencies) { + var _version = rootManifest.dependencies[_name]; // skip linked dependencies - const isLinkedDepencency = /^link:/i.test(version) || /^file:/i.test(version) && config.linkFileDependencies; + var isLinkedDepencency = /^link:/i.test(_version) || /^file:/i.test(_version) && config.linkFileDependencies; if (isLinkedDepencency) { continue; } dependenciesToCheckVersion.push({ - name: name, - originalKey: name, + name: _name, + originalKey: _name, parentCwd: registry.cwd, - version: version + version: _version }); } } if (rootManifest.devDependencies && !config.production) { - for (const name in rootManifest.devDependencies) { - const version = rootManifest.devDependencies[name]; + for (var _name2 in rootManifest.devDependencies) { + var _version2 = rootManifest.devDependencies[_name2]; // skip linked dependencies - const isLinkedDepencency = /^link:/i.test(version) || /^file:/i.test(version) && config.linkFileDependencies; - if (isLinkedDepencency) { + var _isLinkedDepencency = /^link:/i.test(_version2) || /^file:/i.test(_version2) && config.linkFileDependencies; + if (_isLinkedDepencency) { continue; } dependenciesToCheckVersion.push({ - name: name, - originalKey: name, + name: _name2, + originalKey: _name2, parentCwd: registry.cwd, - version: version + version: _version2 }); } } - const locationsVisited = new (_set || _load_set()).default(); + var locationsVisited = new (_set || _load_set()).default(); while (dependenciesToCheckVersion.length) { - const dep = dependenciesToCheckVersion.shift(); - const manifestLoc = path.join(dep.parentCwd, registry.folder, dep.name); + var dep = dependenciesToCheckVersion.shift(); + var manifestLoc = path.join(dep.parentCwd, registry.folder, dep.name); if (locationsVisited.has(manifestLoc + `@${dep.version}`)) { continue; } @@ -57380,23 +59363,23 @@ let verifyTreeCheck = exports.verifyTreeCheck = (() => { if (!(yield (_fs || _load_fs()).exists(path.join(manifestLoc, 'package.json')))) { continue; } - const pkg = yield config.readManifest(manifestLoc, registryName); + var pkg = yield config.readManifest(manifestLoc, registryName); if (semver.validRange(dep.version, config.looseSemver) && !semver.satisfies(pkg.version, dep.version, config.looseSemver)) { reportError('packageWrongVersion', dep.originalKey, dep.version, pkg.version); continue; } - const dependencies = pkg.dependencies; + var dependencies = pkg.dependencies; if (dependencies) { - for (const subdep in dependencies) { - const subDepPath = path.join(manifestLoc, registry.folder, subdep); - let found = false; - const relative = path.relative(registry.cwd, subDepPath); - const locations = path.normalize(relative).split(registry.folder + path.sep).filter(function (dir) { + for (var subdep in dependencies) { + var subDepPath = path.join(manifestLoc, registry.folder, subdep); + var found = false; + var relative = path.relative(registry.cwd, subDepPath); + var locations = path.normalize(relative).split(registry.folder + path.sep).filter(function (dir) { return !!dir; }); locations.pop(); while (locations.length >= 0) { - let possiblePath; + var possiblePath = void 0; if (locations.length > 0) { possiblePath = path.join(registry.cwd, registry.folder, locations.join(path.sep + registry.folder + path.sep)); } else { @@ -57434,11 +59417,11 @@ let verifyTreeCheck = exports.verifyTreeCheck = (() => { return function verifyTreeCheck(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; -})(); +}(); -let integrityHashCheck = (() => { +var integrityHashCheck = function () { var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - let errCount = 0; + var errCount = 0; function reportError(msg) { for (var _len2 = arguments.length, vars = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { vars[_key2 - 1] = arguments[_key2]; @@ -57447,21 +59430,32 @@ let integrityHashCheck = (() => { reporter.error(reporter.lang.apply(reporter, [msg].concat(vars))); errCount++; } - const integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config); + var integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config); - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - const install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); + var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); // get patterns that are installed when running `yarn install` - var _ref3 = yield install.fetchRequestFromCwd(); + var _ref3 = yield install.fetchRequestFromCwd(), + patterns = _ref3.patterns, + workspaceLayout = _ref3.workspaceLayout; + + var match = yield integrityChecker.check(patterns, lockfile.cache, flags, workspaceLayout); + for (var _iterator = match.missingPatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref4; - const patterns = _ref3.patterns, - workspaceLayout = _ref3.workspaceLayout; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } + var pattern = _ref4; - const match = yield integrityChecker.check(patterns, lockfile.cache, flags, workspaceLayout); - for (const pattern of match.missingPatterns) { reportError('lockfileNotContainPattern', pattern); } if (match.integrityFileMissing) { @@ -57482,10 +59476,10 @@ let integrityHashCheck = (() => { return function integrityHashCheck(_x5, _x6, _x7, _x8) { return _ref2.apply(this, arguments); }; -})(); +}(); -let run = exports.run = (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { +var run = exports.run = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { if (flags.verifyTree) { yield verifyTreeCheck(config, reporter, flags, args); return; @@ -57494,14 +59488,17 @@ let run = exports.run = (() => { return; } - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - const install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); + var mainPackageJson = yield config.readJson(path.join(config.cwd, 'package.json')); + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); + var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); function humaniseLocation(loc) { - const relative = path.relative(path.join(config.cwd, 'node_modules'), loc); - const normalized = path.normalize(relative).split(path.sep); - return normalized.filter(p => p !== 'node_modules').reduce((result, part) => { - const length = result.length; + var relative = path.relative(path.join(config.cwd, 'node_modules'), loc); + var normalized = path.normalize(relative).split(path.sep); + return normalized.filter(function (p) { + return p !== 'node_modules'; + }).reduce(function (result, part) { + var length = result.length; if (length && result[length - 1].startsWith('@') && result[length - 1].indexOf(path.sep) === -1) { result[length - 1] += path.sep + part; } else { @@ -57511,8 +59508,8 @@ let run = exports.run = (() => { }, []); } - let warningCount = 0; - let errCount = 0; + var warningCount = 0; + var errCount = 0; function reportError(msg) { for (var _len3 = arguments.length, vars = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { vars[_key3 - 1] = arguments[_key3]; @@ -57524,47 +59521,69 @@ let run = exports.run = (() => { // get patterns that are installed when running `yarn install` - var _ref5 = yield install.hydrate(); + var _ref6 = yield install.hydrate(), + rawPatterns = _ref6.patterns, + workspaceLayout = _ref6.workspaceLayout; - const rawPatterns = _ref5.patterns, - workspaceLayout = _ref5.workspaceLayout; - - const patterns = yield install.flatten(rawPatterns); + var patterns = yield install.flatten(rawPatterns); // check if patterns exist in lockfile - for (const pattern of patterns) { + for (var _iterator2 = patterns, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref7; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref7 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref7 = _i2.value; + } + + var pattern = _ref7; + if (!lockfile.getLocked(pattern) && (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern))) { reportError('lockfileNotContainPattern', pattern); } } - const bundledDeps = {}; + var bundledDeps = {}; // check if any of the node_modules are out of sync - const res = yield install.linker.getFlatHoistedTree(patterns); - for (const _ref6 of res) { - var _ref7 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref6, 2); + var res = yield install.linker.getFlatHoistedTree(patterns); + for (var _iterator3 = res, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref9; - const loc = _ref7[0]; - var _ref7$ = _ref7[1]; - const originalKey = _ref7$.originalKey; - const pkg = _ref7$.pkg; - const ignore = _ref7$.ignore; + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref9 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref9 = _i3.value; + } + + var _ref8 = _ref9; + var loc = _ref8[0]; + var _ref8$ = _ref8[1]; + var _originalKey = _ref8$.originalKey; + var pkg = _ref8$.pkg; + var ignore = _ref8$.ignore; if (ignore) { continue; } - const parts = humaniseLocation(loc); + var parts = humaniseLocation(loc); // grey out hoisted portions of key - let human = originalKey; - const hoistedParts = parts.slice(); - const hoistedKey = parts.join('#'); + var human = _originalKey; + var hoistedParts = parts.slice(); + var hoistedKey = parts.join('#'); if (human !== hoistedKey) { - const humanParts = human.split('#'); + var humanParts = human.split('#'); - for (let i = 0; i < humanParts.length; i++) { - const humanPart = humanParts[i]; + for (var i = 0; i < humanParts.length; i++) { + var humanPart = humanParts[i]; if (hoistedParts[0] === humanPart) { hoistedParts.shift(); @@ -57581,8 +59600,8 @@ let run = exports.run = (() => { } // skip unnecessary checks for linked dependencies - const remoteType = pkg._reference.remote.type; - const isLinkedDepencency = remoteType === 'link' || remoteType === 'workspace' || remoteType === 'file' && config.linkFileDependencies; + var remoteType = pkg._reference.remote.type; + var isLinkedDepencency = remoteType === 'link' || remoteType === 'workspace' || remoteType === 'file' && config.linkFileDependencies; if (isLinkedDepencency) { continue; } @@ -57596,10 +59615,10 @@ let run = exports.run = (() => { continue; } - const pkgLoc = path.join(loc, 'package.json'); + var pkgLoc = path.join(loc, 'package.json'); if (yield (_fs || _load_fs()).exists(pkgLoc)) { - const packageJson = yield config.readJson(pkgLoc); + var packageJson = yield config.readJson(pkgLoc); packageJson.version = semver.clean(packageJson.version); if (pkg.version !== packageJson.version) { @@ -57607,32 +59626,32 @@ let run = exports.run = (() => { reportError('packageWrongVersion', human, pkg.version, packageJson.version); } - const deps = (0, (_assign || _load_assign()).default)({}, packageJson.dependencies, packageJson.peerDependencies); + var deps = (0, (_assign || _load_assign()).default)({}, packageJson.dependencies, packageJson.peerDependencies); bundledDeps[packageJson.name] = packageJson.bundledDependencies || []; - for (const name in deps) { - const range = deps[name]; + for (var _name3 in deps) { + var range = deps[_name3]; if (!semver.validRange(range, config.looseSemver)) { continue; // exotic } - const subHuman = `${human}#${name}@${range}`; + var subHuman = `${human}#${_name3}@${range}`; // find the package that this will resolve to, factoring in hoisting - const possibles = []; - let depLoc; - for (let i = parts.length; i >= 0; i--) { - const myParts = parts.slice(0, i).concat(name); + var possibles = []; + var depLoc = void 0; + for (var _i4 = parts.length; _i4 >= 0; _i4--) { + var myParts = parts.slice(0, _i4).concat(_name3); // build package.json location for this position - const myDepPkgLoc = path.join(config.cwd, 'node_modules', myParts.join(`${path.sep}node_modules${path.sep}`)); + var myDepPkgLoc = path.join(config.cwd, 'node_modules', myParts.join(`${path.sep}node_modules${path.sep}`)); possibles.push(myDepPkgLoc); } while (possibles.length) { - const myDepPkgLoc = possibles.shift(); - if (yield (_fs || _load_fs()).exists(myDepPkgLoc)) { - depLoc = myDepPkgLoc; + var _myDepPkgLoc = possibles.shift(); + if (yield (_fs || _load_fs()).exists(_myDepPkgLoc)) { + depLoc = _myDepPkgLoc; break; } } @@ -57641,33 +59660,59 @@ let run = exports.run = (() => { continue; } - const depPkgLoc = path.join(depLoc, 'package.json'); + var depPkgLoc = path.join(depLoc, 'package.json'); if (yield (_fs || _load_fs()).exists(depPkgLoc)) { - const depPkg = yield config.readJson(depPkgLoc); - const foundHuman = `${humaniseLocation(path.dirname(depPkgLoc)).join('#')}@${depPkg.version}`; + var depPkg = yield config.readJson(depPkgLoc); + var foundHuman = `${humaniseLocation(path.dirname(depPkgLoc)).join('#')}@${depPkg.version}`; if (!semver.satisfies(depPkg.version, range, config.looseSemver)) { // module isn't correct semver - reportError('packageDontSatisfy', subHuman, foundHuman); + var resRange = mainPackageJson.resolutions && mainPackageJson.resolutions[_name3]; + if (resRange) { + var resHuman = `${human}#${_name3}@${resRange}`; + + if (semver.satisfies(depPkg.version, resRange, config.looseSemver)) { + reporter.warn(reporter.lang('incompatibleResolutionVersion', foundHuman, subHuman)); + warningCount++; + } else { + reportError('packageDontSatisfy', resHuman, foundHuman); + } + } else { + reportError('packageDontSatisfy', subHuman, foundHuman); + } + continue; } // check for modules above us that this could be deduped to - for (const loc of possibles) { - const locPkg = path.join(loc, 'package.json'); + for (var _iterator4 = possibles, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref10; + + if (_isArray4) { + if (_i5 >= _iterator4.length) break; + _ref10 = _iterator4[_i5++]; + } else { + _i5 = _iterator4.next(); + if (_i5.done) break; + _ref10 = _i5.value; + } + + var _loc = _ref10; + + var locPkg = path.join(_loc, 'package.json'); if (!(yield (_fs || _load_fs()).exists(locPkg))) { continue; } - const packageJson = yield config.readJson(locPkg); - const packagePath = originalKey.split('#'); - const rootDep = packagePath[0]; - const packageName = packagePath[1] || packageJson.name; + var _packageJson = yield config.readJson(locPkg); + var packagePath = _originalKey.split('#'); + var rootDep = packagePath[0]; + var packageName = packagePath[1] || _packageJson.name; - const bundledDep = bundledDeps[rootDep] && bundledDeps[rootDep].indexOf(packageName) !== -1; - if (!bundledDep && (packageJson.version === depPkg.version || semver.satisfies(packageJson.version, range, config.looseSemver) && semver.gt(packageJson.version, depPkg.version, config.looseSemver))) { - reporter.warn(reporter.lang('couldBeDeduped', subHuman, packageJson.version, `${humaniseLocation(path.dirname(locPkg)).join('#')}@${packageJson.version}`)); + var bundledDep = bundledDeps[rootDep] && bundledDeps[rootDep].indexOf(packageName) !== -1; + if (!bundledDep && (_packageJson.version === depPkg.version || semver.satisfies(_packageJson.version, range, config.looseSemver) && semver.gt(_packageJson.version, depPkg.version, config.looseSemver))) { + reporter.warn(reporter.lang('couldBeDeduped', subHuman, _packageJson.version, `${humaniseLocation(path.dirname(locPkg)).join('#')}@${_packageJson.version}`)); warningCount++; } break; @@ -57689,9 +59734,9 @@ let run = exports.run = (() => { }); return function run(_x9, _x10, _x11, _x12) { - return _ref4.apply(this, arguments); + return _ref5.apply(this, arguments); }; -})(); +}(); exports.hasWrapper = hasWrapper; exports.setFlags = setFlags; @@ -57699,61 +59744,62 @@ exports.setFlags = setFlags; var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _integrityChecker; function _load_integrityChecker() { - return _integrityChecker = _interopRequireDefault(__webpack_require__(141)); + return _integrityChecker = _interopRequireDefault(__webpack_require__(148)); } var _integrityChecker2; function _load_integrityChecker2() { - return _integrityChecker2 = __webpack_require__(141); + return _integrityChecker2 = __webpack_require__(148); } var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(16)); + return _lockfile = _interopRequireDefault(__webpack_require__(20)); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _install; function _load_install() { - return _install = __webpack_require__(27); + return _install = __webpack_require__(33); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const semver = __webpack_require__(19); +var semver = __webpack_require__(21); -const path = __webpack_require__(1); +var path = __webpack_require__(0); -const requireLockfile = exports.requireLockfile = false; -const noArguments = exports.noArguments = true; +var requireLockfile = exports.requireLockfile = false; +var noArguments = exports.noArguments = true; function hasWrapper(commander) { return true; } function setFlags(commander) { + commander.description('Verifies if versions in the current project’s package.json match that of yarn’s lock file.'); commander.option('--integrity'); commander.option('--verify-tree'); } /***/ }), -/* 215 */ +/* 226 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57764,44 +59810,62 @@ Object.defineProperty(exports, "__esModule", { }); exports.run = exports.getRegistryFolder = undefined; +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let getRegistryFolder = exports.getRegistryFolder = (() => { +var getRegistryFolder = exports.getRegistryFolder = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name) { if (config.modulesFolder) { return config.modulesFolder; } - const src = path.join(config.linkFolder, name); - - var _ref2 = yield config.readManifest(src); + var src = path.join(config.linkFolder, name); - const _registry = _ref2._registry; + var _ref2 = yield config.readManifest(src), + _registry = _ref2._registry; invariant(_registry, 'expected registry'); - const registryFolder = config.registries[_registry].folder; + var registryFolder = config.registries[_registry].folder; return path.join(config.cwd, registryFolder); }); return function getRegistryFolder(_x, _x2) { return _ref.apply(this, arguments); }; -})(); +}(); -let run = exports.run = (() => { +var run = exports.run = function () { var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { if (args.length) { - for (const name of args) { - const src = path.join(config.linkFolder, name); + for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref4; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } + + var name = _ref4; + + var src = path.join(config.linkFolder, name); if (yield (_fs || _load_fs()).exists(src)) { - const folder = yield getRegistryFolder(config, name); - const dest = path.join(folder, name); + var folder = yield getRegistryFolder(config, name); + var dest = path.join(folder, name); yield (_fs || _load_fs()).unlink(dest); yield (_fs || _load_fs()).mkdirp(path.dirname(dest)); @@ -57813,15 +59877,15 @@ let run = exports.run = (() => { } } else { // add cwd module to the global registry - const manifest = yield config.readRootManifest(); - const name = manifest.name; - if (!name) { + var manifest = yield config.readRootManifest(); + var _name = manifest.name; + if (!_name) { throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownPackageName')); } - const linkLoc = path.join(config.linkFolder, name); + var linkLoc = path.join(config.linkFolder, _name); if (yield (_fs || _load_fs()).exists(linkLoc)) { - reporter.warn(reporter.lang('linkCollision', name)); + reporter.warn(reporter.lang('linkCollision', _name)); } else { yield (_fs || _load_fs()).mkdirp(path.dirname(linkLoc)); yield (_fs || _load_fs()).symlink(config.cwd, linkLoc); @@ -57829,11 +59893,11 @@ let run = exports.run = (() => { // If there is a `bin` defined in the package.json, // link each bin to the global bin if (manifest.bin) { - const globalBinFolder = yield (0, (_global || _load_global()).getBinFolder)(config, flags); - for (const binName in manifest.bin) { - const binSrc = manifest.bin[binName]; - const binSrcLoc = path.join(linkLoc, binSrc); - const binDestLoc = path.join(globalBinFolder, binName); + var globalBinFolder = yield (0, (_global || _load_global()).getBinFolder)(config, flags); + for (var binName in manifest.bin) { + var binSrc = manifest.bin[binName]; + var binSrcLoc = path.join(linkLoc, binSrc); + var binDestLoc = path.join(globalBinFolder, binName); if (yield (_fs || _load_fs()).exists(binDestLoc)) { reporter.warn(reporter.lang('binLinkCollision', binName)); } else { @@ -57842,8 +59906,8 @@ let run = exports.run = (() => { } } - reporter.success(reporter.lang('linkRegistered', name)); - reporter.info(reporter.lang('linkRegisteredMessage', name)); + reporter.success(reporter.lang('linkRegistered', _name)); + reporter.info(reporter.lang('linkRegisteredMessage', _name)); } } }); @@ -57851,7 +59915,7 @@ let run = exports.run = (() => { return function run(_x3, _x4, _x5, _x6) { return _ref3.apply(this, arguments); }; -})(); +}(); exports.hasWrapper = hasWrapper; exports.setFlags = setFlags; @@ -57859,37 +59923,39 @@ exports.setFlags = setFlags; var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _global; function _load_global() { - return _global = __webpack_require__(78); + return _global = __webpack_require__(83); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); +var invariant = __webpack_require__(9); -const path = __webpack_require__(1); +var path = __webpack_require__(0); function hasWrapper(commander, args) { return true; } -function setFlags(commander) {} +function setFlags(commander) { + commander.description('Symlink a package folder during development.'); +} /***/ }), -/* 216 */ +/* 227 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57903,70 +59969,101 @@ exports.run = exports.buildTree = exports.requireLockfile = undefined; var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); + return _keys = _interopRequireDefault(__webpack_require__(14)); } var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); + return _set = _interopRequireDefault(__webpack_require__(15)); } -var _slicedToArray2; +var _asyncToGenerator2; -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(17)); +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -var _asyncToGenerator2; +var _getIterator2; -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } -let buildTree = exports.buildTree = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (resolver, linker, patterns, opts, onlyFresh, ignoreHoisted) { - const treesByKey = {}; - const trees = []; - const flatTree = yield linker.getFlatHoistedTree(patterns); +var buildTree = exports.buildTree = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (resolver, linker, patterns, opts, onlyFresh, ignoreHoisted) { + var treesByKey = {}; + var trees = []; + var flatTree = yield linker.getFlatHoistedTree(patterns); // If using workspaces, filter out the virtual manifest - const workspaceLayout = resolver.workspaceLayout; - - const hoisted = workspaceLayout && workspaceLayout.virtualManifestName ? flatTree.filter(function (_ref2) { - var _ref3 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref2, 1); + var workspaceLayout = resolver.workspaceLayout; - let key = _ref3[0]; + var hoisted = workspaceLayout && workspaceLayout.virtualManifestName ? flatTree.filter(function (_ref3) { + var key = _ref3[0]; return key.indexOf(workspaceLayout.virtualManifestName) === -1; }) : flatTree; - const hoistedByKey = {}; - for (const _ref4 of hoisted) { - var _ref5 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref4, 2); + var hoistedByKey = {}; + for (var _iterator2 = hoisted, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref5; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref5 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref5 = _i2.value; + } - const key = _ref5[0]; - const info = _ref5[1]; + var _ref4 = _ref5; + var key = _ref4[0]; + var info = _ref4[1]; hoistedByKey[key] = info; } // build initial trees - for (const _ref6 of hoisted) { - var _ref7 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref6, 2); + for (var _iterator3 = hoisted, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref7; - const info = _ref7[1]; + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref7 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref7 = _i3.value; + } - const ref = info.pkg._reference; - const hint = null; - const parent = getParent(info.key, treesByKey); - const children = []; - let depth = 0; - let color = 'bold'; + var _ref6 = _ref7; + var _info = _ref6[1]; + + var ref = _info.pkg._reference; + var hint = null; + var parent = getParent(_info.key, treesByKey); + var children = []; + var depth = 0; + var color = 'bold'; invariant(ref, 'expected reference'); if (onlyFresh) { - let isFresh = false; - for (const pattern of ref.patterns) { + var isFresh = false; + for (var _iterator5 = ref.patterns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref10; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref10 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref10 = _i5.value; + } + + var pattern = _ref10; + if (resolver.isNewPattern(pattern)) { isFresh = true; break; @@ -57977,7 +60074,7 @@ let buildTree = exports.buildTree = (() => { } } - if (info.originalKey !== info.key || opts.reqDepth === 0) { + if (_info.originalKey !== _info.key || opts.reqDepth === 0) { // was hoisted color = null; } @@ -57988,30 +60085,43 @@ let buildTree = exports.buildTree = (() => { depth = 0; } - const topLevel = opts.reqDepth === 0 && !parent; - const showAll = opts.reqDepth === -1; - const nextDepthIsValid = depth + 1 <= Number(opts.reqDepth); + var topLevel = opts.reqDepth === 0 && !parent; + var showAll = opts.reqDepth === -1; + var nextDepthIsValid = depth + 1 <= Number(opts.reqDepth); if (topLevel || nextDepthIsValid || showAll) { - treesByKey[info.key] = { - name: `${info.pkg.name}@${info.pkg.version}`, - children: children, - hint: hint, - color: color, - depth: depth + treesByKey[_info.key] = { + name: `${_info.pkg.name}@${_info.pkg.version}`, + children, + hint, + color, + depth }; } // add in dummy children for hoisted dependencies - const nextChildDepthIsValid = depth + 1 < Number(opts.reqDepth); + var nextChildDepthIsValid = depth + 1 < Number(opts.reqDepth); invariant(ref, 'expected reference'); if (!ignoreHoisted && nextDepthIsValid || showAll) { - for (const pattern of resolver.dedupePatterns(ref.dependencies)) { - const pkg = resolver.getStrictResolvedPattern(pattern); + for (var _iterator6 = resolver.dedupePatterns(ref.dependencies), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref11; - if (!hoistedByKey[`${info.key}#${pkg.name}`] && (nextChildDepthIsValid || showAll)) { + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref11 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref11 = _i6.value; + } + + var _pattern = _ref11; + + var pkg = resolver.getStrictResolvedPattern(_pattern); + + if (!hoistedByKey[`${_info.key}#${pkg.name}`] && (nextChildDepthIsValid || showAll)) { children.push({ - name: pattern, + name: _pattern, color: 'dim', shadow: true }); @@ -58021,18 +60131,28 @@ let buildTree = exports.buildTree = (() => { } // add children - for (const _ref8 of hoisted) { - var _ref9 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref8, 2); + for (var _iterator4 = hoisted, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref9; - const info = _ref9[1]; + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref9 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref9 = _i4.value; + } - const tree = treesByKey[info.key]; - const parent = getParent(info.key, treesByKey); + var _ref8 = _ref9; + var _info2 = _ref8[1]; + + var tree = treesByKey[_info2.key]; + var parent = getParent(_info2.key, treesByKey); if (!tree) { continue; } - if (info.key.split('#').length === 1) { + if (_info2.key.split('#').length === 1) { trees.push(tree); continue; } @@ -58042,35 +60162,34 @@ let buildTree = exports.buildTree = (() => { } } - return { trees: trees, count: buildCount(trees) }; + return { trees, count: buildCount(trees) }; }); return function buildTree(_x, _x2, _x3, _x4, _x5, _x6) { - return _ref.apply(this, arguments); + return _ref2.apply(this, arguments); }; -})(); - -let run = exports.run = (() => { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - const install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); +}(); - var _ref11 = yield install.fetchRequestFromCwd(); +var run = exports.run = function () { + var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); + var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - const depRequests = _ref11.requests, - patterns = _ref11.patterns, - manifest = _ref11.manifest, - workspaceLayout = _ref11.workspaceLayout; + var _ref13 = yield install.fetchRequestFromCwd(), + depRequests = _ref13.requests, + patterns = _ref13.patterns, + manifest = _ref13.manifest, + workspaceLayout = _ref13.workspaceLayout; yield install.resolver.init(depRequests, { isFlat: install.flags.flat, isFrozen: install.flags.frozenLockfile, - workspaceLayout: workspaceLayout + workspaceLayout }); - let activePatterns = []; + var activePatterns = []; if (config.production) { - const devDeps = getDevDeps(manifest); + var devDeps = getDevDeps(manifest); activePatterns = patterns.filter(function (pattern) { return !devDeps.has(pattern); }); @@ -58078,14 +60197,12 @@ let run = exports.run = (() => { activePatterns = patterns; } - const opts = { + var opts = { reqDepth: getReqDepth(flags.depth) }; - var _ref12 = yield buildTree(install.resolver, install.linker, activePatterns, opts); - - let trees = _ref12.trees; - + var _ref14 = yield buildTree(install.resolver, install.linker, activePatterns, opts), + trees = _ref14.trees; if (args.length) { reporter.warn(reporter.lang('deprecatedListArgs')); @@ -58100,9 +60217,9 @@ let run = exports.run = (() => { }); return function run(_x8, _x9, _x10, _x11) { - return _ref10.apply(this, arguments); + return _ref12.apply(this, arguments); }; -})(); +}(); exports.getParent = getParent; exports.hasWrapper = hasWrapper; @@ -58114,31 +60231,44 @@ exports.getDevDeps = getDevDeps; var _install; function _load_install() { - return _install = __webpack_require__(27); + return _install = __webpack_require__(33); } var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(16)); + return _lockfile = _interopRequireDefault(__webpack_require__(20)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); +var invariant = __webpack_require__(9); -const micromatch = __webpack_require__(93); +var micromatch = __webpack_require__(77); -const requireLockfile = exports.requireLockfile = true; +var requireLockfile = exports.requireLockfile = true; function buildCount(trees) { if (!trees || !trees.length) { return 0; } - let count = 0; + var count = 0; + + for (var _iterator = trees, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var tree = _ref; - for (const tree of trees) { if (tree.shadow) { continue; } @@ -58151,7 +60281,7 @@ function buildCount(trees) { } function getParent(key, treesByKey) { - const parentKey = key.split('#').slice(0, -1).join('#'); + var parentKey = key.split('#').slice(0, -1).join('#'); return treesByKey[parentKey]; } @@ -58160,6 +60290,7 @@ function hasWrapper(commander, args) { } function setFlags(commander) { + commander.description('Lists installed packages.'); commander.option('--depth [depth]', 'Limit the depth of the shown dependencies'); commander.option('--pattern [pattern]', 'Filter dependencies by pattern'); } @@ -58169,26 +60300,34 @@ function getReqDepth(inputDepth) { } function filterTree(tree, filters) { - let pattern = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + var pattern = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; if (tree.children) { - tree.children = tree.children.filter(child => filterTree(child, filters, pattern)); + tree.children = tree.children.filter(function (child) { + return filterTree(child, filters, pattern); + }); } - const notDim = tree.color !== 'dim'; - const hasChildren = tree.children == null ? false : tree.children.length > 0; - const name = tree.name.slice(0, tree.name.lastIndexOf('@')); - const found = micromatch.any(name, filters) || micromatch.contains(name, pattern); + var notDim = tree.color !== 'dim'; + var hasChildren = tree.children == null ? false : tree.children.length > 0; + var name = tree.name.slice(0, tree.name.lastIndexOf('@')); + var found = micromatch.any(name, filters) || micromatch.contains(name, pattern); return notDim && (found || hasChildren); } function getDevDeps(manifest) { - return new (_set || _load_set()).default((0, (_keys || _load_keys()).default)(manifest.devDependencies).map(key => `${key}@${manifest.devDependencies[key]}`)); + if (manifest.devDependencies) { + return new (_set || _load_set()).default((0, (_keys || _load_keys()).default)(manifest.devDependencies).map(function (key) { + return `${key}@${manifest.devDependencies[key]}`; + })); + } else { + return new (_set || _load_set()).default(); + } } /***/ }), -/* 217 */ +/* 228 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58199,64 +60338,103 @@ Object.defineProperty(exports, "__esModule", { }); exports.run = exports.requireLockfile = undefined; -var _extends2; +var _keys; -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); } -var _slicedToArray2; +var _getIterator2; -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(17)); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } -var _keys; +var _extends2; -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(25)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let run = exports.run = (() => { +var run = exports.run = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { if (!args.length) { throw new (_errors || _load_errors()).MessageError(reporter.lang('tooFewArguments', 1)); } - const totalSteps = args.length + 1; - let step = 0; + var totalSteps = args.length + 1; + var step = 0; // load manifests - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder); - const rootManifests = yield config.getRootManifests(); - const manifests = []; + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder); + var rootManifests = yield config.getRootManifests(); + var manifests = []; + + for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var name = _ref2; - for (const name of args) { reporter.step(++step, totalSteps, `Removing module ${name}`); - let found = false; + var found = false; + + for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref3; + + if (_isArray2) { + if (_i3 >= _iterator2.length) break; + _ref3 = _iterator2[_i3++]; + } else { + _i3 = _iterator2.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var registryName = _ref3; - for (const registryName of (0, (_keys || _load_keys()).default)((_index || _load_index()).registries)) { - const registry = config.registries[registryName]; - const object = rootManifests[registryName].object; + var registry = config.registries[registryName]; + var object = rootManifests[registryName].object; - for (const type of (_constants || _load_constants()).DEPENDENCY_TYPES) { - const deps = object[type]; + for (var _iterator3 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref4; + + if (_isArray3) { + if (_i4 >= _iterator3.length) break; + _ref4 = _iterator3[_i4++]; + } else { + _i4 = _iterator3.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var type = _ref4; + + var deps = object[type]; if (deps && deps[name]) { found = true; delete deps[name]; } } - const possibleManifestLoc = path.join(config.cwd, registry.folder, name); + var possibleManifestLoc = path.join(config.cwd, registry.folder, name); if (yield (_fs || _load_fs()).exists(possibleManifestLoc)) { - const manifest = yield config.maybeReadManifest(possibleManifestLoc, registryName); + var manifest = yield config.maybeReadManifest(possibleManifestLoc, registryName); if (manifest) { manifests.push([possibleManifestLoc, manifest]); } @@ -58272,11 +60450,23 @@ let run = exports.run = (() => { yield config.saveRootManifests(rootManifests); // run hooks - npm runs these one after another - for (const action of ['preuninstall', 'uninstall', 'postuninstall']) { - for (const _ref2 of manifests) { - var _ref3 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref2, 1); + var _arr = ['preuninstall', 'uninstall', 'postuninstall']; + for (var _i2 = 0; _i2 < _arr.length; _i2++) { + var action = _arr[_i2]; + for (var _iterator4 = manifests, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref6; + + if (_isArray4) { + if (_i5 >= _iterator4.length) break; + _ref6 = _iterator4[_i5++]; + } else { + _i5 = _iterator4.next(); + if (_i5.done) break; + _ref6 = _i5.value; + } - const loc = _ref3[0]; + var _ref5 = _ref6; + var loc = _ref5[0]; yield config.executeLifecycleScript(action, loc); } @@ -58284,8 +60474,8 @@ let run = exports.run = (() => { // reinstall so we can get the updated lockfile reporter.step(++step, totalSteps, reporter.lang('uninstallRegenerate')); - const installFlags = (0, (_extends2 || _load_extends()).default)({ force: true, workspaceRootIsCwd: true }, flags); - const reinstall = new (_install || _load_install()).Install(installFlags, config, new (_index2 || _load_index2()).NoopReporter(), lockfile); + var installFlags = (0, (_extends2 || _load_extends()).default)({ force: true, workspaceRootIsCwd: true }, flags); + var reinstall = new (_install || _load_install()).Install(installFlags, config, new (_index2 || _load_index2()).NoopReporter(), lockfile); yield reinstall.init(); // @@ -58295,7 +60485,7 @@ let run = exports.run = (() => { return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; -})(); +}(); exports.setFlags = setFlags; exports.hasWrapper = hasWrapper; @@ -58303,61 +60493,63 @@ exports.hasWrapper = hasWrapper; var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(16)); + return _lockfile = _interopRequireDefault(__webpack_require__(20)); } var _index; function _load_index() { - return _index = __webpack_require__(37); + return _index = __webpack_require__(40); } var _install; function _load_install() { - return _install = __webpack_require__(27); + return _install = __webpack_require__(33); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _index2; function _load_index2() { - return _index2 = __webpack_require__(136); + return _index2 = __webpack_require__(144); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const path = __webpack_require__(1); +var path = __webpack_require__(0); -const requireLockfile = exports.requireLockfile = true; +var requireLockfile = exports.requireLockfile = true; -function setFlags(commander) {} +function setFlags(commander) { + commander.description('Removes a package from your direct dependencies updating your package.json and yarn.lock.'); +} function hasWrapper(commander, args) { return true; } /***/ }), -/* 218 */ +/* 229 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58366,20 +60558,20 @@ function hasWrapper(commander, args) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.examples = exports.hasWrapper = exports.setFlags = exports.run = exports.getName = undefined; +exports.examples = exports.hasWrapper = exports.run = exports.getName = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let getName = exports.getName = (() => { +var getName = exports.getName = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (args, config) { - let name = args.shift(); + var name = args.shift(); if (!name) { - const pkg = yield config.readRootManifest(); + var pkg = yield config.readRootManifest(); name = pkg.name; } @@ -58397,22 +60589,22 @@ let getName = exports.getName = (() => { return function getName(_x, _x2) { return _ref.apply(this, arguments); }; -})(); +}(); -let _list = (() => { +var list = function () { var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const name = yield getName(args, config); + var name = yield getName(args, config); reporter.step(1, 3, reporter.lang('loggingIn')); - const revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); + var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); reporter.step(2, 3, reporter.lang('gettingTags')); - const tags = yield config.registries.npm.request(`-/package/${name}/dist-tags`); + var tags = yield config.registries.npm.request(`-/package/${name}/dist-tags`); if (tags) { reporter.info(`Package ${name}`); - for (const name in tags) { - reporter.info(`${name}: ${tags[name]}`); + for (var _name in tags) { + reporter.info(`${_name}: ${tags[_name]}`); } } @@ -58424,25 +60616,25 @@ let _list = (() => { } }); - return function _list(_x3, _x4, _x5, _x6) { + return function list(_x3, _x4, _x5, _x6) { return _ref2.apply(this, arguments); }; -})(); +}(); -let _remove = (() => { +var remove = function () { var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { if (args.length !== 2) { return false; } - const name = yield getName(args, config); - const tag = args.shift(); + var name = yield getName(args, config); + var tag = args.shift(); reporter.step(1, 3, reporter.lang('loggingIn')); - const revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); + var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); reporter.step(2, 3, reporter.lang('deletingTags')); - const result = yield config.registries.npm.request(`-/package/${name}/dist-tags/${encodeURI(tag)}`, { + var result = yield config.registries.npm.request(`-/package/${name}/dist-tags/${encodeURI(tag)}`, { method: 'DELETE' }); @@ -58462,61 +60654,66 @@ let _remove = (() => { } }); - return function _remove(_x7, _x8, _x9, _x10) { + return function remove(_x7, _x8, _x9, _x10) { return _ref3.apply(this, arguments); }; -})(); +}(); + +exports.setFlags = setFlags; var _buildSubCommands2; function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(47)); + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(46)); } var _login; function _load_login() { - return _login = __webpack_require__(79); + return _login = __webpack_require__(84); } var _npmRegistry; function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(48)); + return _npmRegistry = _interopRequireDefault(__webpack_require__(53)); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _normalizePattern2; function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(39); + return _normalizePattern2 = __webpack_require__(42); } var _validate; function _load_validate() { - return _validate = __webpack_require__(84); + return _validate = __webpack_require__(90); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function setFlags(commander) { + commander.description('Add, remove, or list tags on a package.'); +} + var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('tag', { - add: (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + add(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { if (args.length !== 2) { return false; } - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(args.shift()); - - const name = _normalizePattern.name, - range = _normalizePattern.range, - hasVersion = _normalizePattern.hasVersion; + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(args.shift()), + name = _normalizePattern.name, + range = _normalizePattern.range, + hasVersion = _normalizePattern.hasVersion; if (!hasVersion) { throw new (_errors || _load_errors()).MessageError(reporter.lang('requiredVersionInRange')); @@ -58525,13 +60722,13 @@ var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).def throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName')); } - const tag = args.shift(); + var tag = args.shift(); reporter.step(1, 3, reporter.lang('loggingIn')); - const revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); + var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); reporter.step(2, 3, reporter.lang('creatingTag', tag, range)); - const result = yield config.registries.npm.request(`-/package/${(_npmRegistry || _load_npmRegistry()).default.escapeName(name)}/dist-tags/${encodeURI(tag)}`, { + var result = yield config.registries.npm.request(`-/package/${(_npmRegistry || _load_npmRegistry()).default.escapeName(name)}/dist-tags/${encodeURI(tag)}`, { method: 'PUT', body: range }); @@ -58550,73 +60747,45 @@ var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).def } else { throw new Error(); } - }); - - function add(_x11, _x12, _x13, _x14) { - return _ref4.apply(this, arguments); - } + })(); + }, - return add; - })(), - rm: (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + rm(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { reporter.warn(`\`yarn tag rm\` is deprecated. Please use \`yarn tag remove\`.`); - yield _remove(config, reporter, flags, args); - }); - - function rm(_x15, _x16, _x17, _x18) { - return _ref5.apply(this, arguments); - } - - return rm; - })(), - remove: (() => { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - yield _remove(config, reporter, flags, args); - }); + yield remove(config, reporter, flags, args); + })(); + }, - function remove(_x19, _x20, _x21, _x22) { - return _ref6.apply(this, arguments); - } + remove(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield remove(config, reporter, flags, args); + })(); + }, - return remove; - })(), - ls: (() => { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + ls(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { reporter.warn(`\`yarn tag ls\` is deprecated. Please use \`yarn tag list\`.`); - yield _list(config, reporter, flags, args); - }); - - function ls(_x23, _x24, _x25, _x26) { - return _ref7.apply(this, arguments); - } - - return ls; - })(), - list: (() => { - var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - yield _list(config, reporter, flags, args); - }); - - function list(_x27, _x28, _x29, _x30) { - return _ref8.apply(this, arguments); - } + yield list(config, reporter, flags, args); + })(); + }, - return list; - })() -}, ['add @ []', 'remove ', 'list []']); + list(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield list(config, reporter, flags, args); + })(); + } +}, ['add @ []', 'remove ', 'list []']), + run = _buildSubCommands.run, + hasWrapper = _buildSubCommands.hasWrapper, + examples = _buildSubCommands.examples; -const run = _buildSubCommands.run, - setFlags = _buildSubCommands.setFlags, - hasWrapper = _buildSubCommands.hasWrapper, - examples = _buildSubCommands.examples; exports.run = run; -exports.setFlags = setFlags; exports.hasWrapper = hasWrapper; exports.examples = examples; /***/ }), -/* 219 */ +/* 230 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58630,42 +60799,48 @@ exports.run = exports.requireLockfile = undefined; var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _keys; function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(10)); + return _keys = _interopRequireDefault(__webpack_require__(14)); } var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); + return _extends2 = _interopRequireDefault(__webpack_require__(25)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let run = exports.run = (() => { +var run = exports.run = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const outdatedFieldName = flags.latest ? 'latest' : 'wanted'; - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder); + var outdatedFieldName = flags.latest ? 'latest' : 'wanted'; + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder); - const deps = yield (0, (_upgrade || _load_upgrade()).getOutdated)(config, reporter, (0, (_extends2 || _load_extends()).default)({}, flags, { includeWorkspaceDeps: true }), lockfile, args); + var deps = yield (0, (_upgrade || _load_upgrade()).getOutdated)(config, reporter, (0, (_extends2 || _load_extends()).default)({}, flags, { includeWorkspaceDeps: true }), lockfile, args); if (deps.length === 0) { reporter.success(reporter.lang('allDependenciesUpToDate')); return; } - const usesWorkspaces = !!config.workspaceRootFolder; + var usesWorkspaces = !!config.workspaceRootFolder; - const maxLengthArr = { + var maxLengthArr = { name: 'name'.length, current: 'from'.length, range: 'latest'.length, @@ -58673,7 +60848,7 @@ let run = exports.run = (() => { workspaceName: 'workspace'.length }; - const keysWithDynamicLength = ['name', 'current', outdatedFieldName]; + var keysWithDynamicLength = ['name', 'current', outdatedFieldName]; if (!flags.latest) { maxLengthArr.range = 'range'.length; @@ -58691,86 +60866,86 @@ let run = exports.run = (() => { }); // Depends on maxLengthArr - const addPadding = function addPadding(dep) { + var addPadding = function addPadding(dep) { return function (key) { return `${dep[key]}${' '.repeat(maxLengthArr[key] - dep[key].length)}`; }; }; - const headerPadding = function headerPadding(header, key) { + var headerPadding = function headerPadding(header, key) { return `${reporter.format.bold.underline(header)}${' '.repeat(maxLengthArr[key] - header.length)}`; }; - const colorizeName = function colorizeName(from, to) { + var colorizeName = function colorizeName(from, to) { return reporter.format[(0, (_colorForVersions || _load_colorForVersions()).default)(from, to)]; }; - const getNameFromHint = function getNameFromHint(hint) { + var getNameFromHint = function getNameFromHint(hint) { return hint ? `${hint}Dependencies` : 'dependencies'; }; - const makeRow = function makeRow(dep) { - const padding = addPadding(dep); - const name = colorizeName(dep.current, dep[outdatedFieldName])(padding('name')); - const current = reporter.format.blue(padding('current')); - const latest = (0, (_colorizeDiff || _load_colorizeDiff()).default)(dep.current, padding(outdatedFieldName), reporter); - const url = reporter.format.cyan(dep.url); - const range = reporter.format.blue(flags.latest ? 'latest' : padding('range')); + var makeRow = function makeRow(dep) { + var padding = addPadding(dep); + var name = colorizeName(dep.current, dep[outdatedFieldName])(padding('name')); + var current = reporter.format.blue(padding('current')); + var latest = (0, (_colorizeDiff || _load_colorizeDiff()).default)(dep.current, padding(outdatedFieldName), reporter); + var url = reporter.format.cyan(dep.url); + var range = reporter.format.blue(flags.latest ? 'latest' : padding('range')); if (usesWorkspaces) { - const workspace = padding('workspaceName'); + var workspace = padding('workspaceName'); return `${name} ${range} ${current} ❯ ${latest} ${workspace} ${url}`; } else { return `${name} ${range} ${current} ❯ ${latest} ${url}`; } }; - const makeHeaderRow = function makeHeaderRow() { - const name = headerPadding('name', 'name'); - const range = headerPadding('range', 'range'); - const from = headerPadding('from', 'current'); - const to = headerPadding('to', outdatedFieldName); - const url = reporter.format.bold.underline('url'); + var makeHeaderRow = function makeHeaderRow() { + var name = headerPadding('name', 'name'); + var range = headerPadding('range', 'range'); + var from = headerPadding('from', 'current'); + var to = headerPadding('to', outdatedFieldName); + var url = reporter.format.bold.underline('url'); if (usesWorkspaces) { - const workspace = headerPadding('workspace', 'workspaceName'); + var workspace = headerPadding('workspace', 'workspaceName'); return ` ${name} ${range} ${from} ${to} ${workspace} ${url}`; } else { return ` ${name} ${range} ${from} ${to} ${url}`; } }; - const groupedDeps = deps.reduce(function (acc, dep) { - const hint = dep.hint, - name = dep.name, - upgradeTo = dep.upgradeTo; + var groupedDeps = deps.reduce(function (acc, dep) { + var hint = dep.hint, + name = dep.name, + upgradeTo = dep.upgradeTo; - const version = dep[outdatedFieldName]; - const key = getNameFromHint(hint); - const xs = acc[key] || []; + var version = dep[outdatedFieldName]; + var key = getNameFromHint(hint); + var xs = acc[key] || []; acc[key] = xs.concat({ name: makeRow(dep), value: dep, short: `${name}@${version}`, - upgradeTo: upgradeTo + upgradeTo }); return acc; }, {}); - const flatten = function flatten(xs) { + var flatten = function flatten(xs) { return xs.reduce(function (ys, y) { return ys.concat(Array.isArray(y) ? flatten(y) : y); }, []); }; - const choices = flatten((0, (_keys || _load_keys()).default)(groupedDeps).map(function (key) { + var choices = flatten((0, (_keys || _load_keys()).default)(groupedDeps).map(function (key) { return [new (_inquirer || _load_inquirer()).default.Separator(reporter.format.bold.underline.green(key)), new (_inquirer || _load_inquirer()).default.Separator(makeHeaderRow()), groupedDeps[key], new (_inquirer || _load_inquirer()).default.Separator(' ')]; })); try { - const red = reporter.format.red(''); - const yellow = reporter.format.yellow(''); - const green = reporter.format.green(''); + var red = reporter.format.red(''); + var yellow = reporter.format.yellow(''); + var green = reporter.format.green(''); reporter.info(reporter.lang('legendColorsForVersionUpdates', red, yellow, green)); - const answers = yield reporter.prompt('Choose which packages to update.', choices, { + var answers = yield reporter.prompt('Choose which packages to update.', choices, { name: 'packages', type: 'checkbox', validate: function validate(answer) { @@ -58778,18 +60953,20 @@ let run = exports.run = (() => { } }); - const getPattern = function getPattern(_ref2) { - let upgradeTo = _ref2.upgradeTo; + var getPattern = function getPattern(_ref2) { + var upgradeTo = _ref2.upgradeTo; return upgradeTo; }; - const isHint = function isHint(x) { + var isHint = function isHint(x) { return function (_ref3) { - let hint = _ref3.hint; + var hint = _ref3.hint; return hint === x; }; }; - for (const hint of [null, 'dev', 'optional', 'peer']) { + var _arr = [null, 'dev', 'optional', 'peer']; + for (var _i = 0; _i < _arr.length; _i++) { + var hint = _arr[_i]; // Reset dependency flags flags.dev = hint === 'dev'; flags.peer = hint === 'peer'; @@ -58797,28 +60974,44 @@ let run = exports.run = (() => { flags.ignoreWorkspaceRootCheck = true; flags.includeWorkspaceDeps = false; flags.workspaceRootIsCwd = false; - const deps = answers.filter(isHint(hint)); - if (deps.length) { - const install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); + var _deps = answers.filter(isHint(hint)); + if (_deps.length) { + var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - var _ref4 = yield install.fetchRequestFromCwd(); + var _ref4 = yield install.fetchRequestFromCwd(), + packagePatterns = _ref4.requests; - const packagePatterns = _ref4.requests; + var depsByWorkspace = _deps.reduce(function (acc, dep) { + var workspaceLoc = dep.workspaceLoc; - const depsByWorkspace = deps.reduce(function (acc, dep) { - const workspaceLoc = dep.workspaceLoc; - - const xs = acc[workspaceLoc] || []; + var xs = acc[workspaceLoc] || []; acc[workspaceLoc] = xs.concat(dep); return acc; }, {}); - for (const loc of (0, (_keys || _load_keys()).default)(depsByWorkspace)) { - const patterns = depsByWorkspace[loc].map(getPattern); - (0, (_upgrade || _load_upgrade()).cleanLockfile)(lockfile, deps, packagePatterns, reporter); + var cwd = config.cwd; + for (var _iterator = (0, (_keys || _load_keys()).default)(depsByWorkspace), _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref5; + + if (_isArray) { + if (_i2 >= _iterator.length) break; + _ref5 = _iterator[_i2++]; + } else { + _i2 = _iterator.next(); + if (_i2.done) break; + _ref5 = _i2.value; + } + + var loc = _ref5; + + var patterns = depsByWorkspace[loc].map(getPattern); + (0, (_upgrade || _load_upgrade()).cleanLockfile)(lockfile, _deps, packagePatterns, reporter); reporter.info(reporter.lang('updateInstalling', getNameFromHint(hint))); - config.cwd = path.resolve(path.dirname(loc)); - const add = new (_add || _load_add()).Add(patterns, flags, config, reporter, lockfile); + if (loc !== '') { + config.cwd = path.resolve(path.dirname(loc)); + } + var add = new (_add || _load_add()).Add(patterns, flags, config, reporter, lockfile); yield add.init(); + config.cwd = cwd; } } } @@ -58830,7 +61023,7 @@ let run = exports.run = (() => { return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; -})(); +}(); exports.setFlags = setFlags; exports.hasWrapper = hasWrapper; @@ -58838,52 +61031,53 @@ exports.hasWrapper = hasWrapper; var _inquirer; function _load_inquirer() { - return _inquirer = _interopRequireDefault(__webpack_require__(172)); + return _inquirer = _interopRequireDefault(__webpack_require__(184)); } var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(16)); + return _lockfile = _interopRequireDefault(__webpack_require__(20)); } var _add; function _load_add() { - return _add = __webpack_require__(100); + return _add = __webpack_require__(107); } var _upgrade; function _load_upgrade() { - return _upgrade = __webpack_require__(140); + return _upgrade = __webpack_require__(147); } var _colorForVersions; function _load_colorForVersions() { - return _colorForVersions = _interopRequireDefault(__webpack_require__(232)); + return _colorForVersions = _interopRequireDefault(__webpack_require__(243)); } var _colorizeDiff; function _load_colorizeDiff() { - return _colorizeDiff = _interopRequireDefault(__webpack_require__(233)); + return _colorizeDiff = _interopRequireDefault(__webpack_require__(244)); } var _install; function _load_install() { - return _install = __webpack_require__(27); + return _install = __webpack_require__(33); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const path = __webpack_require__(1); +var path = __webpack_require__(0); -const requireLockfile = exports.requireLockfile = true; +var requireLockfile = exports.requireLockfile = true; function setFlags(commander) { + commander.description('Provides an easy way to update outdated packages.'); commander.usage('upgrade-interactive [flags]'); commander.option('-S, --scope ', 'upgrade packages under the specified scope'); commander.option('--latest', 'list the latest version of packages, ignoring version ranges in package.json'); @@ -58897,7 +61091,7 @@ function hasWrapper(commander, args) { } /***/ }), -/* 220 */ +/* 231 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58908,30 +61102,36 @@ Object.defineProperty(exports, "__esModule", { }); exports.run = exports.setVersion = undefined; +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + var _assign; function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); + return _assign = _interopRequireDefault(__webpack_require__(17)); } var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let setVersion = exports.setVersion = (() => { +var setVersion = exports.setVersion = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args, required) { - const pkg = yield config.readRootManifest(); - const pkgLoc = pkg._loc; - const scripts = (0, (_map || _load_map()).default)(); - let newVersion = flags.newVersion; + var pkg = yield config.readRootManifest(); + var pkgLoc = pkg._loc; + var scripts = (0, (_map || _load_map()).default)(); + var newVersion = flags.newVersion; invariant(pkgLoc, 'expected package location'); if (args.length && !newVersion) { @@ -58952,7 +61152,7 @@ let setVersion = exports.setVersion = (() => { } // get old version - let oldVersion = pkg.version; + var oldVersion = pkg.version; if (oldVersion) { reporter.info(`${reporter.lang('currentVersion')}: ${oldVersion}`); } else { @@ -58966,9 +61166,15 @@ let setVersion = exports.setVersion = (() => { // wasn't passed a version arg so ask interactively while (!newVersion) { + // make sure we're not running in non-interactive mode before asking for new version + if (flags.nonInteractive || config.nonInteractive) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('nonInteractiveNoVersionSpecified')); + } + newVersion = yield reporter.question(reporter.lang('newVersion')); if (!required && !newVersion) { + reporter.info(`${reporter.lang('noVersionOnPublish')}: ${oldVersion}`); return function () { return (_promise || _load_promise()).default.resolve(); }; @@ -58999,15 +61205,30 @@ let setVersion = exports.setVersion = (() => { pkg.version = newVersion; // update versions in manifests - const manifests = yield config.getRootManifests(); - for (const registryName of (_index || _load_index()).registryNames) { - const manifest = manifests[registryName]; + var manifests = yield config.getRootManifests(); + for (var _iterator = (_index || _load_index()).registryNames, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var registryName = _ref2; + + var manifest = manifests[registryName]; if (manifest.exists) { manifest.object.version = newVersion; } } yield config.saveRootManifests(manifests); + yield runLifecycle('version'); + // check if committing the new version to git is overriden if (!flags.gitTagVersion || !config.getOption('version-git-tag')) { // Don't tag the version in Git @@ -59020,8 +61241,8 @@ let setVersion = exports.setVersion = (() => { invariant(newVersion, 'expected version'); // add git commit and tag - let isGit = false; - const parts = config.cwd.split(path.sep); + var isGit = false; + var parts = config.cwd.split(path.sep); while (parts.length) { isGit = yield (_fs || _load_fs()).exists(path.join(parts.join(path.sep), '.git')); if (isGit) { @@ -59031,15 +61252,13 @@ let setVersion = exports.setVersion = (() => { } } - yield runLifecycle('version'); - if (isGit) { - const message = (flags.message || String(config.getOption('version-git-message'))).replace(/%s/g, newVersion); - const sign = Boolean(config.getOption('version-sign-git-tag')); - const flag = sign ? '-sm' : '-am'; - const prefix = String(config.getOption('version-tag-prefix')); + var message = (flags.message || String(config.getOption('version-git-message'))).replace(/%s/g, newVersion); + var sign = Boolean(config.getOption('version-sign-git-tag')); + var flag = sign ? '-sm' : '-am'; + var prefix = String(config.getOption('version-tag-prefix')); - const gitRoot = (yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['rev-parse', '--show-toplevel'], { cwd: config.cwd })).trim(); + var gitRoot = (yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['rev-parse', '--show-toplevel'], { cwd: config.cwd })).trim(); // add manifest yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['add', path.relative(gitRoot, pkgLoc)], { cwd: gitRoot }); @@ -59058,18 +61277,18 @@ let setVersion = exports.setVersion = (() => { return function setVersion(_x, _x2, _x3, _x4, _x5) { return _ref.apply(this, arguments); }; -})(); +}(); -let run = exports.run = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const commit = yield setVersion(config, reporter, flags, args, true); +var run = exports.run = function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var commit = yield setVersion(config, reporter, flags, args, true); yield commit(); }); return function run(_x6, _x7, _x8, _x9) { - return _ref3.apply(this, arguments); + return _ref4.apply(this, arguments); }; -})(); +}(); exports.setFlags = setFlags; exports.hasWrapper = hasWrapper; @@ -59077,53 +61296,54 @@ exports.hasWrapper = hasWrapper; var _index; function _load_index() { - return _index = __webpack_require__(37); + return _index = __webpack_require__(40); } var _executeLifecycleScript; function _load_executeLifecycleScript() { - return _executeLifecycleScript = __webpack_require__(83); + return _executeLifecycleScript = __webpack_require__(89); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _gitSpawn; function _load_gitSpawn() { - return _gitSpawn = __webpack_require__(235); + return _gitSpawn = __webpack_require__(246); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); + return _map = _interopRequireDefault(__webpack_require__(34)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); -const semver = __webpack_require__(19); -const path = __webpack_require__(1); +var invariant = __webpack_require__(9); +var semver = __webpack_require__(21); +var path = __webpack_require__(0); -const NEW_VERSION_FLAG = '--new-version [version]'; +var NEW_VERSION_FLAG = '--new-version [version]'; function isValidNewVersion(oldVersion, newVersion, looseSemver) { return !!(semver.valid(newVersion, looseSemver) || semver.inc(oldVersion, newVersion, looseSemver)); } function setFlags(commander) { + commander.description('Update the version of your package via the command line.'); commander.option(NEW_VERSION_FLAG, 'new version'); commander.option('--message [message]', 'message'); commander.option('--no-git-tag-version', 'no git tag version'); @@ -59134,7 +61354,7 @@ function hasWrapper(commander, args) { } /***/ }), -/* 221 */ +/* 232 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59148,77 +61368,102 @@ exports.LocalTarballFetcher = undefined; var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); } var _http; function _load_http() { - return _http = _interopRequireDefault(__webpack_require__(45)); + return _http = _interopRequireDefault(__webpack_require__(51)); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _crypto; function _load_crypto() { - return _crypto = _interopRequireWildcard(__webpack_require__(103)); + return _crypto = _interopRequireWildcard(__webpack_require__(88)); } var _baseFetcher; function _load_baseFetcher() { - return _baseFetcher = _interopRequireDefault(__webpack_require__(101)); + return _baseFetcher = _interopRequireDefault(__webpack_require__(109)); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _misc; function _load_misc() { - return _misc = __webpack_require__(15); + return _misc = __webpack_require__(19); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const path = __webpack_require__(1); +var path = __webpack_require__(0); -const tarFs = __webpack_require__(130); -const url = __webpack_require__(14); -const fs = __webpack_require__(8); -const stream = __webpack_require__(25); -const gunzip = __webpack_require__(534); -const invariant = __webpack_require__(6); +var tarFs = __webpack_require__(138); +var url = __webpack_require__(18); +var fs = __webpack_require__(10); +var stream = __webpack_require__(29); +var gunzip = __webpack_require__(556); +var invariant = __webpack_require__(9); -class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { - setupMirrorFromCache() { - var _this = this; +var RE_URL_NAME_MATCH = /\/(?:(@[^/]+)\/)?[^/]+\/-\/(?:@[^/]+\/)?([^/]+)$/; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const tarballMirrorPath = _this.getTarballMirrorPath(); - const tarballCachePath = _this.getTarballCachePath(); +var TarballFetcher = function (_BaseFetcher) { + (0, (_inherits2 || _load_inherits()).default)(TarballFetcher, _BaseFetcher); + + function TarballFetcher() { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, TarballFetcher); + return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseFetcher.apply(this, arguments)); + } + + TarballFetcher.prototype.setupMirrorFromCache = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var tarballMirrorPath = this.getTarballMirrorPath(); + var tarballCachePath = this.getTarballCachePath(); if (tarballMirrorPath == null) { return; @@ -59227,132 +61472,157 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { if (!(yield (_fs || _load_fs()).exists(tarballMirrorPath)) && (yield (_fs || _load_fs()).exists(tarballCachePath))) { // The tarball doesn't exists in the offline cache but does in the cache; we import it to the mirror yield (_fs || _load_fs()).mkdirp(path.dirname(tarballMirrorPath)); - yield (_fs || _load_fs()).copy(tarballCachePath, tarballMirrorPath, _this.reporter); + yield (_fs || _load_fs()).copy(tarballCachePath, tarballMirrorPath, this.reporter); } - })(); - } + }); - getTarballCachePath() { - return path.join(this.dest, (_constants || _load_constants()).TARBALL_FILENAME); - } + function setupMirrorFromCache() { + return _ref.apply(this, arguments); + } - getTarballMirrorPath() { - var _url$parse = url.parse(this.reference); + return setupMirrorFromCache; + }(); - const pathname = _url$parse.pathname; + TarballFetcher.prototype.getTarballCachePath = function getTarballCachePath() { + return path.join(this.dest, (_constants || _load_constants()).TARBALL_FILENAME); + }; + TarballFetcher.prototype.getTarballMirrorPath = function getTarballMirrorPath() { + var _url$parse = url.parse(this.reference), + pathname = _url$parse.pathname; if (pathname == null) { return null; } - // handle scoped packages - const pathParts = pathname.replace(/^\//, '').split(/\//g); + var match = pathname.match(RE_URL_NAME_MATCH); + + var packageFilename = void 0; + if (match) { + var scope = match[1], + tarballBasename = match[2]; - const packageFilename = pathParts.length >= 2 && pathParts[0][0] === '@' ? `${pathParts[0]}-${pathParts[pathParts.length - 1]}` // scopped - : `${pathParts[pathParts.length - 1]}`; + packageFilename = scope ? `${scope}-${tarballBasename}` : tarballBasename; + } else { + // fallback to base name + packageFilename = path.basename(pathname); + } return this.config.getOfflineMirrorPath(packageFilename); - } + }; + + TarballFetcher.prototype.createExtractor = function createExtractor(resolve, reject, tarballPath) { + var _this2 = this; - createExtractor(resolve, reject, tarballPath) { - const validateStream = new (_crypto || _load_crypto()).HashStream(); - const extractorStream = gunzip(); - const untarStream = tarFs.extract(this.dest, { + var validateStream = new (_crypto || _load_crypto()).HashStream(); + var extractorStream = gunzip(); + var untarStream = tarFs.extract(this.dest, { strip: 1, dmode: 0o755, // all dirs should be readable fmode: 0o644, // all files should be readable - chown: false }); + chown: false // don't chown. just leave as it is + }); - extractorStream.pipe(untarStream).on('error', error => { + extractorStream.pipe(untarStream).on('error', function (error) { error.message = `${error.message}${tarballPath ? ` (${tarballPath})` : ''}`; reject(error); - }).on('finish', () => { - const expectHash = this.hash; - const actualHash = validateStream.getHash(); + }).on('finish', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var expectHash = _this2.hash; + var actualHash = validateStream.getHash(); if (!expectHash || expectHash === actualHash) { resolve({ hash: actualHash }); + } else if (_this2.config.updateChecksums) { + // checksums differ and should be updated + // update hash, destination and cached package + var destUpdatedHash = _this2.dest.replace(_this2.hash || '', actualHash); + yield (_fs || _load_fs()).unlink(destUpdatedHash); + yield (_fs || _load_fs()).rename(_this2.dest, destUpdatedHash); + _this2.dest = _this2.dest.replace(_this2.hash || '', actualHash); + _this2.hash = actualHash; + resolve({ + hash: actualHash + }); } else { - reject(new (_errors || _load_errors()).SecurityError(this.config.reporter.lang('fetchBadHashWithPath', this.packageName, this.remote.reference, actualHash, expectHash))); + reject(new (_errors || _load_errors()).SecurityError(_this2.config.reporter.lang('fetchBadHashWithPath', _this2.packageName, _this2.remote.reference, actualHash, expectHash))); } - }); + })); - return { validateStream: validateStream, extractorStream: extractorStream }; - } + return { validateStream, extractorStream }; + }; - *getLocalPaths(override) { + TarballFetcher.prototype.getLocalPaths = function* getLocalPaths(override) { if (override) { yield path.resolve(this.config.cwd, override); } yield this.getTarballMirrorPath(); yield this.getTarballCachePath(); - } - - fetchFromLocal(override) { - var _this2 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref = yield (_fs || _load_fs()).readFirstAvailableStream(_this2.getLocalPaths(override)); + }; - const stream = _ref.stream, - triedPaths = _ref.triedPaths; + TarballFetcher.prototype.fetchFromLocal = function () { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (override) { + var _this3 = this; + var _ref4 = yield (_fs || _load_fs()).readFirstAvailableStream(this.getLocalPaths(override)), + stream = _ref4.stream, + triedPaths = _ref4.triedPaths; return new (_promise || _load_promise()).default(function (resolve, reject) { if (!stream) { - reject(new (_errors || _load_errors()).MessageError(_this2.reporter.lang('tarballNotInNetworkOrCache', _this2.reference, triedPaths))); + reject(new (_errors || _load_errors()).MessageError(_this3.reporter.lang('tarballNotInNetworkOrCache', _this3.reference, triedPaths))); return; } invariant(stream, 'stream should be available at this point'); // $FlowFixMe - This is available https://nodejs.org/api/fs.html#fs_readstream_path - const tarballPath = stream.path; - - var _createExtractor = _this2.createExtractor(resolve, reject, tarballPath); - - const validateStream = _createExtractor.validateStream, - extractorStream = _createExtractor.extractorStream; + var tarballPath = stream.path; + var _createExtractor = _this3.createExtractor(resolve, reject, tarballPath), + validateStream = _createExtractor.validateStream, + extractorStream = _createExtractor.extractorStream; stream.pipe(validateStream).pipe(extractorStream).on('error', function (err) { - reject(new (_errors || _load_errors()).MessageError(_this2.config.reporter.lang('fetchErrorCorrupt', err.message, tarballPath))); + reject(new (_errors || _load_errors()).MessageError(_this3.config.reporter.lang('fetchErrorCorrupt', err.message, tarballPath))); }); }); - })(); - } + }); - fetchFromExternal() { - var _this3 = this; + function fetchFromLocal(_x) { + return _ref3.apply(this, arguments); + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const registry = _this3.config.registries[_this3.registry]; + return fetchFromLocal; + }(); + + TarballFetcher.prototype.fetchFromExternal = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _this4 = this; - let retriesRemaining = 2; + var registry = this.config.registries[this.registry]; + + var retriesRemaining = 2; do { try { - return yield registry.request(_this3.reference, { + return yield registry.request(this.reference, { headers: { 'Accept-Encoding': 'gzip' }, buffer: true, process: function process(req, resolve, reject) { // should we save this to the offline cache? - const reporter = _this3.config.reporter; - - const tarballMirrorPath = _this3.getTarballMirrorPath(); - const tarballCachePath = _this3.getTarballCachePath(); - - var _createExtractor2 = _this3.createExtractor(resolve, reject); + var reporter = _this4.config.reporter; - const validateStream = _createExtractor2.validateStream, - extractorStream = _createExtractor2.extractorStream; + var tarballMirrorPath = _this4.getTarballMirrorPath(); + var tarballCachePath = _this4.getTarballCachePath(); + var _createExtractor2 = _this4.createExtractor(resolve, reject), + validateStream = _createExtractor2.validateStream, + extractorStream = _createExtractor2.extractorStream; req.on('response', function (res) { if (res.statusCode >= 400) { - const statusDescription = (_http || _load_http()).default.STATUS_CODES[res.statusCode]; + var statusDescription = (_http || _load_http()).default.STATUS_CODES[res.statusCode]; reject(new (_errors || _load_errors()).ResponseError(reporter.lang('requestFailed', `${res.statusCode} ${statusDescription}`), res.statusCode)); } }); @@ -59368,15 +61638,15 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { validateStream.pipe(extractorStream).on('error', reject); } - }, _this3.packageName); + }, this.packageName); } catch (err) { if (err instanceof (_errors || _load_errors()).ResponseError && err.responseCode >= 500 && retriesRemaining > 1) { retriesRemaining--; - _this3.reporter.warn(_this3.reporter.lang('retryOnInternalServerError')); + this.reporter.warn(this.reporter.lang('retryOnInternalServerError')); yield (0, (_misc || _load_misc()).sleep)(3000); } else { - const tarballMirrorPath = _this3.getTarballMirrorPath(); - const tarballCachePath = _this3.getTarballCachePath(); + var tarballMirrorPath = this.getTarballMirrorPath(); + var tarballCachePath = this.getTarballCachePath(); if (tarballMirrorPath && (yield (_fs || _load_fs()).exists(tarballMirrorPath))) { yield (_fs || _load_fs()).unlink(tarballMirrorPath); @@ -59392,35 +61662,56 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { } while (retriesRemaining > 0); // Unreachable code, this is just to make Flow happy throw new Error('Ran out of retries!'); - })(); - } + }); + + function fetchFromExternal() { + return _ref5.apply(this, arguments); + } - _fetch() { - const isFilePath = this.reference.startsWith('file:'); + return fetchFromExternal; + }(); + + TarballFetcher.prototype._fetch = function _fetch() { + var _this5 = this; + + var isFilePath = this.reference.startsWith('file:'); this.reference = (0, (_misc || _load_misc()).removePrefix)(this.reference, 'file:'); - const urlParse = url.parse(this.reference); + var urlParse = url.parse(this.reference); // legacy support for local paths in yarn.lock entries - const isRelativePath = urlParse.protocol ? urlParse.protocol.match(/^[a-z]:$/i) : urlParse.pathname ? urlParse.pathname.match(/^(?:\.{1,2})?[\\\/]/) : false; + var isRelativePath = urlParse.protocol ? urlParse.protocol.match(/^[a-z]:$/i) : urlParse.pathname ? urlParse.pathname.match(/^(?:\.{1,2})?[\\\/]/) : false; if (isFilePath || isRelativePath) { return this.fetchFromLocal(this.reference); } - return this.fetchFromLocal().catch(err => this.fetchFromExternal()); - } -} + return this.fetchFromLocal().catch(function (err) { + return _this5.fetchFromExternal(); + }); + }; + + return TarballFetcher; +}((_baseFetcher || _load_baseFetcher()).default); exports.default = TarballFetcher; -class LocalTarballFetcher extends TarballFetcher { - _fetch() { - return this.fetchFromLocal(this.reference); + +var LocalTarballFetcher = exports.LocalTarballFetcher = function (_TarballFetcher) { + (0, (_inherits2 || _load_inherits()).default)(LocalTarballFetcher, _TarballFetcher); + + function LocalTarballFetcher() { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, LocalTarballFetcher); + return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _TarballFetcher.apply(this, arguments)); } -} -exports.LocalTarballFetcher = LocalTarballFetcher; + + LocalTarballFetcher.prototype._fetch = function _fetch() { + return this.fetchFromLocal(this.reference); + }; + + return LocalTarballFetcher; +}(TarballFetcher); /***/ }), -/* 222 */ +/* 233 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59433,11 +61724,23 @@ Object.defineProperty(exports, "__esModule", { var _assign; function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); + return _assign = _interopRequireDefault(__webpack_require__(17)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } exports.default = function (str) { - let fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile'; + var fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile'; str = (0, (_stripBom || _load_stripBom()).default)(str); return hasMergeConflicts(str) ? parseWithConflict(str, fileLoc) : { type: 'success', object: parse(str, fileLoc) }; @@ -59446,46 +61749,46 @@ exports.default = function (str) { var _util; function _load_util() { - return _util = _interopRequireDefault(__webpack_require__(2)); + return _util = _interopRequireDefault(__webpack_require__(4)); } var _invariant; function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); + return _invariant = _interopRequireDefault(__webpack_require__(9)); } var _stripBom; function _load_stripBom() { - return _stripBom = _interopRequireDefault(__webpack_require__(303)); + return _stripBom = _interopRequireDefault(__webpack_require__(320)); } var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); + return _map = _interopRequireDefault(__webpack_require__(34)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint quotes: 0 */ -const VERSION_REGEX = /^yarn lockfile v(\d+)$/; +var VERSION_REGEX = /^yarn lockfile v(\d+)$/; -const TOKEN_TYPES = { +var TOKEN_TYPES = { boolean: 'BOOLEAN', string: 'STRING', identifier: 'IDENTIFIER', @@ -59499,23 +61802,23 @@ const TOKEN_TYPES = { comma: 'COMMA' }; -const VALID_PROP_VALUE_TOKENS = [TOKEN_TYPES.boolean, TOKEN_TYPES.string, TOKEN_TYPES.number]; +var VALID_PROP_VALUE_TOKENS = [TOKEN_TYPES.boolean, TOKEN_TYPES.string, TOKEN_TYPES.number]; function isValidPropValueToken(token) { return VALID_PROP_VALUE_TOKENS.indexOf(token.type) >= 0; } function* tokenise(input) { - let lastNewline = false; - let line = 1; - let col = 0; + var lastNewline = false; + var line = 1; + var col = 0; function buildToken(type, value) { - return { line: line, col: col, type: type, value: value }; + return { line, col, type, value }; } while (input.length) { - let chop = 0; + var chop = 0; if (input[0] === '\n' || input[0] === '\r') { chop++; @@ -59529,7 +61832,7 @@ function* tokenise(input) { } else if (input[0] === '#') { chop++; - let val = ''; + var val = ''; while (input[chop] !== '\n') { val += input[chop]; chop++; @@ -59537,8 +61840,8 @@ function* tokenise(input) { yield buildToken(TOKEN_TYPES.comment, val); } else if (input[0] === ' ') { if (lastNewline) { - let indent = ''; - for (let i = 0; input[i] === ' '; i++) { + var indent = ''; + for (var i = 0; input[i] === ' '; i++) { indent += input[i]; } @@ -59552,24 +61855,24 @@ function* tokenise(input) { chop++; } } else if (input[0] === '"') { - let val = ''; + var _val = ''; - for (let i = 0;; i++) { - const currentChar = input[i]; - val += currentChar; + for (var _i = 0;; _i++) { + var currentChar = input[_i]; + _val += currentChar; - if (i > 0 && currentChar === '"') { - const isEscaped = input[i - 1] === '\\' && input[i - 2] !== '\\'; + if (_i > 0 && currentChar === '"') { + var isEscaped = input[_i - 1] === '\\' && input[_i - 2] !== '\\'; if (!isEscaped) { break; } } } - chop = val.length; + chop = _val.length; try { - yield buildToken(TOKEN_TYPES.string, JSON.parse(val)); + yield buildToken(TOKEN_TYPES.string, JSON.parse(_val)); } catch (err) { if (err instanceof SyntaxError) { yield buildToken(TOKEN_TYPES.invalid); @@ -59578,13 +61881,13 @@ function* tokenise(input) { } } } else if (/^[0-9]/.test(input)) { - let val = ''; - for (let i = 0; /^[0-9]$/.test(input[i]); i++) { - val += input[i]; + var _val2 = ''; + for (var _i2 = 0; /^[0-9]$/.test(input[_i2]); _i2++) { + _val2 += input[_i2]; } - chop = val.length; + chop = _val2.length; - yield buildToken(TOKEN_TYPES.number, +val); + yield buildToken(TOKEN_TYPES.number, +_val2); } else if (/^true/.test(input)) { yield buildToken(TOKEN_TYPES.boolean, true); chop = 4; @@ -59598,9 +61901,9 @@ function* tokenise(input) { yield buildToken(TOKEN_TYPES.comma); chop++; } else if (/^[a-zA-Z\/-]/g.test(input)) { - let name = ''; - for (let i = 0; i < input.length; i++) { - const char = input[i]; + var name = ''; + for (var _i3 = 0; _i3 < input.length; _i3++) { + var char = input[_i3]; if (char === ':' || char === ' ' || char === '\n' || char === '\r' || char === ',') { break; } else { @@ -59627,38 +61930,39 @@ function* tokenise(input) { yield buildToken(TOKEN_TYPES.eof); } -class Parser { - constructor(input) { - let fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile'; +var Parser = function () { + function Parser(input) { + var fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile'; + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Parser); this.comments = []; this.tokens = tokenise(input); this.fileLoc = fileLoc; } - onComment(token) { - const value = token.value; + Parser.prototype.onComment = function onComment(token) { + var value = token.value; (0, (_invariant || _load_invariant()).default)(typeof value === 'string', 'expected token value to be a string'); - const comment = value.trim(); + var comment = value.trim(); - const versionMatch = comment.match(VERSION_REGEX); + var versionMatch = comment.match(VERSION_REGEX); if (versionMatch) { - const version = +versionMatch[1]; + var version = +versionMatch[1]; if (version > (_constants || _load_constants()).LOCKFILE_VERSION) { throw new (_errors || _load_errors()).MessageError(`Can't install from a lockfile of version ${version} as you're on an old yarn version that only supports ` + `versions up to ${(_constants || _load_constants()).LOCKFILE_VERSION}. Run \`$ yarn self-update\` to upgrade to the latest version.`); } } this.comments.push(comment); - } + }; - next() { - const item = this.tokens.next(); + Parser.prototype.next = function next() { + var item = this.tokens.next(); (0, (_invariant || _load_invariant()).default)(item, 'expected a token'); - const done = item.done, - value = item.value; + var done = item.done, + value = item.value; if (done || !value) { throw new Error('No more tokens'); @@ -59668,41 +61972,41 @@ class Parser { } else { return this.token = value; } - } + }; - unexpected() { - let msg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Unexpected token'; + Parser.prototype.unexpected = function unexpected() { + var msg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Unexpected token'; throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`); - } + }; - expect(tokType) { + Parser.prototype.expect = function expect(tokType) { if (this.token.type === tokType) { this.next(); } else { this.unexpected(); } - } + }; - eat(tokType) { + Parser.prototype.eat = function eat(tokType) { if (this.token.type === tokType) { this.next(); return true; } else { return false; } - } + }; - parse() { - let indent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + Parser.prototype.parse = function parse() { + var indent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - const obj = (0, (_map || _load_map()).default)(); + var obj = (0, (_map || _load_map()).default)(); while (true) { - const propToken = this.token; + var propToken = this.token; if (propToken.type === TOKEN_TYPES.newline) { - const nextToken = this.next(); + var nextToken = this.next(); if (!indent) { // if we have 0 indentation then the next token doesn't matter continue; @@ -59730,38 +62034,51 @@ class Parser { break; } else if (propToken.type === TOKEN_TYPES.string) { // property key - const key = propToken.value; + var key = propToken.value; (0, (_invariant || _load_invariant()).default)(key, 'Expected a key'); - const keys = [key]; + var keys = [key]; this.next(); // support multiple keys while (this.token.type === TOKEN_TYPES.comma) { this.next(); // skip comma - const keyToken = this.token; + var keyToken = this.token; if (keyToken.type !== TOKEN_TYPES.string) { this.unexpected('Expected string'); } - const key = keyToken.value; - (0, (_invariant || _load_invariant()).default)(key, 'Expected a key'); - keys.push(key); + var _key = keyToken.value; + (0, (_invariant || _load_invariant()).default)(_key, 'Expected a key'); + keys.push(_key); this.next(); } - const valToken = this.token; + var valToken = this.token; if (valToken.type === TOKEN_TYPES.colon) { // object this.next(); // parse object - const val = this.parse(indent + 1); + var val = this.parse(indent + 1); - for (const key of keys) { - obj[key] = val; + for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i4 = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i4 >= _iterator.length) break; + _ref = _iterator[_i4++]; + } else { + _i4 = _iterator.next(); + if (_i4.done) break; + _ref = _i4.value; + } + + var _key2 = _ref; + + obj[_key2] = val; } if (indent && this.token.type !== TOKEN_TYPES.indent) { @@ -59769,8 +62086,21 @@ class Parser { } } else if (isValidPropValueToken(valToken)) { // plain value - for (const key of keys) { - obj[key] = valToken.value; + for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i5 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i5 >= _iterator2.length) break; + _ref2 = _iterator2[_i5++]; + } else { + _i5 = _iterator2.next(); + if (_i5.done) break; + _ref2 = _i5.value; + } + + var _key3 = _ref2; + + obj[_key3] = valToken.value; } this.next(); @@ -59783,28 +62113,30 @@ class Parser { } return obj; - } -} + }; -const MERGE_CONFLICT_ANCESTOR = '|||||||'; -const MERGE_CONFLICT_END = '>>>>>>>'; -const MERGE_CONFLICT_SEP = '======='; -const MERGE_CONFLICT_START = '<<<<<<<'; + return Parser; +}(); + +var MERGE_CONFLICT_ANCESTOR = '|||||||'; +var MERGE_CONFLICT_END = '>>>>>>>'; +var MERGE_CONFLICT_SEP = '======='; +var MERGE_CONFLICT_START = '<<<<<<<'; /** * Extract the two versions of the lockfile from a merge conflict. */ function extractConflictVariants(str) { - const variants = [[], []]; - const lines = str.split(/\r?\n/g); - let skip = false; + var variants = [[], []]; + var lines = str.split(/\r?\n/g); + var skip = false; while (lines.length) { - const line = lines.shift(); - if (line.startsWith(MERGE_CONFLICT_START)) { + var _line = lines.shift(); + if (_line.startsWith(MERGE_CONFLICT_START)) { // get the first variant while (lines.length) { - const conflictLine = lines.shift(); + var conflictLine = lines.shift(); if (conflictLine === MERGE_CONFLICT_SEP) { skip = false; break; @@ -59818,16 +62150,16 @@ function extractConflictVariants(str) { // get the second variant while (lines.length) { - const conflictLine = lines.shift(); - if (conflictLine.startsWith(MERGE_CONFLICT_END)) { + var _conflictLine = lines.shift(); + if (_conflictLine.startsWith(MERGE_CONFLICT_END)) { break; } else { - variants[1].push(conflictLine); + variants[1].push(_conflictLine); } } } else { - variants[0].push(line); - variants[1].push(line); + variants[0].push(_line); + variants[1].push(_line); } } @@ -59845,7 +62177,7 @@ function hasMergeConflicts(str) { * Parse the lockfile. */ function parse(str, fileLoc) { - const parser = new Parser(str, fileLoc); + var parser = new Parser(str, fileLoc); parser.next(); return parser.parse(); } @@ -59854,7 +62186,7 @@ function parse(str, fileLoc) { * Parse and merge the two variants in a conflicted lockfile. */ function parseWithConflict(str, fileLoc) { - const variants = extractConflictVariants(str); + var variants = extractConflictVariants(str); try { return { type: 'merge', object: (0, (_assign || _load_assign()).default)({}, parse(variants[0], fileLoc), parse(variants[1], fileLoc)) }; } catch (err) { @@ -59867,7 +62199,7 @@ function parseWithConflict(str, fileLoc) { } /***/ }), -/* 223 */ +/* 234 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59877,10 +62209,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + var _assign; function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); + return _assign = _interopRequireDefault(__webpack_require__(17)); } exports.testEngine = testEngine; @@ -59890,41 +62228,61 @@ exports.check = check; var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); + return _map = _interopRequireDefault(__webpack_require__(34)); } var _misc; function _load_misc() { - return _misc = __webpack_require__(15); + return _misc = __webpack_require__(19); } var _yarnVersion; function _load_yarnVersion() { - return _yarnVersion = __webpack_require__(76); + return _yarnVersion = __webpack_require__(81); +} + +var _semver; + +function _load_semver() { + return _semver = __webpack_require__(250); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); -const semver = __webpack_require__(19); +var invariant = __webpack_require__(9); -const VERSIONS = (0, (_assign || _load_assign()).default)({}, process.versions, { +var semver = __webpack_require__(21); + +var VERSIONS = (0, (_assign || _load_assign()).default)({}, process.versions, { yarn: (_yarnVersion || _load_yarnVersion()).version }); function isValid(items, actual) { - let isNotWhitelist = true; - let isBlacklist = false; + var isNotWhitelist = true; + var isBlacklist = false; + + for (var _iterator = items, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var item = _ref; - for (const item of items) { // blacklist if (item[0] === '!') { isBlacklist = true; @@ -59947,16 +62305,17 @@ function isValid(items, actual) { return isBlacklist && isNotWhitelist; } -const aliases = (0, (_map || _load_map()).default)({ - iojs: 'node' }); +var aliases = (0, (_map || _load_map()).default)({ + iojs: 'node' // we should probably prompt these libraries to fix this +}); -const ignore = ['npm', // we'll never satisfy this for obvious reasons +var ignore = ['npm', // we'll never satisfy this for obvious reasons 'teleport', // a module bundler used by some modules 'rhino', // once a target for older modules 'cordovaDependencies']; function testEngine(name, range, versions, looseSemver) { - const actual = versions[name]; + var actual = versions[name]; if (!actual) { return false; } @@ -59969,14 +62328,31 @@ function testEngine(name, range, versions, looseSemver) { return true; } + if (name === 'yarn' && (0, (_semver || _load_semver()).satisfiesWithPreleases)(actual, range, looseSemver)) { + return true; + } + if (name === 'node' && semver.gt(actual, '1.0.0', looseSemver)) { // WARNING: this is a massive hack and is super gross but necessary for compatibility // some modules have the `engines.node` field set to a caret version below semver major v1 // eg. ^0.12.0. this is problematic as we enforce engines checks and node is now on version >=1 // to allow this pattern we transform the node version to fake ones in the minor range 10-13 - const major = semver.major(actual, looseSemver); - const fakes = [`0.10.${major}`, `0.11.${major}`, `0.12.${major}`, `0.13.${major}`]; - for (const actualFake of fakes) { + var major = semver.major(actual, looseSemver); + var fakes = [`0.10.${major}`, `0.11.${major}`, `0.12.${major}`, `0.13.${major}`]; + for (var _iterator2 = fakes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var actualFake = _ref2; + if (semver.satisfies(actualFake, range, looseSemver)) { return true; } @@ -59996,13 +62372,13 @@ function isValidPlatform(platforms) { } function checkOne(info, config, ignoreEngines) { - let didIgnore = false; - let didError = false; - const reporter = config.reporter; - const human = `${info.name}@${info.version}`; + var didIgnore = false; + var didError = false; + var reporter = config.reporter; + var human = `${info.name}@${info.version}`; - const pushError = msg => { - const ref = info._reference; + var pushError = function pushError(msg) { + var ref = info._reference; invariant(ref, 'expected package reference'); if (ref.optional) { @@ -60020,22 +62396,35 @@ function checkOne(info, config, ignoreEngines) { } }; - const invalidPlatform = !config.ignorePlatform && Array.isArray(info.os) && info.os.length > 0 && !isValidPlatform(info.os); + var invalidPlatform = !config.ignorePlatform && Array.isArray(info.os) && info.os.length > 0 && !isValidPlatform(info.os); if (invalidPlatform) { pushError(reporter.lang('incompatibleOS', process.platform)); } - const invalidCpu = !config.ignorePlatform && Array.isArray(info.cpu) && info.cpu.length > 0 && !isValidArch(info.cpu); + var invalidCpu = !config.ignorePlatform && Array.isArray(info.cpu) && info.cpu.length > 0 && !isValidArch(info.cpu); if (invalidCpu) { pushError(reporter.lang('incompatibleCPU', process.arch)); } if (!ignoreEngines && typeof info.engines === 'object') { - for (const entry of (0, (_misc || _load_misc()).entries)(info.engines)) { - let name = entry[0]; - const range = entry[1]; + for (var _iterator3 = (0, (_misc || _load_misc()).entries)(info.engines), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var entry = _ref3; + + var name = entry[0]; + var range = entry[1]; if (aliases[name]) { name = aliases[name]; @@ -60057,13 +62446,26 @@ function checkOne(info, config, ignoreEngines) { } function check(infos, config, ignoreEngines) { - for (const info of infos) { + for (var _iterator4 = infos, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var info = _ref4; + checkOne(info, config, ignoreEngines); } } /***/ }), -/* 224 */ +/* 235 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60073,36 +62475,41 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _keys; + +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); +} + var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(33)); + return _map = _interopRequireDefault(__webpack_require__(37)); } var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let fetchCache = (() => { +var fetchCache = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest, fetcher, config) { - var _ref2 = yield config.readPackageMetadata(dest); - - const hash = _ref2.hash, - pkg = _ref2.package; + var _ref2 = yield config.readPackageMetadata(dest), + hash = _ref2.hash, + pkg = _ref2.package; yield fetcher.setupMirrorFromCache(); return { package: pkg, - hash: hash, - dest: dest, + hash, + dest, cached: true }; }); @@ -60110,25 +62517,25 @@ let fetchCache = (() => { return function fetchCache(_x, _x2, _x3) { return _ref.apply(this, arguments); }; -})(); +}(); -let fetchOne = (() => { +var fetchOne = function () { var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref, config) { - const dest = config.generateHardModulePath(ref); + var dest = config.generateHardModulePath(ref); - const remote = ref.remote; + var remote = ref.remote; // Mock metedata for symlinked dependencies if (remote.type === 'link') { - const mockPkg = { _uid: '', name: '', version: '0.0.0' }; - return (_promise || _load_promise()).default.resolve({ resolved: null, hash: '', dest: dest, package: mockPkg, cached: false }); + var mockPkg = { _uid: '', name: '', version: '0.0.0' }; + return (_promise || _load_promise()).default.resolve({ resolved: null, hash: '', dest, package: mockPkg, cached: false }); } - const Fetcher = (_index || _load_index())[remote.type]; + var Fetcher = (_index || _load_index())[remote.type]; if (!Fetcher) { throw new (_errors || _load_errors()).MessageError(config.reporter.lang('unknownFetcherFor', remote.type)); } - const fetcher = new Fetcher(dest, remote, config); + var fetcher = new Fetcher(dest, remote, config); if (yield config.isValidModuleDest(dest)) { return fetchCache(dest, fetcher, config); } @@ -60154,9 +62561,9 @@ let fetchOne = (() => { return function fetchOne(_x4, _x5) { return _ref3.apply(this, arguments); }; -})(); +}(); -let maybeFetchOne = (() => { +var maybeFetchOne = function () { var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref, config) { try { return yield fetchOne(ref, config); @@ -60173,32 +62580,32 @@ let maybeFetchOne = (() => { return function maybeFetchOne(_x6, _x7) { return _ref4.apply(this, arguments); }; -})(); +}(); exports.fetch = fetch; var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _index; function _load_index() { - return _index = _interopRequireWildcard(__webpack_require__(398)); + return _index = _interopRequireWildcard(__webpack_require__(413)); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } var _promise2; function _load_promise2() { - return _promise2 = _interopRequireWildcard(__webpack_require__(85)); + return _promise2 = _interopRequireWildcard(__webpack_require__(91)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -60206,14 +62613,14 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function fetch(pkgs, config) { - const pkgsPerDest = new (_map || _load_map()).default(); - pkgs = pkgs.filter(pkg => { - const ref = pkg._reference; + var pkgsPerDest = new (_map || _load_map()).default(); + pkgs = pkgs.filter(function (pkg) { + var ref = pkg._reference; if (!ref) { return false; } - const dest = config.generateHardModulePath(ref); - const otherPkg = pkgsPerDest.get(dest); + var dest = config.generateHardModulePath(ref); + var otherPkg = pkgsPerDest.get(dest); if (otherPkg) { config.reporter.warn(config.reporter.lang('multiplePackagesCantUnpackInSameDestination', ref.patterns, dest, otherPkg.patterns)); return false; @@ -60221,17 +62628,17 @@ function fetch(pkgs, config) { pkgsPerDest.set(dest, ref); return true; }); - const tick = config.reporter.progress(pkgs.length); + var tick = config.reporter.progress(pkgs.length); - return (_promise2 || _load_promise2()).queue(pkgs, (() => { + return (_promise2 || _load_promise2()).queue(pkgs, function () { var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg) { - const ref = pkg._reference; + var ref = pkg._reference; if (!ref) { return pkg; } - const res = yield maybeFetchOne(ref, config); - let newPkg; + var res = yield maybeFetchOne(ref, config); + var newPkg = void 0; if (res) { newPkg = res.package; @@ -60239,6 +62646,18 @@ function fetch(pkgs, config) { // update with new remote // but only if there was a hash previously as the tarball fetcher does not provide a hash. if (ref.remote.hash) { + // if the checksum was updated, also update resolved and cache + if (ref.remote.hash !== res.hash && config.updateChecksums) { + var oldHash = ref.remote.hash; + if (ref.remote.resolved) { + ref.remote.resolved = ref.remote.resolved.replace(oldHash, res.hash); + } + ref.config.cache = (0, (_keys || _load_keys()).default)(ref.config.cache).reduce(function (cache, entry) { + var entryWithNewHash = entry.replace(oldHash, res.hash); + cache[entryWithNewHash] = ref.config.cache[entry]; + return cache; + }, {}); + } ref.remote.hash = res.hash; } } @@ -60261,11 +62680,11 @@ function fetch(pkgs, config) { return function (_x8) { return _ref5.apply(this, arguments); }; - })(), config.networkConcurrency); + }(), config.networkConcurrency); } /***/ }), -/* 225 */ +/* 236 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60278,84 +62697,97 @@ Object.defineProperty(exports, "__esModule", { var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); } var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); + return _set = _interopRequireDefault(__webpack_require__(15)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } var _index; function _load_index() { - return _index = __webpack_require__(38); + return _index = __webpack_require__(41); } var _packageRequest; function _load_packageRequest() { - return _packageRequest = _interopRequireDefault(__webpack_require__(80)); + return _packageRequest = _interopRequireDefault(__webpack_require__(85)); } var _normalizePattern2; function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(39); + return _normalizePattern2 = __webpack_require__(42); } var _requestManager; function _load_requestManager() { - return _requestManager = _interopRequireDefault(__webpack_require__(238)); + return _requestManager = _interopRequireDefault(__webpack_require__(249)); } var _blockingQueue; function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(102)); + return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); } var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(16)); + return _lockfile = _interopRequireDefault(__webpack_require__(20)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); + return _map = _interopRequireDefault(__webpack_require__(34)); } var _workspaceLayout; function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(67)); + return _workspaceLayout = _interopRequireDefault(__webpack_require__(74)); } var _resolutionMap; function _load_resolutionMap() { - return _resolutionMap = _interopRequireDefault(__webpack_require__(228)); + return _resolutionMap = _interopRequireDefault(__webpack_require__(239)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); +var invariant = __webpack_require__(9); -const semver = __webpack_require__(19); +var semver = __webpack_require__(21); -class PackageResolver { - constructor(config, lockfile) { - let resolutionMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_resolutionMap || _load_resolutionMap()).default(config); +var PackageResolver = function () { + function PackageResolver(config, lockfile) { + var resolutionMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_resolutionMap || _load_resolutionMap()).default(config); + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageResolver); this.patternsByPackage = (0, (_map || _load_map()).default)(); this.fetchingPatterns = new (_set || _load_set()).default(); @@ -60412,75 +62844,145 @@ class PackageResolver { * TODO description */ - isNewPattern(pattern) { + PackageResolver.prototype.isNewPattern = function isNewPattern(pattern) { return !!this.patterns[pattern].fresh; - } + }; - updateManifest(ref, newPkg) { + PackageResolver.prototype.updateManifest = function updateManifest(ref, newPkg) { // inherit fields - const oldPkg = this.patterns[ref.patterns[0]]; + var oldPkg = this.patterns[ref.patterns[0]]; newPkg._reference = ref; newPkg._remote = ref.remote; newPkg.name = oldPkg.name; newPkg.fresh = oldPkg.fresh; + newPkg.prebuiltVariants = oldPkg.prebuiltVariants; // update patterns - for (const pattern of ref.patterns) { + for (var _iterator = ref.patterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var pattern = _ref; + this.patterns[pattern] = newPkg; } return (_promise || _load_promise()).default.resolve(); - } + }; + + PackageResolver.prototype.updateManifests = function updateManifests(newPkgs) { + for (var _iterator2 = newPkgs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var newPkg = _ref2; - updateManifests(newPkgs) { - for (const newPkg of newPkgs) { if (newPkg._reference) { - for (const pattern of newPkg._reference.patterns) { + for (var _iterator3 = newPkg._reference.patterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var pattern = _ref3; + + var oldPkg = this.patterns[pattern]; + newPkg.prebuiltVariants = oldPkg.prebuiltVariants; this.patterns[pattern] = newPkg; } } } return (_promise || _load_promise()).default.resolve(); - } + }; /** * Given a list of patterns, dedupe them to a list of unique patterns. */ - dedupePatterns(patterns) { - const deduped = []; - const seen = new (_set || _load_set()).default(); + PackageResolver.prototype.dedupePatterns = function dedupePatterns(patterns) { + var deduped = []; + var seen = new (_set || _load_set()).default(); + + for (var _iterator4 = patterns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var pattern = _ref4; - for (const pattern of patterns) { - const info = this.getResolvedPattern(pattern); - if (seen.has(info)) { + var _info = this.getResolvedPattern(pattern); + if (seen.has(_info)) { continue; } - seen.add(info); + seen.add(_info); deduped.push(pattern); } return deduped; - } + }; /** * Get a list of all manifests by topological order. */ - getTopologicalManifests(seedPatterns) { - const pkgs = new (_set || _load_set()).default(); - const skip = new (_set || _load_set()).default(); + PackageResolver.prototype.getTopologicalManifests = function getTopologicalManifests(seedPatterns) { + var _this = this; + + var pkgs = new (_set || _load_set()).default(); + var skip = new (_set || _load_set()).default(); + + var add = function add(seedPatterns) { + for (var _iterator5 = seedPatterns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref5; - const add = seedPatterns => { - for (const pattern of seedPatterns) { - const pkg = this.getStrictResolvedPattern(pattern); + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref5 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref5 = _i5.value; + } + + var pattern = _ref5; + + var pkg = _this.getStrictResolvedPattern(pattern); if (skip.has(pkg)) { continue; } - const ref = pkg._reference; + var ref = pkg._reference; invariant(ref, 'expected reference'); skip.add(pkg); add(ref.dependencies); @@ -60491,26 +62993,41 @@ class PackageResolver { add(seedPatterns); return pkgs; - } + }; /** * Get a list of all manifests by level sort order. */ - getLevelOrderManifests(seedPatterns) { - const pkgs = new (_set || _load_set()).default(); - const skip = new (_set || _load_set()).default(); + PackageResolver.prototype.getLevelOrderManifests = function getLevelOrderManifests(seedPatterns) { + var _this2 = this; + + var pkgs = new (_set || _load_set()).default(); + var skip = new (_set || _load_set()).default(); + + var add = function add(seedPatterns) { + var refs = []; + + for (var _iterator6 = seedPatterns, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref6; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref6 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref6 = _i6.value; + } - const add = seedPatterns => { - const refs = []; + var pattern = _ref6; - for (const pattern of seedPatterns) { - const pkg = this.getStrictResolvedPattern(pattern); + var pkg = _this2.getStrictResolvedPattern(pattern); if (skip.has(pkg)) { continue; } - const ref = pkg._reference; + var ref = pkg._reference; invariant(ref, 'expected reference'); refs.push(ref); @@ -60518,7 +63035,20 @@ class PackageResolver { pkgs.add(pkg); } - for (const ref of refs) { + for (var _iterator7 = refs, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { + var _ref7; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref7 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref7 = _i7.value; + } + + var ref = _ref7; + add(ref.dependencies); } }; @@ -60526,107 +63056,149 @@ class PackageResolver { add(seedPatterns); return pkgs; - } + }; /** * Get a list of all package names in the depenency graph. */ - getAllDependencyNamesByLevelOrder(seedPatterns) { - const names = new (_set || _load_set()).default(); - for (const _ref of this.getLevelOrderManifests(seedPatterns)) { - const name = _ref.name; + PackageResolver.prototype.getAllDependencyNamesByLevelOrder = function getAllDependencyNamesByLevelOrder(seedPatterns) { + var names = new (_set || _load_set()).default(); + for (var _iterator8 = this.getLevelOrderManifests(seedPatterns), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { + var _ref9; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref9 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref9 = _i8.value; + } + + var _ref8 = _ref9; + var _name = _ref8.name; - names.add(name); + names.add(_name); } return names; - } + }; /** * Retrieve all the package info stored for this package name. */ - getAllInfoForPackageName(name) { - const patterns = this.patternsByPackage[name] || []; + PackageResolver.prototype.getAllInfoForPackageName = function getAllInfoForPackageName(name) { + var patterns = this.patternsByPackage[name] || []; return this.getAllInfoForPatterns(patterns); - } + }; /** * Retrieve all the package info stored for a list of patterns. */ - getAllInfoForPatterns(patterns) { - const infos = []; - const seen = new (_set || _load_set()).default(); + PackageResolver.prototype.getAllInfoForPatterns = function getAllInfoForPatterns(patterns) { + var infos = []; + var seen = new (_set || _load_set()).default(); + + for (var _iterator9 = patterns, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { + var _ref10; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref10 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref10 = _i9.value; + } + + var pattern = _ref10; - for (const pattern of patterns) { - const info = this.patterns[pattern]; - if (seen.has(info)) { + var _info2 = this.patterns[pattern]; + if (seen.has(_info2)) { continue; } - seen.add(info); - infos.push(info); + seen.add(_info2); + infos.push(_info2); } return infos; - } + }; /** * Get a flat list of all package info. */ - getManifests() { - const infos = []; - const seen = new (_set || _load_set()).default(); + PackageResolver.prototype.getManifests = function getManifests() { + var infos = []; + var seen = new (_set || _load_set()).default(); - for (const pattern in this.patterns) { - const info = this.patterns[pattern]; - if (seen.has(info)) { + for (var pattern in this.patterns) { + var _info3 = this.patterns[pattern]; + if (seen.has(_info3)) { continue; } - infos.push(info); - seen.add(info); + infos.push(_info3); + seen.add(_info3); } return infos; - } + }; /** * replace pattern in resolver, e.g. `name` is replaced with `name@^1.0.1` */ - replacePattern(pattern, newPattern) { - const pkg = this.getResolvedPattern(pattern); + + + PackageResolver.prototype.replacePattern = function replacePattern(pattern, newPattern) { + var pkg = this.getResolvedPattern(pattern); invariant(pkg, `missing package ${pattern}`); - const ref = pkg._reference; + var ref = pkg._reference; invariant(ref, 'expected package reference'); ref.patterns = [newPattern]; this.addPattern(newPattern, pkg); this.removePattern(pattern); - } + }; /** * Make all versions of this package resolve to it. */ - collapseAllVersionsOfPackage(name, version) { - const patterns = this.dedupePatterns(this.patternsByPackage[name]); + PackageResolver.prototype.collapseAllVersionsOfPackage = function collapseAllVersionsOfPackage(name, version) { + var patterns = this.dedupePatterns(this.patternsByPackage[name]); return this.collapsePackageVersions(name, version, patterns); - } + }; /** * Make all given patterns resolve to version. */ - collapsePackageVersions(name, version, patterns) { - const human = `${name}@${version}`; + + + PackageResolver.prototype.collapsePackageVersions = function collapsePackageVersions(name, version, patterns) { + var human = `${name}@${version}`; // get manifest that matches the version we're collapsing too - let collapseToReference; - let collapseToManifest; - let collapseToPattern; - for (const pattern of patterns) { - const _manifest = this.patterns[pattern]; + var collapseToReference = void 0; + var collapseToManifest = void 0; + var collapseToPattern = void 0; + for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { + var _ref11; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref11 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref11 = _i10.value; + } + + var pattern = _ref11; + + var _manifest = this.patterns[pattern]; if (_manifest.version === version) { collapseToReference = _manifest._reference; collapseToManifest = _manifest; @@ -60637,89 +63209,128 @@ class PackageResolver { invariant(collapseToReference && collapseToManifest && collapseToPattern, `Couldn't find package manifest for ${human}`); - for (const pattern of patterns) { + for (var _iterator11 = patterns, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) { + var _ref12; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref12 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref12 = _i11.value; + } + + var _pattern = _ref12; + // don't touch the pattern we're collapsing to - if (pattern === collapseToPattern) { + if (_pattern === collapseToPattern) { continue; } // remove this pattern - const ref = this.getStrictResolvedPattern(pattern)._reference; + var ref = this.getStrictResolvedPattern(_pattern)._reference; invariant(ref, 'expected package reference'); - const refPatterns = ref.patterns.slice(); + var refPatterns = ref.patterns.slice(); ref.prune(); // add pattern to the manifest we're collapsing to - for (const pattern of refPatterns) { - collapseToReference.addPattern(pattern, collapseToManifest); + for (var _iterator12 = refPatterns, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) { + var _ref13; + + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref13 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref13 = _i12.value; + } + + var _pattern2 = _ref13; + + collapseToReference.addPattern(_pattern2, collapseToManifest); } } return collapseToPattern; - } + }; /** * TODO description */ - addPattern(pattern, info) { + PackageResolver.prototype.addPattern = function addPattern(pattern, info) { this.patterns[pattern] = info; - const byName = this.patternsByPackage[info.name] = this.patternsByPackage[info.name] || []; + var byName = this.patternsByPackage[info.name] = this.patternsByPackage[info.name] || []; byName.push(pattern); - } + }; /** * TODO description */ - removePattern(pattern) { - const pkg = this.patterns[pattern]; + PackageResolver.prototype.removePattern = function removePattern(pattern) { + var pkg = this.patterns[pattern]; if (!pkg) { return; } - const byName = this.patternsByPackage[pkg.name]; + var byName = this.patternsByPackage[pkg.name]; if (!byName) { return; } byName.splice(byName.indexOf(pattern), 1); delete this.patterns[pattern]; - } + }; /** * TODO description */ - getResolvedPattern(pattern) { + PackageResolver.prototype.getResolvedPattern = function getResolvedPattern(pattern) { return this.patterns[pattern]; - } + }; /** * TODO description */ - getStrictResolvedPattern(pattern) { - const manifest = this.getResolvedPattern(pattern); + PackageResolver.prototype.getStrictResolvedPattern = function getStrictResolvedPattern(pattern) { + var manifest = this.getResolvedPattern(pattern); invariant(manifest, 'expected manifest'); return manifest; - } + }; /** * TODO description */ - getExactVersionMatch(name, version, manifest) { - const patterns = this.patternsByPackage[name]; + PackageResolver.prototype.getExactVersionMatch = function getExactVersionMatch(name, version, manifest) { + var patterns = this.patternsByPackage[name]; if (!patterns) { return null; } - for (const pattern of patterns) { - const info = this.getStrictResolvedPattern(pattern); - if (info.version === version) { - return info; + for (var _iterator13 = patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) { + var _ref14; + + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref14 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref14 = _i13.value; + } + + var pattern = _ref14; + + var _info4 = this.getStrictResolvedPattern(pattern); + if (_info4.version === version) { + return _info4; } } @@ -60728,51 +63339,53 @@ class PackageResolver { } return null; - } + }; /** * Get the manifest of the highest known version that satisfies a package range */ - getHighestRangeVersionMatch(name, range, manifest) { - const patterns = this.patternsByPackage[name]; + PackageResolver.prototype.getHighestRangeVersionMatch = function getHighestRangeVersionMatch(name, range, manifest) { + var _this3 = this; + + var patterns = this.patternsByPackage[name]; if (!patterns) { return null; } - const versionNumbers = []; - const resolvedPatterns = patterns.map(pattern => { - const info = this.getStrictResolvedPattern(pattern); + var versionNumbers = []; + var resolvedPatterns = patterns.map(function (pattern) { + var info = _this3.getStrictResolvedPattern(pattern); versionNumbers.push(info.version); return info; }); - const maxValidRange = semver.maxSatisfying(versionNumbers, range); + var maxValidRange = semver.maxSatisfying(versionNumbers, range); if (!maxValidRange) { return manifest && (0, (_index || _load_index()).getExoticResolver)(range) ? this.exoticRangeMatch(resolvedPatterns, manifest) : null; } - const indexOfmaxValidRange = versionNumbers.indexOf(maxValidRange); - const maxValidRangeManifest = resolvedPatterns[indexOfmaxValidRange]; + var indexOfmaxValidRange = versionNumbers.indexOf(maxValidRange); + var maxValidRangeManifest = resolvedPatterns[indexOfmaxValidRange]; return maxValidRangeManifest; - } + }; /** * Get the manifest of the package that matches an exotic range */ - exoticRangeMatch(resolvedPkgs, manifest) { - const remote = manifest._remote; + PackageResolver.prototype.exoticRangeMatch = function exoticRangeMatch(resolvedPkgs, manifest) { + var remote = manifest._remote; if (!(remote && remote.reference && remote.type === 'copy')) { return null; } - const matchedPkg = resolvedPkgs.find((_ref2) => { - let pkgRemote = _ref2._remote; + var matchedPkg = resolvedPkgs.find(function (_ref15) { + var pkgRemote = _ref15._remote; return pkgRemote && pkgRemote.reference === remote.reference && pkgRemote.type === 'copy'; }); @@ -60781,138 +63394,218 @@ class PackageResolver { } return matchedPkg; - } + }; /** * Determine if LockfileEntry is incorrect, remove it from lockfile cache and consider the pattern as new */ - isLockfileEntryOutdated(version, range, hasVersion) { + + + PackageResolver.prototype.isLockfileEntryOutdated = function isLockfileEntryOutdated(version, range, hasVersion) { return !!(semver.validRange(range) && semver.valid(version) && !(0, (_index || _load_index()).getExoticResolver)(range) && hasVersion && !semver.satisfies(version, range)); - } + }; /** * TODO description */ - find(initialReq) { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const req = _this.resolveToResolution(initialReq); + PackageResolver.prototype.find = function () { + var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (initialReq) { + var req = this.resolveToResolution(initialReq); // we've already resolved it with a resolution if (!req) { return; } - const fetchKey = `${req.registry}:${req.pattern}:${String(req.optional)}`; - if (_this.fetchingPatterns.has(fetchKey)) { - return; - } - _this.fetchingPatterns.add(fetchKey); + var request = new (_packageRequest || _load_packageRequest()).default(req, this); + var fetchKey = `${req.registry}:${req.pattern}:${String(req.optional)}`; + var initialFetch = !this.fetchingPatterns.has(fetchKey); + var fresh = false; - if (_this.activity) { - _this.activity.tick(req.pattern); + if (this.activity) { + this.activity.tick(req.pattern); } - const lockfileEntry = _this.lockfile.getLocked(req.pattern); - let fresh = false; + if (initialFetch) { + this.fetchingPatterns.add(fetchKey); - if (lockfileEntry) { - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(req.pattern); + var lockfileEntry = this.lockfile.getLocked(req.pattern); - const range = _normalizePattern.range, + if (lockfileEntry) { + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(req.pattern), + range = _normalizePattern.range, hasVersion = _normalizePattern.hasVersion; - - if (_this.isLockfileEntryOutdated(lockfileEntry.version, range, hasVersion)) { - _this.reporter.warn(_this.reporter.lang('incorrectLockfileEntry', req.pattern)); - _this.removePattern(req.pattern); - _this.lockfile.removePattern(req.pattern); + if (this.isLockfileEntryOutdated(lockfileEntry.version, range, hasVersion)) { + this.reporter.warn(this.reporter.lang('incorrectLockfileEntry', req.pattern)); + this.removePattern(req.pattern); + this.lockfile.removePattern(req.pattern); + fresh = true; + } + } else { fresh = true; } - } else { - fresh = true; + + request.init(); } - const request = new (_packageRequest || _load_packageRequest()).default(req, _this); - yield request.find({ fresh: fresh, frozen: _this.frozen }); - })(); - } + yield request.find({ fresh, frozen: this.frozen }); + }); + + function find(_x2) { + return _ref16.apply(this, arguments); + } + + return find; + }(); /** * TODO description */ - init(deps) { - var _this2 = this, - _arguments = arguments; + PackageResolver.prototype.init = function () { + var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) { + var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { isFlat: false, isFrozen: false, workspaceLayout: undefined }, + isFlat = _ref18.isFlat, + isFrozen = _ref18.isFrozen, + workspaceLayout = _ref18.workspaceLayout; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref3 = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : { isFlat: false, isFrozen: false, workspaceLayout: undefined }; + this.flat = Boolean(isFlat); + this.frozen = Boolean(isFrozen); + this.workspaceLayout = workspaceLayout; + var activity = this.activity = this.reporter.activity(); + + for (var _iterator14 = deps, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) { + var _ref19; - let isFlat = _ref3.isFlat, - isFrozen = _ref3.isFrozen, - workspaceLayout = _ref3.workspaceLayout; + if (_isArray14) { + if (_i14 >= _iterator14.length) break; + _ref19 = _iterator14[_i14++]; + } else { + _i14 = _iterator14.next(); + if (_i14.done) break; + _ref19 = _i14.value; + } - _this2.flat = Boolean(isFlat); - _this2.frozen = Boolean(isFrozen); - _this2.workspaceLayout = workspaceLayout; - const activity = _this2.activity = _this2.reporter.activity(); + var _req = _ref19; - for (const req of deps) { - yield _this2.find(req); + yield this.find(_req); } // all required package versions have been discovered, so now packages that // resolved to existing versions can be resolved to their best available version - _this2.resolvePackagesWithExistingVersions(); + this.resolvePackagesWithExistingVersions(); + + for (var _iterator15 = this.resolutionMap.delayQueue, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) { + var _ref20; + + if (_isArray15) { + if (_i15 >= _iterator15.length) break; + _ref20 = _iterator15[_i15++]; + } else { + _i15 = _iterator15.next(); + if (_i15.done) break; + _ref20 = _i15.value; + } + + var _req2 = _ref20; - for (const req of _this2.resolutionMap.delayQueue) { - _this2.resolveToResolution(req); + this.resolveToResolution(_req2); } if (isFlat) { - for (const dep of deps) { - const name = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(dep.pattern).name; - _this2.optimizeResolutions(name); + for (var _iterator16 = deps, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) { + var _ref21; + + if (_isArray16) { + if (_i16 >= _iterator16.length) break; + _ref21 = _iterator16[_i16++]; + } else { + _i16 = _iterator16.next(); + if (_i16.done) break; + _ref21 = _i16.value; + } + + var dep = _ref21; + + var _name2 = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(dep.pattern).name; + this.optimizeResolutions(_name2); } } activity.end(); - _this2.activity = null; - })(); - } + this.activity = null; + }); + + function init(_x3) { + return _ref17.apply(this, arguments); + } + + return init; + }(); // for a given package, see if a single manifest can satisfy all ranges - optimizeResolutions(name) { - const patterns = this.dedupePatterns(this.patternsByPackage[name] || []); + + + PackageResolver.prototype.optimizeResolutions = function optimizeResolutions(name) { + var _this4 = this; + + var patterns = this.dedupePatterns(this.patternsByPackage[name] || []); // don't optimize things that already have a lockfile entry: // https://github.com/yarnpkg/yarn/issues/79 - const collapsablePatterns = patterns.filter(pattern => { - const remote = this.patterns[pattern]._remote; - return !this.lockfile.getLocked(pattern) && (!remote || remote.type !== 'workspace'); + var collapsablePatterns = patterns.filter(function (pattern) { + var remote = _this4.patterns[pattern]._remote; + return !_this4.lockfile.getLocked(pattern) && (!remote || remote.type !== 'workspace'); }); if (collapsablePatterns.length < 2) { return; } // reverse sort, so we'll find the maximum satisfying version first - const availableVersions = this.getAllInfoForPatterns(collapsablePatterns).map(manifest => manifest.version); + var availableVersions = this.getAllInfoForPatterns(collapsablePatterns).map(function (manifest) { + return manifest.version; + }); availableVersions.sort(semver.rcompare); - const ranges = collapsablePatterns.map(pattern => (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern).range); + var ranges = collapsablePatterns.map(function (pattern) { + return (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern).range; + }); // find the most recent version that satisfies all patterns (if one exists), and // collapse to that version. - for (const version of availableVersions) { - if (ranges.every(range => semver.satisfies(version, range))) { - this.collapsePackageVersions(name, version, collapsablePatterns); - return; + + var _loop = function _loop(version) { + if (ranges.every(function (range) { + return semver.satisfies(version, range); + })) { + _this4.collapsePackageVersions(name, version, collapsablePatterns); + return { + v: void 0 + }; } + }; + + for (var _iterator17 = availableVersions, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator17);;) { + var _ref22; + + if (_isArray17) { + if (_i17 >= _iterator17.length) break; + _ref22 = _iterator17[_i17++]; + } else { + _i17 = _iterator17.next(); + if (_i17.done) break; + _ref22 = _i17.value; + } + + var version = _ref22; + + var _ret = _loop(version); + + if (typeof _ret === "object") return _ret.v; } - } + }; /** * Called by the package requester for packages that this resolver already had @@ -60920,37 +63613,49 @@ class PackageResolver { * discovered. */ - reportPackageWithExistingVersion(req, info) { - this.delayedResolveQueue.push({ req: req, info: info }); - } + PackageResolver.prototype.reportPackageWithExistingVersion = function reportPackageWithExistingVersion(req, info) { + this.delayedResolveQueue.push({ req, info }); + }; /** * Executes the resolve to existing versions for packages after the find process, * when all versions that are going to be used have been discovered. */ - resolvePackagesWithExistingVersions() { - for (const _ref4 of this.delayedResolveQueue) { - const req = _ref4.req; - const info = _ref4.info; + PackageResolver.prototype.resolvePackagesWithExistingVersions = function resolvePackagesWithExistingVersions() { + for (var _iterator18 = this.delayedResolveQueue, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator18);;) { + var _ref24; - req.resolveToExistingVersion(info); + if (_isArray18) { + if (_i18 >= _iterator18.length) break; + _ref24 = _iterator18[_i18++]; + } else { + _i18 = _iterator18.next(); + if (_i18.done) break; + _ref24 = _i18.value; + } + + var _ref23 = _ref24; + var _req3 = _ref23.req, + _info5 = _ref23.info; + + _req3.resolveToExistingVersion(_info5); } - } + }; - resolveToResolution(req) { - const parentNames = req.parentNames, - pattern = req.pattern; + PackageResolver.prototype.resolveToResolution = function resolveToResolution(req) { + var parentNames = req.parentNames, + pattern = req.pattern; if (!parentNames || this.flat) { return req; } - const resolution = this.resolutionMap.find(pattern, parentNames); + var resolution = this.resolutionMap.find(pattern, parentNames); if (resolution) { - const resolutionManifest = this.getResolvedPattern(resolution); + var resolutionManifest = this.getResolvedPattern(resolution); if (resolutionManifest) { invariant(resolutionManifest._reference, 'resolutions should have a resolved reference'); @@ -60966,12 +63671,15 @@ class PackageResolver { } return req; - } -} + }; + + return PackageResolver; +}(); + exports.default = PackageResolver; /***/ }), -/* 226 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60988,7 +63696,7 @@ function formatFunction() { return strs.join(' '); } -const defaultFormatter = exports.defaultFormatter = { +var defaultFormatter = exports.defaultFormatter = { bold: formatFunction, dim: formatFunction, italic: formatFunction, @@ -61009,7 +63717,7 @@ const defaultFormatter = exports.defaultFormatter = { }; /***/ }), -/* 227 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61023,7 +63731,7 @@ exports.en = undefined; var _en; function _load_en() { - return _en = _interopRequireDefault(__webpack_require__(413)); + return _en = _interopRequireDefault(__webpack_require__(428)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -61031,7 +63739,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de exports.en = (_en || _load_en()).default; /***/ }), -/* 228 */ +/* 239 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61041,67 +63749,69 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _toConsumableArray2; +var _set; -function _load_toConsumableArray() { - return _toConsumableArray2 = _interopRequireDefault(__webpack_require__(32)); +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); } -var _set; +var _classCallCheck2; -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } var _semver; function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(19)); + return _semver = _interopRequireDefault(__webpack_require__(21)); } var _minimatch; function _load_minimatch() { - return _minimatch = _interopRequireDefault(__webpack_require__(124)); + return _minimatch = _interopRequireDefault(__webpack_require__(132)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); + return _map = _interopRequireDefault(__webpack_require__(34)); } var _normalizePattern2; function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(39); + return _normalizePattern2 = __webpack_require__(42); } var _parsePackagePath; function _load_parsePackagePath() { - return _parsePackagePath = _interopRequireDefault(__webpack_require__(236)); + return _parsePackagePath = _interopRequireDefault(__webpack_require__(247)); } var _parsePackagePath2; function _load_parsePackagePath2() { - return _parsePackagePath2 = __webpack_require__(236); + return _parsePackagePath2 = __webpack_require__(247); } var _resolvers; function _load_resolvers() { - return _resolvers = __webpack_require__(38); + return _resolvers = __webpack_require__(41); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const DIRECTORY_SEPARATOR = '/'; -const GLOBAL_NESTED_DEP_PATTERN = '**/'; +var DIRECTORY_SEPARATOR = '/'; +var GLOBAL_NESTED_DEP_PATTERN = '**/'; + +var ResolutionMap = function () { + function ResolutionMap(config) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ResolutionMap); -class ResolutionMap { - constructor(config) { this.resolutionsByPackage = (0, (_map || _load_map()).default)(); this.config = config; this.reporter = config.reporter; @@ -61109,35 +63819,35 @@ class ResolutionMap { this.topLevelPatterns = new (_set || _load_set()).default(); } - init() { - let resolutions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + ResolutionMap.prototype.init = function init() { + var resolutions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - for (const globPattern in resolutions) { - const info = this.parsePatternInfo(globPattern, resolutions[globPattern]); + for (var _globPattern in resolutions) { + var info = this.parsePatternInfo(_globPattern, resolutions[_globPattern]); if (info) { - const resolution = this.resolutionsByPackage[info.name] || []; - this.resolutionsByPackage[info.name] = [].concat((0, (_toConsumableArray2 || _load_toConsumableArray()).default)(resolution), [info]); + var resolution = this.resolutionsByPackage[info.name] || []; + this.resolutionsByPackage[info.name] = [].concat(resolution, [info]); } } - } + }; - addToDelayQueue(req) { + ResolutionMap.prototype.addToDelayQueue = function addToDelayQueue(req) { this.delayQueue.add(req); - } + }; - setTopLevelPatterns(patterns) { + ResolutionMap.prototype.setTopLevelPatterns = function setTopLevelPatterns(patterns) { this.topLevelPatterns = new (_set || _load_set()).default(patterns); - } + }; - parsePatternInfo(globPattern, range) { + ResolutionMap.prototype.parsePatternInfo = function parsePatternInfo(globPattern, range) { if (!(0, (_parsePackagePath2 || _load_parsePackagePath2()).isValidPackagePath)(globPattern)) { this.reporter.warn(this.reporter.lang('invalidResolutionName', globPattern)); return null; } - const directories = (0, (_parsePackagePath || _load_parsePackagePath()).default)(globPattern); - const name = directories.pop(); + var directories = (0, (_parsePackagePath || _load_parsePackagePath()).default)(globPattern); + var name = directories.pop(); if (!(_semver || _load_semver()).default.validRange(range) && !(0, (_resolvers || _load_resolvers()).getExoticResolver)(range)) { this.reporter.warn(this.reporter.lang('invalidResolutionVersion', range)); @@ -61150,35 +63860,32 @@ class ResolutionMap { } return { - name: name, - range: range, - globPattern: globPattern, + name, + range, + globPattern, pattern: `${name}@${range}` }; - } - - find(reqPattern, parentNames) { - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(reqPattern); + }; - const name = _normalizePattern.name, - reqRange = _normalizePattern.range; + ResolutionMap.prototype.find = function find(reqPattern, parentNames) { + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(reqPattern), + name = _normalizePattern.name, + reqRange = _normalizePattern.range; - const resolutions = this.resolutionsByPackage[name]; + var resolutions = this.resolutionsByPackage[name]; if (!resolutions) { return ''; } - const modulePath = [].concat((0, (_toConsumableArray2 || _load_toConsumableArray()).default)(parentNames), [name]).join(DIRECTORY_SEPARATOR); + var modulePath = [].concat(parentNames, [name]).join(DIRECTORY_SEPARATOR); - var _ref = resolutions.find((_ref2) => { - let globPattern = _ref2.globPattern; + var _ref = resolutions.find(function (_ref2) { + var globPattern = _ref2.globPattern; return (0, (_minimatch || _load_minimatch()).default)(modulePath, globPattern); - }) || {}; - - const pattern = _ref.pattern, - range = _ref.range; - + }) || {}, + pattern = _ref.pattern, + range = _ref.range; if (pattern) { if ((_semver || _load_semver()).default.validRange(reqRange) && (_semver || _load_semver()).default.valid(range) && !(_semver || _load_semver()).default.satisfies(range, reqRange)) { @@ -61187,12 +63894,15 @@ class ResolutionMap { } return pattern; - } -} + }; + + return ResolutionMap; +}(); + exports.default = ResolutionMap; /***/ }), -/* 229 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61202,17 +63912,41 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); +} + var _hostedGitResolver; function _load_hostedGitResolver() { - return _hostedGitResolver = _interopRequireDefault(__webpack_require__(66)); + return _hostedGitResolver = _interopRequireDefault(__webpack_require__(72)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -class GitHubResolver extends (_hostedGitResolver || _load_hostedGitResolver()).default { +var GitHubResolver = function (_HostedGitResolver) { + (0, (_inherits2 || _load_inherits()).default)(GitHubResolver, _HostedGitResolver); + + function GitHubResolver() { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitHubResolver); + return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _HostedGitResolver.apply(this, arguments)); + } - static isVersion(pattern) { + GitHubResolver.isVersion = function isVersion(pattern) { // github proto if (pattern.startsWith('github:')) { return true; @@ -61224,34 +63958,37 @@ class GitHubResolver extends (_hostedGitResolver || _load_hostedGitResolver()).d } return false; - } + }; - static getTarballUrl(parts, hash) { + GitHubResolver.getTarballUrl = function getTarballUrl(parts, hash) { return `https://codeload.${this.hostname}/${parts.user}/${parts.repo}/tar.gz/${hash}`; - } + }; - static getGitSSHUrl(parts) { + GitHubResolver.getGitSSHUrl = function getGitSSHUrl(parts) { return `git+ssh://git@${this.hostname}/${parts.user}/${parts.repo}.git` + `${parts.hash ? '#' + decodeURIComponent(parts.hash) : ''}`; - } + }; - static getGitHTTPBaseUrl(parts) { + GitHubResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(parts) { return `https://${this.hostname}/${parts.user}/${parts.repo}`; - } + }; - static getGitHTTPUrl(parts) { + GitHubResolver.getGitHTTPUrl = function getGitHTTPUrl(parts) { return `${GitHubResolver.getGitHTTPBaseUrl(parts)}.git`; - } + }; - static getHTTPFileUrl(parts, filename, commit) { + GitHubResolver.getHTTPFileUrl = function getHTTPFileUrl(parts, filename, commit) { return `https://raw.githubusercontent.com/${parts.user}/${parts.repo}/${commit}/${filename}`; - } -} -exports.default = GitHubResolver; + }; + + return GitHubResolver; +}((_hostedGitResolver || _load_hostedGitResolver()).default); + GitHubResolver.protocol = 'github'; GitHubResolver.hostname = 'github.com'; +exports.default = GitHubResolver; /***/ }), -/* 230 */ +/* 241 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61265,58 +64002,80 @@ exports.LINK_PROTOCOL_PREFIX = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); } var _exoticResolver; function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(60)); + return _exoticResolver = _interopRequireDefault(__webpack_require__(63)); } var _misc; function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(15)); + return _misc = _interopRequireWildcard(__webpack_require__(19)); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); + return _fs = _interopRequireWildcard(__webpack_require__(7)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const path = __webpack_require__(1); +var path = __webpack_require__(0); -const LINK_PROTOCOL_PREFIX = exports.LINK_PROTOCOL_PREFIX = 'link:'; +var LINK_PROTOCOL_PREFIX = exports.LINK_PROTOCOL_PREFIX = 'link:'; -class LinkResolver extends (_exoticResolver || _load_exoticResolver()).default { - constructor(request, fragment) { - super(request, fragment); - this.loc = (_misc || _load_misc()).removePrefix(fragment, LINK_PROTOCOL_PREFIX); - } +var LinkResolver = function (_ExoticResolver) { + (0, (_inherits2 || _load_inherits()).default)(LinkResolver, _ExoticResolver); - resolve() { - var _this = this; + function LinkResolver(request, fragment) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, LinkResolver); - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let loc = _this.loc; + var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment)); + + _this.loc = (_misc || _load_misc()).removePrefix(fragment, LINK_PROTOCOL_PREFIX); + return _this; + } + + LinkResolver.prototype.resolve = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var loc = this.loc; if (!path.isAbsolute(loc)) { - loc = path.resolve(_this.config.lockfileFolder, loc); + loc = path.resolve(this.config.lockfileFolder, loc); } - const name = path.basename(loc); - const registry = 'npm'; + var name = path.basename(loc); + var registry = 'npm'; - const manifest = !(yield (_fs || _load_fs()).exists(loc)) ? { _uid: '', name: name, version: '0.0.0', _registry: registry } : yield _this.config.readManifest(loc, _this.registry); + var manifest = !(yield (_fs || _load_fs()).exists(loc)) ? { _uid: '', name, version: '0.0.0', _registry: registry } : yield this.config.readManifest(loc, this.registry); manifest._remote = { type: 'link', - registry: registry, + registry, hash: null, reference: loc }; @@ -61324,14 +64083,23 @@ class LinkResolver extends (_exoticResolver || _load_exoticResolver()).default { manifest._uid = manifest.version; return manifest; - })(); - } -} -exports.default = LinkResolver; + }); + + function resolve() { + return _ref.apply(this, arguments); + } + + return resolve; + }(); + + return LinkResolver; +}((_exoticResolver || _load_exoticResolver()).default); + LinkResolver.protocol = 'link'; +exports.default = LinkResolver; /***/ }), -/* 231 */ +/* 242 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61341,19 +64109,47 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); +} + var _npmResolver; function _load_npmResolver() { - return _npmResolver = _interopRequireDefault(__webpack_require__(147)); + return _npmResolver = _interopRequireDefault(__webpack_require__(154)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -class YarnResolver extends (_npmResolver || _load_npmResolver()).default {} +var YarnResolver = function (_NpmResolver) { + (0, (_inherits2 || _load_inherits()).default)(YarnResolver, _NpmResolver); + + function YarnResolver() { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, YarnResolver); + return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _NpmResolver.apply(this, arguments)); + } + + return YarnResolver; +}((_npmResolver || _load_npmResolver()).default); + exports.default = YarnResolver; /***/ }), -/* 232 */ +/* 243 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61364,9 +64160,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = function (from, to) { - const validFrom = (_semver || _load_semver()).default.valid(from); - const validTo = (_semver || _load_semver()).default.valid(to); - let versionBump = 'unknown'; + var validFrom = (_semver || _load_semver()).default.valid(from); + var validTo = (_semver || _load_semver()).default.valid(to); + var versionBump = 'unknown'; if (validFrom && validTo) { versionBump = (_semver || _load_semver()).default.diff(validFrom, validTo) || 'unchanged'; } @@ -61376,19 +64172,19 @@ exports.default = function (from, to) { var _semver; function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(19)); + return _semver = _interopRequireDefault(__webpack_require__(21)); } var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/* 233 */ +/* 244 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61399,20 +64195,22 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = function (from, to, reporter) { - const parts = to.split('.'); - const fromParts = from.split('.'); + var parts = to.split('.'); + var fromParts = from.split('.'); - const splitIndex = parts.findIndex((part, i) => part !== fromParts[i]); + var splitIndex = parts.findIndex(function (part, i) { + return part !== fromParts[i]; + }); if (splitIndex === -1) { return from; } - const colorized = reporter.format.green(parts.slice(splitIndex).join('.')); + var colorized = reporter.format.green(parts.slice(splitIndex).join('.')); return parts.slice(0, splitIndex).concat(colorized).join('.'); }; /***/ }), -/* 234 */ +/* 245 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61422,16 +64220,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _toConsumableArray2; +var _getIterator2; -function _load_toConsumableArray() { - return _toConsumableArray2 = _interopRequireDefault(__webpack_require__(32)); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); } var _set; function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); + return _set = _interopRequireDefault(__webpack_require__(15)); } exports.sortFilter = sortFilter; @@ -61442,26 +64240,52 @@ exports.filterOverridenGitignores = filterOverridenGitignores; var _misc; function _load_misc() { - return _misc = __webpack_require__(15); + return _misc = __webpack_require__(19); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const mm = __webpack_require__(93); -const path = __webpack_require__(1); +var mm = __webpack_require__(77); +var path = __webpack_require__(0); -const WHITESPACE_RE = /^\s+$/; +var WHITESPACE_RE = /^\s+$/; function sortFilter(files, filters) { - let keepFiles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default(); - let possibleKeepFiles = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new (_set || _load_set()).default(); - let ignoreFiles = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new (_set || _load_set()).default(); + var keepFiles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default(); + var possibleKeepFiles = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new (_set || _load_set()).default(); + var ignoreFiles = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new (_set || _load_set()).default(); + + for (var _iterator = files, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } - for (const file of files) { - let keep = false; + var file = _ref; + + var keep = false; // always keep a file if a ! pattern matches it - for (const filter of filters) { + for (var _iterator5 = filters, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref5; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref5 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref5 = _i5.value; + } + + var filter = _ref5; + if (filter.isNegation && matchesFilter(filter, file.basename, file.relative)) { keep = true; break; @@ -61476,8 +64300,21 @@ function sortFilter(files, filters) { // otherwise don't keep it if a pattern matches it keep = true; - for (const filter of filters) { - if (!filter.isNegation && matchesFilter(filter, file.basename, file.relative)) { + for (var _iterator6 = filters, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref6; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref6 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref6 = _i6.value; + } + + var _filter = _ref6; + + if (!_filter.isNegation && matchesFilter(_filter, file.basename, file.relative)) { keep = false; break; } @@ -61491,13 +64328,26 @@ function sortFilter(files, filters) { } // exclude file - for (const file of possibleKeepFiles) { - const parts = path.dirname(file).split(path.sep); + for (var _iterator2 = possibleKeepFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var _file = _ref2; + + var parts = path.dirname(_file).split(path.sep); while (parts.length) { - const folder = parts.join(path.sep); + var folder = parts.join(path.sep); if (ignoreFiles.has(folder)) { - ignoreFiles.add(file); + ignoreFiles.add(_file); break; } parts.pop(); @@ -61505,15 +64355,41 @@ function sortFilter(files, filters) { } // - for (const file of possibleKeepFiles) { - if (!ignoreFiles.has(file)) { - keepFiles.add(file); + for (var _iterator3 = possibleKeepFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var _file2 = _ref3; + + if (!ignoreFiles.has(_file2)) { + keepFiles.add(_file2); } } // - for (const file of keepFiles) { - const parts = path.dirname(file).split(path.sep); + for (var _iterator4 = keepFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var _file3 = _ref4; + + var parts = path.dirname(_file3).split(path.sep); while (parts.length) { // deregister this folder from being ignored, any files inside @@ -61523,29 +64399,31 @@ function sortFilter(files, filters) { } } - return { ignoreFiles: ignoreFiles, keepFiles: keepFiles }; + return { ignoreFiles, keepFiles }; } function matchesFilter(filter, basename, loc) { if (filter.base && filter.base !== '.') { loc = path.relative(filter.base, loc); } + // the micromatch regex expects unix path separators + loc = loc.replace('\\', '/'); return filter.regex.test(loc) || filter.regex.test(`/${loc}`) || filter.regex.test(basename) || mm.isMatch(loc, filter.pattern); } function ignoreLinesToRegex(lines) { - let base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.'; + var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.'; return lines // create regex - .map(line => { + .map(function (line) { // remove empty lines, comments, etc if (line === '' || line === '!' || line[0] === '#' || WHITESPACE_RE.test(line)) { return null; } - let pattern = line; - let isNegation = false; + var pattern = line; + var isNegation = false; // hide the fact that it's a negation from minimatch since we'll handle this specifically // ourselves @@ -61557,14 +64435,14 @@ function ignoreLinesToRegex(lines) { // remove trailing slash pattern = (0, (_misc || _load_misc()).removeSuffix)(pattern, '/'); - const regex = mm.makeRe(pattern.trim(), { nocase: true }); + var regex = mm.makeRe(pattern.trim(), { dot: true, nocase: true }); if (regex) { return { - base: base, - isNegation: isNegation, - pattern: pattern, - regex: regex + base, + isNegation, + pattern, + regex }; } else { return null; @@ -61573,18 +64451,22 @@ function ignoreLinesToRegex(lines) { } function filterOverridenGitignores(files) { - const IGNORE_FILENAMES = ['.yarnignore', '.npmignore', '.gitignore']; - const GITIGNORE_NAME = IGNORE_FILENAMES[2]; - return files.filter(file => IGNORE_FILENAMES.indexOf(file.basename) > -1).reduce((acc, file) => { + var IGNORE_FILENAMES = ['.yarnignore', '.npmignore', '.gitignore']; + var GITIGNORE_NAME = IGNORE_FILENAMES[2]; + return files.filter(function (file) { + return IGNORE_FILENAMES.indexOf(file.basename) > -1; + }).reduce(function (acc, file) { if (file.basename !== GITIGNORE_NAME) { - return [].concat((0, (_toConsumableArray2 || _load_toConsumableArray()).default)(acc), [file]); + return [].concat(acc, [file]); } else { //don't include .gitignore if .npmignore or .yarnignore are present - const dir = path.dirname(file.absolute); - const higherPriorityIgnoreFilePaths = [`${dir}/${IGNORE_FILENAMES[0]}`, `${dir}/${IGNORE_FILENAMES[1]}`]; - const hasHigherPriorityFiles = files.find(file => higherPriorityIgnoreFilePaths.indexOf(file.absolute) > -1); + var dir = path.dirname(file.absolute); + var higherPriorityIgnoreFilePaths = [`${dir}/${IGNORE_FILENAMES[0]}`, `${dir}/${IGNORE_FILENAMES[1]}`]; + var hasHigherPriorityFiles = files.find(function (file) { + return higherPriorityIgnoreFilePaths.indexOf(file.absolute) > -1; + }); if (!hasHigherPriorityFiles) { - return [].concat((0, (_toConsumableArray2 || _load_toConsumableArray()).default)(acc), [file]); + return [].concat(acc, [file]); } } return acc; @@ -61592,7 +64474,7 @@ function filterOverridenGitignores(files) { } /***/ }), -/* 235 */ +/* 246 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61606,42 +64488,42 @@ exports.spawn = undefined; var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); + return _extends2 = _interopRequireDefault(__webpack_require__(25)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(33)); + return _map = _interopRequireDefault(__webpack_require__(37)); } var _path; function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); + return _path = _interopRequireDefault(__webpack_require__(0)); } var _child; function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(44)); + return _child = _interopRequireWildcard(__webpack_require__(45)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const BATCH_MODE_ARGS = new (_map || _load_map()).default([['ssh', '-oBatchMode=yes'], ['plink', '-batch']]); +var BATCH_MODE_ARGS = new (_map || _load_map()).default([['ssh', '-oBatchMode=yes'], ['plink', '-batch']]); // Suppress any password prompts since we run these in the background -const env = (0, (_extends2 || _load_extends()).default)({ +var env = (0, (_extends2 || _load_extends()).default)({ GIT_ASKPASS: '', GIT_TERMINAL_PROMPT: 0 }, process.env); -const sshCommand = env.GIT_SSH || 'ssh'; -const sshExecutable = (_path || _load_path()).default.basename(sshCommand.toLowerCase(), '.exe'); -const sshBatchArgs = BATCH_MODE_ARGS.get(sshExecutable); +var sshCommand = env.GIT_SSH || 'ssh'; +var sshExecutable = (_path || _load_path()).default.basename(sshCommand.toLowerCase(), '.exe'); +var sshBatchArgs = BATCH_MODE_ARGS.get(sshExecutable); if (!env.GIT_SSH_COMMAND && sshBatchArgs) { // We have to manually specify `GIT_SSH_VARIANT`, @@ -61651,14 +64533,14 @@ if (!env.GIT_SSH_COMMAND && sshBatchArgs) { env.GIT_SSH_COMMAND = `"${sshCommand}" ${sshBatchArgs}`; } -const spawn = exports.spawn = function spawn(args) { - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; +var spawn = exports.spawn = function spawn(args) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return (_child || _load_child()).spawn('git', args, (0, (_extends2 || _load_extends()).default)({}, opts, { env: env })); + return (_child || _load_child()).spawn('git', args, (0, (_extends2 || _load_extends()).default)({}, opts, { env })); }; /***/ }), -/* 236 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61678,14 +64560,14 @@ function parsePackagePath(input) { return input.match(/(@[^\/]+\/)?([^/]+)/g) || []; } -const WRONG_PATTERNS = /\/$|\/{2,}|\*+$/; +var WRONG_PATTERNS = /\/$|\/{2,}|\*+$/; function isValidPackagePath(input) { return !WRONG_PATTERNS.test(input); } /***/ }), -/* 237 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61700,17 +64582,17 @@ exports.resolveWithHome = resolveWithHome; var _path; function _load_path() { - return _path = __webpack_require__(1); + return _path = __webpack_require__(0); } -const userHome = __webpack_require__(86).default; +var userHome = __webpack_require__(73).default; function getPosixPath(path) { return path.replace(/\\/g, '/'); } function resolveWithHome(path) { - const homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//; + var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//; if (homePattern.test(path)) { return (0, (_path || _load_path()).resolve)(userHome, path.substr(2)); } @@ -61719,7 +64601,7 @@ function resolveWithHome(path) { } /***/ }), -/* 238 */ +/* 249 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61729,76 +64611,88 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + var _assign; function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(13)); + return _assign = _interopRequireDefault(__webpack_require__(17)); } var _promise; function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); + return _promise = _interopRequireDefault(__webpack_require__(6)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); } var _fs; function _load_fs() { - return _fs = _interopRequireDefault(__webpack_require__(8)); + return _fs = _interopRequireDefault(__webpack_require__(10)); } var _url; function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(14)); + return _url = _interopRequireDefault(__webpack_require__(18)); } var _dnscache; function _load_dnscache() { - return _dnscache = _interopRequireDefault(__webpack_require__(508)); + return _dnscache = _interopRequireDefault(__webpack_require__(529)); } var _invariant; function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); + return _invariant = _interopRequireDefault(__webpack_require__(9)); } var _requestCaptureHar; function _load_requestCaptureHar() { - return _requestCaptureHar = _interopRequireDefault(__webpack_require__(647)); + return _requestCaptureHar = _interopRequireDefault(__webpack_require__(671)); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(5); } var _blockingQueue; function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(102)); + return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _network; function _load_network() { - return _network = _interopRequireWildcard(__webpack_require__(192)); + return _network = _interopRequireWildcard(__webpack_require__(203)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(28)); + return _map = _interopRequireDefault(__webpack_require__(34)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -61813,11 +64707,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de ttl: 300, cachesize: 10 }); -const successHosts = (0, (_map || _load_map()).default)(); -const controlOffline = (_network || _load_network()).isOffline(); +var successHosts = (0, (_map || _load_map()).default)(); +var controlOffline = (_network || _load_network()).isOffline(); + +var RequestManager = function () { + function RequestManager(reporter) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RequestManager); -class RequestManager { - constructor(reporter) { this.offlineNoRequests = false; this._requestCaptureHar = null; this._requestModule = null; @@ -61836,7 +64732,7 @@ class RequestManager { this.maxRetryAttempts = 5; } - setOptions(opts) { + RequestManager.prototype.setOptions = function setOptions(opts) { if (opts.userAgent != null) { this.userAgent = opts.userAgent; } @@ -61855,6 +64751,8 @@ class RequestManager { if (opts.httpsProxy === '') { this.httpsProxy = opts.httpProxy || ''; + } else if (opts.httpsProxy === false) { + this.httpsProxy = false; } else { this.httpsProxy = opts.httpsProxy || ''; } @@ -61884,8 +64782,10 @@ class RequestManager { // tls.connect wants an array of certificates without any comments/text, so we need to split the string // and strip out any text in between the certificates try { - const bundle = (_fs || _load_fs()).default.readFileSync(opts.cafile).toString(); - const hasPemPrefix = block => block.startsWith('-----BEGIN '); + var bundle = (_fs || _load_fs()).default.readFileSync(opts.cafile).toString(); + var hasPemPrefix = function hasPemPrefix(block) { + return block.startsWith('-----BEGIN '); + }; // opts.cafile overrides opts.ca, this matches with npm behavior this.ca = bundle.split(/(-----BEGIN .*\r?\n[^-]+\r?\n--.*)/).filter(hasPemPrefix); } catch (err) { @@ -61900,16 +64800,16 @@ class RequestManager { if (opts.key != null) { this.key = opts.key; } - } + }; /** * Lazy load `request` since it is exceptionally expensive to load and is * often not needed at all. */ - _getRequestModule() { + RequestManager.prototype._getRequestModule = function _getRequestModule() { if (!this._requestModule) { - const request = __webpack_require__(648); + var request = __webpack_require__(672); if (this.captureHar) { this._requestCaptureHar = new (_requestCaptureHar || _load_requestCaptureHar()).default(request); this._requestModule = this._requestCaptureHar.request.bind(this._requestCaptureHar); @@ -61918,18 +64818,20 @@ class RequestManager { } } return this._requestModule; - } + }; /** * Queue up a request. */ - request(params) { + RequestManager.prototype.request = function request(params) { + var _this = this; + if (this.offlineNoRequests) { return (_promise || _load_promise()).default.reject(new (_errors || _load_errors()).MessageError(this.reporter.lang('cantRequestOffline', params.url))); } - const cached = this.cache[params.url]; + var cached = this.cache[params.url]; if (cached) { return cached; } @@ -61942,9 +64844,9 @@ class RequestManager { 'User-Agent': this.userAgent }, params.headers); - const promise = new (_promise || _load_promise()).default((resolve, reject) => { - this.queue.push({ params: params, reject: reject, resolve: resolve }); - this.shiftQueue(); + var promise = new (_promise || _load_promise()).default(function (resolve, reject) { + _this.queue.push({ params, reject, resolve }); + _this.shiftQueue(); }); // we can't cache a request with a processor @@ -61953,34 +64855,34 @@ class RequestManager { } return promise; - } + }; /** * Clear the request cache. This is important as we cache all HTTP requests so you'll * want to do this as soon as you can. */ - clearCache() { + RequestManager.prototype.clearCache = function clearCache() { this.cache = {}; if (this._requestCaptureHar != null) { this._requestCaptureHar.clear(); } - } + }; /** * Check if an error is possibly due to lost or poor network connectivity. */ - isPossibleOfflineError(err) { - const code = err.code, - hostname = err.hostname; + RequestManager.prototype.isPossibleOfflineError = function isPossibleOfflineError(err) { + var code = err.code, + hostname = err.hostname; if (!code) { return false; } // network was previously online but now we're offline - const possibleOfflineChange = !controlOffline && !(_network || _load_network()).isOffline(); + var possibleOfflineChange = !controlOffline && !(_network || _load_network()).isOffline(); if (code === 'ENOTFOUND' && possibleOfflineChange) { // can't resolve a domain return true; @@ -62008,83 +64910,102 @@ class RequestManager { } return false; - } + }; /** * Queue up request arguments to be retried. Start a network connectivity timer if there * isn't already one. */ - queueForOffline(opts) { + RequestManager.prototype.queueForOffline = function queueForOffline(opts) { if (!this.offlineQueue.length) { this.reporter.info(this.reporter.lang('offlineRetrying')); this.initOfflineRetry(); } this.offlineQueue.push(opts); - } + }; /** * Begin timers to retry failed requests when we possibly establish network connectivity * again. */ - initOfflineRetry() { - setTimeout(() => { - const queue = this.offlineQueue; - this.offlineQueue = []; - for (const opts of queue) { - this.execute(opts); + RequestManager.prototype.initOfflineRetry = function initOfflineRetry() { + var _this2 = this; + + setTimeout(function () { + var queue = _this2.offlineQueue; + _this2.offlineQueue = []; + for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var opts = _ref; + + _this2.execute(opts); } }, 3000); - } + }; /** * Execute a request. */ - execute(opts) { - const params = opts.params; - const reporter = this.reporter; + RequestManager.prototype.execute = function execute(opts) { + var _this3 = this; + + var params = opts.params; + var reporter = this.reporter; - const buildNext = fn => data => { - fn(data); - this.running--; - this.shiftQueue(); + var buildNext = function buildNext(fn) { + return function (data) { + fn(data); + _this3.running--; + _this3.shiftQueue(); + }; }; - const resolve = buildNext(opts.resolve); + var resolve = buildNext(opts.resolve); - const rejectNext = buildNext(opts.reject); - const reject = function reject(err) { + var rejectNext = buildNext(opts.reject); + var reject = function reject(err) { err.message = `${params.url}: ${err.message}`; rejectNext(err); }; - let calledOnError = false; - const onError = err => { + var calledOnError = false; + var onError = function onError(err) { if (calledOnError) { return; } calledOnError = true; - const attempts = params.retryAttempts || 0; - if (attempts < this.maxRetryAttempts - 1 && this.isPossibleOfflineError(err)) { + var attempts = params.retryAttempts || 0; + if (attempts < _this3.maxRetryAttempts - 1 && _this3.isPossibleOfflineError(err)) { params.retryAttempts = attempts + 1; if (typeof params.cleanup === 'function') { params.cleanup(); } - this.queueForOffline(opts); + _this3.queueForOffline(opts); } else { reject(err); } }; if (!params.process) { - const parts = (_url || _load_url()).default.parse(params.url); + var parts = (_url || _load_url()).default.parse(params.url); - params.callback = (err, res, body) => { + params.callback = function (err, res, body) { if (err) { onError(err); return; @@ -62092,7 +65013,7 @@ class RequestManager { successHosts[parts.hostname] = true; - this.reporter.verbose(this.reporter.lang('verboseRequestFinish', params.url, res.statusCode)); + _this3.reporter.verbose(_this3.reporter.lang('verboseRequestFinish', params.url, res.statusCode)); if (body && typeof body.error === 'string') { reject(new Error(body.error)); @@ -62100,7 +65021,7 @@ class RequestManager { } if (res.statusCode === 403) { - const errMsg = body && body.message || reporter.lang('requestError', params.url, res.statusCode); + var errMsg = body && body.message || reporter.lang('requestError', params.url, res.statusCode); reject(new Error(errMsg)); } else { if ([400, 401, 404].concat(params.rejectStatusCode || []).indexOf(res.statusCode) !== -1) { @@ -62115,11 +65036,20 @@ class RequestManager { params.encoding = null; } - let proxy = this.httpProxy; + var proxy = this.httpProxy; if (params.url.startsWith('https:')) { proxy = this.httpsProxy; } - params.proxy = String(proxy); + + if (proxy) { + // if no proxy is set, do not pass a proxy down to request. + // the request library will internally check the HTTP_PROXY and HTTPS_PROXY env vars. + params.proxy = String(proxy); + } else if (proxy === false) { + // passing empty string prevents the underlying library from falling back to the env vars. + // an explicit false in the yarn config should override the env var. See #4546. + params.proxy = ''; + } if (this.ca != null) { params.ca = this.ca; @@ -62137,13 +65067,13 @@ class RequestManager { params.timeout = this.timeout; } - const request = this._getRequestModule(); - const req = request(params); + var request = this._getRequestModule(); + var req = request(params); this.reporter.verbose(this.reporter.lang('verboseRequestStart', params.method, params.url)); req.on('error', onError); - const queue = params.queue; + var queue = params.queue; if (queue) { req.on('data', queue.stillActive.bind(queue)); } @@ -62151,24 +65081,24 @@ class RequestManager { if (params.process) { params.process(req, resolve, reject); } - } + }; /** * Remove an item from the queue. Create it's request options and execute it. */ - shiftQueue() { + RequestManager.prototype.shiftQueue = function shiftQueue() { if (this.running >= this.max || !this.queue.length) { return; } - const opts = this.queue.shift(); + var opts = this.queue.shift(); this.running++; this.execute(opts); - } + }; - saveHar(filename) { + RequestManager.prototype.saveHar = function saveHar(filename) { if (!this.captureHar) { throw new Error(this.reporter.lang('requestManagerNotSetupHAR')); } @@ -62176,18 +65106,115 @@ class RequestManager { this._getRequestModule(); (0, (_invariant || _load_invariant()).default)(this._requestCaptureHar != null, 'request-capture-har not setup'); this._requestCaptureHar.saveHar(filename); + }; + + return RequestManager; +}(); + +exports.default = RequestManager; + +/***/ }), +/* 250 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.satisfiesWithPreleases = satisfiesWithPreleases; +var semver = __webpack_require__(21); + +/** + * Returns whether the given semver version satisfies the given range. Notably this supports + * prerelease versions so that "2.0.0-rc.0" satisfies the range ">=1.0.0", for example. + */ + +function satisfiesWithPreleases(version, range) { + var loose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var semverRange = void 0; + try { + // $FlowFixMe: Add a definition for the Range class + semverRange = new semver.Range(range, loose); + } catch (err) { + return false; } + + if (!version) { + return false; + } + var semverVersion = new semver.SemVer(version, semverRange.loose); + + // A range has multiple sets of comparators. A version must satisfy all comparators in a set + // and at least one set to satisfy the range. + return semverRange.set.some(function (comparatorSet) { + // node-semver converts ~ and ^ ranges into pairs of >= and < ranges but the upper bounds don't + // properly exclude prerelease versions. For example, "^1.0.0" is converted to ">=1.0.0 <2.0.0", + // which includes "2.0.0-pre" since prerelease versions are lower than their non-prerelease + // counterparts. As a practical workaround we make upper-bound ranges exclude prereleases and + // convert "<2.0.0" to "<2.0.0-0", for example. + comparatorSet = comparatorSet.map(function (comparator) { + if (comparator.operator !== '<' || !comparator.value || comparator.semver.prerelease.length) { + return comparator; + } + + // "0" is the lowest prerelease version + comparator.semver.inc('pre', 0); + + var comparatorString = comparator.operator + comparator.semver.version; + // $FlowFixMe: Add a definition for the Comparator class + return new semver.Comparator(comparatorString, comparator.loose); + }); + + return !comparatorSet.some(function (comparator) { + return !comparator.test(semverVersion); + }); + }); } -exports.default = RequestManager; /***/ }), -/* 239 */ +/* 251 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(479), __esModule: true }; + +/***/ }), +/* 252 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _iterator = __webpack_require__(452); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _symbol = __webpack_require__(451); + +var _symbol2 = _interopRequireDefault(_symbol); + +var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); +} : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); +}; + +/***/ }), +/* 253 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var crypto_hash_sha512 = __webpack_require__(131).lowlevel.crypto_hash; +var crypto_hash_sha512 = __webpack_require__(139).lowlevel.crypto_hash; /* * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a @@ -62744,12 +65771,12 @@ module.exports = { /***/ }), -/* 240 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const restoreCursor = __webpack_require__(658); +const restoreCursor = __webpack_require__(685); let hidden = false; @@ -62790,7 +65817,7 @@ exports.toggle = (force, stream) => { /***/ }), -/* 241 */ +/* 255 */ /***/ (function(module, exports) { @@ -63033,11 +66060,11 @@ function isObject(val) { /***/ }), -/* 242 */ +/* 256 */ /***/ (function(module, exports, __webpack_require__) { /* MIT license */ -var cssKeywords = __webpack_require__(453); +var cssKeywords = __webpack_require__(470); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). @@ -63900,12 +66927,12 @@ convert.rgb.gray = function (rgb) { /***/ }), -/* 243 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { -var util = __webpack_require__(2); -var Stream = __webpack_require__(25).Stream; -var DelayedStream = __webpack_require__(505); +var util = __webpack_require__(4); +var Stream = __webpack_require__(29).Stream; +var DelayedStream = __webpack_require__(526); module.exports = CombinedStream; function CombinedStream() { @@ -64094,23 +67121,23 @@ CombinedStream.prototype._emitError = function(err) { /***/ }), -/* 244 */ +/* 258 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var dP = __webpack_require__(53).f - , create = __webpack_require__(256) - , redefineAll = __webpack_require__(161) - , ctx = __webpack_require__(50) - , anInstance = __webpack_require__(156) - , defined = __webpack_require__(107) - , forOf = __webpack_require__(108) - , $iterDefine = __webpack_require__(159) - , step = __webpack_require__(253) - , setSpecies = __webpack_require__(258) - , DESCRIPTORS = __webpack_require__(51) - , fastKey = __webpack_require__(255).fastKey +var dP = __webpack_require__(43).f + , create = __webpack_require__(117) + , redefineAll = __webpack_require__(171) + , ctx = __webpack_require__(54) + , anInstance = __webpack_require__(163) + , defined = __webpack_require__(114) + , forOf = __webpack_require__(115) + , $iterDefine = __webpack_require__(168) + , step = __webpack_require__(267) + , setSpecies = __webpack_require__(272) + , DESCRIPTORS = __webpack_require__(48) + , fastKey = __webpack_require__(169).fastKey , SIZE = DESCRIPTORS ? '_s' : 'size'; var getEntry = function(that, key){ @@ -64242,12 +67269,12 @@ module.exports = { }; /***/ }), -/* 245 */ +/* 259 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON -var classof = __webpack_require__(106) - , from = __webpack_require__(466); +var classof = __webpack_require__(164) + , from = __webpack_require__(485); module.exports = function(NAME){ return function toJSON(){ if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); @@ -64256,24 +67283,24 @@ module.exports = function(NAME){ }; /***/ }), -/* 246 */ +/* 260 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var global = __webpack_require__(35) - , $export = __webpack_require__(41) - , meta = __webpack_require__(255) - , fails = __webpack_require__(68) - , hide = __webpack_require__(61) - , redefineAll = __webpack_require__(161) - , forOf = __webpack_require__(108) - , anInstance = __webpack_require__(156) - , isObject = __webpack_require__(52) - , setToStringTag = __webpack_require__(110) - , dP = __webpack_require__(53).f - , each = __webpack_require__(468)(0) - , DESCRIPTORS = __webpack_require__(51); + , $export = __webpack_require__(38) + , meta = __webpack_require__(169) + , fails = __webpack_require__(64) + , hide = __webpack_require__(55) + , redefineAll = __webpack_require__(171) + , forOf = __webpack_require__(115) + , anInstance = __webpack_require__(163) + , isObject = __webpack_require__(56) + , setToStringTag = __webpack_require__(96) + , dP = __webpack_require__(43).f + , each = __webpack_require__(487)(0) + , DESCRIPTORS = __webpack_require__(48); module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ var Base = global[NAME] @@ -64321,34 +67348,25 @@ module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ }; /***/ }), -/* 247 */ -/***/ (function(module, exports) { - -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - -/***/ }), -/* 248 */ +/* 261 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(35).document && document.documentElement; /***/ }), -/* 249 */ +/* 262 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = !__webpack_require__(51) && !__webpack_require__(68)(function(){ - return Object.defineProperty(__webpack_require__(157)('div'), 'a', {get: function(){ return 7; }}).a != 7; +module.exports = !__webpack_require__(48) && !__webpack_require__(64)(function(){ + return Object.defineProperty(__webpack_require__(165)('div'), 'a', {get: function(){ return 7; }}).a != 7; }); /***/ }), -/* 250 */ +/* 263 */ /***/ (function(module, exports, __webpack_require__) { // check on default Array iterator -var Iterators = __webpack_require__(70) +var Iterators = __webpack_require__(94) , ITERATOR = __webpack_require__(30)('iterator') , ArrayProto = Array.prototype; @@ -64357,11 +67375,21 @@ module.exports = function(it){ }; /***/ }), -/* 251 */ +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(93); +module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; +}; + +/***/ }), +/* 265 */ /***/ (function(module, exports, __webpack_require__) { // call something on iterator step with safe closing on error -var anObject = __webpack_require__(49); +var anObject = __webpack_require__(47); module.exports = function(iterator, fn, value, entries){ try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); @@ -64374,7 +67402,7 @@ module.exports = function(iterator, fn, value, entries){ }; /***/ }), -/* 252 */ +/* 266 */ /***/ (function(module, exports, __webpack_require__) { var ITERATOR = __webpack_require__(30)('iterator') @@ -64400,7 +67428,7 @@ module.exports = function(exec, skipClosing){ }; /***/ }), -/* 253 */ +/* 267 */ /***/ (function(module, exports) { module.exports = function(done, value){ @@ -64408,132 +67436,76 @@ module.exports = function(done, value){ }; /***/ }), -/* 254 */ -/***/ (function(module, exports) { +/* 268 */ +/***/ (function(module, exports, __webpack_require__) { -module.exports = true; +var pIE = __webpack_require__(118) + , createDesc = __webpack_require__(95) + , toIObject = __webpack_require__(66) + , toPrimitive = __webpack_require__(175) + , has = __webpack_require__(65) + , IE8_DOM_DEFINE = __webpack_require__(262) + , gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(48) ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); +}; /***/ }), -/* 255 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { -var META = __webpack_require__(164)('meta') - , isObject = __webpack_require__(52) - , has = __webpack_require__(69) - , setDesc = __webpack_require__(53).f - , id = 0; -var isExtensible = Object.isExtensible || function(){ - return true; -}; -var FREEZE = !__webpack_require__(68)(function(){ - return isExtensible(Object.preventExtensions({})); -}); -var setMeta = function(it){ - setDesc(it, META, {value: { - i: 'O' + ++id, // object ID - w: {} // weak collections IDs - }}); -}; -var fastKey = function(it, create){ - // return primitive with prefix - if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if(!has(it, META)){ - // can't set metadata to uncaught frozen object - if(!isExtensible(it))return 'F'; - // not necessary to add metadata - if(!create)return 'E'; - // add missing metadata - setMeta(it); - // return object ID - } return it[META].i; -}; -var getWeak = function(it, create){ - if(!has(it, META)){ - // can't set metadata to uncaught frozen object - if(!isExtensible(it))return true; - // not necessary to add metadata - if(!create)return false; - // add missing metadata - setMeta(it); - // return hash weak collections IDs - } return it[META].w; -}; -// add metadata on freeze-family methods calling -var onFreeze = function(it){ - if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); - return it; -}; -var meta = module.exports = { - KEY: META, - NEED: false, - fastKey: fastKey, - getWeak: getWeak, - onFreeze: onFreeze +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(270) + , hiddenKeys = __webpack_require__(166).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); }; /***/ }), -/* 256 */ +/* 270 */ /***/ (function(module, exports, __webpack_require__) { -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(49) - , dPs = __webpack_require__(477) - , enumBugKeys = __webpack_require__(247) - , IE_PROTO = __webpack_require__(162)('IE_PROTO') - , Empty = function(){ /* empty */ } - , PROTOTYPE = 'prototype'; - -// Create object with fake `null` prototype: use iframe Object with cleared prototype -var createDict = function(){ - // Thrash, waste and sodomy: IE GC bug - var iframe = __webpack_require__(157)('iframe') - , i = enumBugKeys.length - , lt = '<' - , gt = '>' - , iframeDocument; - iframe.style.display = 'none'; - __webpack_require__(248).appendChild(iframe); - iframe.src = 'javascript:'; // eslint-disable-line no-script-url - // createDict = iframe.contentWindow.Object; - // html.removeChild(iframe); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; - return createDict(); -}; +var has = __webpack_require__(65) + , toIObject = __webpack_require__(66) + , arrayIndexOf = __webpack_require__(486)(false) + , IE_PROTO = __webpack_require__(172)('IE_PROTO'); -module.exports = Object.create || function create(O, Properties){ - var result; - if(O !== null){ - Empty[PROTOTYPE] = anObject(O); - result = new Empty; - Empty[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = createDict(); - return Properties === undefined ? result : dPs(result, Properties); +module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; }; - /***/ }), -/* 257 */ -/***/ (function(module, exports) { +/* 271 */ +/***/ (function(module, exports, __webpack_require__) { -exports.f = {}.propertyIsEnumerable; +module.exports = __webpack_require__(55); /***/ }), -/* 258 */ +/* 272 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var global = __webpack_require__(35) - , core = __webpack_require__(21) - , dP = __webpack_require__(53) - , DESCRIPTORS = __webpack_require__(51) + , core = __webpack_require__(23) + , dP = __webpack_require__(43) + , DESCRIPTORS = __webpack_require__(48) , SPECIES = __webpack_require__(30)('species'); module.exports = function(KEY){ @@ -64545,24 +67517,13 @@ module.exports = function(KEY){ }; /***/ }), -/* 259 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(35) - , SHARED = '__core-js_shared__' - , store = global[SHARED] || (global[SHARED] = {}); -module.exports = function(key){ - return store[key] || (store[key] = {}); -}; - -/***/ }), -/* 260 */ +/* 273 */ /***/ (function(module, exports, __webpack_require__) { -var ctx = __webpack_require__(50) - , invoke = __webpack_require__(472) - , html = __webpack_require__(248) - , cel = __webpack_require__(157) +var ctx = __webpack_require__(54) + , invoke = __webpack_require__(492) + , html = __webpack_require__(261) + , cel = __webpack_require__(165) , global = __webpack_require__(35) , process = global.process , setTask = global.setImmediate @@ -64598,7 +67559,7 @@ if(!setTask || !clearTask){ delete queue[id]; }; // Node.js 0.8- - if(__webpack_require__(89)(process) == 'process'){ + if(__webpack_require__(93)(process) == 'process'){ defer = function(id){ process.nextTick(ctx(run, id, 1)); }; @@ -64636,30 +67597,13 @@ module.exports = { }; /***/ }), -/* 261 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __webpack_require__(52); -// instead of the ES6 spec version, we didn't implement @@toPrimitive case -// and the second argument - flag - preferred type is a string -module.exports = function(it, S){ - if(!isObject(it))return it; - var fn, val; - if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; - if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; - if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; - throw TypeError("Can't convert object to primitive value"); -}; - -/***/ }), -/* 262 */ +/* 274 */ /***/ (function(module, exports, __webpack_require__) { // Load modules -var Crypto = __webpack_require__(9); -var Boom = __webpack_require__(104); +var Crypto = __webpack_require__(13); +var Boom = __webpack_require__(112); // Declare internals @@ -64727,7 +67671,7 @@ exports.fixedTimeComparison = function (a, b) { /***/ }), -/* 263 */ +/* 275 */ /***/ (function(module, exports, __webpack_require__) { @@ -64743,7 +67687,7 @@ exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; -exports.humanize = __webpack_require__(617); +exports.humanize = __webpack_require__(641); /** * The currently active debug mode names, and names to skip. @@ -64935,13 +67879,13 @@ function coerce(val) { /***/ }), -/* 264 */ +/* 276 */ /***/ (function(module, exports, __webpack_require__) { -var stream = __webpack_require__(62) -var eos = __webpack_require__(509) -var inherits = __webpack_require__(54) -var shift = __webpack_require__(681) +var stream = __webpack_require__(67) +var eos = __webpack_require__(530) +var inherits = __webpack_require__(57) +var shift = __webpack_require__(710) var SIGNAL_FLUSH = new Buffer([0]) @@ -65169,13 +68113,13 @@ module.exports = Duplexify /***/ }), -/* 265 */ +/* 277 */ /***/ (function(module, exports, __webpack_require__) { -var crypto = __webpack_require__(9); -var BigInteger = __webpack_require__(57).BigInteger; -var ECPointFp = __webpack_require__(113).ECPointFp; -exports.ECCurves = __webpack_require__(511); +var crypto = __webpack_require__(13); +var BigInteger = __webpack_require__(60).BigInteger; +var ECPointFp = __webpack_require__(122).ECPointFp; +exports.ECCurves = __webpack_require__(532); // zero prepad function unstupid(hex,len) @@ -65232,10 +68176,10 @@ exports.ECKey = function(curve, key, isPublic) /***/ }), -/* 266 */ +/* 278 */ /***/ (function(module, exports, __webpack_require__) { -var once = __webpack_require__(125); +var once = __webpack_require__(133); var noop = function() {}; @@ -65321,15 +68265,15 @@ module.exports = eos; /***/ }), -/* 267 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { /* * extsprintf.js: extended POSIX-style sprintf */ -var mod_assert = __webpack_require__(31); -var mod_util = __webpack_require__(2); +var mod_assert = __webpack_require__(36); +var mod_util = __webpack_require__(4); /* * Public interface @@ -65493,7 +68437,7 @@ function dumpException(ex) /***/ }), -/* 268 */ +/* 280 */ /***/ (function(module, exports, __webpack_require__) { module.exports = realpath @@ -65503,13 +68447,13 @@ realpath.realpathSync = realpathSync realpath.monkeypatch = monkeypatch realpath.unmonkeypatch = unmonkeypatch -var fs = __webpack_require__(8) +var fs = __webpack_require__(10) var origRealpath = fs.realpath var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__(527) +var old = __webpack_require__(549) function newError (er) { return er && er.syscall === 'realpath' && ( @@ -65565,7 +68509,7 @@ function unmonkeypatch () { /***/ }), -/* 269 */ +/* 281 */ /***/ (function(module, exports, __webpack_require__) { exports.alphasort = alphasort @@ -65582,9 +68526,9 @@ function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } -var path = __webpack_require__(1) -var minimatch = __webpack_require__(124) -var isAbsolute = __webpack_require__(181) +var path = __webpack_require__(0) +var minimatch = __webpack_require__(132) +var isAbsolute = __webpack_require__(193) var Minimatch = minimatch.Minimatch function alphasorti (a, b) { @@ -65811,13 +68755,13 @@ function childrenIgnored (self, path) { /***/ }), -/* 270 */ +/* 282 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var fs = __webpack_require__(8) +var fs = __webpack_require__(10) module.exports = clone(fs) @@ -65839,15 +68783,15 @@ function clone (obj) { /***/ }), -/* 271 */ +/* 283 */ /***/ (function(module, exports, __webpack_require__) { -var fs = __webpack_require__(8) -var polyfills = __webpack_require__(532) -var legacy = __webpack_require__(531) +var fs = __webpack_require__(10) +var polyfills = __webpack_require__(554) +var legacy = __webpack_require__(553) var queue = [] -var util = __webpack_require__(2) +var util = __webpack_require__(4) function noop () {} @@ -65864,11 +68808,11 @@ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(queue) - __webpack_require__(31).equal(queue.length, 0) + __webpack_require__(36).equal(queue.length, 0) }) } -module.exports = patch(__webpack_require__(270)) +module.exports = patch(__webpack_require__(282)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { module.exports = patch(fs) } @@ -66107,9364 +69051,8891 @@ function retry () { /***/ }), -/* 272 */ +/* 284 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +// Load modules -var _ = __webpack_require__(26); -var MuteStream = __webpack_require__(279); -var readline = __webpack_require__(135); +var Crypto = __webpack_require__(13); +var Path = __webpack_require__(0); +var Util = __webpack_require__(4); +var Escape = __webpack_require__(582); -/** - * Base interface class other can inherits from - */ -var UI = module.exports = function (opt) { - // Instantiate the Readline interface - // @Note: Don't reassign if already present (allow test to override the Stream) - if (!this.rl) { - this.rl = readline.createInterface(setupReadlineOptions(opt)); - } - this.rl.resume(); +// Declare internals - this.onForceClose = this.onForceClose.bind(this); +var internals = {}; - // Make sure new prompt start on a newline when closing - this.rl.on('SIGINT', this.onForceClose); - process.on('exit', this.onForceClose); -}; -/** - * Handle the ^C exit - * @return {null} - */ +// Clone object or array -UI.prototype.onForceClose = function () { - this.close(); - console.log(''); -}; +exports.clone = function (obj, seen) { -/** - * Close the interface and cleanup listeners - */ + if (typeof obj !== 'object' || + obj === null) { -UI.prototype.close = function () { - // Remove events listeners - this.rl.removeListener('SIGINT', this.onForceClose); - process.removeListener('exit', this.onForceClose); + return obj; + } - this.rl.output.unmute(); + seen = seen || { orig: [], copy: [] }; - if (this.activePrompt && typeof this.activePrompt.close === 'function') { - this.activePrompt.close(); - } + var lookup = seen.orig.indexOf(obj); + if (lookup !== -1) { + return seen.copy[lookup]; + } - // Close the readline - this.rl.output.end(); - this.rl.pause(); - this.rl.close(); -}; + var newObj; + var cloneDeep = false; -function setupReadlineOptions(opt) { - opt = opt || {}; + if (!Array.isArray(obj)) { + if (Buffer.isBuffer(obj)) { + newObj = new Buffer(obj); + } + else if (obj instanceof Date) { + newObj = new Date(obj.getTime()); + } + else if (obj instanceof RegExp) { + newObj = new RegExp(obj); + } + else { + var proto = Object.getPrototypeOf(obj); + if (proto && + proto.isImmutable) { - // Default `input` to stdin - var input = opt.input || process.stdin; + newObj = obj; + } + else { + newObj = Object.create(proto); + cloneDeep = true; + } + } + } + else { + newObj = []; + cloneDeep = true; + } - // Add mute capabilities to the output - var ms = new MuteStream(); - ms.pipe(opt.output || process.stdout); - var output = ms; + seen.orig.push(obj); + seen.copy.push(newObj); - return _.extend({ - terminal: true, - input: input, - output: output - }, _.omit(opt, ['input', 'output'])); -} + if (cloneDeep) { + var keys = Object.getOwnPropertyNames(obj); + for (var i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + var descriptor = Object.getOwnPropertyDescriptor(obj, key); + if (descriptor && + (descriptor.get || + descriptor.set)) { + Object.defineProperty(newObj, key, descriptor); + } + else { + newObj[key] = exports.clone(obj[key], seen); + } + } + } -/***/ }), -/* 273 */ -/***/ (function(module, exports, __webpack_require__) { + return newObj; +}; -"use strict"; -var ansiEscapes = __webpack_require__(354); +// Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied +/*eslint-disable */ +exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) { +/*eslint-enable */ + exports.assert(target && typeof target === 'object', 'Invalid target value: must be an object'); + exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object'); -/** - * Move cursor left by `x` - * @param {Readline} rl - Readline instance - * @param {Number} x - How far to go left (default to 1) - */ + if (!source) { + return target; + } -exports.left = function (rl, x) { - rl.output.write(ansiEscapes.cursorBackward(x)); -}; + if (Array.isArray(source)) { + exports.assert(Array.isArray(target), 'Cannot merge array onto an object'); + if (isMergeArrays === false) { // isMergeArrays defaults to true + target.length = 0; // Must not change target assignment + } -/** - * Move cursor right by `x` - * @param {Readline} rl - Readline instance - * @param {Number} x - How far to go left (default to 1) - */ + for (var i = 0, il = source.length; i < il; ++i) { + target.push(exports.clone(source[i])); + } -exports.right = function (rl, x) { - rl.output.write(ansiEscapes.cursorForward(x)); -}; + return target; + } -/** - * Move cursor up by `x` - * @param {Readline} rl - Readline instance - * @param {Number} x - How far to go up (default to 1) - */ + var keys = Object.keys(source); + for (var k = 0, kl = keys.length; k < kl; ++k) { + var key = keys[k]; + var value = source[key]; + if (value && + typeof value === 'object') { -exports.up = function (rl, x) { - rl.output.write(ansiEscapes.cursorUp(x)); -}; + if (!target[key] || + typeof target[key] !== 'object' || + (Array.isArray(target[key]) ^ Array.isArray(value)) || + value instanceof Date || + Buffer.isBuffer(value) || + value instanceof RegExp) { -/** - * Move cursor down by `x` - * @param {Readline} rl - Readline instance - * @param {Number} x - How far to go down (default to 1) - */ + target[key] = exports.clone(value); + } + else { + exports.merge(target[key], value, isNullOverride, isMergeArrays); + } + } + else { + if (value !== null && + value !== undefined) { // Explicit to preserve empty strings -exports.down = function (rl, x) { - rl.output.write(ansiEscapes.cursorDown(x)); -}; + target[key] = value; + } + else if (isNullOverride !== false) { // Defaults to true + target[key] = value; + } + } + } -/** - * Clear current line - * @param {Readline} rl - Readline instance - * @param {Number} len - number of line to delete - */ -exports.clearLine = function (rl, len) { - rl.output.write(ansiEscapes.eraseLines(len)); + return target; }; -/***/ }), -/* 274 */ -/***/ (function(module, exports, __webpack_require__) { +// Apply options to a copy of the defaults -"use strict"; -/*! - * is-number - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ +exports.applyToDefaults = function (defaults, options, isNullOverride) { + + exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object'); + exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object'); + if (!options) { // If no options, return null + return null; + } + var copy = exports.clone(defaults); -var typeOf = __webpack_require__(178); + if (options === true) { // If options is set to true, use defaults + return copy; + } -module.exports = function isNumber(num) { - var type = typeOf(num); - if (type !== 'number' && type !== 'string') { - return false; - } - var n = +num; - return (n - n + 1) >= 0 && num !== ''; + return exports.merge(copy, options, isNullOverride === true, false); }; -/***/ }), -/* 275 */ -/***/ (function(module, exports, __webpack_require__) { +// Clone an object except for the listed keys which are shallow copied -"use strict"; -/*! - * is-primitive - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ +exports.cloneWithShallow = function (source, keys) { + if (!source || + typeof source !== 'object') { + return source; + } -// see http://jsperf.com/testing-value-is-primitive/7 -module.exports = function isPrimitive(value) { - return value == null || (typeof value !== 'function' && typeof value !== 'object'); + var storage = internals.store(source, keys); // Move shallow copy items to storage + var copy = exports.clone(source); // Deep copy the rest + internals.restore(copy, source, storage); // Shallow copy the stored items and restore + return copy; }; -/***/ }), -/* 276 */ -/***/ (function(module, exports) { +internals.store = function (source, keys) { -var toString = {}.toString; + var storage = {}; + for (var i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + var value = exports.reach(source, key); + if (value !== undefined) { + storage[key] = value; + internals.reachSet(source, key, undefined); + } + } -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; + return storage; }; -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -var stream = __webpack_require__(25) - - -function isStream (obj) { - return obj instanceof stream.Stream -} +internals.restore = function (copy, source, storage) { + var keys = Object.keys(storage); + for (var i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + internals.reachSet(copy, key, storage[key]); + internals.reachSet(source, key, storage[key]); + } +}; -function isReadable (obj) { - return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object' -} +internals.reachSet = function (obj, key, value) { -function isWritable (obj) { - return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object' -} + var path = key.split('.'); + var ref = obj; + for (var i = 0, il = path.length; i < il; ++i) { + var segment = path[i]; + if (i + 1 === il) { + ref[segment] = value; + } + ref = ref[segment]; + } +}; -function isDuplex (obj) { - return isReadable(obj) && isWritable(obj) -} +// Apply options to defaults except for the listed keys which are shallow copied from option without merging -module.exports = isStream -module.exports.isReadable = isReadable -module.exports.isWritable = isWritable -module.exports.isDuplex = isDuplex +exports.applyToDefaultsWithShallow = function (defaults, options, keys) { + exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object'); + exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object'); + exports.assert(keys && Array.isArray(keys), 'Invalid keys'); -/***/ }), -/* 278 */ -/***/ (function(module, exports, __webpack_require__) { + if (!options) { // If no options, return null + return null; + } -"use strict"; -/*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ + var copy = exports.cloneWithShallow(defaults, keys); + if (options === true) { // If options is set to true, use defaults + return copy; + } + var storage = internals.store(options, keys); // Move shallow copy items to storage + exports.merge(copy, options, false, false); // Deep copy the rest + internals.restore(copy, options, storage); // Shallow copy the stored items and restore + return copy; +}; -/** - * Module dependencies. - * @private - */ -var db = __webpack_require__(615) -var extname = __webpack_require__(1).extname +// Deep object or array comparison -/** - * Module variables. - * @private - */ +exports.deepEqual = function (obj, ref, options, seen) { -var extractTypeRegExp = /^\s*([^;\s]*)(?:;|\s|$)/ -var textTypeRegExp = /^text\//i + options = options || { prototype: true }; -/** - * Module exports. - * @public - */ + var type = typeof obj; -exports.charset = charset -exports.charsets = { lookup: charset } -exports.contentType = contentType -exports.extension = extension -exports.extensions = Object.create(null) -exports.lookup = lookup -exports.types = Object.create(null) + if (type !== typeof ref) { + return false; + } -// Populate the extensions/types maps -populateMaps(exports.extensions, exports.types) + if (type !== 'object' || + obj === null || + ref === null) { -/** - * Get the default charset for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ + if (obj === ref) { // Copied from Deep-eql, copyright(c) 2013 Jake Luer, jake@alogicalparadox.com, MIT Licensed, https://github.com/chaijs/deep-eql + return obj !== 0 || 1 / obj === 1 / ref; // -0 / +0 + } -function charset (type) { - if (!type || typeof type !== 'string') { - return false - } + return obj !== obj && ref !== ref; // NaN + } - // TODO: use media-typer - var match = extractTypeRegExp.exec(type) - var mime = match && db[match[1].toLowerCase()] + seen = seen || []; + if (seen.indexOf(obj) !== -1) { + return true; // If previous comparison failed, it would have stopped execution + } - if (mime && mime.charset) { - return mime.charset - } + seen.push(obj); - // default text/* to utf-8 - if (match && textTypeRegExp.test(match[1])) { - return 'UTF-8' - } + if (Array.isArray(obj)) { + if (!Array.isArray(ref)) { + return false; + } - return false -} + if (!options.part && obj.length !== ref.length) { + return false; + } -/** - * Create a full Content-Type header given a MIME type or extension. - * - * @param {string} str - * @return {boolean|string} - */ + for (var i = 0, il = obj.length; i < il; ++i) { + if (options.part) { + var found = false; + for (var r = 0, rl = ref.length; r < rl; ++r) { + if (exports.deepEqual(obj[i], ref[r], options, seen)) { + found = true; + break; + } + } -function contentType (str) { - // TODO: should this even be in this module? - if (!str || typeof str !== 'string') { - return false - } + return found; + } - var mime = str.indexOf('/') === -1 - ? exports.lookup(str) - : str + if (!exports.deepEqual(obj[i], ref[i], options, seen)) { + return false; + } + } - if (!mime) { - return false - } + return true; + } - // TODO: use content-type or other module - if (mime.indexOf('charset') === -1) { - var charset = exports.charset(mime) - if (charset) mime += '; charset=' + charset.toLowerCase() - } + if (Buffer.isBuffer(obj)) { + if (!Buffer.isBuffer(ref)) { + return false; + } - return mime -} + if (obj.length !== ref.length) { + return false; + } -/** - * Get the default extension for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ + for (var j = 0, jl = obj.length; j < jl; ++j) { + if (obj[j] !== ref[j]) { + return false; + } + } -function extension (type) { - if (!type || typeof type !== 'string') { - return false - } + return true; + } - // TODO: use media-typer - var match = extractTypeRegExp.exec(type) + if (obj instanceof Date) { + return (ref instanceof Date && obj.getTime() === ref.getTime()); + } - // get extensions - var exts = match && exports.extensions[match[1].toLowerCase()] + if (obj instanceof RegExp) { + return (ref instanceof RegExp && obj.toString() === ref.toString()); + } - if (!exts || !exts.length) { - return false - } + if (options.prototype) { + if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) { + return false; + } + } - return exts[0] -} + var keys = Object.getOwnPropertyNames(obj); -/** - * Lookup the MIME type for a file path/extension. - * - * @param {string} path - * @return {boolean|string} - */ + if (!options.part && keys.length !== Object.getOwnPropertyNames(ref).length) { + return false; + } -function lookup (path) { - if (!path || typeof path !== 'string') { - return false - } + for (var k = 0, kl = keys.length; k < kl; ++k) { + var key = keys[k]; + var descriptor = Object.getOwnPropertyDescriptor(obj, key); + if (descriptor.get) { + if (!exports.deepEqual(descriptor, Object.getOwnPropertyDescriptor(ref, key), options, seen)) { + return false; + } + } + else if (!exports.deepEqual(obj[key], ref[key], options, seen)) { + return false; + } + } - // get the extension ("ext" or ".ext" or full path) - var extension = extname('x.' + path) - .toLowerCase() - .substr(1) + return true; +}; - if (!extension) { - return false - } - return exports.types[extension] || false -} +// Remove duplicate items from array -/** - * Populate the extensions and types maps. - * @private - */ +exports.unique = function (array, key) { -function populateMaps (extensions, types) { - // source preference (least -> most) - var preference = ['nginx', 'apache', undefined, 'iana'] + var index = {}; + var result = []; - Object.keys(db).forEach(function forEachMimeType (type) { - var mime = db[type] - var exts = mime.extensions + for (var i = 0, il = array.length; i < il; ++i) { + var id = (key ? array[i][key] : array[i]); + if (index[id] !== true) { - if (!exts || !exts.length) { - return + result.push(array[i]); + index[id] = true; + } } - // mime -> extensions - extensions[type] = exts + return result; +}; - // extension -> mime - for (var i = 0; i < exts.length; i++) { - var extension = exts[i] - if (types[extension]) { - var from = preference.indexOf(db[types[extension]].source) - var to = preference.indexOf(mime.source) +// Convert array into object - if (types[extension] !== 'application/octet-stream' && - (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { - // skip the remapping - continue - } - } +exports.mapToObject = function (array, key) { - // set the extension -> mime - types[extension] = type + if (!array) { + return null; } - }) -} - - -/***/ }), -/* 279 */ -/***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__(25) + var obj = {}; + for (var i = 0, il = array.length; i < il; ++i) { + if (key) { + if (array[i][key]) { + obj[array[i][key]] = true; + } + } + else { + obj[array[i]] = true; + } + } -module.exports = MuteStream + return obj; +}; -// var out = new MuteStream(process.stdout) -// argument auto-pipes -function MuteStream (opts) { - Stream.apply(this) - opts = opts || {} - this.writable = this.readable = true - this.muted = false - this.on('pipe', this._onpipe) - this.replace = opts.replace - // For readline-type situations - // This much at the start of a line being redrawn after a ctrl char - // is seen (such as backspace) won't be redrawn as the replacement - this._prompt = opts.prompt || null - this._hadControl = false -} +// Find the common unique items in two arrays -MuteStream.prototype = Object.create(Stream.prototype) +exports.intersect = function (array1, array2, justFirst) { -Object.defineProperty(MuteStream.prototype, 'constructor', { - value: MuteStream, - enumerable: false -}) + if (!array1 || !array2) { + return []; + } -MuteStream.prototype.mute = function () { - this.muted = true -} + var common = []; + var hash = (Array.isArray(array1) ? exports.mapToObject(array1) : array1); + var found = {}; + for (var i = 0, il = array2.length; i < il; ++i) { + if (hash[array2[i]] && !found[array2[i]]) { + if (justFirst) { + return array2[i]; + } -MuteStream.prototype.unmute = function () { - this.muted = false -} + common.push(array2[i]); + found[array2[i]] = true; + } + } -Object.defineProperty(MuteStream.prototype, '_onpipe', { - value: onPipe, - enumerable: false, - writable: true, - configurable: true -}) + return (justFirst ? null : common); +}; -function onPipe (src) { - this._src = src -} -Object.defineProperty(MuteStream.prototype, 'isTTY', { - get: getIsTTY, - set: setIsTTY, - enumerable: true, - configurable: true -}) +// Test if the reference contains the values -function getIsTTY () { - return( (this._dest) ? this._dest.isTTY - : (this._src) ? this._src.isTTY - : false - ) -} +exports.contain = function (ref, values, options) { -// basically just get replace the getter/setter with a regular value -function setIsTTY (isTTY) { - Object.defineProperty(this, 'isTTY', { - value: isTTY, - enumerable: true, - writable: true, - configurable: true - }) -} + /* + string -> string(s) + array -> item(s) + object -> key(s) + object -> object (key:value) + */ -Object.defineProperty(MuteStream.prototype, 'rows', { - get: function () { - return( this._dest ? this._dest.rows - : this._src ? this._src.rows - : undefined ) - }, enumerable: true, configurable: true }) + var valuePairs = null; + if (typeof ref === 'object' && + typeof values === 'object' && + !Array.isArray(ref) && + !Array.isArray(values)) { -Object.defineProperty(MuteStream.prototype, 'columns', { - get: function () { - return( this._dest ? this._dest.columns - : this._src ? this._src.columns - : undefined ) - }, enumerable: true, configurable: true }) + valuePairs = values; + values = Object.keys(values); + } + else { + values = [].concat(values); + } + options = options || {}; // deep, once, only, part -MuteStream.prototype.pipe = function (dest, options) { - this._dest = dest - return Stream.prototype.pipe.call(this, dest, options) -} + exports.assert(arguments.length >= 2, 'Insufficient arguments'); + exports.assert(typeof ref === 'string' || typeof ref === 'object', 'Reference must be string or an object'); + exports.assert(values.length, 'Values array cannot be empty'); -MuteStream.prototype.pause = function () { - if (this._src) return this._src.pause() -} + var compare, compareFlags; + if (options.deep) { + compare = exports.deepEqual; -MuteStream.prototype.resume = function () { - if (this._src) return this._src.resume() -} + var hasOnly = options.hasOwnProperty('only'), hasPart = options.hasOwnProperty('part'); -MuteStream.prototype.write = function (c) { - if (this.muted) { - if (!this.replace) return true - if (c.match(/^\u001b/)) { - if(c.indexOf(this._prompt) === 0) { - c = c.substr(this._prompt.length); - c = c.replace(/./g, this.replace); - c = this._prompt + c; - } - this._hadControl = true - return this.emit('data', c) - } else { - if (this._prompt && this._hadControl && - c.indexOf(this._prompt) === 0) { - this._hadControl = false - this.emit('data', this._prompt) - c = c.substr(this._prompt.length) - } - c = c.toString().replace(/./g, this.replace) + compareFlags = { + prototype: hasOnly ? options.only : hasPart ? !options.part : false, + part: hasOnly ? !options.only : hasPart ? options.part : true + }; } - } - this.emit('data', c) -} + else { + compare = function (a, b) { -MuteStream.prototype.end = function (c) { - if (this.muted) { - if (c && this.replace) { - c = c.toString().replace(/./g, this.replace) - } else { - c = null + return a === b; + }; } - } - if (c) this.emit('data', c) - this.emit('end') -} - -function proxy (fn) { return function () { - var d = this._dest - var s = this._src - if (d && d[fn]) d[fn].apply(d, arguments) - if (s && s[fn]) s[fn].apply(s, arguments) -}} -MuteStream.prototype.destroy = proxy('destroy') -MuteStream.prototype.destroySoon = proxy('destroySoon') -MuteStream.prototype.close = proxy('close') + var misses = false; + var matches = new Array(values.length); + for (var i = 0, il = matches.length; i < il; ++i) { + matches[i] = 0; + } + if (typeof ref === 'string') { + var pattern = '('; + for (i = 0, il = values.length; i < il; ++i) { + var value = values[i]; + exports.assert(typeof value === 'string', 'Cannot compare string reference to non-string value'); + pattern += (i ? '|' : '') + exports.escapeRegex(value); + } -/***/ }), -/* 280 */ -/***/ (function(module, exports, __webpack_require__) { + var regex = new RegExp(pattern + ')', 'g'); + var leftovers = ref.replace(regex, function ($0, $1) { -module.exports = __webpack_require__(618); + var index = values.indexOf($1); + ++matches[index]; + return ''; // Remove from string + }); -/***/ }), -/* 281 */ -/***/ (function(module, exports, __webpack_require__) { + misses = !!leftovers; + } + else if (Array.isArray(ref)) { + for (i = 0, il = ref.length; i < il; ++i) { + for (var j = 0, jl = values.length, matched = false; j < jl && matched === false; ++j) { + matched = compare(values[j], ref[i], compareFlags) && j; + } -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - - -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; + if (matched !== false) { + ++matches[matched]; + } + else { + misses = true; + } + } + } + else { + var keys = Object.keys(ref); + for (i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + var pos = values.indexOf(key); + if (pos !== -1) { + if (valuePairs && + !compare(valuePairs[key], ref[key], compareFlags)) { -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } + return false; + } - return Object(val); -} + ++matches[pos]; + } + else { + misses = true; + } + } + } -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } + var result = false; + for (i = 0, il = matches.length; i < il; ++i) { + result = result || !!matches[i]; + if ((options.once && matches[i] > 1) || + (!options.part && !matches[i])) { - // Detect buggy property enumeration order in older V8 versions. + return false; + } + } - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } + if (options.only && + misses) { - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } + return false; + } - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } + return result; +}; - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; +// Flatten array - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); +exports.flatten = function (array, target) { - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } + var result = target || []; - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } + for (var i = 0, il = array.length; i < il; ++i) { + if (Array.isArray(array[i])) { + exports.flatten(array[i], result); + } + else { + result.push(array[i]); + } + } - return to; + return result; }; -/***/ }), -/* 282 */ -/***/ (function(module, exports, __webpack_require__) { +// Convert an object key chain string ('a.b.c') to reference (object[a][b][c]) -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory){ - 'use strict'; +exports.reach = function (obj, chain, options) { - /*istanbul ignore next:cant test*/ - if (typeof module === 'object' && typeof module.exports === 'object') { - module.exports = factory(); - } else if (true) { - // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - // Browser globals - root.objectPath = factory(); - } -})(this, function(){ - 'use strict'; + if (chain === false || + chain === null || + typeof chain === 'undefined') { - var toStr = Object.prototype.toString; - function hasOwnProperty(obj, prop) { - if(obj == null) { - return false + return obj; } - //to handle objects with null prototypes (too edge case?) - return Object.prototype.hasOwnProperty.call(obj, prop) - } - function isEmpty(value){ - if (!value) { - return true; + options = options || {}; + if (typeof options === 'string') { + options = { separator: options }; } - if (isArray(value) && value.length === 0) { - return true; - } else if (typeof value !== 'string') { - for (var i in value) { - if (hasOwnProperty(value, i)) { - return false; - } + + var path = chain.split(options.separator || '.'); + var ref = obj; + for (var i = 0, il = path.length; i < il; ++i) { + var key = path[i]; + if (key[0] === '-' && Array.isArray(ref)) { + key = key.slice(1, key.length); + key = ref.length - key; } - return true; - } - return false; - } - function toString(type){ - return toStr.call(type); - } + if (!ref || + !ref.hasOwnProperty(key) || + (typeof ref !== 'object' && options.functions === false)) { // Only object and function can have properties - function isObject(obj){ - return typeof obj === 'object' && toString(obj) === "[object Object]"; - } + exports.assert(!options.strict || i + 1 === il, 'Missing segment', key, 'in reach path ', chain); + exports.assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain); + ref = options.default; + break; + } - var isArray = Array.isArray || function(obj){ - /*istanbul ignore next:cant test*/ - return toStr.call(obj) === '[object Array]'; - } + ref = ref[key]; + } - function isBoolean(obj){ - return typeof obj === 'boolean' || toString(obj) === '[object Boolean]'; - } + return ref; +}; - function getKey(key){ - var intKey = parseInt(key); - if (intKey.toString() === key) { - return intKey; - } - return key; - } - function factory(options) { - options = options || {} +exports.reachTemplate = function (obj, template, options) { - var objectPath = function(obj) { - return Object.keys(objectPath).reduce(function(proxy, prop) { - if(prop === 'create') { - return proxy; - } + return template.replace(/{([^}]+)}/g, function ($0, chain) { - /*istanbul ignore else*/ - if (typeof objectPath[prop] === 'function') { - proxy[prop] = objectPath[prop].bind(objectPath, obj); - } + var value = exports.reach(obj, chain, options); + return (value === undefined || value === null ? '' : value); + }); +}; - return proxy; - }, {}); - }; - function hasShallowProperty(obj, prop) { - return (options.includeInheritedProps || (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop)) - } +exports.formatStack = function (stack) { - function getShallowProperty(obj, prop) { - if (hasShallowProperty(obj, prop)) { - return obj[prop]; - } + var trace = []; + for (var i = 0, il = stack.length; i < il; ++i) { + var item = stack[i]; + trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]); } - function set(obj, path, value, doNotReplace){ - if (typeof path === 'number') { - path = [path]; - } - if (!path || path.length === 0) { - return obj; - } - if (typeof path === 'string') { - return set(obj, path.split('.').map(getKey), value, doNotReplace); - } - var currentPath = path[0]; - var currentValue = getShallowProperty(obj, currentPath); - if (path.length === 1) { - if (currentValue === void 0 || !doNotReplace) { - obj[currentPath] = value; - } - return currentValue; - } + return trace; +}; - if (currentValue === void 0) { - //check if we assume an array - if(typeof path[1] === 'number') { - obj[currentPath] = []; - } else { - obj[currentPath] = {}; - } - } - return set(obj[currentPath], path.slice(1), value, doNotReplace); +exports.formatTrace = function (trace) { + + var display = []; + + for (var i = 0, il = trace.length; i < il; ++i) { + var row = trace[i]; + display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')'); } - objectPath.has = function (obj, path) { - if (typeof path === 'number') { - path = [path]; - } else if (typeof path === 'string') { - path = path.split('.'); - } + return display; +}; - if (!path || path.length === 0) { - return !!obj; - } - for (var i = 0; i < path.length; i++) { - var j = getKey(path[i]); +exports.callStack = function (slice) { - if((typeof j === 'number' && isArray(obj) && j < obj.length) || - (options.includeInheritedProps ? (j in Object(obj)) : hasOwnProperty(obj, j))) { - obj = obj[j]; - } else { - return false; - } - } + // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi - return true; - }; + var v8 = Error.prepareStackTrace; + Error.prepareStackTrace = function (err, stack) { - objectPath.ensureExists = function (obj, path, value){ - return set(obj, path, value, true); + return stack; }; - objectPath.set = function (obj, path, value, doNotReplace){ - return set(obj, path, value, doNotReplace); - }; + var capture = {}; + Error.captureStackTrace(capture, arguments.callee); /*eslint no-caller:0 */ + var stack = capture.stack; - objectPath.insert = function (obj, path, value, at){ - var arr = objectPath.get(obj, path); - at = ~~at; - if (!isArray(arr)) { - arr = []; - objectPath.set(obj, path, arr); - } - arr.splice(at, 0, value); - }; + Error.prepareStackTrace = v8; - objectPath.empty = function(obj, path) { - if (isEmpty(path)) { - return void 0; - } - if (obj == null) { - return void 0; - } + var trace = exports.formatStack(stack); - var value, i; - if (!(value = objectPath.get(obj, path))) { - return void 0; - } + if (slice) { + return trace.slice(slice); + } - if (typeof value === 'string') { - return objectPath.set(obj, path, ''); - } else if (isBoolean(value)) { - return objectPath.set(obj, path, false); - } else if (typeof value === 'number') { - return objectPath.set(obj, path, 0); - } else if (isArray(value)) { - value.length = 0; - } else if (isObject(value)) { - for (i in value) { - if (hasShallowProperty(value, i)) { - delete value[i]; - } - } - } else { - return objectPath.set(obj, path, null); - } - }; + return trace; +}; - objectPath.push = function (obj, path /*, values */){ - var arr = objectPath.get(obj, path); - if (!isArray(arr)) { - arr = []; - objectPath.set(obj, path, arr); - } - arr.push.apply(arr, Array.prototype.slice.call(arguments, 2)); - }; +exports.displayStack = function (slice) { - objectPath.coalesce = function (obj, paths, defaultValue) { - var value; + var trace = exports.callStack(slice === undefined ? 1 : slice + 1); - for (var i = 0, len = paths.length; i < len; i++) { - if ((value = objectPath.get(obj, paths[i])) !== void 0) { - return value; - } - } + return exports.formatTrace(trace); +}; - return defaultValue; - }; - objectPath.get = function (obj, path, defaultValue){ - if (typeof path === 'number') { - path = [path]; - } - if (!path || path.length === 0) { - return obj; - } - if (obj == null) { - return defaultValue; - } - if (typeof path === 'string') { - return objectPath.get(obj, path.split('.'), defaultValue); - } +exports.abortThrow = false; - var currentPath = getKey(path[0]); - var nextObj = getShallowProperty(obj, currentPath) - if (nextObj === void 0) { - return defaultValue; - } - if (path.length === 1) { - return nextObj; - } +exports.abort = function (message, hideStack) { - return objectPath.get(obj[currentPath], path.slice(1), defaultValue); - }; + if (process.env.NODE_ENV === 'test' || exports.abortThrow === true) { + throw new Error(message || 'Unknown error'); + } - objectPath.del = function del(obj, path) { - if (typeof path === 'number') { - path = [path]; - } + var stack = ''; + if (!hideStack) { + stack = exports.displayStack(1).join('\n\t'); + } + console.log('ABORT: ' + message + '\n\t' + stack); + process.exit(1); +}; - if (obj == null) { - return obj; - } - if (isEmpty(path)) { - return obj; - } - if(typeof path === 'string') { - return objectPath.del(obj, path.split('.')); - } +exports.assert = function (condition /*, msg1, msg2, msg3 */) { - var currentPath = getKey(path[0]); - if (!hasShallowProperty(obj, currentPath)) { - return obj; - } + if (condition) { + return; + } - if(path.length === 1) { - if (isArray(obj)) { - obj.splice(currentPath, 1); - } else { - delete obj[currentPath]; - } - } else { - return objectPath.del(obj[currentPath], path.slice(1)); - } + if (arguments.length === 2 && arguments[1] instanceof Error) { + throw arguments[1]; + } - return obj; + var msgs = []; + for (var i = 1, il = arguments.length; i < il; ++i) { + if (arguments[i] !== '') { + msgs.push(arguments[i]); // Avoids Array.slice arguments leak, allowing for V8 optimizations + } } - return objectPath; - } + msgs = msgs.map(function (msg) { - var mod = factory(); - mod.create = factory; - mod.withInheritedProps = factory({includeInheritedProps: true}) - return mod; -}); + return typeof msg === 'string' ? msg : msg instanceof Error ? msg.message : exports.stringify(msg); + }); + throw new Error(msgs.join(' ') || 'Unknown error'); +}; -/***/ }), -/* 283 */ -/***/ (function(module, exports, __webpack_require__) { +exports.Timer = function () { -var once = __webpack_require__(125) -var eos = __webpack_require__(266) -var fs = __webpack_require__(8) // we only need fs to get the ReadStream and WriteStream prototypes + this.ts = 0; + this.reset(); +}; -var noop = function () {} -var isFn = function (fn) { - return typeof fn === 'function' -} +exports.Timer.prototype.reset = function () { -var isFS = function (stream) { - if (!fs) return false // browser - return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) -} + this.ts = Date.now(); +}; -var isRequest = function (stream) { - return stream.setHeader && isFn(stream.abort) -} -var destroyer = function (stream, reading, writing, callback) { - callback = once(callback) +exports.Timer.prototype.elapsed = function () { - var closed = false - stream.on('close', function () { - closed = true - }) + return Date.now() - this.ts; +}; - eos(stream, {readable: reading, writable: writing}, function (err) { - if (err) return callback(err) - closed = true - callback() - }) - var destroyed = false - return function (err) { - if (closed) return - if (destroyed) return - destroyed = true +exports.Bench = function () { - if (isFS(stream)) return stream.close() // use close for fs streams to avoid fd leaks - if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want + this.ts = 0; + this.reset(); +}; - if (isFn(stream.destroy)) return stream.destroy() - callback(err || new Error('stream was destroyed')) - } -} +exports.Bench.prototype.reset = function () { -var call = function (fn) { - fn() -} + this.ts = exports.Bench.now(); +}; -var pipe = function (from, to) { - return from.pipe(to) -} -var pump = function () { - var streams = Array.prototype.slice.call(arguments) - var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop +exports.Bench.prototype.elapsed = function () { - if (Array.isArray(streams[0])) streams = streams[0] - if (streams.length < 2) throw new Error('pump requires two streams per minimum') + return exports.Bench.now() - this.ts; +}; - var error - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1 - var writing = i > 0 - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err - if (err) destroys.forEach(call) - if (reading) return - destroys.forEach(call) - callback(error) - }) - }) - return streams.reduce(pipe) -} +exports.Bench.now = function () { -module.exports = pump + var ts = process.hrtime(); + return (ts[0] * 1e3) + (ts[1] / 1e6); +}; -/***/ }), -/* 284 */ -/***/ (function(module, exports, __webpack_require__) { +// Escape string for Regex construction -"use strict"; +exports.escapeRegex = function (string) { + // Escape ^$.*+-?=!:|\/()[]{}, + return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&'); +}; -var replace = String.prototype.replace; -var percentTwenties = /%20/g; -module.exports = { - 'default': 'RFC3986', - formatters: { - RFC1738: function (value) { - return replace.call(value, percentTwenties, '+'); - }, - RFC3986: function (value) { - return value; - } - }, - RFC1738: 'RFC1738', - RFC3986: 'RFC3986' +// Base64url (RFC 4648) encode + +exports.base64urlEncode = function (value, encoding) { + + var buf = (Buffer.isBuffer(value) ? value : new Buffer(value, encoding || 'binary')); + return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); }; -/***/ }), -/* 285 */ -/***/ (function(module, exports, __webpack_require__) { +// Base64url (RFC 4648) decode -"use strict"; +exports.base64urlDecode = function (value, encoding) { + if (value && + !/^[\w\-]*$/.test(value)) { -var stringify = __webpack_require__(635); -var parse = __webpack_require__(634); -var formats = __webpack_require__(284); + return new Error('Invalid character'); + } -module.exports = { - formats: formats, - parse: parse, - stringify: stringify + try { + var buf = new Buffer(value, 'base64'); + return (encoding === 'buffer' ? buf : buf.toString(encoding || 'binary')); + } + catch (err) { + return err; + } }; -/***/ }), -/* 286 */ -/***/ (function(module, exports, __webpack_require__) { +// Escape attribute value for use in HTTP header -"use strict"; +exports.escapeHeaderAttribute = function (attribute) { + // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, " -var has = Object.prototype.hasOwnProperty; + exports.assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')'); -var hexTable = (function () { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } + return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash +}; - return array; -}()); -exports.arrayToObject = function (source, options) { - var obj = options && options.plainObjects ? Object.create(null) : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } +exports.escapeHtml = function (string) { - return obj; + return Escape.escapeHtml(string); }; -exports.merge = function (target, source, options) { - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (Array.isArray(target)) { - target.push(source); - } else if (typeof target === 'object') { - if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - return target; - } +exports.escapeJavaScript = function (string) { - if (typeof target !== 'object') { - return [target].concat(source); - } + return Escape.escapeJavaScript(string); +}; - var mergeTarget = target; - if (Array.isArray(target) && !Array.isArray(source)) { - mergeTarget = exports.arrayToObject(target, options); - } - if (Array.isArray(target) && Array.isArray(source)) { - source.forEach(function (item, i) { - if (has.call(target, i)) { - if (target[i] && typeof target[i] === 'object') { - target[i] = exports.merge(target[i], item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } +exports.nextTick = function (callback) { - return Object.keys(source).reduce(function (acc, key) { - var value = source[key]; + return function () { - if (Object.prototype.hasOwnProperty.call(acc, key)) { - acc[key] = exports.merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -}; + var args = arguments; + process.nextTick(function () { -exports.decode = function (str) { - try { - return decodeURIComponent(str.replace(/\+/g, ' ')); - } catch (e) { - return str; - } + callback.apply(null, args); + }); + }; }; -exports.encode = function (str) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - var string = typeof str === 'string' ? str : String(str); +exports.once = function (method) { - var out = ''; - for (var i = 0; i < string.length; ++i) { - var c = string.charCodeAt(i); + if (method._hoekOnce) { + return method; + } - if ( - c === 0x2D || // - - c === 0x2E || // . - c === 0x5F || // _ - c === 0x7E || // ~ - (c >= 0x30 && c <= 0x39) || // 0-9 - (c >= 0x41 && c <= 0x5A) || // a-z - (c >= 0x61 && c <= 0x7A) // A-Z - ) { - out += string.charAt(i); - continue; - } + var once = false; + var wrapped = function () { - if (c < 0x80) { - out = out + hexTable[c]; - continue; + if (!once) { + once = true; + method.apply(null, arguments); } + }; - if (c < 0x800) { - out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } + wrapped._hoekOnce = true; - if (c < 0xD800 || c >= 0xE000) { - out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } + return wrapped; +}; - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; // eslint-disable-line max-len - } - return out; -}; +exports.isAbsolutePath = function (path, platform) { -exports.compact = function (obj, references) { - if (typeof obj !== 'object' || obj === null) { - return obj; + if (!path) { + return false; } - var refs = references || []; - var lookup = refs.indexOf(obj); - if (lookup !== -1) { - return refs[lookup]; + if (Path.isAbsolute) { // node >= 0.11 + return Path.isAbsolute(path); } - refs.push(obj); - - if (Array.isArray(obj)) { - var compacted = []; + platform = platform || process.platform; - for (var i = 0; i < obj.length; ++i) { - if (obj[i] && typeof obj[i] === 'object') { - compacted.push(exports.compact(obj[i], refs)); - } else if (typeof obj[i] !== 'undefined') { - compacted.push(obj[i]); - } - } + // Unix - return compacted; + if (platform !== 'win32') { + return path[0] === '/'; } - var keys = Object.keys(obj); - keys.forEach(function (key) { - obj[key] = exports.compact(obj[key], refs); - }); + // Windows - return obj; + return !!/^(?:[a-zA-Z]:[\\\/])|(?:[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/])/.test(path); // C:\ or \\something\something }; -exports.isRegExp = function (obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; -exports.isBuffer = function (obj) { - if (obj === null || typeof obj === 'undefined') { - return false; - } +exports.isInteger = function (value) { - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); + return (typeof value === 'number' && + parseFloat(value) === parseInt(value, 10) && + !isNaN(value)); }; -/***/ }), -/* 287 */ -/***/ (function(module, exports, __webpack_require__) { +exports.ignore = function () { }; -"use strict"; +exports.inherits = Util.inherits; -module.exports = Readable; -/**/ -var processNextTick = __webpack_require__(182); -/**/ +exports.format = Util.format; -/**/ -var isArray = __webpack_require__(276); -/**/ -/**/ -var Duplex; -/**/ +exports.transform = function (source, transform, options) { -Readable.ReadableState = ReadableState; + exports.assert(source === null || source === undefined || typeof source === 'object' || Array.isArray(source), 'Invalid source object: must be null, undefined, an object, or an array'); -/**/ -var EE = __webpack_require__(64).EventEmitter; + if (Array.isArray(source)) { + var results = []; + for (var i = 0, il = source.length; i < il; ++i) { + results.push(exports.transform(source[i], transform, options)); + } + return results; + } -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ + var result = {}; + var keys = Object.keys(transform); -/**/ -var Stream = __webpack_require__(290); -/**/ + for (var k = 0, kl = keys.length; k < kl; ++k) { + var key = keys[k]; + var path = key.split('.'); + var sourcePath = transform[key]; -var Buffer = __webpack_require__(98).Buffer; -/**/ -var bufferShim = __webpack_require__(153); -/**/ + exports.assert(typeof sourcePath === 'string', 'All mappings must be "." delineated strings'); -/**/ -var util = __webpack_require__(92); -util.inherits = __webpack_require__(54); -/**/ + var segment; + var res = result; -/**/ -var debugUtil = __webpack_require__(2); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ + while (path.length > 1) { + segment = path.shift(); + if (!res[segment]) { + res[segment] = {}; + } + res = res[segment]; + } + segment = path.shift(); + res[segment] = exports.reach(source, sourcePath, options); + } -var BufferList = __webpack_require__(641); -var StringDecoder; + return result; +}; -util.inherits(Readable, Stream); -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; +exports.uniqueFilename = function (path, extension) { -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') { - return emitter.prependListener(event, fn); - } else { - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; - } -} + if (extension) { + extension = extension[0] !== '.' ? '.' + extension : extension; + } + else { + extension = ''; + } -function ReadableState(options, stream) { - Duplex = Duplex || __webpack_require__(72); + path = Path.resolve(path); + var name = [Date.now(), process.pid, Crypto.randomBytes(8).toString('hex')].join('-') + extension; + return Path.join(path, name); +}; - options = options || {}; - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; +exports.stringify = function () { - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + try { + return JSON.stringify.apply(null, arguments); + } + catch (err) { + return '[Cannot display object: ' + err.message + ']'; + } +}; - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; +exports.shallow = function (source) { - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; + var target = {}; + var keys = Object.keys(source); + for (var i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + target[key] = source[key]; + } - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; + return target; +}; - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; +/***/ }), +/* 285 */ +/***/ (function(module, exports, __webpack_require__) { - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; +"use strict"; - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; +var _ = __webpack_require__(31); +var MuteStream = __webpack_require__(292); +var readline = __webpack_require__(143); - // if true, a maybeReadMore has been scheduled - this.readingMore = false; +/** + * Base interface class other can inherits from + */ - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = __webpack_require__(291).StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; +var UI = module.exports = function (opt) { + // Instantiate the Readline interface + // @Note: Don't reassign if already present (allow test to override the Stream) + if (!this.rl) { + this.rl = readline.createInterface(setupReadlineOptions(opt)); } -} + this.rl.resume(); -function Readable(options) { - Duplex = Duplex || __webpack_require__(72); + this.onForceClose = this.onForceClose.bind(this); - if (!(this instanceof Readable)) return new Readable(options); + // Make sure new prompt start on a newline when closing + this.rl.on('SIGINT', this.onForceClose); + process.on('exit', this.onForceClose); +}; - this._readableState = new ReadableState(options, this); +/** + * Handle the ^C exit + * @return {null} + */ - // legacy - this.readable = true; +UI.prototype.onForceClose = function () { + this.close(); + console.log(''); +}; - if (options && typeof options.read === 'function') this._read = options.read; +/** + * Close the interface and cleanup listeners + */ - Stream.call(this); -} +UI.prototype.close = function () { + // Remove events listeners + this.rl.removeListener('SIGINT', this.onForceClose); + process.removeListener('exit', this.onForceClose); -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; + this.rl.output.unmute(); - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = bufferShim.from(chunk, encoding); - encoding = ''; - } + if (this.activePrompt && typeof this.activePrompt.close === 'function') { + this.activePrompt.close(); } - return readableAddChunk(this, state, chunk, encoding, false); + // Close the readline + this.rl.output.end(); + this.rl.pause(); + this.rl.close(); }; -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; +function setupReadlineOptions(opt) { + opt = opt || {}; -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; + // Default `input` to stdin + var input = opt.input || process.stdin; -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var _e = new Error('stream.unshift() after end event'); - stream.emit('error', _e); - } else { - var skipAdd; - if (state.decoder && !addToFront && !encoding) { - chunk = state.decoder.write(chunk); - skipAdd = !state.objectMode && chunk.length === 0; - } + // Add mute capabilities to the output + var ms = new MuteStream(); + ms.pipe(opt.output || process.stdout); + var output = ms; - if (!addToFront) state.reading = false; + return _.extend({ + terminal: true, + input: input, + output: output + }, _.omit(opt, ['input', 'output'])); +} - // Don't add to the buffer if we've decoded to an empty string chunk and - // we're not in object mode - if (!skipAdd) { - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream); - } - } +/***/ }), +/* 286 */ +/***/ (function(module, exports, __webpack_require__) { - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } +"use strict"; - return needMoreData(state); -} +var ansiEscapes = __webpack_require__(367); -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} +/** + * Move cursor left by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go left (default to 1) + */ -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = __webpack_require__(291).StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; +exports.left = function (rl, x) { + rl.output.write(ansiEscapes.cursorBackward(x)); }; -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} +/** + * Move cursor right by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go left (default to 1) + */ -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} +exports.right = function (rl, x) { + rl.output.write(ansiEscapes.cursorForward(x)); +}; -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; +/** + * Move cursor up by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go up (default to 1) + */ - if (n !== 0) state.emittedReadable = false; +exports.up = function (rl, x) { + rl.output.write(ansiEscapes.cursorUp(x)); +}; - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } +/** + * Move cursor down by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go down (default to 1) + */ - n = howMuchToRead(n, state); +exports.down = function (rl, x) { + rl.output.write(ansiEscapes.cursorDown(x)); +}; - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } +/** + * Clear current line + * @param {Readline} rl - Readline instance + * @param {Number} len - number of line to delete + */ +exports.clearLine = function (rl, len) { + rl.output.write(ansiEscapes.eraseLines(len)); +}; - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); +/***/ }), +/* 287 */ +/***/ (function(module, exports, __webpack_require__) { - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } +"use strict"; +/*! + * is-number + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; +var typeOf = __webpack_require__(190); + +module.exports = function isNumber(num) { + var type = typeOf(num); + if (type !== 'number' && type !== 'string') { + return false; } + var n = +num; + return (n - n + 1) >= 0 && num !== ''; +}; - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } +/***/ }), +/* 288 */ +/***/ (function(module, exports, __webpack_require__) { - if (ret !== null) this.emit('data', ret); +"use strict"; +/*! + * is-primitive + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ - return ret; + + +// see http://jsperf.com/testing-value-is-primitive/7 +module.exports = function isPrimitive(value) { + return value == null || (typeof value !== 'function' && typeof value !== 'object'); }; -function chunkInvalid(state, chunk) { - var er = null; - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; +/***/ }), +/* 289 */ +/***/ (function(module, exports) { - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} +var toString = {}.toString; -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); - } +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + + +/***/ }), +/* 290 */ +/***/ (function(module, exports, __webpack_require__) { + +var stream = __webpack_require__(29) + + +function isStream (obj) { + return obj instanceof stream.Stream } -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); + +function isReadable (obj) { + return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object' } -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } + +function isWritable (obj) { + return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object' } -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; + +function isDuplex (obj) { + return isReadable(obj) && isWritable(obj) } -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; +module.exports = isStream +module.exports.isReadable = isReadable +module.exports.isWritable = isWritable +module.exports.isDuplex = isDuplex - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; +/***/ }), +/* 291 */ +/***/ (function(module, exports, __webpack_require__) { - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); +"use strict"; +/*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - function onend() { - debug('onend'); - dest.end(); - } - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); +/** + * Module dependencies. + * @private + */ - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); +var db = __webpack_require__(639) +var extname = __webpack_require__(0).extname - cleanedUp = true; +/** + * Module variables. + * @private + */ - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } +var extractTypeRegExp = /^\s*([^;\s]*)(?:;|\s|$)/ +var textTypeRegExp = /^text\//i - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } +/** + * Module exports. + * @public + */ - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); +exports.charset = charset +exports.charsets = { lookup: charset } +exports.contentType = contentType +exports.extension = extension +exports.extensions = Object.create(null) +exports.lookup = lookup +exports.types = Object.create(null) + +// Populate the extensions/types maps +populateMaps(exports.extensions, exports.types) + +/** + * Get the default charset for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ + +function charset (type) { + if (!type || typeof type !== 'string') { + return false } - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); + // TODO: use media-typer + var match = extractTypeRegExp.exec(type) + var mime = match && db[match[1].toLowerCase()] - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); + if (mime && mime.charset) { + return mime.charset } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); + + // default text/* to utf-8 + if (match && textTypeRegExp.test(match[1])) { + return 'UTF-8' } - dest.once('finish', onfinish); - function unpipe() { - debug('unpipe'); - src.unpipe(dest); + return false +} + +/** + * Create a full Content-Type header given a MIME type or extension. + * + * @param {string} str + * @return {boolean|string} + */ + +function contentType (str) { + // TODO: should this even be in this module? + if (!str || typeof str !== 'string') { + return false } - // tell the dest that it's being piped to - dest.emit('pipe', src); + var mime = str.indexOf('/') === -1 + ? exports.lookup(str) + : str - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); + if (!mime) { + return false } - return dest; -}; + // TODO: use content-type or other module + if (mime.indexOf('charset') === -1) { + var charset = exports.charset(mime) + if (charset) mime += '; charset=' + charset.toLowerCase() + } -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; + return mime } -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; +/** + * Get the default extension for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; +function extension (type) { + if (!type || typeof type !== 'string') { + return false + } - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; + // TODO: use media-typer + var match = extractTypeRegExp.exec(type) - if (!dest) dest = state.pipes; + // get extensions + var exts = match && exports.extensions[match[1].toLowerCase()] - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this); - return this; + if (!exts || !exts.length) { + return false } - // slow case. multiple pipe destinations. + return exts[0] +} - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; +/** + * Lookup the MIME type for a file path/extension. + * + * @param {string} path + * @return {boolean|string} + */ - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this); - }return this; +function lookup (path) { + if (!path || typeof path !== 'string') { + return false } - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; + // get the extension ("ext" or ".ext" or full path) + var extension = extname('x.' + path) + .toLowerCase() + .substr(1) - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; + if (!extension) { + return false + } - dest.emit('unpipe', this); + return exports.types[extension] || false +} - return this; -}; +/** + * Populate the extensions and types maps. + * @private + */ -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); +function populateMaps (extensions, types) { + // source preference (least -> most) + var preference = ['nginx', 'apache', undefined, 'iana'] - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } + Object.keys(db).forEach(function forEachMimeType (type) { + var mime = db[type] + var exts = mime.extensions + + if (!exts || !exts.length) { + return } - } - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; + // mime -> extensions + extensions[type] = exts -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} + // extension -> mime + for (var i = 0; i < exts.length; i++) { + var extension = exts[i] -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; + if (types[extension]) { + var from = preference.indexOf(db[types[extension]].source) + var to = preference.indexOf(mime.source) -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } + if (types[extension] !== 'application/octet-stream' && + (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { + // skip the remapping + continue + } + } + + // set the extension -> mime + types[extension] = type + } + }) } -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} +/***/ }), +/* 292 */ +/***/ (function(module, exports, __webpack_require__) { -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; +var Stream = __webpack_require__(29) -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} +module.exports = MuteStream + +// var out = new MuteStream(process.stdout) +// argument auto-pipes +function MuteStream (opts) { + Stream.apply(this) + opts = opts || {} + this.writable = this.readable = true + this.muted = false + this.on('pipe', this._onpipe) + this.replace = opts.replace + + // For readline-type situations + // This much at the start of a line being redrawn after a ctrl char + // is seen (such as backspace) won't be redrawn as the replacement + this._prompt = opts.prompt || null + this._hadControl = false } -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var state = this._readableState; - var paused = false; +MuteStream.prototype = Object.create(Stream.prototype) - var self = this; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) self.push(chunk); - } +Object.defineProperty(MuteStream.prototype, 'constructor', { + value: MuteStream, + enumerable: false +}) - self.push(null); - }); +MuteStream.prototype.mute = function () { + this.muted = true +} - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); +MuteStream.prototype.unmute = function () { + this.muted = false +} - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; +Object.defineProperty(MuteStream.prototype, '_onpipe', { + value: onPipe, + enumerable: false, + writable: true, + configurable: true +}) - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); +function onPipe (src) { + this._src = src +} - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } +Object.defineProperty(MuteStream.prototype, 'isTTY', { + get: getIsTTY, + set: setIsTTY, + enumerable: true, + configurable: true +}) - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n])); - } +function getIsTTY () { + return( (this._dest) ? this._dest.isTTY + : (this._src) ? this._src.isTTY + : false + ) +} - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; +// basically just get replace the getter/setter with a regular value +function setIsTTY (isTTY) { + Object.defineProperty(this, 'isTTY', { + value: isTTY, + enumerable: true, + writable: true, + configurable: true + }) +} - return self; -}; +Object.defineProperty(MuteStream.prototype, 'rows', { + get: function () { + return( this._dest ? this._dest.rows + : this._src ? this._src.rows + : undefined ) + }, enumerable: true, configurable: true }) -// exposed for testing purposes only. -Readable._fromList = fromList; +Object.defineProperty(MuteStream.prototype, 'columns', { + get: function () { + return( this._dest ? this._dest.columns + : this._src ? this._src.columns + : undefined ) + }, enumerable: true, configurable: true }) -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } +MuteStream.prototype.pipe = function (dest, options) { + this._dest = dest + return Stream.prototype.pipe.call(this, dest, options) +} - return ret; +MuteStream.prototype.pause = function () { + if (this._src) return this._src.pause() } -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; +MuteStream.prototype.resume = function () { + if (this._src) return this._src.resume() } -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); +MuteStream.prototype.write = function (c) { + if (this.muted) { + if (!this.replace) return true + if (c.match(/^\u001b/)) { + if(c.indexOf(this._prompt) === 0) { + c = c.substr(this._prompt.length); + c = c.replace(/./g, this.replace); + c = this._prompt + c; } - break; + this._hadControl = true + return this.emit('data', c) + } else { + if (this._prompt && this._hadControl && + c.indexOf(this._prompt) === 0) { + this._hadControl = false + this.emit('data', this._prompt) + c = c.substr(this._prompt.length) + } + c = c.toString().replace(/./g, this.replace) } - ++c; } - list.length -= c; - return ret; + this.emit('data', c) } -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = bufferShim.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; +MuteStream.prototype.end = function (c) { + if (this.muted) { + if (c && this.replace) { + c = c.toString().replace(/./g, this.replace) + } else { + c = null } - ++c; } - list.length -= c; - return ret; + if (c) this.emit('data', c) + this.emit('end') } -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); +function proxy (fn) { return function () { + var d = this._dest + var s = this._src + if (d && d[fn]) d[fn].apply(d, arguments) + if (s && s[fn]) s[fn].apply(s, arguments) +}} - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } -} +MuteStream.prototype.destroy = proxy('destroy') +MuteStream.prototype.destroySoon = proxy('destroySoon') +MuteStream.prototype.close = proxy('close') -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} +/***/ }), +/* 293 */ +/***/ (function(module, exports, __webpack_require__) { -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} +module.exports = __webpack_require__(642); /***/ }), -/* 288 */ +/* 294 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - - - -module.exports = Transform; - -var Duplex = __webpack_require__(72); +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ -/**/ -var util = __webpack_require__(92); -util.inherits = __webpack_require__(54); -/**/ -util.inherits(Transform, Duplex); +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; -function TransformState(stream) { - this.afterTransform = function (er, data) { - return afterTransform(stream, er, data); - }; +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; - this.writeencoding = null; + return Object(val); } -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } - if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); + // Detect buggy property enumeration order in older V8 versions. - ts.writechunk = null; - ts.writecb = null; + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } - if (data !== null && data !== undefined) stream.push(data); + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } - cb(er); + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } } -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; - this._transformState = new TransformState(this); + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); - var stream = this; + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; + return to; +}; - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') this._flush = options.flush; - } +/***/ }), +/* 295 */ +/***/ (function(module, exports, __webpack_require__) { - // When the writable side finishes, then flush out anything remaining. - this.once('prefinish', function () { - if (typeof this._flush === 'function') this._flush(function (er, data) { - done(stream, er, data); - });else done(stream); - }); -} +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory){ + 'use strict'; -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; + /*istanbul ignore next:cant test*/ + if (typeof module === 'object' && typeof module.exports === 'object') { + module.exports = factory(); + } else if (true) { + // AMD. Register as an anonymous module. + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { + // Browser globals + root.objectPath = factory(); + } +})(this, function(){ + 'use strict'; -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; + var toStr = Object.prototype.toString; + function hasOwnProperty(obj, prop) { + if(obj == null) { + return false + } + //to handle objects with null prototypes (too edge case?) + return Object.prototype.hasOwnProperty.call(obj, prop) + } -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + function isEmpty(value){ + if (!value) { + return true; + } + if (isArray(value) && value.length === 0) { + return true; + } else if (typeof value !== 'string') { + for (var i in value) { + if (hasOwnProperty(value, i)) { + return false; + } + } + return true; + } + return false; } -}; -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; + function toString(type){ + return toStr.call(type); + } - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; + function isObject(obj){ + return typeof obj === 'object' && toString(obj) === "[object Object]"; } -}; -function done(stream, er, data) { - if (er) return stream.emit('error', er); + var isArray = Array.isArray || function(obj){ + /*istanbul ignore next:cant test*/ + return toStr.call(obj) === '[object Array]'; + } - if (data !== null && data !== undefined) stream.push(data); + function isBoolean(obj){ + return typeof obj === 'boolean' || toString(obj) === '[object Boolean]'; + } - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; + function getKey(key){ + var intKey = parseInt(key); + if (intKey.toString() === key) { + return intKey; + } + return key; + } - if (ws.length) throw new Error('Calling transform done when ws.length != 0'); + function factory(options) { + options = options || {} - if (ts.transforming) throw new Error('Calling transform done when still transforming'); + var objectPath = function(obj) { + return Object.keys(objectPath).reduce(function(proxy, prop) { + if(prop === 'create') { + return proxy; + } - return stream.push(null); -} + /*istanbul ignore else*/ + if (typeof objectPath[prop] === 'function') { + proxy[prop] = objectPath[prop].bind(objectPath, obj); + } -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { + return proxy; + }, {}); + }; -"use strict"; -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. + function hasShallowProperty(obj, prop) { + return (options.includeInheritedProps || (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop)) + } + function getShallowProperty(obj, prop) { + if (hasShallowProperty(obj, prop)) { + return obj[prop]; + } + } + function set(obj, path, value, doNotReplace){ + if (typeof path === 'number') { + path = [path]; + } + if (!path || path.length === 0) { + return obj; + } + if (typeof path === 'string') { + return set(obj, path.split('.').map(getKey), value, doNotReplace); + } + var currentPath = path[0]; + var currentValue = getShallowProperty(obj, currentPath); + if (path.length === 1) { + if (currentValue === void 0 || !doNotReplace) { + obj[currentPath] = value; + } + return currentValue; + } -module.exports = Writable; + if (currentValue === void 0) { + //check if we assume an array + if(typeof path[1] === 'number') { + obj[currentPath] = []; + } else { + obj[currentPath] = {}; + } + } -/**/ -var processNextTick = __webpack_require__(182); -/**/ + return set(obj[currentPath], path.slice(1), value, doNotReplace); + } -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; -/**/ + objectPath.has = function (obj, path) { + if (typeof path === 'number') { + path = [path]; + } else if (typeof path === 'string') { + path = path.split('.'); + } -/**/ -var Duplex; -/**/ + if (!path || path.length === 0) { + return !!obj; + } -Writable.WritableState = WritableState; + for (var i = 0; i < path.length; i++) { + var j = getKey(path[i]); -/**/ -var util = __webpack_require__(92); -util.inherits = __webpack_require__(54); -/**/ + if((typeof j === 'number' && isArray(obj) && j < obj.length) || + (options.includeInheritedProps ? (j in Object(obj)) : hasOwnProperty(obj, j))) { + obj = obj[j]; + } else { + return false; + } + } -/**/ -var internalUtil = { - deprecate: __webpack_require__(695) -}; -/**/ + return true; + }; -/**/ -var Stream = __webpack_require__(290); -/**/ + objectPath.ensureExists = function (obj, path, value){ + return set(obj, path, value, true); + }; -var Buffer = __webpack_require__(98).Buffer; -/**/ -var bufferShim = __webpack_require__(153); -/**/ + objectPath.set = function (obj, path, value, doNotReplace){ + return set(obj, path, value, doNotReplace); + }; -util.inherits(Writable, Stream); + objectPath.insert = function (obj, path, value, at){ + var arr = objectPath.get(obj, path); + at = ~~at; + if (!isArray(arr)) { + arr = []; + objectPath.set(obj, path, arr); + } + arr.splice(at, 0, value); + }; -function nop() {} + objectPath.empty = function(obj, path) { + if (isEmpty(path)) { + return void 0; + } + if (obj == null) { + return void 0; + } -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} + var value, i; + if (!(value = objectPath.get(obj, path))) { + return void 0; + } -function WritableState(options, stream) { - Duplex = Duplex || __webpack_require__(72); + if (typeof value === 'string') { + return objectPath.set(obj, path, ''); + } else if (isBoolean(value)) { + return objectPath.set(obj, path, false); + } else if (typeof value === 'number') { + return objectPath.set(obj, path, 0); + } else if (isArray(value)) { + value.length = 0; + } else if (isObject(value)) { + for (i in value) { + if (hasShallowProperty(value, i)) { + delete value[i]; + } + } + } else { + return objectPath.set(obj, path, null); + } + }; - options = options || {}; + objectPath.push = function (obj, path /*, values */){ + var arr = objectPath.get(obj, path); + if (!isArray(arr)) { + arr = []; + objectPath.set(obj, path, arr); + } - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; + arr.push.apply(arr, Array.prototype.slice.call(arguments, 2)); + }; - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + objectPath.coalesce = function (obj, paths, defaultValue) { + var value; - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + for (var i = 0, len = paths.length; i < len; i++) { + if ((value = objectPath.get(obj, paths[i])) !== void 0) { + return value; + } + } - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; + return defaultValue; + }; - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; + objectPath.get = function (obj, path, defaultValue){ + if (typeof path === 'number') { + path = [path]; + } + if (!path || path.length === 0) { + return obj; + } + if (obj == null) { + return defaultValue; + } + if (typeof path === 'string') { + return objectPath.get(obj, path.split('.'), defaultValue); + } - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; + var currentPath = getKey(path[0]); + var nextObj = getShallowProperty(obj, currentPath) + if (nextObj === void 0) { + return defaultValue; + } - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; + if (path.length === 1) { + return nextObj; + } - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; + return objectPath.get(obj[currentPath], path.slice(1), defaultValue); + }; - // a flag to see when we're in the middle of a write. - this.writing = false; + objectPath.del = function del(obj, path) { + if (typeof path === 'number') { + path = [path]; + } - // when true all writes will be buffered until .uncork() call - this.corked = 0; + if (obj == null) { + return obj; + } - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; + if (isEmpty(path)) { + return obj; + } + if(typeof path === 'string') { + return objectPath.del(obj, path.split('.')); + } - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; + var currentPath = getKey(path[0]); + if (!hasShallowProperty(obj, currentPath)) { + return obj; + } - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; + if(path.length === 1) { + if (isArray(obj)) { + obj.splice(currentPath, 1); + } else { + delete obj[currentPath]; + } + } else { + return objectPath.del(obj[currentPath], path.slice(1)); + } - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; + return obj; + } - // the amount that is being written when _write is called. - this.writelen = 0; + return objectPath; + } - this.bufferedRequest = null; - this.lastBufferedRequest = null; + var mod = factory(); + mod.create = factory; + mod.withInheritedProps = factory({includeInheritedProps: true}) + return mod; +}); - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; +/***/ }), +/* 296 */ +/***/ (function(module, exports, __webpack_require__) { - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; +var once = __webpack_require__(133) +var eos = __webpack_require__(278) +var fs = __webpack_require__(10) // we only need fs to get the ReadStream and WriteStream prototypes - // count buffered requests - this.bufferedRequestCount = 0; +var noop = function () {} - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); +var isFn = function (fn) { + return typeof fn === 'function' } -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; +var isFS = function (stream) { + if (!fs) return false // browser + return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) +} - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; +var isRequest = function (stream) { + return stream.setHeader && isFn(stream.abort) } -function Writable(options) { - Duplex = Duplex || __webpack_require__(72); +var destroyer = function (stream, reading, writing, callback) { + callback = once(callback) - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. + var closed = false + stream.on('close', function () { + closed = true + }) - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } + eos(stream, {readable: reading, writable: writing}, function (err) { + if (err) return callback(err) + closed = true + callback() + }) - this._writableState = new WritableState(options, this); + var destroyed = false + return function (err) { + if (closed) return + if (destroyed) return + destroyed = true - // legacy. - this.writable = true; + if (isFS(stream)) return stream.close() // use close for fs streams to avoid fd leaks + if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want - if (options) { - if (typeof options.write === 'function') this._write = options.write; + if (isFn(stream.destroy)) return stream.destroy() - if (typeof options.writev === 'function') this._writev = options.writev; + callback(err || new Error('stream was destroyed')) } - - Stream.call(this); } -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); +var call = function (fn) { + fn() } -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - processNextTick(cb, er); - valid = false; - } - return valid; +var pipe = function (from, to) { + return from.pipe(to) } -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = Buffer.isBuffer(chunk); - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } +var pump = function () { + var streams = Array.prototype.slice.call(arguments) + var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + if (Array.isArray(streams[0])) streams = streams[0] + if (streams.length < 2) throw new Error('pump requires two streams per minimum') - if (typeof cb !== 'function') cb = nop; + var error + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1 + var writing = i > 0 + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err + if (err) destroys.forEach(call) + if (reading) return + destroys.forEach(call) + callback(error) + }) + }) - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } + return streams.reduce(pipe) +} - return ret; -}; +module.exports = pump -Writable.prototype.cork = function () { - var state = this._writableState; - state.corked++; -}; +/***/ }), +/* 297 */ +/***/ (function(module, exports, __webpack_require__) { -Writable.prototype.uncork = function () { - var state = this._writableState; +"use strict"; - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; +var replace = String.prototype.replace; +var percentTwenties = /%20/g; -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; +module.exports = { + 'default': 'RFC3986', + formatters: { + RFC1738: function (value) { + return replace.call(value, percentTwenties, '+'); + }, + RFC3986: function (value) { + return value; + } + }, + RFC1738: 'RFC1738', + RFC3986: 'RFC3986' }; -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = bufferShim.from(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - chunk = decodeChunk(state, chunk, encoding); - if (Buffer.isBuffer(chunk)) encoding = 'buffer'; - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; +/***/ }), +/* 298 */ +/***/ (function(module, exports, __webpack_require__) { - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } +"use strict"; - return ret; -} -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} +var stringify = __webpack_require__(659); +var parse = __webpack_require__(658); +var formats = __webpack_require__(297); -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) processNextTick(cb, er);else cb(er); +module.exports = { + formats: formats, + parse: parse, + stringify: stringify +}; - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} +/***/ }), +/* 299 */ +/***/ (function(module, exports, __webpack_require__) { -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; +"use strict"; - onwriteStateUpdate(state); - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); +var has = Object.prototype.hasOwnProperty; - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); } - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} + return array; +}()); -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} +exports.arrayToObject = function (source, options) { + var obj = options && options.plainObjects ? Object.create(null) : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} + return obj; +}; -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; +exports.merge = function (target, source, options) { + if (!source) { + return target; + } - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } else if (typeof target === 'object') { + if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } - var count = 0; - while (entry) { - buffer[count] = entry; - entry = entry.next; - count += 1; + return target; } - doWrite(stream, state, true, state.length, buffer, '', holder.finish); + if (typeof target !== 'object') { + return [target].concat(source); + } - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); + var mergeTarget = target; + if (Array.isArray(target) && !Array.isArray(source)) { + mergeTarget = exports.arrayToObject(target, options); } - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } + if (Array.isArray(target) && Array.isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + if (target[i] && typeof target[i] === 'object') { + target[i] = exports.merge(target[i], item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; } - if (entry === null) state.lastBufferedRequest = null; - } + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; - state.bufferedRequestCount = 0; - state.bufferedRequest = entry; - state.bufferProcessing = false; -} + if (Object.prototype.hasOwnProperty.call(acc, key)) { + acc[key] = exports.merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); +exports.decode = function (str) { + try { + return decodeURIComponent(str.replace(/\+/g, ' ')); + } catch (e) { + return str; + } }; -Writable.prototype._writev = null; +exports.encode = function (str) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; + var string = typeof str === 'string' ? str : String(str); - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } + var out = ''; + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + if ( + c === 0x2D || // - + c === 0x2E || // . + c === 0x5F || // _ + c === 0x7E || // ~ + (c >= 0x30 && c <= 0x39) || // 0-9 + (c >= 0x41 && c <= 0x5A) || // a-z + (c >= 0x61 && c <= 0x7A) // A-Z + ) { + out += string.charAt(i); + continue; + } - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } + if (c < 0x80) { + out = out + hexTable[c]; + continue; + } - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} + if (c < 0x800) { + out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } -} + if (c < 0xD800 || c >= 0xE000) { + out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); + out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; // eslint-disable-line max-len } - } - return need; -} -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) processNextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} + return out; +}; -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; +exports.compact = function (obj, references) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } - this.next = null; - this.entry = null; - this.finish = function (err) { - var entry = _this.entry; - _this.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; + var refs = references || []; + var lookup = refs.indexOf(obj); + if (lookup !== -1) { + return refs[lookup]; } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = _this; - } else { - state.corkedRequestsFree = _this; + + refs.push(obj); + + if (Array.isArray(obj)) { + var compacted = []; + + for (var i = 0; i < obj.length; ++i) { + if (obj[i] && typeof obj[i] === 'object') { + compacted.push(exports.compact(obj[i], refs)); + } else if (typeof obj[i] !== 'undefined') { + compacted.push(obj[i]); + } + } + + return compacted; } - }; -} -/***/ }), -/* 290 */ -/***/ (function(module, exports, __webpack_require__) { + var keys = Object.keys(obj); + keys.forEach(function (key) { + obj[key] = exports.compact(obj[key], refs); + }); + + return obj; +}; + +exports.isRegExp = function (obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +exports.isBuffer = function (obj) { + if (obj === null || typeof obj === 'undefined') { + return false; + } -module.exports = __webpack_require__(25); + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; /***/ }), -/* 291 */ +/* 300 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Buffer = __webpack_require__(73).Buffer; +module.exports = Readable; -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; +/**/ +var processNextTick = __webpack_require__(194); +/**/ -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } +/**/ +var isArray = __webpack_require__(289); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = __webpack_require__(69).EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; }; +/**/ -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} +/**/ +var Stream = __webpack_require__(303); +/**/ -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); +var Buffer = __webpack_require__(104).Buffer; +/**/ +var bufferShim = __webpack_require__(160); +/**/ + +/**/ +var util = __webpack_require__(99); +util.inherits = __webpack_require__(57); +/**/ + +/**/ +var debugUtil = __webpack_require__(4); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; } +/**/ -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; +var BufferList = __webpack_require__(665); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') { + return emitter.prependListener(event, fn); } else { - i = 0; + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; +} -StringDecoder.prototype.end = utf8End; +function ReadableState(options, stream) { + Duplex = Duplex || __webpack_require__(78); -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; + options = options || {}; -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return -1; -} + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = __webpack_require__(304).StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; } - return 0; } -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'.repeat(p); - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'.repeat(p + 1); - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'.repeat(p + 2); - } - } - } +function Readable(options) { + Duplex = Duplex || __webpack_require__(78); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options && typeof options.read === 'function') this._read = options.read; + + Stream.call(this); } -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = bufferShim.from(chunk, encoding); + encoding = ''; + } } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} + return readableAddChunk(this, state, chunk, encoding, false); +}; -// For UTF-8, a replacement character for each buffered byte of a (partial) -// character needs to be added to the output. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed); - return r; -} +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var _e = new Error('stream.unshift() after end event'); + stream.emit('error', _e); + } else { + var skipAdd; + if (state.decoder && !addToFront && !encoding) { + chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } + + if (!addToFront) state.reading = false; + + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } } + + maybeReadMore(stream, state); } - return r; + } else if (!addToFront) { + state.reading = false; } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); + + return needMoreData(state); } -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = __webpack_require__(304).StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; } - return buf.toString('base64', i, buf.length - n); + return n; } -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; } -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} + if (n !== 0) state.emittedReadable = false; -/***/ }), -/* 292 */ -/***/ (function(module, exports, __webpack_require__) { + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } -"use strict"; -/*! - * repeat-element - * - * Copyright (c) 2015 Jon Schlinkert. - * Licensed under the MIT license. - */ + n = howMuchToRead(n, state); + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. -module.exports = function repeat(ele, num) { - var arr = new Array(num); + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); - for (var i = 0; i < num; i++) { - arr[i] = ele; + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); } - return arr; -}; - + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } -/***/ }), -/* 293 */ -/***/ (function(module, exports, __webpack_require__) { + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; -"use strict"; + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; -var tough = __webpack_require__(691) + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } -var Cookie = tough.Cookie - , CookieJar = tough.CookieJar + if (ret !== null) this.emit('data', ret); + return ret; +}; -exports.parse = function(str) { - if (str && str.uri) { - str = str.uri - } - if (typeof str !== 'string') { - throw new Error('The cookie function only accepts STRING as param') +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); } - return Cookie.parse(str, {loose: true}) + return er; } -// Adapt the sometimes-Async api of tough.CookieJar to our requirements -function RequestJar(store) { - var self = this - self._jar = new CookieJar(store, {looseMode: true}) +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); } -RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) { - var self = this - return self._jar.setCookieSync(cookieOrStr, uri, options || {}) + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } } -RequestJar.prototype.getCookieString = function(uri) { - var self = this - return self._jar.getCookieStringSync(uri) + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); } -RequestJar.prototype.getCookies = function(uri) { - var self = this - return self._jar.getCookiesSync(uri) + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } } -exports.jar = function(store) { - return new RequestJar(store) +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; } +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; -/***/ }), -/* 294 */ -/***/ (function(module, exports, __webpack_require__) { + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } } - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(40)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - return factory(root, exports, Rx); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); - } else { - root.Rx = factory(root, {}, root.Rx); + function onend() { + debug('onend'); + dest.end(); } -}.call(this, function (root, exp, Rx, undefined) { - var Observable = Rx.Observable, - observableProto = Observable.prototype, - AnonymousObservable = Rx.AnonymousObservable, - ObservableBase = Rx.ObservableBase, - Subject = Rx.Subject, - AsyncSubject = Rx.AsyncSubject, - Observer = Rx.Observer, - ScheduledObserver = Rx.internals.ScheduledObserver, - disposableCreate = Rx.Disposable.create, - disposableEmpty = Rx.Disposable.empty, - BinaryDisposable = Rx.BinaryDisposable, - currentThreadScheduler = Rx.Scheduler.currentThread, - isFunction = Rx.helpers.isFunction, - inherits = Rx.internals.inherits, - addProperties = Rx.internals.addProperties, - checkDisposed = Rx.Disposable.checkDisposed; + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); - // Utilities - function cloneArray(arr) { - var len = arr.length, a = new Array(len); - for(var i = 0; i < len; i++) { a[i] = arr[i]; } - return a; + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } - var MulticastObservable = (function (__super__) { - inherits(MulticastObservable, __super__); - function MulticastObservable(source, fn1, fn2) { - this.source = source; - this._fn1 = fn1; - this._fn2 = fn2; - __super__.call(this); + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); } + } - MulticastObservable.prototype.subscribeCore = function (o) { - var connectable = this.source.multicast(this._fn1()); - return new BinaryDisposable(this._fn2(connectable).subscribe(o), connectable.connect()); - }; + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } - return MulticastObservable; - }(ObservableBase)); + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); - /** - * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each - * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's - * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay. - * - * @example - * 1 - res = source.multicast(observable); - * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; }); - * - * @param {Function|Subject} subjectOrSubjectSelector - * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. - * Or: - * Subject to push source elements into. - * - * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if 0; }, - /** - * Notifies all subscribed observers about the end of the sequence. - */ - onCompleted: function () { - checkDisposed(this); - if (this.isStopped) { return; } - this.isStopped = true; - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - os[i].onCompleted(); - } + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; - this.observers.length = 0; - }, - /** - * Notifies all subscribed observers about the exception. - * @param {Mixed} error The exception to send to all observers. - */ - onError: function (error) { - checkDisposed(this); - if (this.isStopped) { return; } - this.isStopped = true; - this.hasError = true; - this.error = error; + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this); + }return this; + } - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - os[i].onError(error); - } + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; - this.observers.length = 0; - }, - /** - * Notifies all subscribed observers about the arrival of the specified element in the sequence. - * @param {Mixed} value The value to send to all observers. - */ - onNext: function (value) { - checkDisposed(this); - if (this.isStopped) { return; } - this.value = value; - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - os[i].onNext(value); - } - }, - /** - * Unsubscribe all observers and release resources. - */ - dispose: function () { - this.isDisposed = true; - this.observers = null; - this.value = null; - this.error = null; - } - }); + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; - return BehaviorSubject; - }(Observable)); + dest.emit('unpipe', this); - /** - * Represents an object that is both an observable sequence as well as an observer. - * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies. - */ - var ReplaySubject = Rx.ReplaySubject = (function (__super__) { + return this; +}; - var maxSafeInteger = Math.pow(2, 53) - 1; +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); - function createRemovableDisposable(subject, observer) { - return disposableCreate(function () { - observer.dispose(); - !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1); - }); + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } } + } - inherits(ReplaySubject, __super__); + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; - /** - * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler. - * @param {Number} [bufferSize] Maximum element count of the replay buffer. - * @param {Number} [windowSize] Maximum time length of the replay buffer. - * @param {Scheduler} [scheduler] Scheduler the observers are invoked on. - */ - function ReplaySubject(bufferSize, windowSize, scheduler) { - this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize; - this.windowSize = windowSize == null ? maxSafeInteger : windowSize; - this.scheduler = scheduler || currentThreadScheduler; - this.q = []; - this.observers = []; - this.isStopped = false; - this.isDisposed = false; - this.hasError = false; - this.error = null; - __super__.call(this); - } +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} - addProperties(ReplaySubject.prototype, Observer.prototype, { - _subscribe: function (o) { - checkDisposed(this); - var so = new ScheduledObserver(this.scheduler, o), subscription = createRemovableDisposable(this, so); +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; - this._trim(this.scheduler.now()); - this.observers.push(so); +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); + } +} - for (var i = 0, len = this.q.length; i < len; i++) { - so.onNext(this.q[i].value); - } +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } - if (this.hasError) { - so.onError(this.error); - } else if (this.isStopped) { - so.onCompleted(); - } + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} - so.ensureActive(); - return subscription; - }, - /** - * Indicates whether the subject has observers subscribed to it. - * @returns {Boolean} Indicates whether the subject has observers subscribed to it. - */ - hasObservers: function () { checkDisposed(this); return this.observers.length > 0; }, - _trim: function (now) { - while (this.q.length > this.bufferSize) { - this.q.shift(); - } - while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) { - this.q.shift(); - } - }, - /** - * Notifies all subscribed observers about the arrival of the specified element in the sequence. - * @param {Mixed} value The value to send to all observers. - */ - onNext: function (value) { - checkDisposed(this); - if (this.isStopped) { return; } - var now = this.scheduler.now(); - this.q.push({ interval: now, value: value }); - this._trim(now); +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - var observer = os[i]; - observer.onNext(value); - observer.ensureActive(); - } - }, - /** - * Notifies all subscribed observers about the exception. - * @param {Mixed} error The exception to send to all observers. - */ - onError: function (error) { - checkDisposed(this); - if (this.isStopped) { return; } - this.isStopped = true; - this.error = error; - this.hasError = true; - var now = this.scheduler.now(); - this._trim(now); - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - var observer = os[i]; - observer.onError(error); - observer.ensureActive(); - } - this.observers.length = 0; - }, - /** - * Notifies all subscribed observers about the end of the sequence. - */ - onCompleted: function () { - checkDisposed(this); - if (this.isStopped) { return; } - this.isStopped = true; - var now = this.scheduler.now(); - this._trim(now); - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - var observer = os[i]; - observer.onCompleted(); - observer.ensureActive(); - } - this.observers.length = 0; - }, - /** - * Unsubscribe all observers and release resources. - */ - dispose: function () { - this.isDisposed = true; - this.observers = null; - } - }); +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} - return ReplaySubject; - }(Observable)); +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; - var RefCountObservable = (function (__super__) { - inherits(RefCountObservable, __super__); - function RefCountObservable(source) { - this.source = source; - this._count = 0; - this._connectableSubscription = null; - __super__.call(this); + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); } - RefCountObservable.prototype.subscribeCore = function (o) { - var subscription = this.source.subscribe(o); - ++this._count === 1 && (this._connectableSubscription = this.source.connect()); - return new RefCountDisposable(this, subscription); - }; - - function RefCountDisposable(p, s) { - this._p = p; - this._s = s; - this.isDisposed = false; - } + self.push(null); + }); - RefCountDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - this._s.dispose(); - --this._p._count === 0 && this._p._connectableSubscription.dispose(); - } - }; + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); - return RefCountObservable; - }(ObservableBase)); + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) { - inherits(ConnectableObservable, __super__); - function ConnectableObservable(source, subject) { - this.source = source; - this._connection = null; - this._source = source.asObservable(); - this._subject = subject; - __super__.call(this); + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); } + }); - function ConnectDisposable(parent, subscription) { - this._p = parent; - this._s = subscription; + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); } + } - ConnectDisposable.prototype.dispose = function () { - if (this._s) { - this._s.dispose(); - this._s = null; - this._p._connection = null; - } - }; - - ConnectableObservable.prototype.connect = function () { - if (!this._connection) { - if (this._subject.isStopped) { - return disposableEmpty; - } - var subscription = this._source.subscribe(this._subject); - this._connection = new ConnectDisposable(this, subscription); - } - return this._connection; - }; - - ConnectableObservable.prototype._subscribe = function (o) { - return this._subject.subscribe(o); - }; - - ConnectableObservable.prototype.refCount = function () { - return new RefCountObservable(this); - }; - - return ConnectableObservable; - }(Observable)); - - /** - * Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence - * can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`) - * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source. - */ - observableProto.singleInstance = function() { - var source = this, hasObservable = false, observable; + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n])); + } - function getObservable() { - if (!hasObservable) { - hasObservable = true; - observable = source['finally'](function() { hasObservable = false; }).publish().refCount(); - } - return observable; + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); } - - return new AnonymousObservable(function(o) { - return getObservable().subscribe(o); - }); }; - return Rx; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module))) - -/***/ }), -/* 295 */ -/***/ (function(module, exports, __webpack_require__) { + return self; +}; -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. +// exposed for testing purposes only. +Readable._fromList = fromList; -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); } - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); + return ret; +} - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(40)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - return factory(root, exports, Rx); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); } else { - root.Rx = factory(root, {}, root.Rx); + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); } -}.call(this, function (root, exp, Rx, undefined) { - - // Aliases - var Scheduler = Rx.Scheduler, - ScheduledItem = Rx.internals.ScheduledItem, - SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive, - PriorityQueue = Rx.internals.PriorityQueue, - inherits = Rx.internals.inherits, - defaultSubComparer = Rx.helpers.defaultSubComparer, - notImplemented = Rx.helpers.notImplemented; - - /** Provides a set of extension methods for virtual time scheduling. */ - var VirtualTimeScheduler = Rx.VirtualTimeScheduler = (function (__super__) { - inherits(VirtualTimeScheduler, __super__); + return ret; +} - /** - * Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer. - * - * @constructor - * @param {Number} initialClock Initial value for the clock. - * @param {Function} comparer Comparer to determine causality of events based on absolute time. - */ - function VirtualTimeScheduler(initialClock, comparer) { - this.clock = initialClock; - this.comparer = comparer; - this.isEnabled = false; - this.queue = new PriorityQueue(1024); - __super__.call(this); +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; } + ++c; + } + list.length -= c; + return ret; +} - var VirtualTimeSchedulerPrototype = VirtualTimeScheduler.prototype; - - VirtualTimeSchedulerPrototype.now = function () { - return this.toAbsoluteTime(this.clock); - }; - - VirtualTimeSchedulerPrototype.schedule = function (state, action) { - return this.scheduleAbsolute(state, this.clock, action); - }; +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = bufferShim.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} - VirtualTimeSchedulerPrototype.scheduleFuture = function (state, dueTime, action) { - var dt = dueTime instanceof Date ? - this.toRelativeTime(dueTime - this.now()) : - this.toRelativeTime(dueTime); +function endReadable(stream) { + var state = stream._readableState; - return this.scheduleRelative(state, dt, action); - }; + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - /** - * Adds a relative time value to an absolute time value. - * @param {Number} absolute Absolute virtual time value. - * @param {Number} relative Relative virtual time value to add. - * @return {Number} Resulting absolute virtual time sum value. - */ - VirtualTimeSchedulerPrototype.add = notImplemented; + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } +} - /** - * Converts an absolute time to a number - * @param {Any} The absolute time. - * @returns {Number} The absolute time in ms - */ - VirtualTimeSchedulerPrototype.toAbsoluteTime = notImplemented; +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} - /** - * Converts the TimeSpan value to a relative virtual time value. - * @param {Number} timeSpan TimeSpan value to convert. - * @return {Number} Corresponding relative virtual time value. - */ - VirtualTimeSchedulerPrototype.toRelativeTime = notImplemented; +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} - /** - * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be emulated using recursive scheduling. - * @param {Mixed} state Initial state passed to the action upon the first iteration. - * @param {Number} period Period for running the work periodically. - * @param {Function} action Action to be executed, potentially updating the state. - * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). - */ - VirtualTimeSchedulerPrototype.schedulePeriodic = function (state, period, action) { - var s = new SchedulePeriodicRecursive(this, state, period, action); - return s.start(); - }; +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} - /** - * Schedules an action to be executed after dueTime. - * @param {Mixed} state State passed to the action to be executed. - * @param {Number} dueTime Relative time after which to execute the action. - * @param {Function} action Action to be executed. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - VirtualTimeSchedulerPrototype.scheduleRelative = function (state, dueTime, action) { - var runAt = this.add(this.clock, dueTime); - return this.scheduleAbsolute(state, runAt, action); - }; +/***/ }), +/* 301 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Starts the virtual time scheduler. - */ - VirtualTimeSchedulerPrototype.start = function () { - if (!this.isEnabled) { - this.isEnabled = true; - do { - var next = this.getNext(); - if (next !== null) { - this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime); - next.invoke(); - } else { - this.isEnabled = false; - } - } while (this.isEnabled); - } - }; +"use strict"; +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. - /** - * Stops the virtual time scheduler. - */ - VirtualTimeSchedulerPrototype.stop = function () { - this.isEnabled = false; - }; - /** - * Advances the scheduler's clock to the specified time, running all work till that point. - * @param {Number} time Absolute time to advance the scheduler's clock to. - */ - VirtualTimeSchedulerPrototype.advanceTo = function (time) { - var dueToClock = this.comparer(this.clock, time); - if (this.comparer(this.clock, time) > 0) { throw new ArgumentOutOfRangeError(); } - if (dueToClock === 0) { return; } - if (!this.isEnabled) { - this.isEnabled = true; - do { - var next = this.getNext(); - if (next !== null && this.comparer(next.dueTime, time) <= 0) { - this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime); - next.invoke(); - } else { - this.isEnabled = false; - } - } while (this.isEnabled); - this.clock = time; - } - }; - /** - * Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan. - * @param {Number} time Relative time to advance the scheduler's clock by. - */ - VirtualTimeSchedulerPrototype.advanceBy = function (time) { - var dt = this.add(this.clock, time), - dueToClock = this.comparer(this.clock, dt); - if (dueToClock > 0) { throw new ArgumentOutOfRangeError(); } - if (dueToClock === 0) { return; } +module.exports = Transform; - this.advanceTo(dt); - }; +var Duplex = __webpack_require__(78); - /** - * Advances the scheduler's clock by the specified relative time. - * @param {Number} time Relative time to advance the scheduler's clock by. - */ - VirtualTimeSchedulerPrototype.sleep = function (time) { - var dt = this.add(this.clock, time); - if (this.comparer(this.clock, dt) >= 0) { throw new ArgumentOutOfRangeError(); } +/**/ +var util = __webpack_require__(99); +util.inherits = __webpack_require__(57); +/**/ - this.clock = dt; - }; +util.inherits(Transform, Duplex); - /** - * Gets the next scheduled item to be executed. - * @returns {ScheduledItem} The next scheduled item. - */ - VirtualTimeSchedulerPrototype.getNext = function () { - while (this.queue.length > 0) { - var next = this.queue.peek(); - if (next.isCancelled()) { - this.queue.dequeue(); - } else { - return next; - } - } - return null; - }; +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; - /** - * Schedules an action to be executed at dueTime. - * @param {Mixed} state State passed to the action to be executed. - * @param {Number} dueTime Absolute time at which to execute the action. - * @param {Function} action Action to be executed. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - VirtualTimeSchedulerPrototype.scheduleAbsolute = function (state, dueTime, action) { - var self = this; + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; +} - function run(scheduler, state1) { - self.queue.remove(si); - return action(scheduler, state1); - } +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; - var si = new ScheduledItem(this, state, run, dueTime, this.comparer); - this.queue.enqueue(si); + var cb = ts.writecb; - return si.disposable; - }; + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - return VirtualTimeScheduler; - }(Scheduler)); + ts.writechunk = null; + ts.writecb = null; - /** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */ - Rx.HistoricalScheduler = (function (__super__) { - inherits(HistoricalScheduler, __super__); + if (data !== null && data !== undefined) stream.push(data); - /** - * Creates a new historical scheduler with the specified initial clock value. - * @constructor - * @param {Number} initialClock Initial value for the clock. - * @param {Function} comparer Comparer to determine causality of events based on absolute time. - */ - function HistoricalScheduler(initialClock, comparer) { - var clock = initialClock == null ? 0 : initialClock; - var cmp = comparer || defaultSubComparer; - __super__.call(this, clock, cmp); - } + cb(er); - var HistoricalSchedulerProto = HistoricalScheduler.prototype; + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} - /** - * Adds a relative time value to an absolute time value. - * @param {Number} absolute Absolute virtual time value. - * @param {Number} relative Relative virtual time value to add. - * @return {Number} Resulting absolute virtual time sum value. - */ - HistoricalSchedulerProto.add = function (absolute, relative) { - return absolute + relative; - }; +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); - HistoricalSchedulerProto.toAbsoluteTime = function (absolute) { - return new Date(absolute).getTime(); - }; + Duplex.call(this, options); - /** - * Converts the TimeSpan value to a relative virtual time value. - * @memberOf HistoricalScheduler - * @param {Number} timeSpan TimeSpan value to convert. - * @return {Number} Corresponding relative virtual time value. - */ - HistoricalSchedulerProto.toRelativeTime = function (timeSpan) { - return timeSpan; - }; + this._transformState = new TransformState(this); - return HistoricalScheduler; - }(Rx.VirtualTimeScheduler)); + var stream = this; - return Rx; -})); + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module))) + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; -/***/ }), -/* 296 */ -/***/ (function(module, exports, __webpack_require__) { + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; -// Note: since nyc uses this module to output coverage, any lines -// that are in the direct sync flow of nyc's outputCoverage are -// ignored, since we can never get coverage for them. -var assert = __webpack_require__(31) -var signals = __webpack_require__(672) + if (typeof options.flush === 'function') this._flush = options.flush; + } -var EE = __webpack_require__(64) -/* istanbul ignore if */ -if (typeof EE !== 'function') { - EE = EE.EventEmitter + // When the writable side finishes, then flush out anything remaining. + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er, data) { + done(stream, er, data); + });else done(stream); + }); } -var emitter -if (process.__signal_exit_emitter__) { - emitter = process.__signal_exit_emitter__ -} else { - emitter = process.__signal_exit_emitter__ = new EE() - emitter.count = 0 - emitter.emitted = {} -} +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; -// Because this emitter is a global, we have to check to see if a -// previous version of this library failed to enable infinite listeners. -// I know what you're about to say. But literally everything about -// signal-exit is a compromise with evil. Get used to it. -if (!emitter.infinite) { - emitter.setMaxListeners(Infinity) - emitter.infinite = true -} - -module.exports = function (cb, opts) { - assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; - if (loaded === false) { - load() +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } +}; - var ev = 'exit' - if (opts && opts.alwaysLast) { - ev = 'afterexit' - } +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; - var remove = function () { - emitter.removeListener(ev, cb) - if (emitter.listeners('exit').length === 0 && - emitter.listeners('afterexit').length === 0) { - unload() - } + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } - emitter.on(ev, cb) +}; - return remove -} +function done(stream, er, data) { + if (er) return stream.emit('error', er); -module.exports.unload = unload -function unload () { - if (!loaded) { - return - } - loaded = false + if (data !== null && data !== undefined) stream.push(data); - signals.forEach(function (sig) { - try { - process.removeListener(sig, sigListeners[sig]) - } catch (er) {} - }) - process.emit = originalProcessEmit - process.reallyExit = originalProcessReallyExit - emitter.count -= 1 -} + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; -function emit (event, code, signal) { - if (emitter.emitted[event]) { - return - } - emitter.emitted[event] = true - emitter.emit(event, code, signal) -} + if (ws.length) throw new Error('Calling transform done when ws.length != 0'); -// { : , ... } -var sigListeners = {} -signals.forEach(function (sig) { - sigListeners[sig] = function listener () { - // If there are no other listeners, an exit is coming! - // Simplest way: remove us and then re-send the signal. - // We know that this will kill the process, so we can - // safely emit now. - var listeners = process.listeners(sig) - if (listeners.length === emitter.count) { - unload() - emit('exit', null, sig) - /* istanbul ignore next */ - emit('afterexit', null, sig) - /* istanbul ignore next */ - process.kill(process.pid, sig) - } - } -}) + if (ts.transforming) throw new Error('Calling transform done when still transforming'); -module.exports.signals = function () { - return signals + return stream.push(null); } -module.exports.load = load +/***/ }), +/* 302 */ +/***/ (function(module, exports, __webpack_require__) { -var loaded = false +"use strict"; +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. -function load () { - if (loaded) { - return - } - loaded = true - // This is the number of onSignalExit's that are in play. - // It's important so that we can count the correct number of - // listeners on signals, and don't wait for the other one to - // handle it instead of us. - emitter.count += 1 - signals = signals.filter(function (sig) { - try { - process.on(sig, sigListeners[sig]) - return true - } catch (er) { - return false - } - }) +module.exports = Writable; - process.emit = processEmit - process.reallyExit = processReallyExit -} +/**/ +var processNextTick = __webpack_require__(194); +/**/ -var originalProcessReallyExit = process.reallyExit -function processReallyExit (code) { - process.exitCode = code || 0 - emit('exit', process.exitCode, null) - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null) - /* istanbul ignore next */ - originalProcessReallyExit.call(process, process.exitCode) -} +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ -var originalProcessEmit = process.emit -function processEmit (ev, arg) { - if (ev === 'exit') { - if (arg !== undefined) { - process.exitCode = arg - } - var ret = originalProcessEmit.apply(this, arguments) - emit('exit', process.exitCode, null) - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null) - return ret - } else { - return originalProcessEmit.apply(this, arguments) - } -} +/**/ +var Duplex; +/**/ +Writable.WritableState = WritableState; -/***/ }), -/* 297 */ -/***/ (function(module, exports, __webpack_require__) { +/**/ +var util = __webpack_require__(99); +util.inherits = __webpack_require__(57); +/**/ -module.exports = __webpack_require__(673); +/**/ +var internalUtil = { + deprecate: __webpack_require__(721) +}; +/**/ -/***/ }), -/* 298 */ -/***/ (function(module, exports, __webpack_require__) { +/**/ +var Stream = __webpack_require__(303); +/**/ -// Copyright 2017 Joyent, Inc. +var Buffer = __webpack_require__(104).Buffer; +/**/ +var bufferShim = __webpack_require__(160); +/**/ -module.exports = { - DiffieHellman: DiffieHellman, - generateECDSA: generateECDSA, - generateED25519: generateED25519 -}; +util.inherits(Writable, Stream); -var assert = __webpack_require__(12); -var crypto = __webpack_require__(9); -var algs = __webpack_require__(22); -var utils = __webpack_require__(20); -var ed; -var nacl; +function nop() {} -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} -var CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined); +function WritableState(options, stream) { + Duplex = Duplex || __webpack_require__(78); -var ecdh, ec, jsbn; + options = options || {}; -function DiffieHellman(key) { - utils.assertCompatible(key, Key, [1, 4], 'key'); - this._isPriv = PrivateKey.isPrivateKey(key, [1, 3]); - this._algo = key.type; - this._curve = key.curve; - this._key = key; - if (key.type === 'dsa') { - if (!CRYPTO_HAVE_ECDH) { - throw (new Error('Due to bugs in the node 0.10 ' + - 'crypto API, node 0.12.x or later is required ' + - 'to use DH')); - } - this._dh = crypto.createDiffieHellman( - key.part.p.data, undefined, - key.part.g.data, undefined); - this._p = key.part.p; - this._g = key.part.g; - if (this._isPriv) - this._dh.setPrivateKey(key.part.x.data); - this._dh.setPublicKey(key.part.y.data); + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; - } else if (key.type === 'ecdsa') { - if (!CRYPTO_HAVE_ECDH) { - if (ecdh === undefined) - ecdh = __webpack_require__(265); - if (ec === undefined) - ec = __webpack_require__(113); - if (jsbn === undefined) - jsbn = __webpack_require__(57).BigInteger; + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - this._ecParams = new X9ECParameters(this._curve); + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - if (this._isPriv) { - this._priv = new ECPrivate( - this._ecParams, key.part.d.data); - } - return; - } + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; - var curve = { - 'nistp256': 'prime256v1', - 'nistp384': 'secp384r1', - 'nistp521': 'secp521r1' - }[key.curve]; - this._dh = crypto.createECDH(curve); - if (typeof (this._dh) !== 'object' || - typeof (this._dh.setPrivateKey) !== 'function') { - CRYPTO_HAVE_ECDH = false; - DiffieHellman.call(this, key); - return; - } - if (this._isPriv) - this._dh.setPrivateKey(key.part.d.data); - this._dh.setPublicKey(key.part.Q.data); + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; - } else if (key.type === 'curve25519') { - if (ed === undefined) - ed = __webpack_require__(175); + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; - if (this._isPriv) { - this._priv = key.part.r.data; - if (this._priv[0] === 0x00) - this._priv = this._priv.slice(1); - this._priv = this._priv.slice(0, 32); - } + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; - } else { - throw (new Error('DH not supported for ' + key.type + ' keys')); - } -} + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; -DiffieHellman.prototype.getPublicKey = function () { - if (this._isPriv) - return (this._key.toPublic()); - return (this._key); -}; + // a flag to see when we're in the middle of a write. + this.writing = false; -DiffieHellman.prototype.getPrivateKey = function () { - if (this._isPriv) - return (this._key); - else - return (undefined); -}; -DiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey; + // when true all writes will be buffered until .uncork() call + this.corked = 0; -DiffieHellman.prototype._keyCheck = function (pk, isPub) { - assert.object(pk, 'key'); - if (!isPub) - utils.assertCompatible(pk, PrivateKey, [1, 3], 'key'); - utils.assertCompatible(pk, Key, [1, 4], 'key'); + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; - if (pk.type !== this._algo) { - throw (new Error('A ' + pk.type + ' key cannot be used in ' + - this._algo + ' Diffie-Hellman')); - } + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; - if (pk.curve !== this._curve) { - throw (new Error('A key from the ' + pk.curve + ' curve ' + - 'cannot be used with a ' + this._curve + - ' Diffie-Hellman')); - } + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; - if (pk.type === 'dsa') { - assert.deepEqual(pk.part.p, this._p, - 'DSA key prime does not match'); - assert.deepEqual(pk.part.g, this._g, - 'DSA key generator does not match'); - } -}; + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; -DiffieHellman.prototype.setKey = function (pk) { - this._keyCheck(pk); + // the amount that is being written when _write is called. + this.writelen = 0; - if (pk.type === 'dsa') { - this._dh.setPrivateKey(pk.part.x.data); - this._dh.setPublicKey(pk.part.y.data); + this.bufferedRequest = null; + this.lastBufferedRequest = null; - } else if (pk.type === 'ecdsa') { - if (CRYPTO_HAVE_ECDH) { - this._dh.setPrivateKey(pk.part.d.data); - this._dh.setPublicKey(pk.part.Q.data); - } else { - this._priv = new ECPrivate( - this._ecParams, pk.part.d.data); - } + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; - } else if (pk.type === 'curve25519') { - this._priv = pk.part.r.data; - if (this._priv[0] === 0x00) - this._priv = this._priv.slice(1); - this._priv = this._priv.slice(0, 32); - } - this._key = pk; - this._isPriv = true; + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; }; -DiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey; -DiffieHellman.prototype.computeSecret = function (otherpk) { - this._keyCheck(otherpk, true); - if (!this._isPriv) - throw (new Error('DH exchange has not been initialized with ' + - 'a private key yet')); +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); - var pub; - if (this._algo === 'dsa') { - return (this._dh.computeSecret( - otherpk.part.y.data)); +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; - } else if (this._algo === 'ecdsa') { - if (CRYPTO_HAVE_ECDH) { - return (this._dh.computeSecret( - otherpk.part.Q.data)); - } else { - pub = new ECPublic( - this._ecParams, otherpk.part.Q.data); - return (this._priv.deriveSharedSecret(pub)); - } + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} - } else if (this._algo === 'curve25519') { - pub = otherpk.part.R.data; - if (pub[0] === 0x00) - pub = pub.slice(1); +function Writable(options) { + Duplex = Duplex || __webpack_require__(78); - var secret = ed.dh.computeKey( - this._priv.toString('binary'), - pub.toString('binary')); + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. - return (new Buffer(secret, 'binary')); - } + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } - throw (new Error('Invalid algorithm: ' + this._algo)); -}; + this._writableState = new WritableState(options, this); -DiffieHellman.prototype.generateKey = function () { - var parts = []; - var priv, pub; - if (this._algo === 'dsa') { - this._dh.generateKeys(); + // legacy. + this.writable = true; - parts.push({name: 'p', data: this._p.data}); - parts.push({name: 'q', data: this._key.part.q.data}); - parts.push({name: 'g', data: this._g.data}); - parts.push({name: 'y', data: this._dh.getPublicKey()}); - parts.push({name: 'x', data: this._dh.getPrivateKey()}); - this._key = new PrivateKey({ - type: 'dsa', - parts: parts - }); - this._isPriv = true; - return (this._key); + if (options) { + if (typeof options.write === 'function') this._write = options.write; - } else if (this._algo === 'ecdsa') { - if (CRYPTO_HAVE_ECDH) { - this._dh.generateKeys(); + if (typeof options.writev === 'function') this._writev = options.writev; + } - parts.push({name: 'curve', - data: new Buffer(this._curve)}); - parts.push({name: 'Q', data: this._dh.getPublicKey()}); - parts.push({name: 'd', data: this._dh.getPrivateKey()}); - this._key = new PrivateKey({ - type: 'ecdsa', - curve: this._curve, - parts: parts - }); - this._isPriv = true; - return (this._key); + Stream.call(this); +} - } else { - var n = this._ecParams.getN(); - var r = new jsbn(crypto.randomBytes(n.bitLength())); - var n1 = n.subtract(jsbn.ONE); - priv = r.mod(n1).add(jsbn.ONE); - pub = this._ecParams.getG().multiply(priv); +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; - priv = new Buffer(priv.toByteArray()); - pub = new Buffer(this._ecParams.getCurve(). - encodePointHex(pub), 'hex'); +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} - this._priv = new ECPrivate(this._ecParams, priv); +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; - parts.push({name: 'curve', - data: new Buffer(this._curve)}); - parts.push({name: 'Q', data: pub}); - parts.push({name: 'd', data: priv}); + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} - this._key = new PrivateKey({ - type: 'ecdsa', - curve: this._curve, - parts: parts - }); - this._isPriv = true; - return (this._key); - } +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = Buffer.isBuffer(chunk); - } else if (this._algo === 'curve25519') { - priv = ed.dh.generateKey(); - pub = ed.dh.publicKey(priv); - this._priv = priv = new Buffer(priv, 'binary'); - pub = new Buffer(pub, 'binary'); + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } - parts.push({name: 'R', data: pub}); - parts.push({name: 'r', data: Buffer.concat([priv, pub])}); - this._key = new PrivateKey({ - type: 'curve25519', - parts: parts - }); - this._isPriv = true; - return (this._key); - } + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - throw (new Error('Invalid algorithm: ' + this._algo)); + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; }; -DiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey; -/* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */ +Writable.prototype.cork = function () { + var state = this._writableState; -function X9ECParameters(name) { - var params = algs.curves[name]; - assert.object(params); + state.corked++; +}; - var p = new jsbn(params.p); - var a = new jsbn(params.a); - var b = new jsbn(params.b); - var n = new jsbn(params.n); - var h = jsbn.ONE; - var curve = new ec.ECCurveFp(p, a, b); - var G = curve.decodePointHex(params.G.toString('hex')); +Writable.prototype.uncork = function () { + var state = this._writableState; - this.curve = curve; - this.g = G; - this.n = n; - this.h = h; -} -X9ECParameters.prototype.getCurve = function () { return (this.curve); }; -X9ECParameters.prototype.getG = function () { return (this.g); }; -X9ECParameters.prototype.getN = function () { return (this.n); }; -X9ECParameters.prototype.getH = function () { return (this.h); }; + if (state.corked) { + state.corked--; -function ECPublic(params, buffer) { - this._params = params; - if (buffer[0] === 0x00) - buffer = buffer.slice(1); - this._pub = params.getCurve().decodePointHex(buffer.toString('hex')); -} + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; -function ECPrivate(params, buffer) { - this._params = params; - this._priv = new jsbn(utils.mpNormalize(buffer)); -} -ECPrivate.prototype.deriveSharedSecret = function (pubKey) { - assert.ok(pubKey instanceof ECPublic); - var S = pubKey._pub.multiply(this._priv); - return (new Buffer(S.getX().toBigInteger().toByteArray())); +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; }; -function generateED25519() { - if (nacl === undefined) - nacl = __webpack_require__(131); +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = bufferShim.from(chunk, encoding); + } + return chunk; +} - var pair = nacl.sign.keyPair(); - var priv = new Buffer(pair.secretKey); - var pub = new Buffer(pair.publicKey); - assert.strictEqual(priv.length, 64); - assert.strictEqual(pub.length, 32); +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + chunk = decodeChunk(state, chunk, encoding); + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + } + var len = state.objectMode ? 1 : chunk.length; - var parts = []; - parts.push({name: 'R', data: pub}); - parts.push({name: 'r', data: priv}); - var key = new PrivateKey({ - type: 'ed25519', - parts: parts - }); - return (key); -} + state.length += len; -/* Generates a new ECDSA private key on a given curve. */ -function generateECDSA(curve) { - var parts = []; - var key; + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; - if (CRYPTO_HAVE_ECDH) { - /* - * Node crypto doesn't expose key generation directly, but the - * ECDH instances can generate keys. It turns out this just - * calls into the OpenSSL generic key generator, and we can - * read its output happily without doing an actual DH. So we - * use that here. - */ - var osCurve = { - 'nistp256': 'prime256v1', - 'nistp384': 'secp384r1', - 'nistp521': 'secp521r1' - }[curve]; + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } - var dh = crypto.createECDH(osCurve); - dh.generateKeys(); + return ret; +} - parts.push({name: 'curve', - data: new Buffer(curve)}); - parts.push({name: 'Q', data: dh.getPublicKey()}); - parts.push({name: 'd', data: dh.getPrivateKey()}); +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} - key = new PrivateKey({ - type: 'ecdsa', - curve: curve, - parts: parts - }); - return (key); +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); - } else { - if (ecdh === undefined) - ecdh = __webpack_require__(265); - if (ec === undefined) - ec = __webpack_require__(113); - if (jsbn === undefined) - jsbn = __webpack_require__(57).BigInteger; + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} - var ecParams = new X9ECParameters(curve); +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} - /* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */ - var n = ecParams.getN(); - /* - * The crypto.randomBytes() function can only give us whole - * bytes, so taking a nod from X9.62, we round up. - */ - var cByteLen = Math.ceil((n.bitLength() + 64) / 8); - var c = new jsbn(crypto.randomBytes(cByteLen)); +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; - var n1 = n.subtract(jsbn.ONE); - var priv = c.mod(n1).add(jsbn.ONE); - var pub = ecParams.getG().multiply(priv); + onwriteStateUpdate(state); - priv = new Buffer(priv.toByteArray()); - pub = new Buffer(ecParams.getCurve(). - encodePointHex(pub), 'hex'); + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); - parts.push({name: 'curve', data: new Buffer(curve)}); - parts.push({name: 'Q', data: pub}); - parts.push({name: 'd', data: priv}); + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } - key = new PrivateKey({ - type: 'ecdsa', - curve: curve, - parts: parts - }); - return (key); - } + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } } +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} -/***/ }), -/* 299 */ -/***/ (function(module, exports, __webpack_require__) { +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} -// Copyright 2015 Joyent, Inc. +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; -module.exports = { - Verifier: Verifier, - Signer: Signer -}; + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; -var nacl; -var stream = __webpack_require__(25); -var util = __webpack_require__(2); -var assert = __webpack_require__(12); -var Signature = __webpack_require__(43); + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } -function Verifier(key, hashAlgo) { - if (nacl === undefined) - nacl = __webpack_require__(131); + doWrite(stream, state, true, state.length, buffer, '', holder.finish); - if (hashAlgo.toLowerCase() !== 'sha512') - throw (new Error('ED25519 only supports the use of ' + - 'SHA-512 hashes')); + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; - this.key = key; - this.chunks = []; + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } - stream.Writable.call(this, {}); + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; } -util.inherits(Verifier, stream.Writable); -Verifier.prototype._write = function (chunk, enc, cb) { - this.chunks.push(chunk); - cb(); +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); }; -Verifier.prototype.update = function (chunk) { - if (typeof (chunk) === 'string') - chunk = new Buffer(chunk, 'binary'); - this.chunks.push(chunk); -}; +Writable.prototype._writev = null; -Verifier.prototype.verify = function (signature, fmt) { - var sig; - if (Signature.isSignature(signature, [2, 0])) { - if (signature.type !== 'ed25519') - return (false); - sig = signature.toBuffer('raw'); +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; - } else if (typeof (signature) === 'string') { - sig = new Buffer(signature, 'base64'); + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } - } else if (Signature.isSignature(signature, [1, 0])) { - throw (new Error('signature was created by too old ' + - 'a version of sshpk and cannot be verified')); - } + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - assert.buffer(sig); - return (nacl.sign.detached.verify( - new Uint8Array(Buffer.concat(this.chunks)), - new Uint8Array(sig), - new Uint8Array(this.key.part.R.data))); + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); }; -function Signer(key, hashAlgo) { - if (nacl === undefined) - nacl = __webpack_require__(131); +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} - if (hashAlgo.toLowerCase() !== 'sha512') - throw (new Error('ED25519 only supports the use of ' + - 'SHA-512 hashes')); +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} - this.key = key; - this.chunks = []; +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} - stream.Writable.call(this, {}); +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; } -util.inherits(Signer, stream.Writable); -Signer.prototype._write = function (chunk, enc, cb) { - this.chunks.push(chunk); - cb(); -}; +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; -Signer.prototype.update = function (chunk) { - if (typeof (chunk) === 'string') - chunk = new Buffer(chunk, 'binary'); - this.chunks.push(chunk); -}; + this.next = null; + this.entry = null; + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; + } + }; +} -Signer.prototype.sign = function () { - var sig = nacl.sign.detached( - new Uint8Array(Buffer.concat(this.chunks)), - new Uint8Array(this.key.part.r.data)); - var sigBuf = new Buffer(sig); - var sigObj = Signature.parse(sigBuf, 'ed25519', 'raw'); - sigObj.hashAlgorithm = 'sha512'; - return (sigObj); -}; +/***/ }), +/* 303 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(29); /***/ }), -/* 300 */ +/* 304 */ /***/ (function(module, exports, __webpack_require__) { -// Copyright 2015 Joyent, Inc. +"use strict"; -module.exports = { - read: read, - write: write -}; -var assert = __webpack_require__(12); -var utils = __webpack_require__(20); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); +var Buffer = __webpack_require__(79).Buffer; -var pem = __webpack_require__(58); -var ssh = __webpack_require__(301); -var rfc4253 = __webpack_require__(63); +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; -function read(buf, options) { - if (typeof (buf) === 'string') { - if (buf.trim().match(/^[-]+[ ]*BEGIN/)) - return (pem.read(buf, options)); - if (buf.match(/^\s*ssh-[a-z]/)) - return (ssh.read(buf, options)); - if (buf.match(/^\s*ecdsa-/)) - return (ssh.read(buf, options)); - buf = new Buffer(buf, 'binary'); - } else { - assert.buffer(buf); - if (findPEMHeader(buf)) - return (pem.read(buf, options)); - if (findSSHHeader(buf)) - return (ssh.read(buf, options)); - } - if (buf.readUInt32BE(0) < buf.length) - return (rfc4253.read(buf, options)); - throw (new Error('Failed to auto-detect format of key')); +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; } -function findSSHHeader(buf) { - var offset = 0; - while (offset < buf.length && - (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9)) - ++offset; - if (offset + 4 <= buf.length && - buf.slice(offset, offset + 4).toString('ascii') === 'ssh-') - return (true); - if (offset + 6 <= buf.length && - buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-') - return (true); - return (false); +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); } -function findPEMHeader(buf) { - var offset = 0; - while (offset < buf.length && - (buf[offset] === 32 || buf[offset] === 10)) - ++offset; - if (buf[offset] !== 45) - return (false); - while (offset < buf.length && - (buf[offset] === 45)) - ++offset; - while (offset < buf.length && - (buf[offset] === 32)) - ++offset; - if (offset + 5 > buf.length || - buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN') - return (false); - return (true); +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return -1; } -function write(key, options) { - throw (new Error('"auto" format cannot be used for writing')); +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'.repeat(p); + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'.repeat(p + 1); + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'.repeat(p + 2); + } + } + } } +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} -/***/ }), -/* 301 */ -/***/ (function(module, exports, __webpack_require__) { +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} -// Copyright 2015 Joyent, Inc. +// For UTF-8, a replacement character for each buffered byte of a (partial) +// character needs to be added to the output. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed); + return r; +} -module.exports = { - read: read, - write: write -}; +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} -var assert = __webpack_require__(12); -var rfc4253 = __webpack_require__(63); -var utils = __webpack_require__(20); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} -var sshpriv = __webpack_require__(128); +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} -/*JSSTYLED*/ -var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([\n \t]+([^\n]+))?$/; -/*JSSTYLED*/ -var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/ \t\n]+[=]*)(.*)$/; +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} -function read(buf, options) { - if (typeof (buf) !== 'string') { - assert.buffer(buf, 'buf'); - buf = buf.toString('ascii'); - } +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} - var trimmed = buf.trim().replace(/[\\\r]/g, ''); - var m = trimmed.match(SSHKEY_RE); - if (!m) - m = trimmed.match(SSHKEY_RE2); - assert.ok(m, 'key must match regex'); +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} - var type = rfc4253.algToKeyType(m[1]); - var kbuf = new Buffer(m[2], 'base64'); +/***/ }), +/* 305 */ +/***/ (function(module, exports, __webpack_require__) { - /* - * This is a bit tricky. If we managed to parse the key and locate the - * key comment with the regex, then do a non-partial read and assert - * that we have consumed all bytes. If we couldn't locate the key - * comment, though, there may be whitespace shenanigans going on that - * have conjoined the comment to the rest of the key. We do a partial - * read in this case to try to make the best out of a sorry situation. - */ - var key; - var ret = {}; - if (m[4]) { - try { - key = rfc4253.read(kbuf); +"use strict"; +/*! + * repeat-element + * + * Copyright (c) 2015 Jon Schlinkert. + * Licensed under the MIT license. + */ - } catch (e) { - m = trimmed.match(SSHKEY_RE2); - assert.ok(m, 'key must match regex'); - kbuf = new Buffer(m[2], 'base64'); - key = rfc4253.readInternal(ret, 'public', kbuf); - } - } else { - key = rfc4253.readInternal(ret, 'public', kbuf); - } - assert.strictEqual(type, key.type); - if (m[4] && m[4].length > 0) { - key.comment = m[4]; +module.exports = function repeat(ele, num) { + var arr = new Array(num); - } else if (ret.consumed) { - /* - * Now the magic: trying to recover the key comment when it's - * gotten conjoined to the key or otherwise shenanigan'd. - * - * Work out how much base64 we used, then drop all non-base64 - * chars from the beginning up to this point in the the string. - * Then offset in this and try to make up for missing = chars. - */ - var data = m[2] + m[3]; - var realOffset = Math.ceil(ret.consumed / 3) * 4; - data = data.slice(0, realOffset - 2). /*JSSTYLED*/ - replace(/[^a-zA-Z0-9+\/=]/g, '') + - data.slice(realOffset - 2); + for (var i = 0; i < num; i++) { + arr[i] = ele; + } - var padding = ret.consumed % 3; - if (padding > 0 && - data.slice(realOffset - 1, realOffset) !== '=') - realOffset--; - while (data.slice(realOffset, realOffset + 1) === '=') - realOffset++; + return arr; +}; - /* Finally, grab what we think is the comment & clean it up. */ - var trailer = data.slice(realOffset); - trailer = trailer.replace(/[\r\n]/g, ' '). - replace(/^\s+/, ''); - if (trailer.match(/^[a-zA-Z0-9]/)) - key.comment = trailer; - } - return (key); -} +/***/ }), +/* 306 */ +/***/ (function(module, exports, __webpack_require__) { -function write(key, options) { - assert.object(key); - if (!Key.isKey(key)) - throw (new Error('Must be a public key')); +"use strict"; - var parts = []; - var alg = rfc4253.keyTypeToAlg(key); - parts.push(alg); - var buf = rfc4253.write(key); - parts.push(buf.toString('base64')); +var tough = __webpack_require__(681) - if (key.comment) - parts.push(key.comment); +var Cookie = tough.Cookie + , CookieJar = tough.CookieJar - return (new Buffer(parts.join(' '))); + +exports.parse = function(str) { + if (str && str.uri) { + str = str.uri + } + if (typeof str !== 'string') { + throw new Error('The cookie function only accepts STRING as param') + } + return Cookie.parse(str, {loose: true}) +} + +// Adapt the sometimes-Async api of tough.CookieJar to our requirements +function RequestJar(store) { + var self = this + self._jar = new CookieJar(store, {looseMode: true}) +} +RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) { + var self = this + return self._jar.setCookieSync(cookieOrStr, uri, options || {}) +} +RequestJar.prototype.getCookieString = function(uri) { + var self = this + return self._jar.getCookieStringSync(uri) +} +RequestJar.prototype.getCookies = function(uri) { + var self = this + return self._jar.getCookiesSync(uri) +} + +exports.jar = function(store) { + return new RequestJar(store) } /***/ }), -/* 302 */ +/* 307 */ /***/ (function(module, exports, __webpack_require__) { -// Copyright 2017 Joyent, Inc. - -module.exports = { - read: read, - verify: verify, - sign: sign, - signAsync: signAsync, - write: write -}; - -var assert = __webpack_require__(12); -var asn1 = __webpack_require__(46); -var algs = __webpack_require__(22); -var utils = __webpack_require__(20); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var pem = __webpack_require__(58); -var Identity = __webpack_require__(97); -var Signature = __webpack_require__(43); -var Certificate = __webpack_require__(94); -var pkcs8 = __webpack_require__(96); +"use strict"; +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ /* - * This file is based on RFC5280 (X.509). + * "A request-path path-matches a given cookie-path if at least one of the + * following conditions holds:" */ +function pathMatch (reqPath, cookiePath) { + // "o The cookie-path and the request-path are identical." + if (cookiePath === reqPath) { + return true; + } -/* Helper to read in a single mpint */ -function readMPInt(der, nm) { - assert.strictEqual(der.peek(), asn1.Ber.Integer, - nm + ' is not an Integer'); - return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); + var idx = reqPath.indexOf(cookiePath); + if (idx === 0) { + // "o The cookie-path is a prefix of the request-path, and the last + // character of the cookie-path is %x2F ("/")." + if (cookiePath.substr(-1) === "/") { + return true; + } + + // " o The cookie-path is a prefix of the request-path, and the first + // character of the request-path that is not included in the cookie- path + // is a %x2F ("/") character." + if (reqPath.substr(cookiePath.length, 1) === "/") { + return true; + } + } + + return false; } -function verify(cert, key) { - var sig = cert.signatures.x509; - assert.object(sig, 'x509 signature'); +exports.pathMatch = pathMatch; - var algParts = sig.algo.split('-'); - if (algParts[0] !== key.type) - return (false); - var blob = sig.cache; - if (blob === undefined) { - var der = new asn1.BerWriter(); - writeTBSCert(cert, der); - blob = der.buffer; - } +/***/ }), +/* 308 */ +/***/ (function(module, exports, __webpack_require__) { - var verifier = key.createVerify(algParts[1]); - verifier.write(blob); - return (verifier.verify(sig.signature)); -} +"use strict"; +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ -function Local(i) { - return (asn1.Ber.Context | asn1.Ber.Constructor | i); -} +var pubsuffix = __webpack_require__(309); -function Context(i) { - return (asn1.Ber.Context | i); -} +// Gives the permutation of all possible domainMatch()es of a given domain. The +// array is in shortest-to-longest order. Handy for indexing. +function permuteDomain (domain) { + var pubSuf = pubsuffix.getPublicSuffix(domain); + if (!pubSuf) { + return null; + } + if (pubSuf == domain) { + return [domain]; + } -var SIGN_ALGS = { - 'rsa-md5': '1.2.840.113549.1.1.4', - 'rsa-sha1': '1.2.840.113549.1.1.5', - 'rsa-sha256': '1.2.840.113549.1.1.11', - 'rsa-sha384': '1.2.840.113549.1.1.12', - 'rsa-sha512': '1.2.840.113549.1.1.13', - 'dsa-sha1': '1.2.840.10040.4.3', - 'dsa-sha256': '2.16.840.1.101.3.4.3.2', - 'ecdsa-sha1': '1.2.840.10045.4.1', - 'ecdsa-sha256': '1.2.840.10045.4.3.2', - 'ecdsa-sha384': '1.2.840.10045.4.3.3', - 'ecdsa-sha512': '1.2.840.10045.4.3.4' -}; -Object.keys(SIGN_ALGS).forEach(function (k) { - SIGN_ALGS[SIGN_ALGS[k]] = k; -}); -SIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5'; -SIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1'; + var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com" + var parts = prefix.split('.').reverse(); + var cur = pubSuf; + var permutations = [cur]; + while (parts.length) { + cur = parts.shift() + '.' + cur; + permutations.push(cur); + } + return permutations; +} -var EXTS = { - 'issuerKeyId': '2.5.29.35', - 'altName': '2.5.29.17', - 'basicConstraints': '2.5.29.19', - 'keyUsage': '2.5.29.15', - 'extKeyUsage': '2.5.29.37' -}; +exports.permuteDomain = permuteDomain; -function read(buf, options) { - if (typeof (buf) === 'string') { - buf = new Buffer(buf, 'binary'); - } - assert.buffer(buf, 'buf'); - var der = new asn1.BerReader(buf); +/***/ }), +/* 309 */ +/***/ (function(module, exports, __webpack_require__) { - der.readSequence(); - if (Math.abs(der.length - der.remain) > 1) { - throw (new Error('DER sequence does not contain whole byte ' + - 'stream')); - } +"use strict"; +/**************************************************** + * AUTOMATICALLY GENERATED by generate-pubsuffix.js * + * DO NOT EDIT! * + ****************************************************/ - var tbsStart = der.offset; - der.readSequence(); - var sigOffset = der.offset + der.length; - var tbsEnd = sigOffset; - if (der.peek() === Local(0)) { - der.readSequence(Local(0)); - var version = der.readInt(); - assert.ok(version <= 3, - 'only x.509 versions up to v3 supported'); - } - var cert = {}; - cert.signatures = {}; - var sig = (cert.signatures.x509 = {}); - sig.extras = {}; +var punycode = __webpack_require__(199); - cert.serial = readMPInt(der, 'serial'); +module.exports.getPublicSuffix = function getPublicSuffix(domain) { + /*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + if (!domain) { + return null; + } + if (domain.match(/^\./)) { + return null; + } + var asciiDomain = punycode.toASCII(domain); + var converted = false; + if (asciiDomain !== domain) { + domain = asciiDomain; + converted = true; + } + if (index[domain]) { + return null; + } - der.readSequence(); - var after = der.offset + der.length; - var certAlgOid = der.readOID(); - var certAlg = SIGN_ALGS[certAlgOid]; - if (certAlg === undefined) - throw (new Error('unknown signature algorithm ' + certAlgOid)); + domain = domain.toLowerCase(); + var parts = domain.split('.').reverse(); - der._offset = after; - cert.issuer = Identity.parseAsn1(der); + var suffix = ''; + var suffixLen = 0; + for (var i=0; i suffixLen) { + var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.'); + return converted ? punycode.toUnicode(publicSuffix) : publicSuffix; + } - /* subjectUniqueID */ - if (der.peek() === Local(2)) { - der.readSequence(Local(2)); - sig.extras.subjectUniqueID = - buf.slice(der.offset, der.offset + der.length); - der._offset += der.length; - } + return null; +}; - /* extensions */ - if (der.peek() === Local(3)) { - der.readSequence(Local(3)); - var extEnd = der.offset + der.length; - der.readSequence(); +// The following generated structure is used under the MPL version 2.0 +// See public-suffix.txt for more information - while (der.offset < extEnd) - readExtension(cert, buf, der); +var index = module.exports.index = Object.freeze( +{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mp.br":true,"mus.br":true,"net.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"ac.cy":true,"biz.cy":true,"com.cy":true,"ekloges.cy":true,"gov.cy":true,"ltd.cy":true,"name.cy":true,"net.cy":true,"org.cy":true,"parliament.cy":true,"press.cy":true,"pro.cy":true,"tm.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"net.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"co.gl":true,"com.gl":true,"edu.gl":true,"net.gl":true,"org.gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"il":true,"ac.il":true,"co.il":true,"gov.il":true,"idf.il":true,"k12.il":true,"muni.il":true,"net.il":true,"org.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"catanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":true,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pescara.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"trani-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehime.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn--efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takahama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gonohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":true,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"shonai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kitakata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiroshima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkaido.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokkaido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.ibaraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagawa.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagawa.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.jp":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"hitoyoshi.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kashima.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kosa.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.kumamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mie.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"kesennuma.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":true,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasaki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.niigata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":true,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"higashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shimane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shizuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"komatsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koganei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"yazu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":true,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikawamisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"ac.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"co.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"teledata.mz":false,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"sch.ng":true,"gov.ng":true,"mil.ng":true,"mobi.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"nz":true,"ac.nz":true,"co.nz":true,"cri.nz":true,"geek.nz":true,"gen.nz":true,"govt.nz":true,"health.nz":true,"iwi.nz":true,"kiwi.nz":true,"maori.nz":true,"mil.nz":true,"xn--mori-qsa.nz":true,"net.nz":true,"org.nz":true,"parliament.nz":true,"school.nz":true,"om":true,"co.om":true,"com.om":true,"edu.om":true,"gov.om":true,"med.om":true,"museum.om":true,"net.om":true,"org.om":true,"pro.om":true,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"com.pl":true,"net.pl":true,"org.pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"gov.pl":true,"ap.gov.pl":true,"ic.gov.pl":true,"is.gov.pl":true,"us.gov.pl":true,"kmpsp.gov.pl":true,"kppsp.gov.pl":true,"kwpsp.gov.pl":true,"psp.gov.pl":true,"wskr.gov.pl":true,"kwp.gov.pl":true,"mw.gov.pl":true,"ug.gov.pl":true,"um.gov.pl":true,"umig.gov.pl":true,"ugim.gov.pl":true,"upow.gov.pl":true,"uw.gov.pl":true,"starostwo.gov.pl":true,"pa.gov.pl":true,"po.gov.pl":true,"psse.gov.pl":true,"pup.gov.pl":true,"rzgw.gov.pl":true,"sa.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"wsa.gov.pl":true,"sko.gov.pl":true,"uzs.gov.pl":true,"wiih.gov.pl":true,"winb.gov.pl":true,"pinb.gov.pl":true,"wios.gov.pl":true,"witd.gov.pl":true,"wzmiuw.gov.pl":true,"piw.gov.pl":true,"wiw.gov.pl":true,"griw.gov.pl":true,"wif.gov.pl":true,"oum.gov.pl":true,"sdn.gov.pl":true,"zp.gov.pl":true,"uppo.gov.pl":true,"mup.gov.pl":true,"wuoz.gov.pl":true,"konsulat.gov.pl":true,"oirm.gov.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"post":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aca.pro":true,"bar.pro":true,"cpa.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"eng.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"py":true,"com.py":true,"coop.py":true,"edu.py":true,"gov.py":true,"mil.py":true,"net.py":true,"org.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"com.re":true,"asso.re":true,"nom.re":true,"ro":true,"com.ro":true,"org.ro":true,"tm.ro":true,"nt.ro":true,"nom.ro":true,"info.ro":true,"rec.ro":true,"arts.ro":true,"firm.ro":true,"store.ro":true,"www.ro":true,"rs":true,"co.rs":true,"org.rs":true,"edu.rs":true,"ac.rs":true,"gov.rs":true,"in.rs":true,"ru":true,"ac.ru":true,"com.ru":true,"edu.ru":true,"int.ru":true,"net.ru":true,"org.ru":true,"pp.ru":true,"adygeya.ru":true,"altai.ru":true,"amur.ru":true,"arkhangelsk.ru":true,"astrakhan.ru":true,"bashkiria.ru":true,"belgorod.ru":true,"bir.ru":true,"bryansk.ru":true,"buryatia.ru":true,"cbg.ru":true,"chel.ru":true,"chelyabinsk.ru":true,"chita.ru":true,"chukotka.ru":true,"chuvashia.ru":true,"dagestan.ru":true,"dudinka.ru":true,"e-burg.ru":true,"grozny.ru":true,"irkutsk.ru":true,"ivanovo.ru":true,"izhevsk.ru":true,"jar.ru":true,"joshkar-ola.ru":true,"kalmykia.ru":true,"kaluga.ru":true,"kamchatka.ru":true,"karelia.ru":true,"kazan.ru":true,"kchr.ru":true,"kemerovo.ru":true,"khabarovsk.ru":true,"khakassia.ru":true,"khv.ru":true,"kirov.ru":true,"koenig.ru":true,"komi.ru":true,"kostroma.ru":true,"krasnoyarsk.ru":true,"kuban.ru":true,"kurgan.ru":true,"kursk.ru":true,"lipetsk.ru":true,"magadan.ru":true,"mari.ru":true,"mari-el.ru":true,"marine.ru":true,"mordovia.ru":true,"msk.ru":true,"murmansk.ru":true,"nalchik.ru":true,"nnov.ru":true,"nov.ru":true,"novosibirsk.ru":true,"nsk.ru":true,"omsk.ru":true,"orenburg.ru":true,"oryol.ru":true,"palana.ru":true,"penza.ru":true,"perm.ru":true,"ptz.ru":true,"rnd.ru":true,"ryazan.ru":true,"sakhalin.ru":true,"samara.ru":true,"saratov.ru":true,"simbirsk.ru":true,"smolensk.ru":true,"spb.ru":true,"stavropol.ru":true,"stv.ru":true,"surgut.ru":true,"tambov.ru":true,"tatarstan.ru":true,"tom.ru":true,"tomsk.ru":true,"tsaritsyn.ru":true,"tsk.ru":true,"tula.ru":true,"tuva.ru":true,"tver.ru":true,"tyumen.ru":true,"udm.ru":true,"udmurtia.ru":true,"ulan-ude.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"vladivostok.ru":true,"volgograd.ru":true,"vologda.ru":true,"voronezh.ru":true,"vrn.ru":true,"vyatka.ru":true,"yakutia.ru":true,"yamal.ru":true,"yaroslavl.ru":true,"yekaterinburg.ru":true,"yuzhno-sakhalinsk.ru":true,"amursk.ru":true,"baikal.ru":true,"cmw.ru":true,"fareast.ru":true,"jamal.ru":true,"kms.ru":true,"k-uralsk.ru":true,"kustanai.ru":true,"kuzbass.ru":true,"magnitka.ru":true,"mytis.ru":true,"nakhodka.ru":true,"nkz.ru":true,"norilsk.ru":true,"oskol.ru":true,"pyatigorsk.ru":true,"rubtsovsk.ru":true,"snz.ru":true,"syzran.ru":true,"vdonsk.ru":true,"zgrad.ru":true,"gov.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"tv.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"com.sh":true,"net.sh":true,"gov.sh":true,"org.sh":true,"mil.sh":true,"si":true,"sj":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"adygeya.su":true,"arkhangelsk.su":true,"balashov.su":true,"bashkiria.su":true,"bryansk.su":true,"dagestan.su":true,"grozny.su":true,"ivanovo.su":true,"kalmykia.su":true,"kaluga.su":true,"karelia.su":true,"khakassia.su":true,"krasnodar.su":true,"kurgan.su":true,"lenug.su":true,"mordovia.su":true,"msk.su":true,"murmansk.su":true,"nalchik.su":true,"nov.su":true,"obninsk.su":true,"penza.su":true,"pokrovsk.su":true,"sochi.su":true,"spb.su":true,"togliatti.su":true,"troitsk.su":true,"tula.su":true,"tuva.su":true,"vladikavkaz.su":true,"vladimir.su":true,"vologda.su":true,"sv":true,"com.sv":true,"edu.sv":true,"gob.sv":true,"org.sv":true,"red.sv":true,"sx":true,"gov.sx":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"com.tm":true,"co.tm":true,"org.tm":true,"net.tm":true,"nom.tm":true,"gov.tm":true,"mil.tm":true,"edu.tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"tp":true,"tr":true,"com.tr":true,"info.tr":true,"biz.tr":true,"net.tr":true,"org.tr":true,"web.tr":true,"gen.tr":true,"tv.tr":true,"av.tr":true,"dr.tr":true,"bbs.tr":true,"name.tr":true,"tel.tr":true,"gov.tr":true,"bel.tr":true,"pol.tr":true,"mil.tr":true,"k12.tr":true,"edu.tr":true,"kep.tr":true,"nc.tr":true,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"tz":true,"ac.tz":true,"co.tz":true,"go.tz":true,"hotel.tz":true,"info.tz":true,"me.tz":true,"mil.tz":true,"mobi.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"tv.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"cherkasy.ua":true,"chernigov.ua":true,"chernihiv.ua":true,"chernivtsi.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"cr.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"dnipropetrovsk.ua":true,"dominic.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkiv.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"khmelnytskyi.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"krym.ua":true,"ks.ua":true,"kv.ua":true,"kyiv.ua":true,"lg.ua":true,"lt.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lv.ua":true,"lviv.ua":true,"mk.ua":true,"mykolaiv.ua":true,"nikolaev.ua":true,"od.ua":true,"odesa.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rivne.ua":true,"rovno.ua":true,"rv.ua":true,"sb.ua":true,"sebastopol.ua":true,"sevastopol.ua":true,"sm.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uz.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vinnytsia.ua":true,"vn.ua":true,"volyn.ua":true,"yalta.ua":true,"zaporizhzhe.ua":true,"zaporizhzhia.ua":true,"zhitomir.ua":true,"zhytomyr.ua":true,"zp.ua":true,"zt.ua":true,"ug":true,"co.ug":true,"or.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"com.ug":true,"org.ug":true,"uk":true,"ac.uk":true,"co.uk":true,"gov.uk":true,"ltd.uk":true,"me.uk":true,"net.uk":true,"nhs.uk":true,"org.uk":true,"plc.uk":true,"police.uk":true,"*.sch.uk":true,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.de.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"uy":true,"com.uy":true,"edu.uy":true,"gub.uy":true,"mil.uy":true,"net.uy":true,"org.uy":true,"uz":true,"co.uz":true,"com.uz":true,"net.uz":true,"org.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"ve":true,"arts.ve":true,"co.ve":true,"com.ve":true,"e12.ve":true,"edu.ve":true,"firm.ve":true,"gob.ve":true,"gov.ve":true,"info.ve":true,"int.ve":true,"mil.ve":true,"net.ve":true,"org.ve":true,"rec.ve":true,"store.ve":true,"tec.ve":true,"web.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"com.vu":true,"edu.vu":true,"net.vu":true,"org.vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--y9a3aq":true,"xn--54b7fta0cc":true,"xn--90ais":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--node":true,"xn--qxam":true,"xn--j6w193g":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbtx2b":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--80ao21a":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--d1alf":true,"xn--l1acc":true,"xn--mix891f":true,"xn--mix082f":true,"xn--mgbx4cd0ab":true,"xn--mgb9awbf":true,"xn--mgbai9azgqp6j":true,"xn--mgbai9a5eva00b":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--o1ac.xn--90a3ac":true,"xn--c1avg.xn--90a3ac":true,"xn--90azh.xn--90a3ac":true,"xn--d1at.xn--90a3ac":true,"xn--o1ach.xn--90a3ac":true,"xn--80au.xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--mgbpl2fh":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"ac.za":true,"agrica.za":true,"alt.za":true,"co.za":true,"edu.za":true,"gov.za":true,"grondar.za":true,"law.za":true,"mil.za":true,"net.za":true,"ngo.za":true,"nis.za":true,"nom.za":true,"org.za":true,"school.za":true,"tm.za":true,"web.za":true,"*.zm":true,"*.zw":true,"aaa":true,"aarp":true,"abarth":true,"abb":true,"abbott":true,"abbvie":true,"abc":true,"able":true,"abogado":true,"abudhabi":true,"academy":true,"accenture":true,"accountant":true,"accountants":true,"aco":true,"active":true,"actor":true,"adac":true,"ads":true,"adult":true,"aeg":true,"aetna":true,"afamilycompany":true,"afl":true,"africa":true,"africamagic":true,"agakhan":true,"agency":true,"aig":true,"aigo":true,"airbus":true,"airforce":true,"airtel":true,"akdn":true,"alfaromeo":true,"alibaba":true,"alipay":true,"allfinanz":true,"allstate":true,"ally":true,"alsace":true,"alstom":true,"americanexpress":true,"americanfamily":true,"amex":true,"amfam":true,"amica":true,"amsterdam":true,"analytics":true,"android":true,"anquan":true,"anz":true,"aol":true,"apartments":true,"app":true,"apple":true,"aquarelle":true,"aramco":true,"archi":true,"army":true,"arte":true,"asda":true,"associates":true,"athleta":true,"attorney":true,"auction":true,"audi":true,"audible":true,"audio":true,"auspost":true,"author":true,"auto":true,"autos":true,"avianca":true,"aws":true,"axa":true,"azure":true,"baby":true,"baidu":true,"banamex":true,"bananarepublic":true,"band":true,"bank":true,"bar":true,"barcelona":true,"barclaycard":true,"barclays":true,"barefoot":true,"bargains":true,"basketball":true,"bauhaus":true,"bayern":true,"bbc":true,"bbt":true,"bbva":true,"bcg":true,"bcn":true,"beats":true,"beer":true,"bentley":true,"berlin":true,"best":true,"bestbuy":true,"bet":true,"bharti":true,"bible":true,"bid":true,"bike":true,"bing":true,"bingo":true,"bio":true,"black":true,"blackfriday":true,"blanco":true,"blockbuster":true,"blog":true,"bloomberg":true,"blue":true,"bms":true,"bmw":true,"bnl":true,"bnpparibas":true,"boats":true,"boehringer":true,"bofa":true,"bom":true,"bond":true,"boo":true,"book":true,"booking":true,"boots":true,"bosch":true,"bostik":true,"bot":true,"boutique":true,"bradesco":true,"bridgestone":true,"broadway":true,"broker":true,"brother":true,"brussels":true,"budapest":true,"bugatti":true,"build":true,"builders":true,"business":true,"buy":true,"buzz":true,"bzh":true,"cab":true,"cafe":true,"cal":true,"call":true,"calvinklein":true,"camera":true,"camp":true,"cancerresearch":true,"canon":true,"capetown":true,"capital":true,"capitalone":true,"car":true,"caravan":true,"cards":true,"care":true,"career":true,"careers":true,"cars":true,"cartier":true,"casa":true,"case":true,"caseih":true,"cash":true,"casino":true,"catering":true,"cba":true,"cbn":true,"cbre":true,"cbs":true,"ceb":true,"center":true,"ceo":true,"cern":true,"cfa":true,"cfd":true,"chanel":true,"channel":true,"chase":true,"chat":true,"cheap":true,"chintai":true,"chloe":true,"christmas":true,"chrome":true,"chrysler":true,"church":true,"cipriani":true,"circle":true,"cisco":true,"citadel":true,"citi":true,"citic":true,"city":true,"cityeats":true,"claims":true,"cleaning":true,"click":true,"clinic":true,"clothing":true,"cloud":true,"club":true,"clubmed":true,"coach":true,"codes":true,"coffee":true,"college":true,"cologne":true,"comcast":true,"commbank":true,"community":true,"company":true,"computer":true,"comsec":true,"condos":true,"construction":true,"consulting":true,"contact":true,"contractors":true,"cooking":true,"cookingchannel":true,"cool":true,"corsica":true,"country":true,"coupon":true,"coupons":true,"courses":true,"credit":true,"creditcard":true,"creditunion":true,"cricket":true,"crown":true,"crs":true,"cruises":true,"csc":true,"cuisinella":true,"cymru":true,"cyou":true,"dabur":true,"dad":true,"dance":true,"date":true,"dating":true,"datsun":true,"day":true,"dclk":true,"dds":true,"deal":true,"dealer":true,"deals":true,"degree":true,"delivery":true,"dell":true,"deloitte":true,"delta":true,"democrat":true,"dental":true,"dentist":true,"desi":true,"design":true,"dev":true,"dhl":true,"diamonds":true,"diet":true,"digital":true,"direct":true,"directory":true,"discount":true,"discover":true,"dish":true,"dnp":true,"docs":true,"dodge":true,"dog":true,"doha":true,"domains":true,"doosan":true,"dot":true,"download":true,"drive":true,"dstv":true,"dtv":true,"dubai":true,"duck":true,"dunlop":true,"duns":true,"dupont":true,"durban":true,"dvag":true,"dwg":true,"earth":true,"eat":true,"edeka":true,"education":true,"email":true,"emerck":true,"emerson":true,"energy":true,"engineer":true,"engineering":true,"enterprises":true,"epost":true,"epson":true,"equipment":true,"ericsson":true,"erni":true,"esq":true,"estate":true,"esurance":true,"etisalat":true,"eurovision":true,"eus":true,"events":true,"everbank":true,"exchange":true,"expert":true,"exposed":true,"express":true,"extraspace":true,"fage":true,"fail":true,"fairwinds":true,"faith":true,"family":true,"fan":true,"fans":true,"farm":true,"farmers":true,"fashion":true,"fast":true,"fedex":true,"feedback":true,"ferrari":true,"ferrero":true,"fiat":true,"fidelity":true,"fido":true,"film":true,"final":true,"finance":true,"financial":true,"fire":true,"firestone":true,"firmdale":true,"fish":true,"fishing":true,"fit":true,"fitness":true,"flickr":true,"flights":true,"flir":true,"florist":true,"flowers":true,"flsmidth":true,"fly":true,"foo":true,"foodnetwork":true,"football":true,"ford":true,"forex":true,"forsale":true,"forum":true,"foundation":true,"fox":true,"fresenius":true,"frl":true,"frogans":true,"frontdoor":true,"frontier":true,"ftr":true,"fujitsu":true,"fujixerox":true,"fund":true,"furniture":true,"futbol":true,"fyi":true,"gal":true,"gallery":true,"gallo":true,"gallup":true,"game":true,"games":true,"gap":true,"garden":true,"gbiz":true,"gdn":true,"gea":true,"gent":true,"genting":true,"george":true,"ggee":true,"gift":true,"gifts":true,"gives":true,"giving":true,"glade":true,"glass":true,"gle":true,"global":true,"globo":true,"gmail":true,"gmo":true,"gmx":true,"godaddy":true,"gold":true,"goldpoint":true,"golf":true,"goo":true,"goodhands":true,"goodyear":true,"goog":true,"google":true,"gop":true,"got":true,"gotv":true,"grainger":true,"graphics":true,"gratis":true,"green":true,"gripe":true,"group":true,"guardian":true,"gucci":true,"guge":true,"guide":true,"guitars":true,"guru":true,"hamburg":true,"hangout":true,"haus":true,"hbo":true,"hdfc":true,"hdfcbank":true,"health":true,"healthcare":true,"help":true,"helsinki":true,"here":true,"hermes":true,"hgtv":true,"hiphop":true,"hisamitsu":true,"hitachi":true,"hiv":true,"hkt":true,"hockey":true,"holdings":true,"holiday":true,"homedepot":true,"homegoods":true,"homes":true,"homesense":true,"honda":true,"honeywell":true,"horse":true,"host":true,"hosting":true,"hot":true,"hoteles":true,"hotmail":true,"house":true,"how":true,"hsbc":true,"htc":true,"hughes":true,"hyatt":true,"hyundai":true,"ibm":true,"icbc":true,"ice":true,"icu":true,"ieee":true,"ifm":true,"iinet":true,"ikano":true,"imamat":true,"imdb":true,"immo":true,"immobilien":true,"industries":true,"infiniti":true,"ing":true,"ink":true,"institute":true,"insurance":true,"insure":true,"intel":true,"international":true,"intuit":true,"investments":true,"ipiranga":true,"irish":true,"iselect":true,"ismaili":true,"ist":true,"istanbul":true,"itau":true,"itv":true,"iveco":true,"iwc":true,"jaguar":true,"java":true,"jcb":true,"jcp":true,"jeep":true,"jetzt":true,"jewelry":true,"jio":true,"jlc":true,"jll":true,"jmp":true,"jnj":true,"joburg":true,"jot":true,"joy":true,"jpmorgan":true,"jprs":true,"juegos":true,"juniper":true,"kaufen":true,"kddi":true,"kerryhotels":true,"kerrylogistics":true,"kerryproperties":true,"kfh":true,"kia":true,"kim":true,"kinder":true,"kindle":true,"kitchen":true,"kiwi":true,"koeln":true,"komatsu":true,"kosher":true,"kpmg":true,"kpn":true,"krd":true,"kred":true,"kuokgroup":true,"kyknet":true,"kyoto":true,"lacaixa":true,"ladbrokes":true,"lamborghini":true,"lancaster":true,"lancia":true,"lancome":true,"land":true,"landrover":true,"lanxess":true,"lasalle":true,"lat":true,"latino":true,"latrobe":true,"law":true,"lawyer":true,"lds":true,"lease":true,"leclerc":true,"lefrak":true,"legal":true,"lego":true,"lexus":true,"lgbt":true,"liaison":true,"lidl":true,"life":true,"lifeinsurance":true,"lifestyle":true,"lighting":true,"like":true,"lilly":true,"limited":true,"limo":true,"lincoln":true,"linde":true,"link":true,"lipsy":true,"live":true,"living":true,"lixil":true,"loan":true,"loans":true,"locker":true,"locus":true,"loft":true,"lol":true,"london":true,"lotte":true,"lotto":true,"love":true,"lpl":true,"lplfinancial":true,"ltd":true,"ltda":true,"lundbeck":true,"lupin":true,"luxe":true,"luxury":true,"macys":true,"madrid":true,"maif":true,"maison":true,"makeup":true,"man":true,"management":true,"mango":true,"market":true,"marketing":true,"markets":true,"marriott":true,"marshalls":true,"maserati":true,"mattel":true,"mba":true,"mcd":true,"mcdonalds":true,"mckinsey":true,"med":true,"media":true,"meet":true,"melbourne":true,"meme":true,"memorial":true,"men":true,"menu":true,"meo":true,"metlife":true,"miami":true,"microsoft":true,"mini":true,"mint":true,"mit":true,"mitsubishi":true,"mlb":true,"mls":true,"mma":true,"mnet":true,"mobily":true,"moda":true,"moe":true,"moi":true,"mom":true,"monash":true,"money":true,"monster":true,"montblanc":true,"mopar":true,"mormon":true,"mortgage":true,"moscow":true,"moto":true,"motorcycles":true,"mov":true,"movie":true,"movistar":true,"msd":true,"mtn":true,"mtpc":true,"mtr":true,"multichoice":true,"mutual":true,"mutuelle":true,"mzansimagic":true,"nab":true,"nadex":true,"nagoya":true,"naspers":true,"nationwide":true,"natura":true,"navy":true,"nba":true,"nec":true,"netbank":true,"netflix":true,"network":true,"neustar":true,"new":true,"newholland":true,"news":true,"next":true,"nextdirect":true,"nexus":true,"nfl":true,"ngo":true,"nhk":true,"nico":true,"nike":true,"nikon":true,"ninja":true,"nissan":true,"nokia":true,"northwesternmutual":true,"norton":true,"now":true,"nowruz":true,"nowtv":true,"nra":true,"nrw":true,"ntt":true,"nyc":true,"obi":true,"observer":true,"off":true,"office":true,"okinawa":true,"olayan":true,"olayangroup":true,"oldnavy":true,"ollo":true,"omega":true,"one":true,"ong":true,"onl":true,"online":true,"onyourside":true,"ooo":true,"open":true,"oracle":true,"orange":true,"organic":true,"orientexpress":true,"osaka":true,"otsuka":true,"ott":true,"ovh":true,"page":true,"pamperedchef":true,"panasonic":true,"panerai":true,"paris":true,"pars":true,"partners":true,"parts":true,"party":true,"passagens":true,"pay":true,"payu":true,"pccw":true,"pet":true,"pfizer":true,"pharmacy":true,"philips":true,"photo":true,"photography":true,"photos":true,"physio":true,"piaget":true,"pics":true,"pictet":true,"pictures":true,"pid":true,"pin":true,"ping":true,"pink":true,"pioneer":true,"pizza":true,"place":true,"play":true,"playstation":true,"plumbing":true,"plus":true,"pnc":true,"pohl":true,"poker":true,"politie":true,"porn":true,"pramerica":true,"praxi":true,"press":true,"prime":true,"prod":true,"productions":true,"prof":true,"progressive":true,"promo":true,"properties":true,"property":true,"protection":true,"pru":true,"prudential":true,"pub":true,"qpon":true,"quebec":true,"quest":true,"qvc":true,"racing":true,"raid":true,"read":true,"realestate":true,"realtor":true,"realty":true,"recipes":true,"red":true,"redstone":true,"redumbrella":true,"rehab":true,"reise":true,"reisen":true,"reit":true,"reliance":true,"ren":true,"rent":true,"rentals":true,"repair":true,"report":true,"republican":true,"rest":true,"restaurant":true,"review":true,"reviews":true,"rexroth":true,"rich":true,"richardli":true,"ricoh":true,"rightathome":true,"ril":true,"rio":true,"rip":true,"rocher":true,"rocks":true,"rodeo":true,"rogers":true,"room":true,"rsvp":true,"ruhr":true,"run":true,"rwe":true,"ryukyu":true,"saarland":true,"safe":true,"safety":true,"sakura":true,"sale":true,"salon":true,"samsclub":true,"samsung":true,"sandvik":true,"sandvikcoromant":true,"sanofi":true,"sap":true,"sapo":true,"sarl":true,"sas":true,"save":true,"saxo":true,"sbi":true,"sbs":true,"sca":true,"scb":true,"schaeffler":true,"schmidt":true,"scholarships":true,"school":true,"schule":true,"schwarz":true,"science":true,"scjohnson":true,"scor":true,"scot":true,"seat":true,"secure":true,"security":true,"seek":true,"sener":true,"services":true,"ses":true,"seven":true,"sew":true,"sex":true,"sexy":true,"sfr":true,"shangrila":true,"sharp":true,"shaw":true,"shell":true,"shia":true,"shiksha":true,"shoes":true,"shouji":true,"show":true,"showtime":true,"shriram":true,"silk":true,"sina":true,"singles":true,"site":true,"ski":true,"skin":true,"sky":true,"skype":true,"sling":true,"smart":true,"smile":true,"sncf":true,"soccer":true,"social":true,"softbank":true,"software":true,"sohu":true,"solar":true,"solutions":true,"song":true,"sony":true,"soy":true,"space":true,"spiegel":true,"spot":true,"spreadbetting":true,"srl":true,"srt":true,"stada":true,"staples":true,"star":true,"starhub":true,"statebank":true,"statefarm":true,"statoil":true,"stc":true,"stcgroup":true,"stockholm":true,"storage":true,"store":true,"studio":true,"study":true,"style":true,"sucks":true,"supersport":true,"supplies":true,"supply":true,"support":true,"surf":true,"surgery":true,"suzuki":true,"swatch":true,"swiftcover":true,"swiss":true,"sydney":true,"symantec":true,"systems":true,"tab":true,"taipei":true,"talk":true,"taobao":true,"target":true,"tatamotors":true,"tatar":true,"tattoo":true,"tax":true,"taxi":true,"tci":true,"tdk":true,"team":true,"tech":true,"technology":true,"telecity":true,"telefonica":true,"temasek":true,"tennis":true,"teva":true,"thd":true,"theater":true,"theatre":true,"theguardian":true,"tiaa":true,"tickets":true,"tienda":true,"tiffany":true,"tips":true,"tires":true,"tirol":true,"tjmaxx":true,"tjx":true,"tkmaxx":true,"tmall":true,"today":true,"tokyo":true,"tools":true,"top":true,"toray":true,"toshiba":true,"total":true,"tours":true,"town":true,"toyota":true,"toys":true,"trade":true,"trading":true,"training":true,"travelchannel":true,"travelers":true,"travelersinsurance":true,"trust":true,"trv":true,"tube":true,"tui":true,"tunes":true,"tushu":true,"tvs":true,"ubank":true,"ubs":true,"uconnect":true,"university":true,"uno":true,"uol":true,"ups":true,"vacations":true,"vana":true,"vanguard":true,"vegas":true,"ventures":true,"verisign":true,"versicherung":true,"vet":true,"viajes":true,"video":true,"vig":true,"viking":true,"villas":true,"vin":true,"vip":true,"virgin":true,"visa":true,"vision":true,"vista":true,"vistaprint":true,"viva":true,"vivo":true,"vlaanderen":true,"vodka":true,"volkswagen":true,"vote":true,"voting":true,"voto":true,"voyage":true,"vuelos":true,"wales":true,"walmart":true,"walter":true,"wang":true,"wanggou":true,"warman":true,"watch":true,"watches":true,"weather":true,"weatherchannel":true,"webcam":true,"weber":true,"website":true,"wed":true,"wedding":true,"weibo":true,"weir":true,"whoswho":true,"wien":true,"wiki":true,"williamhill":true,"win":true,"windows":true,"wine":true,"winners":true,"wme":true,"wolterskluwer":true,"woodside":true,"work":true,"works":true,"world":true,"wtc":true,"wtf":true,"xbox":true,"xerox":true,"xfinity":true,"xihuan":true,"xin":true,"xn--11b4c3d":true,"xn--1ck2e1b":true,"xn--1qqw23a":true,"xn--30rr7y":true,"xn--3bst00m":true,"xn--3ds443g":true,"xn--3oq18vl8pn36a":true,"xn--3pxu8k":true,"xn--42c2d9a":true,"xn--45q11c":true,"xn--4gbrim":true,"xn--4gq48lf9j":true,"xn--55qw42g":true,"xn--55qx5d":true,"xn--5su34j936bgsg":true,"xn--5tzm5g":true,"xn--6frz82g":true,"xn--6qq986b3xl":true,"xn--80adxhks":true,"xn--80asehdb":true,"xn--80aswg":true,"xn--8y0a063a":true,"xn--9dbq2a":true,"xn--9et52u":true,"xn--9krt00a":true,"xn--b4w605ferd":true,"xn--bck1b9a5dre4c":true,"xn--c1avg":true,"xn--c2br7g":true,"xn--cck2b3b":true,"xn--cg4bki":true,"xn--czr694b":true,"xn--czrs0t":true,"xn--czru2d":true,"xn--d1acj3b":true,"xn--eckvdtc9d":true,"xn--efvy88h":true,"xn--estv75g":true,"xn--fct429k":true,"xn--fhbei":true,"xn--fiq228c5hs":true,"xn--fiq64b":true,"xn--fjq720a":true,"xn--flw351e":true,"xn--fzys8d69uvgm":true,"xn--g2xx48c":true,"xn--gckr3f0f":true,"xn--hxt814e":true,"xn--i1b6b1a6a2e":true,"xn--imr513n":true,"xn--io0a7i":true,"xn--j1aef":true,"xn--jlq61u9w7b":true,"xn--jvr189m":true,"xn--kcrx77d1x4a":true,"xn--kpu716f":true,"xn--kput3i":true,"xn--mgba3a3ejt":true,"xn--mgba7c0bbn0a":true,"xn--mgbaakc7dvf":true,"xn--mgbab2bd":true,"xn--mgbb9fbpob":true,"xn--mgbca7dzdo":true,"xn--mgbt3dhd":true,"xn--mk1bu44c":true,"xn--mxtq1m":true,"xn--ngbc5azd":true,"xn--ngbe9e0a":true,"xn--nqv7f":true,"xn--nqv7fs00ema":true,"xn--nyqy26a":true,"xn--p1acf":true,"xn--pbt977c":true,"xn--pssy2u":true,"xn--q9jyb4c":true,"xn--qcka1pmc":true,"xn--rhqv96g":true,"xn--rovu88b":true,"xn--ses554g":true,"xn--t60b56a":true,"xn--tckwe":true,"xn--unup4y":true,"xn--vermgensberater-ctb":true,"xn--vermgensberatung-pwb":true,"xn--vhquv":true,"xn--vuq861b":true,"xn--w4r85el8fhu5dnra":true,"xn--w4rs40l":true,"xn--xhq521b":true,"xn--zfr164b":true,"xperia":true,"xyz":true,"yachts":true,"yahoo":true,"yamaxun":true,"yandex":true,"yodobashi":true,"yoga":true,"yokohama":true,"you":true,"youtube":true,"yun":true,"zappos":true,"zara":true,"zero":true,"zip":true,"zippo":true,"zone":true,"zuerich":true,"cloudfront.net":true,"ap-northeast-1.compute.amazonaws.com":true,"ap-southeast-1.compute.amazonaws.com":true,"ap-southeast-2.compute.amazonaws.com":true,"cn-north-1.compute.amazonaws.cn":true,"compute.amazonaws.cn":true,"compute.amazonaws.com":true,"compute-1.amazonaws.com":true,"eu-west-1.compute.amazonaws.com":true,"eu-central-1.compute.amazonaws.com":true,"sa-east-1.compute.amazonaws.com":true,"us-east-1.amazonaws.com":true,"us-gov-west-1.compute.amazonaws.com":true,"us-west-1.compute.amazonaws.com":true,"us-west-2.compute.amazonaws.com":true,"z-1.compute-1.amazonaws.com":true,"z-2.compute-1.amazonaws.com":true,"elasticbeanstalk.com":true,"elb.amazonaws.com":true,"s3.amazonaws.com":true,"s3-ap-northeast-1.amazonaws.com":true,"s3-ap-southeast-1.amazonaws.com":true,"s3-ap-southeast-2.amazonaws.com":true,"s3-external-1.amazonaws.com":true,"s3-external-2.amazonaws.com":true,"s3-fips-us-gov-west-1.amazonaws.com":true,"s3-eu-central-1.amazonaws.com":true,"s3-eu-west-1.amazonaws.com":true,"s3-sa-east-1.amazonaws.com":true,"s3-us-gov-west-1.amazonaws.com":true,"s3-us-west-1.amazonaws.com":true,"s3-us-west-2.amazonaws.com":true,"s3.cn-north-1.amazonaws.com.cn":true,"s3.eu-central-1.amazonaws.com":true,"betainabox.com":true,"ae.org":true,"ar.com":true,"br.com":true,"cn.com":true,"com.de":true,"com.se":true,"de.com":true,"eu.com":true,"gb.com":true,"gb.net":true,"hu.com":true,"hu.net":true,"jp.net":true,"jpn.com":true,"kr.com":true,"mex.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"se.net":true,"uk.com":true,"uk.net":true,"us.com":true,"uy.com":true,"za.bz":true,"za.com":true,"africa.com":true,"gr.com":true,"in.net":true,"us.org":true,"co.com":true,"c.la":true,"cloudcontrolled.com":true,"cloudcontrolapp.com":true,"co.ca":true,"c.cdn77.org":true,"cdn77-ssl.net":true,"r.cdn77.net":true,"rsc.cdn77.org":true,"ssl.origin.cdn77-secure.org":true,"co.nl":true,"co.no":true,"*.platform.sh":true,"cupcake.is":true,"dreamhosters.com":true,"duckdns.org":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true,"eu.org":true,"al.eu.org":true,"asso.eu.org":true,"at.eu.org":true,"au.eu.org":true,"be.eu.org":true,"bg.eu.org":true,"ca.eu.org":true,"cd.eu.org":true,"ch.eu.org":true,"cn.eu.org":true,"cy.eu.org":true,"cz.eu.org":true,"de.eu.org":true,"dk.eu.org":true,"edu.eu.org":true,"ee.eu.org":true,"es.eu.org":true,"fi.eu.org":true,"fr.eu.org":true,"gr.eu.org":true,"hr.eu.org":true,"hu.eu.org":true,"ie.eu.org":true,"il.eu.org":true,"in.eu.org":true,"int.eu.org":true,"is.eu.org":true,"it.eu.org":true,"jp.eu.org":true,"kr.eu.org":true,"lt.eu.org":true,"lu.eu.org":true,"lv.eu.org":true,"mc.eu.org":true,"me.eu.org":true,"mk.eu.org":true,"mt.eu.org":true,"my.eu.org":true,"net.eu.org":true,"ng.eu.org":true,"nl.eu.org":true,"no.eu.org":true,"nz.eu.org":true,"paris.eu.org":true,"pl.eu.org":true,"pt.eu.org":true,"q-a.eu.org":true,"ro.eu.org":true,"ru.eu.org":true,"se.eu.org":true,"si.eu.org":true,"sk.eu.org":true,"tr.eu.org":true,"uk.eu.org":true,"us.eu.org":true,"a.ssl.fastly.net":true,"b.ssl.fastly.net":true,"global.ssl.fastly.net":true,"a.prod.fastly.net":true,"global.prod.fastly.net":true,"firebaseapp.com":true,"flynnhub.com":true,"service.gov.uk":true,"github.io":true,"githubusercontent.com":true,"ro.com":true,"appspot.com":true,"blogspot.ae":true,"blogspot.al":true,"blogspot.am":true,"blogspot.ba":true,"blogspot.be":true,"blogspot.bg":true,"blogspot.bj":true,"blogspot.ca":true,"blogspot.cf":true,"blogspot.ch":true,"blogspot.cl":true,"blogspot.co.at":true,"blogspot.co.id":true,"blogspot.co.il":true,"blogspot.co.ke":true,"blogspot.co.nz":true,"blogspot.co.uk":true,"blogspot.co.za":true,"blogspot.com":true,"blogspot.com.ar":true,"blogspot.com.au":true,"blogspot.com.br":true,"blogspot.com.by":true,"blogspot.com.co":true,"blogspot.com.cy":true,"blogspot.com.ee":true,"blogspot.com.eg":true,"blogspot.com.es":true,"blogspot.com.mt":true,"blogspot.com.ng":true,"blogspot.com.tr":true,"blogspot.com.uy":true,"blogspot.cv":true,"blogspot.cz":true,"blogspot.de":true,"blogspot.dk":true,"blogspot.fi":true,"blogspot.fr":true,"blogspot.gr":true,"blogspot.hk":true,"blogspot.hr":true,"blogspot.hu":true,"blogspot.ie":true,"blogspot.in":true,"blogspot.is":true,"blogspot.it":true,"blogspot.jp":true,"blogspot.kr":true,"blogspot.li":true,"blogspot.lt":true,"blogspot.lu":true,"blogspot.md":true,"blogspot.mk":true,"blogspot.mr":true,"blogspot.mx":true,"blogspot.my":true,"blogspot.nl":true,"blogspot.no":true,"blogspot.pe":true,"blogspot.pt":true,"blogspot.qa":true,"blogspot.re":true,"blogspot.ro":true,"blogspot.rs":true,"blogspot.ru":true,"blogspot.se":true,"blogspot.sg":true,"blogspot.si":true,"blogspot.sk":true,"blogspot.sn":true,"blogspot.td":true,"blogspot.tw":true,"blogspot.ug":true,"blogspot.vn":true,"codespot.com":true,"googleapis.com":true,"googlecode.com":true,"pagespeedmobilizer.com":true,"withgoogle.com":true,"withyoutube.com":true,"herokuapp.com":true,"herokussl.com":true,"iki.fi":true,"biz.at":true,"info.at":true,"co.pl":true,"azurewebsites.net":true,"azure-mobile.net":true,"cloudapp.net":true,"bmoattachments.org":true,"4u.com":true,"nfshost.com":true,"nyc.mn":true,"nid.io":true,"operaunite.com":true,"outsystemscloud.com":true,"art.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pantheon.io":true,"gotpantheon.com":true,"priv.at":true,"qa2.com":true,"rhcloud.com":true,"sandcats.io":true,"biz.ua":true,"co.ua":true,"pp.ua":true,"sinaapp.com":true,"vipsinaapp.com":true,"1kapp.com":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"hk.com":true,"hk.org":true,"ltd.hk":true,"inc.hk":true,"yolasite.com":true,"za.net":true,"za.org":true}); - assert.strictEqual(der.offset, extEnd); - } +// END of automatically generated file - assert.strictEqual(der.offset, sigOffset); - der.readSequence(); - after = der.offset + der.length; - var sigAlgOid = der.readOID(); - var sigAlg = SIGN_ALGS[sigAlgOid]; - if (sigAlg === undefined) - throw (new Error('unknown signature algorithm ' + sigAlgOid)); - der._offset = after; +/***/ }), +/* 310 */ +/***/ (function(module, exports, __webpack_require__) { - var sigData = der.readString(asn1.Ber.BitString, true); - if (sigData[0] === 0) - sigData = sigData.slice(1); - var algParts = sigAlg.split('-'); +"use strict"; +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ - sig.signature = Signature.parse(sigData, algParts[0], 'asn1'); - sig.signature.hashAlgorithm = algParts[1]; - sig.algo = sigAlg; - sig.cache = buf.slice(tbsStart, tbsEnd); +/*jshint unused:false */ - return (new Certificate(cert)); +function Store() { } +exports.Store = Store; -function readDate(der) { - if (der.peek() === asn1.Ber.UTCTime) { - return (utcTimeToDate(der.readString(asn1.Ber.UTCTime))); - } else if (der.peek() === asn1.Ber.GeneralizedTime) { - return (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime))); - } else { - throw (new Error('Unsupported date format')); - } -} +// Stores may be synchronous, but are still required to use a +// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" +// API that converts from synchronous-callbacks to imperative style. +Store.prototype.synchronous = false; -/* RFC5280, section 4.2.1.6 (GeneralName type) */ -var ALTNAME = { - OtherName: Local(0), - RFC822Name: Context(1), - DNSName: Context(2), - X400Address: Local(3), - DirectoryName: Local(4), - EDIPartyName: Local(5), - URI: Context(6), - IPAddress: Context(7), - OID: Context(8) +Store.prototype.findCookie = function(domain, path, key, cb) { + throw new Error('findCookie is not implemented'); }; -/* RFC5280, section 4.2.1.12 (KeyPurposeId) */ -var EXTPURPOSE = { - 'serverAuth': '1.3.6.1.5.5.7.3.1', - 'clientAuth': '1.3.6.1.5.5.7.3.2', - 'codeSigning': '1.3.6.1.5.5.7.3.3', +Store.prototype.findCookies = function(domain, path, cb) { + throw new Error('findCookies is not implemented'); +}; - /* See https://github.com/joyent/oid-docs/blob/master/root.md */ - 'joyentDocker': '1.3.6.1.4.1.38678.1.4.1', - 'joyentCmon': '1.3.6.1.4.1.38678.1.4.2' +Store.prototype.putCookie = function(cookie, cb) { + throw new Error('putCookie is not implemented'); }; -var EXTPURPOSE_REV = {}; -Object.keys(EXTPURPOSE).forEach(function (k) { - EXTPURPOSE_REV[EXTPURPOSE[k]] = k; -}); -var KEYUSEBITS = [ - 'signature', 'identity', 'keyEncryption', - 'encryption', 'keyAgreement', 'ca', 'crl' -]; +Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { + // recommended default implementation: + // return this.putCookie(newCookie, cb); + throw new Error('updateCookie is not implemented'); +}; -function readExtension(cert, buf, der) { - der.readSequence(); - var after = der.offset + der.length; - var extId = der.readOID(); - var id; - var sig = cert.signatures.x509; - sig.extras.exts = []; +Store.prototype.removeCookie = function(domain, path, key, cb) { + throw new Error('removeCookie is not implemented'); +}; - var critical; - if (der.peek() === asn1.Ber.Boolean) - critical = der.readBoolean(); +Store.prototype.removeCookies = function(domain, path, cb) { + throw new Error('removeCookies is not implemented'); +}; - switch (extId) { - case (EXTS.basicConstraints): - der.readSequence(asn1.Ber.OctetString); - der.readSequence(); - var bcEnd = der.offset + der.length; - var ca = false; - if (der.peek() === asn1.Ber.Boolean) - ca = der.readBoolean(); - if (cert.purposes === undefined) - cert.purposes = []; - if (ca === true) - cert.purposes.push('ca'); - var bc = { oid: extId, critical: critical }; - if (der.offset < bcEnd && der.peek() === asn1.Ber.Integer) - bc.pathLen = der.readInt(); - sig.extras.exts.push(bc); - break; - case (EXTS.extKeyUsage): - der.readSequence(asn1.Ber.OctetString); - der.readSequence(); - if (cert.purposes === undefined) - cert.purposes = []; - var ekEnd = der.offset + der.length; - while (der.offset < ekEnd) { - var oid = der.readOID(); - cert.purposes.push(EXTPURPOSE_REV[oid] || oid); - } - /* - * This is a bit of a hack: in the case where we have a cert - * that's only allowed to do serverAuth or clientAuth (and not - * the other), we want to make sure all our Subjects are of - * the right type. But we already parsed our Subjects and - * decided if they were hosts or users earlier (since it appears - * first in the cert). - * - * So we go through and mutate them into the right kind here if - * it doesn't match. This might not be hugely beneficial, as it - * seems that single-purpose certs are not often seen in the - * wild. - */ - if (cert.purposes.indexOf('serverAuth') !== -1 && - cert.purposes.indexOf('clientAuth') === -1) { - cert.subjects.forEach(function (ide) { - if (ide.type !== 'host') { - ide.type = 'host'; - ide.hostname = ide.uid || - ide.email || - ide.components[0].value; - } - }); - } else if (cert.purposes.indexOf('clientAuth') !== -1 && - cert.purposes.indexOf('serverAuth') === -1) { - cert.subjects.forEach(function (ide) { - if (ide.type !== 'user') { - ide.type = 'user'; - ide.uid = ide.hostname || - ide.email || - ide.components[0].value; - } - }); - } - sig.extras.exts.push({ oid: extId, critical: critical }); - break; - case (EXTS.keyUsage): - der.readSequence(asn1.Ber.OctetString); - var bits = der.readString(asn1.Ber.BitString, true); - var setBits = readBitField(bits, KEYUSEBITS); - setBits.forEach(function (bit) { - if (cert.purposes === undefined) - cert.purposes = []; - if (cert.purposes.indexOf(bit) === -1) - cert.purposes.push(bit); - }); - sig.extras.exts.push({ oid: extId, critical: critical, - bits: bits }); - break; - case (EXTS.altName): - der.readSequence(asn1.Ber.OctetString); - der.readSequence(); - var aeEnd = der.offset + der.length; - while (der.offset < aeEnd) { - switch (der.peek()) { - case ALTNAME.OtherName: - case ALTNAME.EDIPartyName: - der.readSequence(); - der._offset += der.length; - break; - case ALTNAME.OID: - der.readOID(ALTNAME.OID); - break; - case ALTNAME.RFC822Name: - /* RFC822 specifies email addresses */ - var email = der.readString(ALTNAME.RFC822Name); - id = Identity.forEmail(email); - if (!cert.subjects[0].equals(id)) - cert.subjects.push(id); - break; - case ALTNAME.DirectoryName: - der.readSequence(ALTNAME.DirectoryName); - id = Identity.parseAsn1(der); - if (!cert.subjects[0].equals(id)) - cert.subjects.push(id); - break; - case ALTNAME.DNSName: - var host = der.readString( - ALTNAME.DNSName); - id = Identity.forHost(host); - if (!cert.subjects[0].equals(id)) - cert.subjects.push(id); - break; - default: - der.readString(der.peek()); - break; - } - } - sig.extras.exts.push({ oid: extId, critical: critical }); - break; - default: - sig.extras.exts.push({ - oid: extId, - critical: critical, - data: der.readString(asn1.Ber.OctetString, true) - }); - break; - } +Store.prototype.getAllCookies = function(cb) { + throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)'); +}; - der._offset = after; -} -var UTCTIME_RE = - /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; -function utcTimeToDate(t) { - var m = t.match(UTCTIME_RE); - assert.ok(m, 'timestamps must be in UTC'); - var d = new Date(); +/***/ }), +/* 311 */ +/***/ (function(module, exports, __webpack_require__) { - var thisYear = d.getUTCFullYear(); - var century = Math.floor(thisYear / 100) * 100; - - var year = parseInt(m[1], 10); - if (thisYear % 100 < 50 && year >= 60) - year += (century - 1); - else - year += century; - d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10)); - d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); - if (m[6] && m[6].length > 0) - d.setUTCSeconds(parseInt(m[6], 10)); - return (d); -} +/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. -var GTIME_RE = - /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; -function gTimeToDate(t) { - var m = t.match(GTIME_RE); - assert.ok(m); - var d = new Date(); +;(function (factory) { + var objectTypes = { + 'function': true, + 'object': true + }; - d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1, - parseInt(m[3], 10)); - d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); - if (m[6] && m[6].length > 0) - d.setUTCSeconds(parseInt(m[6], 10)); - return (d); -} + function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; + } -function zeroPad(n) { - var s = '' + n; - while (s.length < 2) - s = '0' + s; - return (s); -} + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; + var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); + var freeSelf = checkGlobal(objectTypes[typeof self] && self); + var freeWindow = checkGlobal(objectTypes[typeof window] && window); + var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; + var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); -function dateToUTCTime(d) { - var s = ''; - s += zeroPad(d.getUTCFullYear() % 100); - s += zeroPad(d.getUTCMonth() + 1); - s += zeroPad(d.getUTCDate()); - s += zeroPad(d.getUTCHours()); - s += zeroPad(d.getUTCMinutes()); - s += zeroPad(d.getUTCSeconds()); - s += 'Z'; - return (s); -} + // Because of build optimizers + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(44)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { + return factory(root, exports, Rx); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof module === 'object' && module && module.exports === freeExports) { + module.exports = factory(root, module.exports, require('./rx')); + } else { + root.Rx = factory(root, {}, root.Rx); + } +}.call(this, function (root, exp, Rx, undefined) { -function sign(cert, key) { - if (cert.signatures.x509 === undefined) - cert.signatures.x509 = {}; - var sig = cert.signatures.x509; + var Observable = Rx.Observable, + observableProto = Observable.prototype, + AnonymousObservable = Rx.AnonymousObservable, + ObservableBase = Rx.ObservableBase, + Subject = Rx.Subject, + AsyncSubject = Rx.AsyncSubject, + Observer = Rx.Observer, + ScheduledObserver = Rx.internals.ScheduledObserver, + disposableCreate = Rx.Disposable.create, + disposableEmpty = Rx.Disposable.empty, + BinaryDisposable = Rx.BinaryDisposable, + currentThreadScheduler = Rx.Scheduler.currentThread, + isFunction = Rx.helpers.isFunction, + inherits = Rx.internals.inherits, + addProperties = Rx.internals.addProperties, + checkDisposed = Rx.Disposable.checkDisposed; - sig.algo = key.type + '-' + key.defaultHashAlgorithm(); - if (SIGN_ALGS[sig.algo] === undefined) - return (false); + // Utilities + function cloneArray(arr) { + var len = arr.length, a = new Array(len); + for(var i = 0; i < len; i++) { a[i] = arr[i]; } + return a; + } - var der = new asn1.BerWriter(); - writeTBSCert(cert, der); - var blob = der.buffer; - sig.cache = blob; + var MulticastObservable = (function (__super__) { + inherits(MulticastObservable, __super__); + function MulticastObservable(source, fn1, fn2) { + this.source = source; + this._fn1 = fn1; + this._fn2 = fn2; + __super__.call(this); + } - var signer = key.createSign(); - signer.write(blob); - cert.signatures.x509.signature = signer.sign(); + MulticastObservable.prototype.subscribeCore = function (o) { + var connectable = this.source.multicast(this._fn1()); + return new BinaryDisposable(this._fn2(connectable).subscribe(o), connectable.connect()); + }; - return (true); -} + return MulticastObservable; + }(ObservableBase)); -function signAsync(cert, signer, done) { - if (cert.signatures.x509 === undefined) - cert.signatures.x509 = {}; - var sig = cert.signatures.x509; + /** + * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each + * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's + * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay. + * + * @example + * 1 - res = source.multicast(observable); + * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; }); + * + * @param {Function|Subject} subjectOrSubjectSelector + * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. + * Or: + * Subject to push source elements into. + * + * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if 0; }, + /** + * Notifies all subscribed observers about the end of the sequence. + */ + onCompleted: function () { + checkDisposed(this); + if (this.isStopped) { return; } + this.isStopped = true; + for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { + os[i].onCompleted(); + } - cert.issuer.toAsn1(der); + this.observers.length = 0; + }, + /** + * Notifies all subscribed observers about the exception. + * @param {Mixed} error The exception to send to all observers. + */ + onError: function (error) { + checkDisposed(this); + if (this.isStopped) { return; } + this.isStopped = true; + this.hasError = true; + this.error = error; - der.startSequence(); - der.writeString(dateToUTCTime(cert.validFrom), asn1.Ber.UTCTime); - der.writeString(dateToUTCTime(cert.validUntil), asn1.Ber.UTCTime); - der.endSequence(); + for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { + os[i].onError(error); + } - var subject = cert.subjects[0]; - var altNames = cert.subjects.slice(1); - subject.toAsn1(der); + this.observers.length = 0; + }, + /** + * Notifies all subscribed observers about the arrival of the specified element in the sequence. + * @param {Mixed} value The value to send to all observers. + */ + onNext: function (value) { + checkDisposed(this); + if (this.isStopped) { return; } + this.value = value; + for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { + os[i].onNext(value); + } + }, + /** + * Unsubscribe all observers and release resources. + */ + dispose: function () { + this.isDisposed = true; + this.observers = null; + this.value = null; + this.error = null; + } + }); - pkcs8.writePkcs8(der, cert.subjectKey); + return BehaviorSubject; + }(Observable)); - if (sig.extras && sig.extras.issuerUniqueID) { - der.writeBuffer(sig.extras.issuerUniqueID, Local(1)); - } + /** + * Represents an object that is both an observable sequence as well as an observer. + * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies. + */ + var ReplaySubject = Rx.ReplaySubject = (function (__super__) { - if (sig.extras && sig.extras.subjectUniqueID) { - der.writeBuffer(sig.extras.subjectUniqueID, Local(2)); - } + var maxSafeInteger = Math.pow(2, 53) - 1; - if (altNames.length > 0 || subject.type === 'host' || - (cert.purposes !== undefined && cert.purposes.length > 0) || - (sig.extras && sig.extras.exts)) { - der.startSequence(Local(3)); - der.startSequence(); + function createRemovableDisposable(subject, observer) { + return disposableCreate(function () { + observer.dispose(); + !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1); + }); + } - var exts = []; - if (cert.purposes !== undefined && cert.purposes.length > 0) { - exts.push({ - oid: EXTS.basicConstraints, - critical: true - }); - exts.push({ - oid: EXTS.keyUsage, - critical: true - }); - exts.push({ - oid: EXTS.extKeyUsage, - critical: true - }); - } - exts.push({ oid: EXTS.altName }); - if (sig.extras && sig.extras.exts) - exts = sig.extras.exts; + inherits(ReplaySubject, __super__); - for (var i = 0; i < exts.length; ++i) { - der.startSequence(); - der.writeOID(exts[i].oid); + /** + * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler. + * @param {Number} [bufferSize] Maximum element count of the replay buffer. + * @param {Number} [windowSize] Maximum time length of the replay buffer. + * @param {Scheduler} [scheduler] Scheduler the observers are invoked on. + */ + function ReplaySubject(bufferSize, windowSize, scheduler) { + this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize; + this.windowSize = windowSize == null ? maxSafeInteger : windowSize; + this.scheduler = scheduler || currentThreadScheduler; + this.q = []; + this.observers = []; + this.isStopped = false; + this.isDisposed = false; + this.hasError = false; + this.error = null; + __super__.call(this); + } - if (exts[i].critical !== undefined) - der.writeBoolean(exts[i].critical); + addProperties(ReplaySubject.prototype, Observer.prototype, { + _subscribe: function (o) { + checkDisposed(this); + var so = new ScheduledObserver(this.scheduler, o), subscription = createRemovableDisposable(this, so); - if (exts[i].oid === EXTS.altName) { - der.startSequence(asn1.Ber.OctetString); - der.startSequence(); - if (subject.type === 'host') { - der.writeString(subject.hostname, - Context(2)); - } - for (var j = 0; j < altNames.length; ++j) { - if (altNames[j].type === 'host') { - der.writeString( - altNames[j].hostname, - ALTNAME.DNSName); - } else if (altNames[j].type === - 'email') { - der.writeString( - altNames[j].email, - ALTNAME.RFC822Name); - } else { - /* - * Encode anything else as a - * DN style name for now. - */ - der.startSequence( - ALTNAME.DirectoryName); - altNames[j].toAsn1(der); - der.endSequence(); - } - } - der.endSequence(); - der.endSequence(); - } else if (exts[i].oid === EXTS.basicConstraints) { - der.startSequence(asn1.Ber.OctetString); - der.startSequence(); - var ca = (cert.purposes.indexOf('ca') !== -1); - var pathLen = exts[i].pathLen; - der.writeBoolean(ca); - if (pathLen !== undefined) - der.writeInt(pathLen); - der.endSequence(); - der.endSequence(); - } else if (exts[i].oid === EXTS.extKeyUsage) { - der.startSequence(asn1.Ber.OctetString); - der.startSequence(); - cert.purposes.forEach(function (purpose) { - if (purpose === 'ca') - return; - if (KEYUSEBITS.indexOf(purpose) !== -1) - return; - var oid = purpose; - if (EXTPURPOSE[purpose] !== undefined) - oid = EXTPURPOSE[purpose]; - der.writeOID(oid); - }); - der.endSequence(); - der.endSequence(); - } else if (exts[i].oid === EXTS.keyUsage) { - der.startSequence(asn1.Ber.OctetString); - /* - * If we parsed this certificate from a byte - * stream (i.e. we didn't generate it in sshpk) - * then we'll have a ".bits" property on the - * ext with the original raw byte contents. - * - * If we have this, use it here instead of - * regenerating it. This guarantees we output - * the same data we parsed, so signatures still - * validate. - */ - if (exts[i].bits !== undefined) { - der.writeBuffer(exts[i].bits, - asn1.Ber.BitString); - } else { - var bits = writeBitField(cert.purposes, - KEYUSEBITS); - der.writeBuffer(bits, - asn1.Ber.BitString); - } - der.endSequence(); - } else { - der.writeBuffer(exts[i].data, - asn1.Ber.OctetString); - } + this._trim(this.scheduler.now()); + this.observers.push(so); - der.endSequence(); - } + for (var i = 0, len = this.q.length; i < len; i++) { + so.onNext(this.q[i].value); + } - der.endSequence(); - der.endSequence(); - } + if (this.hasError) { + so.onError(this.error); + } else if (this.isStopped) { + so.onCompleted(); + } - der.endSequence(); -} + so.ensureActive(); + return subscription; + }, + /** + * Indicates whether the subject has observers subscribed to it. + * @returns {Boolean} Indicates whether the subject has observers subscribed to it. + */ + hasObservers: function () { checkDisposed(this); return this.observers.length > 0; }, + _trim: function (now) { + while (this.q.length > this.bufferSize) { + this.q.shift(); + } + while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) { + this.q.shift(); + } + }, + /** + * Notifies all subscribed observers about the arrival of the specified element in the sequence. + * @param {Mixed} value The value to send to all observers. + */ + onNext: function (value) { + checkDisposed(this); + if (this.isStopped) { return; } + var now = this.scheduler.now(); + this.q.push({ interval: now, value: value }); + this._trim(now); -/* - * Reads an ASN.1 BER bitfield out of the Buffer produced by doing - * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw - * contents of the BitString tag, which is a count of unused bits followed by - * the bits as a right-padded byte string. - * - * `bits` is the Buffer, `bitIndex` should contain an array of string names - * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec. - * - * Returns an array of Strings, the names of the bits that were set to 1. - */ -function readBitField(bits, bitIndex) { - var bitLen = 8 * (bits.length - 1) - bits[0]; - var setBits = {}; - for (var i = 0; i < bitLen; ++i) { - var byteN = 1 + Math.floor(i / 8); - var bit = 7 - (i % 8); - var mask = 1 << bit; - var bitVal = ((bits[byteN] & mask) !== 0); - var name = bitIndex[i]; - if (bitVal && typeof (name) === 'string') { - setBits[name] = true; - } - } - return (Object.keys(setBits)); -} + for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { + var observer = os[i]; + observer.onNext(value); + observer.ensureActive(); + } + }, + /** + * Notifies all subscribed observers about the exception. + * @param {Mixed} error The exception to send to all observers. + */ + onError: function (error) { + checkDisposed(this); + if (this.isStopped) { return; } + this.isStopped = true; + this.error = error; + this.hasError = true; + var now = this.scheduler.now(); + this._trim(now); + for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { + var observer = os[i]; + observer.onError(error); + observer.ensureActive(); + } + this.observers.length = 0; + }, + /** + * Notifies all subscribed observers about the end of the sequence. + */ + onCompleted: function () { + checkDisposed(this); + if (this.isStopped) { return; } + this.isStopped = true; + var now = this.scheduler.now(); + this._trim(now); + for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { + var observer = os[i]; + observer.onCompleted(); + observer.ensureActive(); + } + this.observers.length = 0; + }, + /** + * Unsubscribe all observers and release resources. + */ + dispose: function () { + this.isDisposed = true; + this.observers = null; + } + }); -/* - * `setBits` is an array of strings, containing the names for each bit that - * sould be set to 1. `bitIndex` is same as in `readBitField()`. - * - * Returns a Buffer, ready to be written out with `BerWriter#writeString()`. - */ -function writeBitField(setBits, bitIndex) { - var bitLen = bitIndex.length; - var blen = Math.ceil(bitLen / 8); - var unused = blen * 8 - bitLen; - var bits = new Buffer(1 + blen); - bits.fill(0); - bits[0] = unused; - for (var i = 0; i < bitLen; ++i) { - var byteN = 1 + Math.floor(i / 8); - var bit = 7 - (i % 8); - var mask = 1 << bit; - var name = bitIndex[i]; - if (name === undefined) - continue; - var bitVal = (setBits.indexOf(name) !== -1); - if (bitVal) { - bits[byteN] |= mask; - } - } - return (bits); -} + return ReplaySubject; + }(Observable)); + var RefCountObservable = (function (__super__) { + inherits(RefCountObservable, __super__); + function RefCountObservable(source) { + this.source = source; + this._count = 0; + this._connectableSubscription = null; + __super__.call(this); + } -/***/ }), -/* 303 */ -/***/ (function(module, exports, __webpack_require__) { + RefCountObservable.prototype.subscribeCore = function (o) { + var subscription = this.source.subscribe(o); + ++this._count === 1 && (this._connectableSubscription = this.source.connect()); + return new RefCountDisposable(this, subscription); + }; -"use strict"; + function RefCountDisposable(p, s) { + this._p = p; + this._s = s; + this.isDisposed = false; + } -module.exports = x => { - if (typeof x !== 'string') { - throw new TypeError('Expected a string, got ' + typeof x); - } + RefCountDisposable.prototype.dispose = function () { + if (!this.isDisposed) { + this.isDisposed = true; + this._s.dispose(); + --this._p._count === 0 && this._p._connectableSubscription.dispose(); + } + }; - // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string - // conversion translates it to FEFF (UTF-16 BOM) - if (x.charCodeAt(0) === 0xFEFF) { - return x.slice(1); - } + return RefCountObservable; + }(ObservableBase)); - return x; -}; + var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) { + inherits(ConnectableObservable, __super__); + function ConnectableObservable(source, subject) { + this.source = source; + this._connection = null; + this._source = source.asObservable(); + this._subject = subject; + __super__.call(this); + } + function ConnectDisposable(parent, subscription) { + this._p = parent; + this._s = subscription; + } -/***/ }), -/* 304 */ -/***/ (function(module, exports) { + ConnectDisposable.prototype.dispose = function () { + if (this._s) { + this._s.dispose(); + this._s = null; + this._p._connection = null; + } + }; -var ZEROS = '0000000000000000000' -var SEVENS = '7777777777777777777' -var ZERO_OFFSET = '0'.charCodeAt(0) -var USTAR = 'ustar\x0000' -var MASK = parseInt('7777', 8) + ConnectableObservable.prototype.connect = function () { + if (!this._connection) { + if (this._subject.isStopped) { + return disposableEmpty; + } + var subscription = this._source.subscribe(this._subject); + this._connection = new ConnectDisposable(this, subscription); + } + return this._connection; + }; -var clamp = function (index, len, defaultValue) { - if (typeof index !== 'number') return defaultValue - index = ~~index // Coerce to integer. - if (index >= len) return len - if (index >= 0) return index - index += len - if (index >= 0) return index - return 0 -} + ConnectableObservable.prototype._subscribe = function (o) { + return this._subject.subscribe(o); + }; -var toType = function (flag) { - switch (flag) { - case 0: - return 'file' - case 1: - return 'link' - case 2: - return 'symlink' - case 3: - return 'character-device' - case 4: - return 'block-device' - case 5: - return 'directory' - case 6: - return 'fifo' - case 7: - return 'contiguous-file' - case 72: - return 'pax-header' - case 55: - return 'pax-global-header' - case 27: - return 'gnu-long-link-path' - case 28: - case 30: - return 'gnu-long-path' - } + ConnectableObservable.prototype.refCount = function () { + return new RefCountObservable(this); + }; - return null -} + return ConnectableObservable; + }(Observable)); -var toTypeflag = function (flag) { - switch (flag) { - case 'file': - return 0 - case 'link': - return 1 - case 'symlink': - return 2 - case 'character-device': - return 3 - case 'block-device': - return 4 - case 'directory': - return 5 - case 'fifo': - return 6 - case 'contiguous-file': - return 7 - case 'pax-header': - return 72 - } + /** + * Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence + * can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`) + * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source. + */ + observableProto.singleInstance = function() { + var source = this, hasObservable = false, observable; - return 0 -} + function getObservable() { + if (!hasObservable) { + hasObservable = true; + observable = source['finally'](function() { hasObservable = false; }).publish().refCount(); + } + return observable; + } -var alloc = function (size) { - var buf = new Buffer(size) - buf.fill(0) - return buf -} + return new AnonymousObservable(function(o) { + return getObservable().subscribe(o); + }); + }; -var indexOf = function (block, num, offset, end) { - for (; offset < end; offset++) { - if (block[offset] === num) return offset - } - return end -} + return Rx; +})); -var cksum = function (block) { - var sum = 8 * 32 - for (var i = 0; i < 148; i++) sum += block[i] - for (var j = 156; j < 512; j++) sum += block[j] - return sum -} +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)(module))) -var encodeOct = function (val, n) { - val = val.toString(8) - if (val.length > n) return SEVENS.slice(0, n) + ' ' - else return ZEROS.slice(0, n - val.length) + val + ' ' -} +/***/ }), +/* 312 */ +/***/ (function(module, exports, __webpack_require__) { -/* Copied from the node-tar repo and modified to meet - * tar-stream coding standard. - * - * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349 - */ -function parse256 (buf) { - // first byte MUST be either 80 or FF - // 80 for positive, FF for 2's comp - var positive - if (buf[0] === 0x80) positive = true - else if (buf[0] === 0xFF) positive = false - else return null +/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. - // build up a base-256 tuple from the least sig to the highest - var zero = false - var tuple = [] - for (var i = buf.length - 1; i > 0; i--) { - var byte = buf[i] - if (positive) tuple.push(byte) - else if (zero && byte === 0) tuple.push(0) - else if (zero) { - zero = false - tuple.push(0x100 - byte) - } else tuple.push(0xFF - byte) - } +;(function (factory) { + var objectTypes = { + 'function': true, + 'object': true + }; - var sum = 0 - var l = tuple.length - for (i = 0; i < l; i++) { - sum += tuple[i] * Math.pow(256, i) + function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; } - return positive ? sum : -1 * sum -} - -var decodeOct = function (val, offset, length) { - val = val.slice(offset, offset + length) - offset = 0 + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; + var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); + var freeSelf = checkGlobal(objectTypes[typeof self] && self); + var freeWindow = checkGlobal(objectTypes[typeof window] && window); + var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; + var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - // If prefixed with 0x80 then parse as a base-256 integer - if (val[offset] & 0x80) { - return parse256(val) + // Because of build optimizers + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(44)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { + return factory(root, exports, Rx); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof module === 'object' && module && module.exports === freeExports) { + module.exports = factory(root, module.exports, require('./rx')); } else { - // Older versions of tar can prefix with spaces - while (offset < val.length && val[offset] === 32) offset++ - var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length) - while (offset < end && val[offset] === 0) offset++ - if (end === offset) return 0 - return parseInt(val.slice(offset, end).toString(), 8) + root.Rx = factory(root, {}, root.Rx); } -} +}.call(this, function (root, exp, Rx, undefined) { -var decodeStr = function (val, offset, length) { - return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString() -} + // Aliases + var Scheduler = Rx.Scheduler, + ScheduledItem = Rx.internals.ScheduledItem, + SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive, + PriorityQueue = Rx.internals.PriorityQueue, + inherits = Rx.internals.inherits, + defaultSubComparer = Rx.helpers.defaultSubComparer, + notImplemented = Rx.helpers.notImplemented; -var addLength = function (str) { - var len = Buffer.byteLength(str) - var digits = Math.floor(Math.log(len) / Math.log(10)) + 1 - if (len + digits > Math.pow(10, digits)) digits++ + /** Provides a set of extension methods for virtual time scheduling. */ + var VirtualTimeScheduler = Rx.VirtualTimeScheduler = (function (__super__) { + inherits(VirtualTimeScheduler, __super__); - return (len + digits) + str -} + /** + * Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer. + * + * @constructor + * @param {Number} initialClock Initial value for the clock. + * @param {Function} comparer Comparer to determine causality of events based on absolute time. + */ + function VirtualTimeScheduler(initialClock, comparer) { + this.clock = initialClock; + this.comparer = comparer; + this.isEnabled = false; + this.queue = new PriorityQueue(1024); + __super__.call(this); + } -exports.decodeLongPath = function (buf) { - return decodeStr(buf, 0, buf.length) -} + var VirtualTimeSchedulerPrototype = VirtualTimeScheduler.prototype; -exports.encodePax = function (opts) { // TODO: encode more stuff in pax - var result = '' - if (opts.name) result += addLength(' path=' + opts.name + '\n') - if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n') - var pax = opts.pax - if (pax) { - for (var key in pax) { - result += addLength(' ' + key + '=' + pax[key] + '\n') - } - } - return new Buffer(result) -} + VirtualTimeSchedulerPrototype.now = function () { + return this.toAbsoluteTime(this.clock); + }; -exports.decodePax = function (buf) { - var result = {} + VirtualTimeSchedulerPrototype.schedule = function (state, action) { + return this.scheduleAbsolute(state, this.clock, action); + }; - while (buf.length) { - var i = 0 - while (i < buf.length && buf[i] !== 32) i++ - var len = parseInt(buf.slice(0, i).toString(), 10) - if (!len) return result + VirtualTimeSchedulerPrototype.scheduleFuture = function (state, dueTime, action) { + var dt = dueTime instanceof Date ? + this.toRelativeTime(dueTime - this.now()) : + this.toRelativeTime(dueTime); - var b = buf.slice(i + 1, len - 1).toString() - var keyIndex = b.indexOf('=') - if (keyIndex === -1) return result - result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1) + return this.scheduleRelative(state, dt, action); + }; - buf = buf.slice(len) - } + /** + * Adds a relative time value to an absolute time value. + * @param {Number} absolute Absolute virtual time value. + * @param {Number} relative Relative virtual time value to add. + * @return {Number} Resulting absolute virtual time sum value. + */ + VirtualTimeSchedulerPrototype.add = notImplemented; - return result -} + /** + * Converts an absolute time to a number + * @param {Any} The absolute time. + * @returns {Number} The absolute time in ms + */ + VirtualTimeSchedulerPrototype.toAbsoluteTime = notImplemented; -exports.encode = function (opts) { - var buf = alloc(512) - var name = opts.name - var prefix = '' + /** + * Converts the TimeSpan value to a relative virtual time value. + * @param {Number} timeSpan TimeSpan value to convert. + * @return {Number} Corresponding relative virtual time value. + */ + VirtualTimeSchedulerPrototype.toRelativeTime = notImplemented; - if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/' - if (Buffer.byteLength(name) !== name.length) return null // utf-8 + /** + * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be emulated using recursive scheduling. + * @param {Mixed} state Initial state passed to the action upon the first iteration. + * @param {Number} period Period for running the work periodically. + * @param {Function} action Action to be executed, potentially updating the state. + * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). + */ + VirtualTimeSchedulerPrototype.schedulePeriodic = function (state, period, action) { + var s = new SchedulePeriodicRecursive(this, state, period, action); + return s.start(); + }; - while (Buffer.byteLength(name) > 100) { - var i = name.indexOf('/') - if (i === -1) return null - prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i) - name = name.slice(i + 1) - } + /** + * Schedules an action to be executed after dueTime. + * @param {Mixed} state State passed to the action to be executed. + * @param {Number} dueTime Relative time after which to execute the action. + * @param {Function} action Action to be executed. + * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). + */ + VirtualTimeSchedulerPrototype.scheduleRelative = function (state, dueTime, action) { + var runAt = this.add(this.clock, dueTime); + return this.scheduleAbsolute(state, runAt, action); + }; - if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null - if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null + /** + * Starts the virtual time scheduler. + */ + VirtualTimeSchedulerPrototype.start = function () { + if (!this.isEnabled) { + this.isEnabled = true; + do { + var next = this.getNext(); + if (next !== null) { + this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime); + next.invoke(); + } else { + this.isEnabled = false; + } + } while (this.isEnabled); + } + }; - buf.write(name) - buf.write(encodeOct(opts.mode & MASK, 6), 100) - buf.write(encodeOct(opts.uid, 6), 108) - buf.write(encodeOct(opts.gid, 6), 116) - buf.write(encodeOct(opts.size, 11), 124) - buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136) + /** + * Stops the virtual time scheduler. + */ + VirtualTimeSchedulerPrototype.stop = function () { + this.isEnabled = false; + }; - buf[156] = ZERO_OFFSET + toTypeflag(opts.type) + /** + * Advances the scheduler's clock to the specified time, running all work till that point. + * @param {Number} time Absolute time to advance the scheduler's clock to. + */ + VirtualTimeSchedulerPrototype.advanceTo = function (time) { + var dueToClock = this.comparer(this.clock, time); + if (this.comparer(this.clock, time) > 0) { throw new ArgumentOutOfRangeError(); } + if (dueToClock === 0) { return; } + if (!this.isEnabled) { + this.isEnabled = true; + do { + var next = this.getNext(); + if (next !== null && this.comparer(next.dueTime, time) <= 0) { + this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime); + next.invoke(); + } else { + this.isEnabled = false; + } + } while (this.isEnabled); + this.clock = time; + } + }; - if (opts.linkname) buf.write(opts.linkname, 157) + /** + * Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan. + * @param {Number} time Relative time to advance the scheduler's clock by. + */ + VirtualTimeSchedulerPrototype.advanceBy = function (time) { + var dt = this.add(this.clock, time), + dueToClock = this.comparer(this.clock, dt); + if (dueToClock > 0) { throw new ArgumentOutOfRangeError(); } + if (dueToClock === 0) { return; } - buf.write(USTAR, 257) - if (opts.uname) buf.write(opts.uname, 265) - if (opts.gname) buf.write(opts.gname, 297) - buf.write(encodeOct(opts.devmajor || 0, 6), 329) - buf.write(encodeOct(opts.devminor || 0, 6), 337) + this.advanceTo(dt); + }; - if (prefix) buf.write(prefix, 345) + /** + * Advances the scheduler's clock by the specified relative time. + * @param {Number} time Relative time to advance the scheduler's clock by. + */ + VirtualTimeSchedulerPrototype.sleep = function (time) { + var dt = this.add(this.clock, time); + if (this.comparer(this.clock, dt) >= 0) { throw new ArgumentOutOfRangeError(); } - buf.write(encodeOct(cksum(buf), 6), 148) + this.clock = dt; + }; - return buf -} + /** + * Gets the next scheduled item to be executed. + * @returns {ScheduledItem} The next scheduled item. + */ + VirtualTimeSchedulerPrototype.getNext = function () { + while (this.queue.length > 0) { + var next = this.queue.peek(); + if (next.isCancelled()) { + this.queue.dequeue(); + } else { + return next; + } + } + return null; + }; -exports.decode = function (buf) { - var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET + /** + * Schedules an action to be executed at dueTime. + * @param {Mixed} state State passed to the action to be executed. + * @param {Number} dueTime Absolute time at which to execute the action. + * @param {Function} action Action to be executed. + * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). + */ + VirtualTimeSchedulerPrototype.scheduleAbsolute = function (state, dueTime, action) { + var self = this; - var name = decodeStr(buf, 0, 100) - var mode = decodeOct(buf, 100, 8) - var uid = decodeOct(buf, 108, 8) - var gid = decodeOct(buf, 116, 8) - var size = decodeOct(buf, 124, 12) - var mtime = decodeOct(buf, 136, 12) - var type = toType(typeflag) - var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100) - var uname = decodeStr(buf, 265, 32) - var gname = decodeStr(buf, 297, 32) - var devmajor = decodeOct(buf, 329, 8) - var devminor = decodeOct(buf, 337, 8) + function run(scheduler, state1) { + self.queue.remove(si); + return action(scheduler, state1); + } - if (buf[345]) name = decodeStr(buf, 345, 155) + '/' + name + var si = new ScheduledItem(this, state, run, dueTime, this.comparer); + this.queue.enqueue(si); - // to support old tar versions that use trailing / to indicate dirs - if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5 + return si.disposable; + }; - var c = cksum(buf) + return VirtualTimeScheduler; + }(Scheduler)); - // checksum is still initial value if header was null. - if (c === 8 * 32) return null + /** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */ + Rx.HistoricalScheduler = (function (__super__) { + inherits(HistoricalScheduler, __super__); - // valid checksum - if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?') + /** + * Creates a new historical scheduler with the specified initial clock value. + * @constructor + * @param {Number} initialClock Initial value for the clock. + * @param {Function} comparer Comparer to determine causality of events based on absolute time. + */ + function HistoricalScheduler(initialClock, comparer) { + var clock = initialClock == null ? 0 : initialClock; + var cmp = comparer || defaultSubComparer; + __super__.call(this, clock, cmp); + } - return { - name: name, - mode: mode, - uid: uid, - gid: gid, - size: size, - mtime: new Date(1000 * mtime), - type: type, - linkname: linkname, - uname: uname, - gname: gname, - devmajor: devmajor, - devminor: devminor - } -} + var HistoricalSchedulerProto = HistoricalScheduler.prototype; + + /** + * Adds a relative time value to an absolute time value. + * @param {Number} absolute Absolute virtual time value. + * @param {Number} relative Relative virtual time value to add. + * @return {Number} Resulting absolute virtual time sum value. + */ + HistoricalSchedulerProto.add = function (absolute, relative) { + return absolute + relative; + }; + HistoricalSchedulerProto.toAbsoluteTime = function (absolute) { + return new Date(absolute).getTime(); + }; -/***/ }), -/* 305 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Converts the TimeSpan value to a relative virtual time value. + * @memberOf HistoricalScheduler + * @param {Number} timeSpan TimeSpan value to convert. + * @return {Number} Corresponding relative virtual time value. + */ + HistoricalSchedulerProto.toRelativeTime = function (timeSpan) { + return timeSpan; + }; + + return HistoricalScheduler; + }(Rx.VirtualTimeScheduler)); -exports.extract = __webpack_require__(687) -exports.pack = __webpack_require__(688) + return Rx; +})); +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)(module))) /***/ }), -/* 306 */ +/* 313 */ /***/ (function(module, exports, __webpack_require__) { -var Transform = __webpack_require__(642) - , inherits = __webpack_require__(2).inherits - , xtend = __webpack_require__(313) +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +var assert = __webpack_require__(36) +var signals = __webpack_require__(699) -function DestroyableTransform(opts) { - Transform.call(this, opts) - this._destroyed = false +var EE = __webpack_require__(69) +/* istanbul ignore if */ +if (typeof EE !== 'function') { + EE = EE.EventEmitter } -inherits(DestroyableTransform, Transform) - -DestroyableTransform.prototype.destroy = function(err) { - if (this._destroyed) return - this._destroyed = true - - var self = this - process.nextTick(function() { - if (err) - self.emit('error', err) - self.emit('close') - }) +var emitter +if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ +} else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} } -// a noop _transform function -function noop (chunk, enc, callback) { - callback(null, chunk) +// Because this emitter is a global, we have to check to see if a +// previous version of this library failed to enable infinite listeners. +// I know what you're about to say. But literally everything about +// signal-exit is a compromise with evil. Get used to it. +if (!emitter.infinite) { + emitter.setMaxListeners(Infinity) + emitter.infinite = true } +module.exports = function (cb, opts) { + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') -// create a new export function, used by both the main export and -// the .ctor export, contains common logic for dealing with arguments -function through2 (construct) { - return function (options, transform, flush) { - if (typeof options == 'function') { - flush = transform - transform = options - options = {} - } - - if (typeof transform != 'function') - transform = noop - - if (typeof flush != 'function') - flush = null - - return construct(options, transform, flush) + if (loaded === false) { + load() } -} - - -// main export, just make me a transform stream! -module.exports = through2(function (options, transform, flush) { - var t2 = new DestroyableTransform(options) - - t2._transform = transform - - if (flush) - t2._flush = flush - return t2 -}) - - -// make me a reusable prototype that I can `new`, or implicitly `new` -// with a constructor call -module.exports.ctor = through2(function (options, transform, flush) { - function Through2 (override) { - if (!(this instanceof Through2)) - return new Through2(override) - - this.options = xtend(options, override) - - DestroyableTransform.call(this, this.options) + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' } - inherits(Through2, DestroyableTransform) - - Through2.prototype._transform = transform - - if (flush) - Through2.prototype._flush = flush - - return Through2 -}) + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + return remove +} -module.exports.obj = through2(function (options, transform, flush) { - var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options)) +module.exports.unload = unload +function unload () { + if (!loaded) { + return + } + loaded = false - t2._transform = transform + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 +} - if (flush) - t2._flush = flush +function emit (event, code, signal) { + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) +} - return t2 +// { : , ... } +var sigListeners = {} +signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } }) +module.exports.signals = function () { + return signals +} -/***/ }), -/* 307 */ -/***/ (function(module, exports, __webpack_require__) { +module.exports.load = load -"use strict"; -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +var loaded = false -/* - * "A request-path path-matches a given cookie-path if at least one of the - * following conditions holds:" - */ -function pathMatch (reqPath, cookiePath) { - // "o The cookie-path and the request-path are identical." - if (cookiePath === reqPath) { - return true; +function load () { + if (loaded) { + return } + loaded = true - var idx = reqPath.indexOf(cookiePath); - if (idx === 0) { - // "o The cookie-path is a prefix of the request-path, and the last - // character of the cookie-path is %x2F ("/")." - if (cookiePath.substr(-1) === "/") { - return true; - } + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 - // " o The cookie-path is a prefix of the request-path, and the first - // character of the request-path that is not included in the cookie- path - // is a %x2F ("/") character." - if (reqPath.substr(cookiePath.length, 1) === "/") { - return true; + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false } - } + }) - return false; + process.emit = processEmit + process.reallyExit = processReallyExit } -exports.pathMatch = pathMatch; - - -/***/ }), -/* 308 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -var pubsuffix = __webpack_require__(309); - -// Gives the permutation of all possible domainMatch()es of a given domain. The -// array is in shortest-to-longest order. Handy for indexing. -function permuteDomain (domain) { - var pubSuf = pubsuffix.getPublicSuffix(domain); - if (!pubSuf) { - return null; - } - if (pubSuf == domain) { - return [domain]; - } +var originalProcessReallyExit = process.reallyExit +function processReallyExit (code) { + process.exitCode = code || 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) +} - var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com" - var parts = prefix.split('.').reverse(); - var cur = pubSuf; - var permutations = [cur]; - while (parts.length) { - cur = parts.shift() + '.' + cur; - permutations.push(cur); +var originalProcessEmit = process.emit +function processEmit (ev, arg) { + if (ev === 'exit') { + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + return ret + } else { + return originalProcessEmit.apply(this, arguments) } - return permutations; } -exports.permuteDomain = permuteDomain; - /***/ }), -/* 309 */ +/* 314 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/**************************************************** - * AUTOMATICALLY GENERATED by generate-pubsuffix.js * - * DO NOT EDIT! * - ****************************************************/ - - - -var punycode = __webpack_require__(187); - -module.exports.getPublicSuffix = function getPublicSuffix(domain) { - /*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - if (!domain) { - return null; - } - if (domain.match(/^\./)) { - return null; - } - var asciiDomain = punycode.toASCII(domain); - var converted = false; - if (asciiDomain !== domain) { - domain = asciiDomain; - converted = true; - } - if (index[domain]) { - return null; - } +module.exports = __webpack_require__(700); - domain = domain.toLowerCase(); - var parts = domain.split('.').reverse(); +/***/ }), +/* 315 */ +/***/ (function(module, exports, __webpack_require__) { - var suffix = ''; - var suffixLen = 0; - for (var i=0; i suffixLen) { - var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.'); - return converted ? punycode.toUnicode(publicSuffix) : publicSuffix; - } +var CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined); - return null; -}; +var ecdh, ec, jsbn; -// The following generated structure is used under the MPL version 2.0 -// See public-suffix.txt for more information +function DiffieHellman(key) { + utils.assertCompatible(key, Key, [1, 4], 'key'); + this._isPriv = PrivateKey.isPrivateKey(key, [1, 3]); + this._algo = key.type; + this._curve = key.curve; + this._key = key; + if (key.type === 'dsa') { + if (!CRYPTO_HAVE_ECDH) { + throw (new Error('Due to bugs in the node 0.10 ' + + 'crypto API, node 0.12.x or later is required ' + + 'to use DH')); + } + this._dh = crypto.createDiffieHellman( + key.part.p.data, undefined, + key.part.g.data, undefined); + this._p = key.part.p; + this._g = key.part.g; + if (this._isPriv) + this._dh.setPrivateKey(key.part.x.data); + this._dh.setPublicKey(key.part.y.data); -var index = module.exports.index = Object.freeze( -{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mp.br":true,"mus.br":true,"net.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"ac.cy":true,"biz.cy":true,"com.cy":true,"ekloges.cy":true,"gov.cy":true,"ltd.cy":true,"name.cy":true,"net.cy":true,"org.cy":true,"parliament.cy":true,"press.cy":true,"pro.cy":true,"tm.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"net.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"co.gl":true,"com.gl":true,"edu.gl":true,"net.gl":true,"org.gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"il":true,"ac.il":true,"co.il":true,"gov.il":true,"idf.il":true,"k12.il":true,"muni.il":true,"net.il":true,"org.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"catanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":true,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pescara.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"trani-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehime.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn--efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takahama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gonohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":true,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"shonai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kitakata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiroshima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkaido.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokkaido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.ibaraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagawa.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagawa.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.jp":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"hitoyoshi.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kashima.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kosa.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.kumamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mie.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"kesennuma.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":true,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasaki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.niigata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":true,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"higashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shimane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shizuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"komatsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koganei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"yazu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":true,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikawamisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"ac.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"co.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"teledata.mz":false,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"sch.ng":true,"gov.ng":true,"mil.ng":true,"mobi.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"nz":true,"ac.nz":true,"co.nz":true,"cri.nz":true,"geek.nz":true,"gen.nz":true,"govt.nz":true,"health.nz":true,"iwi.nz":true,"kiwi.nz":true,"maori.nz":true,"mil.nz":true,"xn--mori-qsa.nz":true,"net.nz":true,"org.nz":true,"parliament.nz":true,"school.nz":true,"om":true,"co.om":true,"com.om":true,"edu.om":true,"gov.om":true,"med.om":true,"museum.om":true,"net.om":true,"org.om":true,"pro.om":true,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"com.pl":true,"net.pl":true,"org.pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"gov.pl":true,"ap.gov.pl":true,"ic.gov.pl":true,"is.gov.pl":true,"us.gov.pl":true,"kmpsp.gov.pl":true,"kppsp.gov.pl":true,"kwpsp.gov.pl":true,"psp.gov.pl":true,"wskr.gov.pl":true,"kwp.gov.pl":true,"mw.gov.pl":true,"ug.gov.pl":true,"um.gov.pl":true,"umig.gov.pl":true,"ugim.gov.pl":true,"upow.gov.pl":true,"uw.gov.pl":true,"starostwo.gov.pl":true,"pa.gov.pl":true,"po.gov.pl":true,"psse.gov.pl":true,"pup.gov.pl":true,"rzgw.gov.pl":true,"sa.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"wsa.gov.pl":true,"sko.gov.pl":true,"uzs.gov.pl":true,"wiih.gov.pl":true,"winb.gov.pl":true,"pinb.gov.pl":true,"wios.gov.pl":true,"witd.gov.pl":true,"wzmiuw.gov.pl":true,"piw.gov.pl":true,"wiw.gov.pl":true,"griw.gov.pl":true,"wif.gov.pl":true,"oum.gov.pl":true,"sdn.gov.pl":true,"zp.gov.pl":true,"uppo.gov.pl":true,"mup.gov.pl":true,"wuoz.gov.pl":true,"konsulat.gov.pl":true,"oirm.gov.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"post":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aca.pro":true,"bar.pro":true,"cpa.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"eng.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"py":true,"com.py":true,"coop.py":true,"edu.py":true,"gov.py":true,"mil.py":true,"net.py":true,"org.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"com.re":true,"asso.re":true,"nom.re":true,"ro":true,"com.ro":true,"org.ro":true,"tm.ro":true,"nt.ro":true,"nom.ro":true,"info.ro":true,"rec.ro":true,"arts.ro":true,"firm.ro":true,"store.ro":true,"www.ro":true,"rs":true,"co.rs":true,"org.rs":true,"edu.rs":true,"ac.rs":true,"gov.rs":true,"in.rs":true,"ru":true,"ac.ru":true,"com.ru":true,"edu.ru":true,"int.ru":true,"net.ru":true,"org.ru":true,"pp.ru":true,"adygeya.ru":true,"altai.ru":true,"amur.ru":true,"arkhangelsk.ru":true,"astrakhan.ru":true,"bashkiria.ru":true,"belgorod.ru":true,"bir.ru":true,"bryansk.ru":true,"buryatia.ru":true,"cbg.ru":true,"chel.ru":true,"chelyabinsk.ru":true,"chita.ru":true,"chukotka.ru":true,"chuvashia.ru":true,"dagestan.ru":true,"dudinka.ru":true,"e-burg.ru":true,"grozny.ru":true,"irkutsk.ru":true,"ivanovo.ru":true,"izhevsk.ru":true,"jar.ru":true,"joshkar-ola.ru":true,"kalmykia.ru":true,"kaluga.ru":true,"kamchatka.ru":true,"karelia.ru":true,"kazan.ru":true,"kchr.ru":true,"kemerovo.ru":true,"khabarovsk.ru":true,"khakassia.ru":true,"khv.ru":true,"kirov.ru":true,"koenig.ru":true,"komi.ru":true,"kostroma.ru":true,"krasnoyarsk.ru":true,"kuban.ru":true,"kurgan.ru":true,"kursk.ru":true,"lipetsk.ru":true,"magadan.ru":true,"mari.ru":true,"mari-el.ru":true,"marine.ru":true,"mordovia.ru":true,"msk.ru":true,"murmansk.ru":true,"nalchik.ru":true,"nnov.ru":true,"nov.ru":true,"novosibirsk.ru":true,"nsk.ru":true,"omsk.ru":true,"orenburg.ru":true,"oryol.ru":true,"palana.ru":true,"penza.ru":true,"perm.ru":true,"ptz.ru":true,"rnd.ru":true,"ryazan.ru":true,"sakhalin.ru":true,"samara.ru":true,"saratov.ru":true,"simbirsk.ru":true,"smolensk.ru":true,"spb.ru":true,"stavropol.ru":true,"stv.ru":true,"surgut.ru":true,"tambov.ru":true,"tatarstan.ru":true,"tom.ru":true,"tomsk.ru":true,"tsaritsyn.ru":true,"tsk.ru":true,"tula.ru":true,"tuva.ru":true,"tver.ru":true,"tyumen.ru":true,"udm.ru":true,"udmurtia.ru":true,"ulan-ude.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"vladivostok.ru":true,"volgograd.ru":true,"vologda.ru":true,"voronezh.ru":true,"vrn.ru":true,"vyatka.ru":true,"yakutia.ru":true,"yamal.ru":true,"yaroslavl.ru":true,"yekaterinburg.ru":true,"yuzhno-sakhalinsk.ru":true,"amursk.ru":true,"baikal.ru":true,"cmw.ru":true,"fareast.ru":true,"jamal.ru":true,"kms.ru":true,"k-uralsk.ru":true,"kustanai.ru":true,"kuzbass.ru":true,"magnitka.ru":true,"mytis.ru":true,"nakhodka.ru":true,"nkz.ru":true,"norilsk.ru":true,"oskol.ru":true,"pyatigorsk.ru":true,"rubtsovsk.ru":true,"snz.ru":true,"syzran.ru":true,"vdonsk.ru":true,"zgrad.ru":true,"gov.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"tv.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"com.sh":true,"net.sh":true,"gov.sh":true,"org.sh":true,"mil.sh":true,"si":true,"sj":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"adygeya.su":true,"arkhangelsk.su":true,"balashov.su":true,"bashkiria.su":true,"bryansk.su":true,"dagestan.su":true,"grozny.su":true,"ivanovo.su":true,"kalmykia.su":true,"kaluga.su":true,"karelia.su":true,"khakassia.su":true,"krasnodar.su":true,"kurgan.su":true,"lenug.su":true,"mordovia.su":true,"msk.su":true,"murmansk.su":true,"nalchik.su":true,"nov.su":true,"obninsk.su":true,"penza.su":true,"pokrovsk.su":true,"sochi.su":true,"spb.su":true,"togliatti.su":true,"troitsk.su":true,"tula.su":true,"tuva.su":true,"vladikavkaz.su":true,"vladimir.su":true,"vologda.su":true,"sv":true,"com.sv":true,"edu.sv":true,"gob.sv":true,"org.sv":true,"red.sv":true,"sx":true,"gov.sx":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"com.tm":true,"co.tm":true,"org.tm":true,"net.tm":true,"nom.tm":true,"gov.tm":true,"mil.tm":true,"edu.tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"tp":true,"tr":true,"com.tr":true,"info.tr":true,"biz.tr":true,"net.tr":true,"org.tr":true,"web.tr":true,"gen.tr":true,"tv.tr":true,"av.tr":true,"dr.tr":true,"bbs.tr":true,"name.tr":true,"tel.tr":true,"gov.tr":true,"bel.tr":true,"pol.tr":true,"mil.tr":true,"k12.tr":true,"edu.tr":true,"kep.tr":true,"nc.tr":true,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"tz":true,"ac.tz":true,"co.tz":true,"go.tz":true,"hotel.tz":true,"info.tz":true,"me.tz":true,"mil.tz":true,"mobi.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"tv.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"cherkasy.ua":true,"chernigov.ua":true,"chernihiv.ua":true,"chernivtsi.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"cr.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"dnipropetrovsk.ua":true,"dominic.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkiv.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"khmelnytskyi.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"krym.ua":true,"ks.ua":true,"kv.ua":true,"kyiv.ua":true,"lg.ua":true,"lt.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lv.ua":true,"lviv.ua":true,"mk.ua":true,"mykolaiv.ua":true,"nikolaev.ua":true,"od.ua":true,"odesa.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rivne.ua":true,"rovno.ua":true,"rv.ua":true,"sb.ua":true,"sebastopol.ua":true,"sevastopol.ua":true,"sm.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uz.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vinnytsia.ua":true,"vn.ua":true,"volyn.ua":true,"yalta.ua":true,"zaporizhzhe.ua":true,"zaporizhzhia.ua":true,"zhitomir.ua":true,"zhytomyr.ua":true,"zp.ua":true,"zt.ua":true,"ug":true,"co.ug":true,"or.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"com.ug":true,"org.ug":true,"uk":true,"ac.uk":true,"co.uk":true,"gov.uk":true,"ltd.uk":true,"me.uk":true,"net.uk":true,"nhs.uk":true,"org.uk":true,"plc.uk":true,"police.uk":true,"*.sch.uk":true,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.de.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"uy":true,"com.uy":true,"edu.uy":true,"gub.uy":true,"mil.uy":true,"net.uy":true,"org.uy":true,"uz":true,"co.uz":true,"com.uz":true,"net.uz":true,"org.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"ve":true,"arts.ve":true,"co.ve":true,"com.ve":true,"e12.ve":true,"edu.ve":true,"firm.ve":true,"gob.ve":true,"gov.ve":true,"info.ve":true,"int.ve":true,"mil.ve":true,"net.ve":true,"org.ve":true,"rec.ve":true,"store.ve":true,"tec.ve":true,"web.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"com.vu":true,"edu.vu":true,"net.vu":true,"org.vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--y9a3aq":true,"xn--54b7fta0cc":true,"xn--90ais":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--node":true,"xn--qxam":true,"xn--j6w193g":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbtx2b":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--80ao21a":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--d1alf":true,"xn--l1acc":true,"xn--mix891f":true,"xn--mix082f":true,"xn--mgbx4cd0ab":true,"xn--mgb9awbf":true,"xn--mgbai9azgqp6j":true,"xn--mgbai9a5eva00b":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--o1ac.xn--90a3ac":true,"xn--c1avg.xn--90a3ac":true,"xn--90azh.xn--90a3ac":true,"xn--d1at.xn--90a3ac":true,"xn--o1ach.xn--90a3ac":true,"xn--80au.xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--mgbpl2fh":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"ac.za":true,"agrica.za":true,"alt.za":true,"co.za":true,"edu.za":true,"gov.za":true,"grondar.za":true,"law.za":true,"mil.za":true,"net.za":true,"ngo.za":true,"nis.za":true,"nom.za":true,"org.za":true,"school.za":true,"tm.za":true,"web.za":true,"*.zm":true,"*.zw":true,"aaa":true,"aarp":true,"abarth":true,"abb":true,"abbott":true,"abbvie":true,"abc":true,"able":true,"abogado":true,"abudhabi":true,"academy":true,"accenture":true,"accountant":true,"accountants":true,"aco":true,"active":true,"actor":true,"adac":true,"ads":true,"adult":true,"aeg":true,"aetna":true,"afamilycompany":true,"afl":true,"africa":true,"africamagic":true,"agakhan":true,"agency":true,"aig":true,"aigo":true,"airbus":true,"airforce":true,"airtel":true,"akdn":true,"alfaromeo":true,"alibaba":true,"alipay":true,"allfinanz":true,"allstate":true,"ally":true,"alsace":true,"alstom":true,"americanexpress":true,"americanfamily":true,"amex":true,"amfam":true,"amica":true,"amsterdam":true,"analytics":true,"android":true,"anquan":true,"anz":true,"aol":true,"apartments":true,"app":true,"apple":true,"aquarelle":true,"aramco":true,"archi":true,"army":true,"arte":true,"asda":true,"associates":true,"athleta":true,"attorney":true,"auction":true,"audi":true,"audible":true,"audio":true,"auspost":true,"author":true,"auto":true,"autos":true,"avianca":true,"aws":true,"axa":true,"azure":true,"baby":true,"baidu":true,"banamex":true,"bananarepublic":true,"band":true,"bank":true,"bar":true,"barcelona":true,"barclaycard":true,"barclays":true,"barefoot":true,"bargains":true,"basketball":true,"bauhaus":true,"bayern":true,"bbc":true,"bbt":true,"bbva":true,"bcg":true,"bcn":true,"beats":true,"beer":true,"bentley":true,"berlin":true,"best":true,"bestbuy":true,"bet":true,"bharti":true,"bible":true,"bid":true,"bike":true,"bing":true,"bingo":true,"bio":true,"black":true,"blackfriday":true,"blanco":true,"blockbuster":true,"blog":true,"bloomberg":true,"blue":true,"bms":true,"bmw":true,"bnl":true,"bnpparibas":true,"boats":true,"boehringer":true,"bofa":true,"bom":true,"bond":true,"boo":true,"book":true,"booking":true,"boots":true,"bosch":true,"bostik":true,"bot":true,"boutique":true,"bradesco":true,"bridgestone":true,"broadway":true,"broker":true,"brother":true,"brussels":true,"budapest":true,"bugatti":true,"build":true,"builders":true,"business":true,"buy":true,"buzz":true,"bzh":true,"cab":true,"cafe":true,"cal":true,"call":true,"calvinklein":true,"camera":true,"camp":true,"cancerresearch":true,"canon":true,"capetown":true,"capital":true,"capitalone":true,"car":true,"caravan":true,"cards":true,"care":true,"career":true,"careers":true,"cars":true,"cartier":true,"casa":true,"case":true,"caseih":true,"cash":true,"casino":true,"catering":true,"cba":true,"cbn":true,"cbre":true,"cbs":true,"ceb":true,"center":true,"ceo":true,"cern":true,"cfa":true,"cfd":true,"chanel":true,"channel":true,"chase":true,"chat":true,"cheap":true,"chintai":true,"chloe":true,"christmas":true,"chrome":true,"chrysler":true,"church":true,"cipriani":true,"circle":true,"cisco":true,"citadel":true,"citi":true,"citic":true,"city":true,"cityeats":true,"claims":true,"cleaning":true,"click":true,"clinic":true,"clothing":true,"cloud":true,"club":true,"clubmed":true,"coach":true,"codes":true,"coffee":true,"college":true,"cologne":true,"comcast":true,"commbank":true,"community":true,"company":true,"computer":true,"comsec":true,"condos":true,"construction":true,"consulting":true,"contact":true,"contractors":true,"cooking":true,"cookingchannel":true,"cool":true,"corsica":true,"country":true,"coupon":true,"coupons":true,"courses":true,"credit":true,"creditcard":true,"creditunion":true,"cricket":true,"crown":true,"crs":true,"cruises":true,"csc":true,"cuisinella":true,"cymru":true,"cyou":true,"dabur":true,"dad":true,"dance":true,"date":true,"dating":true,"datsun":true,"day":true,"dclk":true,"dds":true,"deal":true,"dealer":true,"deals":true,"degree":true,"delivery":true,"dell":true,"deloitte":true,"delta":true,"democrat":true,"dental":true,"dentist":true,"desi":true,"design":true,"dev":true,"dhl":true,"diamonds":true,"diet":true,"digital":true,"direct":true,"directory":true,"discount":true,"discover":true,"dish":true,"dnp":true,"docs":true,"dodge":true,"dog":true,"doha":true,"domains":true,"doosan":true,"dot":true,"download":true,"drive":true,"dstv":true,"dtv":true,"dubai":true,"duck":true,"dunlop":true,"duns":true,"dupont":true,"durban":true,"dvag":true,"dwg":true,"earth":true,"eat":true,"edeka":true,"education":true,"email":true,"emerck":true,"emerson":true,"energy":true,"engineer":true,"engineering":true,"enterprises":true,"epost":true,"epson":true,"equipment":true,"ericsson":true,"erni":true,"esq":true,"estate":true,"esurance":true,"etisalat":true,"eurovision":true,"eus":true,"events":true,"everbank":true,"exchange":true,"expert":true,"exposed":true,"express":true,"extraspace":true,"fage":true,"fail":true,"fairwinds":true,"faith":true,"family":true,"fan":true,"fans":true,"farm":true,"farmers":true,"fashion":true,"fast":true,"fedex":true,"feedback":true,"ferrari":true,"ferrero":true,"fiat":true,"fidelity":true,"fido":true,"film":true,"final":true,"finance":true,"financial":true,"fire":true,"firestone":true,"firmdale":true,"fish":true,"fishing":true,"fit":true,"fitness":true,"flickr":true,"flights":true,"flir":true,"florist":true,"flowers":true,"flsmidth":true,"fly":true,"foo":true,"foodnetwork":true,"football":true,"ford":true,"forex":true,"forsale":true,"forum":true,"foundation":true,"fox":true,"fresenius":true,"frl":true,"frogans":true,"frontdoor":true,"frontier":true,"ftr":true,"fujitsu":true,"fujixerox":true,"fund":true,"furniture":true,"futbol":true,"fyi":true,"gal":true,"gallery":true,"gallo":true,"gallup":true,"game":true,"games":true,"gap":true,"garden":true,"gbiz":true,"gdn":true,"gea":true,"gent":true,"genting":true,"george":true,"ggee":true,"gift":true,"gifts":true,"gives":true,"giving":true,"glade":true,"glass":true,"gle":true,"global":true,"globo":true,"gmail":true,"gmo":true,"gmx":true,"godaddy":true,"gold":true,"goldpoint":true,"golf":true,"goo":true,"goodhands":true,"goodyear":true,"goog":true,"google":true,"gop":true,"got":true,"gotv":true,"grainger":true,"graphics":true,"gratis":true,"green":true,"gripe":true,"group":true,"guardian":true,"gucci":true,"guge":true,"guide":true,"guitars":true,"guru":true,"hamburg":true,"hangout":true,"haus":true,"hbo":true,"hdfc":true,"hdfcbank":true,"health":true,"healthcare":true,"help":true,"helsinki":true,"here":true,"hermes":true,"hgtv":true,"hiphop":true,"hisamitsu":true,"hitachi":true,"hiv":true,"hkt":true,"hockey":true,"holdings":true,"holiday":true,"homedepot":true,"homegoods":true,"homes":true,"homesense":true,"honda":true,"honeywell":true,"horse":true,"host":true,"hosting":true,"hot":true,"hoteles":true,"hotmail":true,"house":true,"how":true,"hsbc":true,"htc":true,"hughes":true,"hyatt":true,"hyundai":true,"ibm":true,"icbc":true,"ice":true,"icu":true,"ieee":true,"ifm":true,"iinet":true,"ikano":true,"imamat":true,"imdb":true,"immo":true,"immobilien":true,"industries":true,"infiniti":true,"ing":true,"ink":true,"institute":true,"insurance":true,"insure":true,"intel":true,"international":true,"intuit":true,"investments":true,"ipiranga":true,"irish":true,"iselect":true,"ismaili":true,"ist":true,"istanbul":true,"itau":true,"itv":true,"iveco":true,"iwc":true,"jaguar":true,"java":true,"jcb":true,"jcp":true,"jeep":true,"jetzt":true,"jewelry":true,"jio":true,"jlc":true,"jll":true,"jmp":true,"jnj":true,"joburg":true,"jot":true,"joy":true,"jpmorgan":true,"jprs":true,"juegos":true,"juniper":true,"kaufen":true,"kddi":true,"kerryhotels":true,"kerrylogistics":true,"kerryproperties":true,"kfh":true,"kia":true,"kim":true,"kinder":true,"kindle":true,"kitchen":true,"kiwi":true,"koeln":true,"komatsu":true,"kosher":true,"kpmg":true,"kpn":true,"krd":true,"kred":true,"kuokgroup":true,"kyknet":true,"kyoto":true,"lacaixa":true,"ladbrokes":true,"lamborghini":true,"lancaster":true,"lancia":true,"lancome":true,"land":true,"landrover":true,"lanxess":true,"lasalle":true,"lat":true,"latino":true,"latrobe":true,"law":true,"lawyer":true,"lds":true,"lease":true,"leclerc":true,"lefrak":true,"legal":true,"lego":true,"lexus":true,"lgbt":true,"liaison":true,"lidl":true,"life":true,"lifeinsurance":true,"lifestyle":true,"lighting":true,"like":true,"lilly":true,"limited":true,"limo":true,"lincoln":true,"linde":true,"link":true,"lipsy":true,"live":true,"living":true,"lixil":true,"loan":true,"loans":true,"locker":true,"locus":true,"loft":true,"lol":true,"london":true,"lotte":true,"lotto":true,"love":true,"lpl":true,"lplfinancial":true,"ltd":true,"ltda":true,"lundbeck":true,"lupin":true,"luxe":true,"luxury":true,"macys":true,"madrid":true,"maif":true,"maison":true,"makeup":true,"man":true,"management":true,"mango":true,"market":true,"marketing":true,"markets":true,"marriott":true,"marshalls":true,"maserati":true,"mattel":true,"mba":true,"mcd":true,"mcdonalds":true,"mckinsey":true,"med":true,"media":true,"meet":true,"melbourne":true,"meme":true,"memorial":true,"men":true,"menu":true,"meo":true,"metlife":true,"miami":true,"microsoft":true,"mini":true,"mint":true,"mit":true,"mitsubishi":true,"mlb":true,"mls":true,"mma":true,"mnet":true,"mobily":true,"moda":true,"moe":true,"moi":true,"mom":true,"monash":true,"money":true,"monster":true,"montblanc":true,"mopar":true,"mormon":true,"mortgage":true,"moscow":true,"moto":true,"motorcycles":true,"mov":true,"movie":true,"movistar":true,"msd":true,"mtn":true,"mtpc":true,"mtr":true,"multichoice":true,"mutual":true,"mutuelle":true,"mzansimagic":true,"nab":true,"nadex":true,"nagoya":true,"naspers":true,"nationwide":true,"natura":true,"navy":true,"nba":true,"nec":true,"netbank":true,"netflix":true,"network":true,"neustar":true,"new":true,"newholland":true,"news":true,"next":true,"nextdirect":true,"nexus":true,"nfl":true,"ngo":true,"nhk":true,"nico":true,"nike":true,"nikon":true,"ninja":true,"nissan":true,"nokia":true,"northwesternmutual":true,"norton":true,"now":true,"nowruz":true,"nowtv":true,"nra":true,"nrw":true,"ntt":true,"nyc":true,"obi":true,"observer":true,"off":true,"office":true,"okinawa":true,"olayan":true,"olayangroup":true,"oldnavy":true,"ollo":true,"omega":true,"one":true,"ong":true,"onl":true,"online":true,"onyourside":true,"ooo":true,"open":true,"oracle":true,"orange":true,"organic":true,"orientexpress":true,"osaka":true,"otsuka":true,"ott":true,"ovh":true,"page":true,"pamperedchef":true,"panasonic":true,"panerai":true,"paris":true,"pars":true,"partners":true,"parts":true,"party":true,"passagens":true,"pay":true,"payu":true,"pccw":true,"pet":true,"pfizer":true,"pharmacy":true,"philips":true,"photo":true,"photography":true,"photos":true,"physio":true,"piaget":true,"pics":true,"pictet":true,"pictures":true,"pid":true,"pin":true,"ping":true,"pink":true,"pioneer":true,"pizza":true,"place":true,"play":true,"playstation":true,"plumbing":true,"plus":true,"pnc":true,"pohl":true,"poker":true,"politie":true,"porn":true,"pramerica":true,"praxi":true,"press":true,"prime":true,"prod":true,"productions":true,"prof":true,"progressive":true,"promo":true,"properties":true,"property":true,"protection":true,"pru":true,"prudential":true,"pub":true,"qpon":true,"quebec":true,"quest":true,"qvc":true,"racing":true,"raid":true,"read":true,"realestate":true,"realtor":true,"realty":true,"recipes":true,"red":true,"redstone":true,"redumbrella":true,"rehab":true,"reise":true,"reisen":true,"reit":true,"reliance":true,"ren":true,"rent":true,"rentals":true,"repair":true,"report":true,"republican":true,"rest":true,"restaurant":true,"review":true,"reviews":true,"rexroth":true,"rich":true,"richardli":true,"ricoh":true,"rightathome":true,"ril":true,"rio":true,"rip":true,"rocher":true,"rocks":true,"rodeo":true,"rogers":true,"room":true,"rsvp":true,"ruhr":true,"run":true,"rwe":true,"ryukyu":true,"saarland":true,"safe":true,"safety":true,"sakura":true,"sale":true,"salon":true,"samsclub":true,"samsung":true,"sandvik":true,"sandvikcoromant":true,"sanofi":true,"sap":true,"sapo":true,"sarl":true,"sas":true,"save":true,"saxo":true,"sbi":true,"sbs":true,"sca":true,"scb":true,"schaeffler":true,"schmidt":true,"scholarships":true,"school":true,"schule":true,"schwarz":true,"science":true,"scjohnson":true,"scor":true,"scot":true,"seat":true,"secure":true,"security":true,"seek":true,"sener":true,"services":true,"ses":true,"seven":true,"sew":true,"sex":true,"sexy":true,"sfr":true,"shangrila":true,"sharp":true,"shaw":true,"shell":true,"shia":true,"shiksha":true,"shoes":true,"shouji":true,"show":true,"showtime":true,"shriram":true,"silk":true,"sina":true,"singles":true,"site":true,"ski":true,"skin":true,"sky":true,"skype":true,"sling":true,"smart":true,"smile":true,"sncf":true,"soccer":true,"social":true,"softbank":true,"software":true,"sohu":true,"solar":true,"solutions":true,"song":true,"sony":true,"soy":true,"space":true,"spiegel":true,"spot":true,"spreadbetting":true,"srl":true,"srt":true,"stada":true,"staples":true,"star":true,"starhub":true,"statebank":true,"statefarm":true,"statoil":true,"stc":true,"stcgroup":true,"stockholm":true,"storage":true,"store":true,"studio":true,"study":true,"style":true,"sucks":true,"supersport":true,"supplies":true,"supply":true,"support":true,"surf":true,"surgery":true,"suzuki":true,"swatch":true,"swiftcover":true,"swiss":true,"sydney":true,"symantec":true,"systems":true,"tab":true,"taipei":true,"talk":true,"taobao":true,"target":true,"tatamotors":true,"tatar":true,"tattoo":true,"tax":true,"taxi":true,"tci":true,"tdk":true,"team":true,"tech":true,"technology":true,"telecity":true,"telefonica":true,"temasek":true,"tennis":true,"teva":true,"thd":true,"theater":true,"theatre":true,"theguardian":true,"tiaa":true,"tickets":true,"tienda":true,"tiffany":true,"tips":true,"tires":true,"tirol":true,"tjmaxx":true,"tjx":true,"tkmaxx":true,"tmall":true,"today":true,"tokyo":true,"tools":true,"top":true,"toray":true,"toshiba":true,"total":true,"tours":true,"town":true,"toyota":true,"toys":true,"trade":true,"trading":true,"training":true,"travelchannel":true,"travelers":true,"travelersinsurance":true,"trust":true,"trv":true,"tube":true,"tui":true,"tunes":true,"tushu":true,"tvs":true,"ubank":true,"ubs":true,"uconnect":true,"university":true,"uno":true,"uol":true,"ups":true,"vacations":true,"vana":true,"vanguard":true,"vegas":true,"ventures":true,"verisign":true,"versicherung":true,"vet":true,"viajes":true,"video":true,"vig":true,"viking":true,"villas":true,"vin":true,"vip":true,"virgin":true,"visa":true,"vision":true,"vista":true,"vistaprint":true,"viva":true,"vivo":true,"vlaanderen":true,"vodka":true,"volkswagen":true,"vote":true,"voting":true,"voto":true,"voyage":true,"vuelos":true,"wales":true,"walmart":true,"walter":true,"wang":true,"wanggou":true,"warman":true,"watch":true,"watches":true,"weather":true,"weatherchannel":true,"webcam":true,"weber":true,"website":true,"wed":true,"wedding":true,"weibo":true,"weir":true,"whoswho":true,"wien":true,"wiki":true,"williamhill":true,"win":true,"windows":true,"wine":true,"winners":true,"wme":true,"wolterskluwer":true,"woodside":true,"work":true,"works":true,"world":true,"wtc":true,"wtf":true,"xbox":true,"xerox":true,"xfinity":true,"xihuan":true,"xin":true,"xn--11b4c3d":true,"xn--1ck2e1b":true,"xn--1qqw23a":true,"xn--30rr7y":true,"xn--3bst00m":true,"xn--3ds443g":true,"xn--3oq18vl8pn36a":true,"xn--3pxu8k":true,"xn--42c2d9a":true,"xn--45q11c":true,"xn--4gbrim":true,"xn--4gq48lf9j":true,"xn--55qw42g":true,"xn--55qx5d":true,"xn--5su34j936bgsg":true,"xn--5tzm5g":true,"xn--6frz82g":true,"xn--6qq986b3xl":true,"xn--80adxhks":true,"xn--80asehdb":true,"xn--80aswg":true,"xn--8y0a063a":true,"xn--9dbq2a":true,"xn--9et52u":true,"xn--9krt00a":true,"xn--b4w605ferd":true,"xn--bck1b9a5dre4c":true,"xn--c1avg":true,"xn--c2br7g":true,"xn--cck2b3b":true,"xn--cg4bki":true,"xn--czr694b":true,"xn--czrs0t":true,"xn--czru2d":true,"xn--d1acj3b":true,"xn--eckvdtc9d":true,"xn--efvy88h":true,"xn--estv75g":true,"xn--fct429k":true,"xn--fhbei":true,"xn--fiq228c5hs":true,"xn--fiq64b":true,"xn--fjq720a":true,"xn--flw351e":true,"xn--fzys8d69uvgm":true,"xn--g2xx48c":true,"xn--gckr3f0f":true,"xn--hxt814e":true,"xn--i1b6b1a6a2e":true,"xn--imr513n":true,"xn--io0a7i":true,"xn--j1aef":true,"xn--jlq61u9w7b":true,"xn--jvr189m":true,"xn--kcrx77d1x4a":true,"xn--kpu716f":true,"xn--kput3i":true,"xn--mgba3a3ejt":true,"xn--mgba7c0bbn0a":true,"xn--mgbaakc7dvf":true,"xn--mgbab2bd":true,"xn--mgbb9fbpob":true,"xn--mgbca7dzdo":true,"xn--mgbt3dhd":true,"xn--mk1bu44c":true,"xn--mxtq1m":true,"xn--ngbc5azd":true,"xn--ngbe9e0a":true,"xn--nqv7f":true,"xn--nqv7fs00ema":true,"xn--nyqy26a":true,"xn--p1acf":true,"xn--pbt977c":true,"xn--pssy2u":true,"xn--q9jyb4c":true,"xn--qcka1pmc":true,"xn--rhqv96g":true,"xn--rovu88b":true,"xn--ses554g":true,"xn--t60b56a":true,"xn--tckwe":true,"xn--unup4y":true,"xn--vermgensberater-ctb":true,"xn--vermgensberatung-pwb":true,"xn--vhquv":true,"xn--vuq861b":true,"xn--w4r85el8fhu5dnra":true,"xn--w4rs40l":true,"xn--xhq521b":true,"xn--zfr164b":true,"xperia":true,"xyz":true,"yachts":true,"yahoo":true,"yamaxun":true,"yandex":true,"yodobashi":true,"yoga":true,"yokohama":true,"you":true,"youtube":true,"yun":true,"zappos":true,"zara":true,"zero":true,"zip":true,"zippo":true,"zone":true,"zuerich":true,"cloudfront.net":true,"ap-northeast-1.compute.amazonaws.com":true,"ap-southeast-1.compute.amazonaws.com":true,"ap-southeast-2.compute.amazonaws.com":true,"cn-north-1.compute.amazonaws.cn":true,"compute.amazonaws.cn":true,"compute.amazonaws.com":true,"compute-1.amazonaws.com":true,"eu-west-1.compute.amazonaws.com":true,"eu-central-1.compute.amazonaws.com":true,"sa-east-1.compute.amazonaws.com":true,"us-east-1.amazonaws.com":true,"us-gov-west-1.compute.amazonaws.com":true,"us-west-1.compute.amazonaws.com":true,"us-west-2.compute.amazonaws.com":true,"z-1.compute-1.amazonaws.com":true,"z-2.compute-1.amazonaws.com":true,"elasticbeanstalk.com":true,"elb.amazonaws.com":true,"s3.amazonaws.com":true,"s3-ap-northeast-1.amazonaws.com":true,"s3-ap-southeast-1.amazonaws.com":true,"s3-ap-southeast-2.amazonaws.com":true,"s3-external-1.amazonaws.com":true,"s3-external-2.amazonaws.com":true,"s3-fips-us-gov-west-1.amazonaws.com":true,"s3-eu-central-1.amazonaws.com":true,"s3-eu-west-1.amazonaws.com":true,"s3-sa-east-1.amazonaws.com":true,"s3-us-gov-west-1.amazonaws.com":true,"s3-us-west-1.amazonaws.com":true,"s3-us-west-2.amazonaws.com":true,"s3.cn-north-1.amazonaws.com.cn":true,"s3.eu-central-1.amazonaws.com":true,"betainabox.com":true,"ae.org":true,"ar.com":true,"br.com":true,"cn.com":true,"com.de":true,"com.se":true,"de.com":true,"eu.com":true,"gb.com":true,"gb.net":true,"hu.com":true,"hu.net":true,"jp.net":true,"jpn.com":true,"kr.com":true,"mex.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"se.net":true,"uk.com":true,"uk.net":true,"us.com":true,"uy.com":true,"za.bz":true,"za.com":true,"africa.com":true,"gr.com":true,"in.net":true,"us.org":true,"co.com":true,"c.la":true,"cloudcontrolled.com":true,"cloudcontrolapp.com":true,"co.ca":true,"c.cdn77.org":true,"cdn77-ssl.net":true,"r.cdn77.net":true,"rsc.cdn77.org":true,"ssl.origin.cdn77-secure.org":true,"co.nl":true,"co.no":true,"*.platform.sh":true,"cupcake.is":true,"dreamhosters.com":true,"duckdns.org":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true,"eu.org":true,"al.eu.org":true,"asso.eu.org":true,"at.eu.org":true,"au.eu.org":true,"be.eu.org":true,"bg.eu.org":true,"ca.eu.org":true,"cd.eu.org":true,"ch.eu.org":true,"cn.eu.org":true,"cy.eu.org":true,"cz.eu.org":true,"de.eu.org":true,"dk.eu.org":true,"edu.eu.org":true,"ee.eu.org":true,"es.eu.org":true,"fi.eu.org":true,"fr.eu.org":true,"gr.eu.org":true,"hr.eu.org":true,"hu.eu.org":true,"ie.eu.org":true,"il.eu.org":true,"in.eu.org":true,"int.eu.org":true,"is.eu.org":true,"it.eu.org":true,"jp.eu.org":true,"kr.eu.org":true,"lt.eu.org":true,"lu.eu.org":true,"lv.eu.org":true,"mc.eu.org":true,"me.eu.org":true,"mk.eu.org":true,"mt.eu.org":true,"my.eu.org":true,"net.eu.org":true,"ng.eu.org":true,"nl.eu.org":true,"no.eu.org":true,"nz.eu.org":true,"paris.eu.org":true,"pl.eu.org":true,"pt.eu.org":true,"q-a.eu.org":true,"ro.eu.org":true,"ru.eu.org":true,"se.eu.org":true,"si.eu.org":true,"sk.eu.org":true,"tr.eu.org":true,"uk.eu.org":true,"us.eu.org":true,"a.ssl.fastly.net":true,"b.ssl.fastly.net":true,"global.ssl.fastly.net":true,"a.prod.fastly.net":true,"global.prod.fastly.net":true,"firebaseapp.com":true,"flynnhub.com":true,"service.gov.uk":true,"github.io":true,"githubusercontent.com":true,"ro.com":true,"appspot.com":true,"blogspot.ae":true,"blogspot.al":true,"blogspot.am":true,"blogspot.ba":true,"blogspot.be":true,"blogspot.bg":true,"blogspot.bj":true,"blogspot.ca":true,"blogspot.cf":true,"blogspot.ch":true,"blogspot.cl":true,"blogspot.co.at":true,"blogspot.co.id":true,"blogspot.co.il":true,"blogspot.co.ke":true,"blogspot.co.nz":true,"blogspot.co.uk":true,"blogspot.co.za":true,"blogspot.com":true,"blogspot.com.ar":true,"blogspot.com.au":true,"blogspot.com.br":true,"blogspot.com.by":true,"blogspot.com.co":true,"blogspot.com.cy":true,"blogspot.com.ee":true,"blogspot.com.eg":true,"blogspot.com.es":true,"blogspot.com.mt":true,"blogspot.com.ng":true,"blogspot.com.tr":true,"blogspot.com.uy":true,"blogspot.cv":true,"blogspot.cz":true,"blogspot.de":true,"blogspot.dk":true,"blogspot.fi":true,"blogspot.fr":true,"blogspot.gr":true,"blogspot.hk":true,"blogspot.hr":true,"blogspot.hu":true,"blogspot.ie":true,"blogspot.in":true,"blogspot.is":true,"blogspot.it":true,"blogspot.jp":true,"blogspot.kr":true,"blogspot.li":true,"blogspot.lt":true,"blogspot.lu":true,"blogspot.md":true,"blogspot.mk":true,"blogspot.mr":true,"blogspot.mx":true,"blogspot.my":true,"blogspot.nl":true,"blogspot.no":true,"blogspot.pe":true,"blogspot.pt":true,"blogspot.qa":true,"blogspot.re":true,"blogspot.ro":true,"blogspot.rs":true,"blogspot.ru":true,"blogspot.se":true,"blogspot.sg":true,"blogspot.si":true,"blogspot.sk":true,"blogspot.sn":true,"blogspot.td":true,"blogspot.tw":true,"blogspot.ug":true,"blogspot.vn":true,"codespot.com":true,"googleapis.com":true,"googlecode.com":true,"pagespeedmobilizer.com":true,"withgoogle.com":true,"withyoutube.com":true,"herokuapp.com":true,"herokussl.com":true,"iki.fi":true,"biz.at":true,"info.at":true,"co.pl":true,"azurewebsites.net":true,"azure-mobile.net":true,"cloudapp.net":true,"bmoattachments.org":true,"4u.com":true,"nfshost.com":true,"nyc.mn":true,"nid.io":true,"operaunite.com":true,"outsystemscloud.com":true,"art.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pantheon.io":true,"gotpantheon.com":true,"priv.at":true,"qa2.com":true,"rhcloud.com":true,"sandcats.io":true,"biz.ua":true,"co.ua":true,"pp.ua":true,"sinaapp.com":true,"vipsinaapp.com":true,"1kapp.com":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"hk.com":true,"hk.org":true,"ltd.hk":true,"inc.hk":true,"yolasite.com":true,"za.net":true,"za.org":true}); + } else if (key.type === 'ecdsa') { + if (!CRYPTO_HAVE_ECDH) { + if (ecdh === undefined) + ecdh = __webpack_require__(277); + if (ec === undefined) + ec = __webpack_require__(122); + if (jsbn === undefined) + jsbn = __webpack_require__(60).BigInteger; -// END of automatically generated file + this._ecParams = new X9ECParameters(this._curve); + if (this._isPriv) { + this._priv = new ECPrivate( + this._ecParams, key.part.d.data); + } + return; + } -/***/ }), -/* 310 */ -/***/ (function(module, exports, __webpack_require__) { + var curve = { + 'nistp256': 'prime256v1', + 'nistp384': 'secp384r1', + 'nistp521': 'secp521r1' + }[key.curve]; + this._dh = crypto.createECDH(curve); + if (typeof (this._dh) !== 'object' || + typeof (this._dh.setPrivateKey) !== 'function') { + CRYPTO_HAVE_ECDH = false; + DiffieHellman.call(this, key); + return; + } + if (this._isPriv) + this._dh.setPrivateKey(key.part.d.data); + this._dh.setPublicKey(key.part.Q.data); -"use strict"; -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ + } else if (key.type === 'curve25519') { + if (ed === undefined) + ed = __webpack_require__(187); -/*jshint unused:false */ + if (this._isPriv) { + this._priv = key.part.r.data; + if (this._priv[0] === 0x00) + this._priv = this._priv.slice(1); + this._priv = this._priv.slice(0, 32); + } -function Store() { + } else { + throw (new Error('DH not supported for ' + key.type + ' keys')); + } } -exports.Store = Store; - -// Stores may be synchronous, but are still required to use a -// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" -// API that converts from synchronous-callbacks to imperative style. -Store.prototype.synchronous = false; -Store.prototype.findCookie = function(domain, path, key, cb) { - throw new Error('findCookie is not implemented'); +DiffieHellman.prototype.getPublicKey = function () { + if (this._isPriv) + return (this._key.toPublic()); + return (this._key); }; -Store.prototype.findCookies = function(domain, path, cb) { - throw new Error('findCookies is not implemented'); +DiffieHellman.prototype.getPrivateKey = function () { + if (this._isPriv) + return (this._key); + else + return (undefined); }; +DiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey; -Store.prototype.putCookie = function(cookie, cb) { - throw new Error('putCookie is not implemented'); -}; +DiffieHellman.prototype._keyCheck = function (pk, isPub) { + assert.object(pk, 'key'); + if (!isPub) + utils.assertCompatible(pk, PrivateKey, [1, 3], 'key'); + utils.assertCompatible(pk, Key, [1, 4], 'key'); -Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { - // recommended default implementation: - // return this.putCookie(newCookie, cb); - throw new Error('updateCookie is not implemented'); -}; + if (pk.type !== this._algo) { + throw (new Error('A ' + pk.type + ' key cannot be used in ' + + this._algo + ' Diffie-Hellman')); + } -Store.prototype.removeCookie = function(domain, path, key, cb) { - throw new Error('removeCookie is not implemented'); -}; + if (pk.curve !== this._curve) { + throw (new Error('A key from the ' + pk.curve + ' curve ' + + 'cannot be used with a ' + this._curve + + ' Diffie-Hellman')); + } -Store.prototype.removeCookies = function(domain, path, cb) { - throw new Error('removeCookies is not implemented'); + if (pk.type === 'dsa') { + assert.deepEqual(pk.part.p, this._p, + 'DSA key prime does not match'); + assert.deepEqual(pk.part.g, this._g, + 'DSA key generator does not match'); + } }; -Store.prototype.getAllCookies = function(cb) { - throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)'); -}; +DiffieHellman.prototype.setKey = function (pk) { + this._keyCheck(pk); + if (pk.type === 'dsa') { + this._dh.setPrivateKey(pk.part.x.data); + this._dh.setPublicKey(pk.part.y.data); -/***/ }), -/* 311 */ -/***/ (function(module, exports) { + } else if (pk.type === 'ecdsa') { + if (CRYPTO_HAVE_ECDH) { + this._dh.setPrivateKey(pk.part.d.data); + this._dh.setPublicKey(pk.part.Q.data); + } else { + this._priv = new ECPrivate( + this._ecParams, pk.part.d.data); + } -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -var byteToHex = []; -for (var i = 0; i < 256; ++i) { - byteToHex[i] = (i + 0x100).toString(16).substr(1); -} + } else if (pk.type === 'curve25519') { + this._priv = pk.part.r.data; + if (this._priv[0] === 0x00) + this._priv = this._priv.slice(1); + this._priv = this._priv.slice(0, 32); + } + this._key = pk; + this._isPriv = true; +}; +DiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey; -function bytesToUuid(buf, offset) { - var i = offset || 0; - var bth = byteToHex; - return bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]]; -} +DiffieHellman.prototype.computeSecret = function (otherpk) { + this._keyCheck(otherpk, true); + if (!this._isPriv) + throw (new Error('DH exchange has not been initialized with ' + + 'a private key yet')); -module.exports = bytesToUuid; + var pub; + if (this._algo === 'dsa') { + return (this._dh.computeSecret( + otherpk.part.y.data)); + } else if (this._algo === 'ecdsa') { + if (CRYPTO_HAVE_ECDH) { + return (this._dh.computeSecret( + otherpk.part.Q.data)); + } else { + pub = new ECPublic( + this._ecParams, otherpk.part.Q.data); + return (this._priv.deriveSharedSecret(pub)); + } -/***/ }), -/* 312 */ -/***/ (function(module, exports, __webpack_require__) { + } else if (this._algo === 'curve25519') { + pub = otherpk.part.R.data; + if (pub[0] === 0x00) + pub = pub.slice(1); -// Unique ID creation requires a high quality random # generator. In node.js -// this is prett straight-forward - we use the crypto API. + var secret = ed.dh.computeKey( + this._priv.toString('binary'), + pub.toString('binary')); -var rb = __webpack_require__(9).randomBytes; + return (new Buffer(secret, 'binary')); + } -function rng() { - return rb(16); + throw (new Error('Invalid algorithm: ' + this._algo)); }; -module.exports = rng; +DiffieHellman.prototype.generateKey = function () { + var parts = []; + var priv, pub; + if (this._algo === 'dsa') { + this._dh.generateKeys(); + parts.push({name: 'p', data: this._p.data}); + parts.push({name: 'q', data: this._key.part.q.data}); + parts.push({name: 'g', data: this._g.data}); + parts.push({name: 'y', data: this._dh.getPublicKey()}); + parts.push({name: 'x', data: this._dh.getPrivateKey()}); + this._key = new PrivateKey({ + type: 'dsa', + parts: parts + }); + this._isPriv = true; + return (this._key); -/***/ }), -/* 313 */ -/***/ (function(module, exports) { + } else if (this._algo === 'ecdsa') { + if (CRYPTO_HAVE_ECDH) { + this._dh.generateKeys(); -module.exports = extend + parts.push({name: 'curve', + data: new Buffer(this._curve)}); + parts.push({name: 'Q', data: this._dh.getPublicKey()}); + parts.push({name: 'd', data: this._dh.getPrivateKey()}); + this._key = new PrivateKey({ + type: 'ecdsa', + curve: this._curve, + parts: parts + }); + this._isPriv = true; + return (this._key); -var hasOwnProperty = Object.prototype.hasOwnProperty; + } else { + var n = this._ecParams.getN(); + var r = new jsbn(crypto.randomBytes(n.bitLength())); + var n1 = n.subtract(jsbn.ONE); + priv = r.mod(n1).add(jsbn.ONE); + pub = this._ecParams.getG().multiply(priv); -function extend() { - var target = {} + priv = new Buffer(priv.toByteArray()); + pub = new Buffer(this._ecParams.getCurve(). + encodePointHex(pub), 'hex'); - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] + this._priv = new ECPrivate(this._ecParams, priv); - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } + parts.push({name: 'curve', + data: new Buffer(this._curve)}); + parts.push({name: 'Q', data: pub}); + parts.push({name: 'd', data: priv}); - return target -} + this._key = new PrivateKey({ + type: 'ecdsa', + curve: this._curve, + parts: parts + }); + this._isPriv = true; + return (this._key); + } + } else if (this._algo === 'curve25519') { + priv = ed.dh.generateKey(); + pub = ed.dh.publicKey(priv); + this._priv = priv = new Buffer(priv, 'binary'); + pub = new Buffer(pub, 'binary'); -/***/ }), -/* 314 */ -/***/ (function(module, exports) { - -module.exports = { - "name": "yarn", - "installationMethod": "unknown", - "version": "1.3.2", - "license": "BSD-2-Clause", - "preferGlobal": true, - "description": "📦🐈 Fast, reliable, and secure dependency management.", - "dependencies": { - "babel-eslint": "^7.2.3", - "babel-runtime": "^6.0.0", - "bytes": "^2.4.0", - "camelcase": "^4.0.0", - "chalk": "^2.1.0", - "cmd-shim": "^2.0.1", - "commander": "^2.9.0", - "death": "^1.0.0", - "debug": "^2.2.0", - "detect-indent": "^5.0.0", - "dnscache": "^1.0.1", - "eslint-plugin-jest": "^20.0.3", - "eslint-plugin-jsx-a11y": "^6.0.2", - "eslint-plugin-relay": "0.0.8", - "glob": "^7.1.1", - "gunzip-maybe": "^1.4.0", - "ini": "^1.3.4", - "inquirer": "^3.0.1", - "invariant": "^2.2.0", - "is-builtin-module": "^1.0.0", - "is-ci": "^1.0.10", - "is-webpack-bundle": "^1.0.0", - "leven": "^2.0.0", - "loud-rejection": "^1.2.0", - "micromatch": "^2.3.11", - "mkdirp": "^0.5.1", - "node-emoji": "^1.6.1", - "normalize-url": "^1.9.1", - "object-path": "^0.11.2", - "proper-lockfile": "^2.0.0", - "puka": "^1.0.0", - "read": "^1.0.7", - "request": "^2.81.0", - "request-capture-har": "^1.2.2", - "rimraf": "^2.5.0", - "semver": "^5.1.0", - "strip-ansi": "^4.0.0", - "strip-bom": "^3.0.0", - "tar-fs": "^1.15.1", - "tar-stream": "^1.5.2", - "uuid": "^3.0.1", - "v8-compile-cache": "^1.1.0", - "validate-npm-package-license": "^3.0.1", - "yn": "^2.0.0" - }, - "devDependencies": { - "babel-core": "^6.24.1", - "babel-loader": "^6.2.5", - "babel-plugin-array-includes": "^2.0.3", - "babel-plugin-transform-inline-imports-commonjs": "^1.0.0", - "babel-plugin-transform-runtime": "^6.4.3", - "babel-preset-es2015-node4": "^2.1.0", - "babel-preset-node5": "^10.2.0", - "babel-preset-stage-0": "^6.0.0", - "babylon": "^6.5.0", - "commitizen": "^2.9.6", - "cz-conventional-changelog": "^2.0.0", - "eslint": "^4.3.0", - "eslint-config-fb-strict": "^20.1.0-delta.3", - "eslint-plugin-babel": "^4.0.0", - "eslint-plugin-flowtype": "^2.35.0", - "eslint-plugin-jasmine": "^2.6.2", - "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-prettier": "^2.1.2", - "eslint-plugin-react": "^7.1.0", - "eslint-plugin-yarn-internal": "file:scripts/eslint-rules", - "execa": "^0.7.0", - "flow-bin": "^0.52.0", - "gulp": "^3.9.0", - "gulp-babel": "^6.0.0", - "gulp-if": "^2.0.1", - "gulp-newer": "^1.0.0", - "gulp-plumber": "^1.0.1", - "gulp-sourcemaps": "^2.2.0", - "gulp-util": "^3.0.7", - "gulp-watch": "^4.3.5", - "jest": "20.0.4", - "minimatch": "^3.0.4", - "mock-stdin": "^0.3.0", - "prettier": "^1.5.2", - "temp": "^0.8.3", - "webpack": "^2.1.0-beta.25", - "yargs": "^6.3.0" - }, - "engines": { - "node": ">=4.0.0" - }, - "repository": "yarnpkg/yarn", - "bin": { - "yarn": "./bin/yarn.js", - "yarnpkg": "./bin/yarn.js" - }, - "scripts": { - "build": "gulp build", - "build-bundle": "node ./scripts/build-webpack.js", - "build-chocolatey": "powershell ./scripts/build-chocolatey.ps1", - "build-deb": "./scripts/build-deb.sh", - "build-dist": "bash ./scripts/build-dist.sh", - "build-win-installer": "scripts\\build-windows-installer.bat", - "check-lockfile": "./scripts/check-lockfile.sh", - "lint": "eslint . && flow check", - "prettier": "eslint src __tests__ --fix", - "release-branch": "./scripts/release-branch.sh", - "test": "yarn lint && yarn test-only", - "test-ci": "yarn build && yarn test-only", - "test-only": "node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose", - "test-coverage": "node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose", - "watch": "gulp watch", - "commit": "git-cz" - }, - "jest": { - "collectCoverageFrom": [ - "src/**/*.js" - ], - "testEnvironment": "node", - "modulePathIgnorePatterns": [ - "__tests__/fixtures/" - ], - "testPathIgnorePatterns": [ - "__tests__/(fixtures|__mocks__)/", - "updates/", - "/_(temp|mock|install|init|helpers).js$" - ] - }, - "config": { - "commitizen": { - "path": "./node_modules/cz-conventional-changelog" - } + parts.push({name: 'R', data: pub}); + parts.push({name: 'r', data: Buffer.concat([priv, pub])}); + this._key = new PrivateKey({ + type: 'curve25519', + parts: parts + }); + this._isPriv = true; + return (this._key); } -}; - -/***/ }), -/* 315 */ -/***/ (function(module, exports) { - -module.exports = require("constants"); -/***/ }), -/* 316 */ -/***/ (function(module, exports) { + throw (new Error('Invalid algorithm: ' + this._algo)); +}; +DiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey; -module.exports = require("dns"); +/* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */ -/***/ }), -/* 317 */ -/***/ (function(module, exports) { +function X9ECParameters(name) { + var params = algs.curves[name]; + assert.object(params); -module.exports = require("tls"); + var p = new jsbn(params.p); + var a = new jsbn(params.a); + var b = new jsbn(params.b); + var n = new jsbn(params.n); + var h = jsbn.ONE; + var curve = new ec.ECCurveFp(p, a, b); + var G = curve.decodePointHex(params.G.toString('hex')); -/***/ }), -/* 318 */ -/***/ (function(module, exports, __webpack_require__) { + this.curve = curve; + this.g = G; + this.n = n; + this.h = h; +} +X9ECParameters.prototype.getCurve = function () { return (this.curve); }; +X9ECParameters.prototype.getG = function () { return (this.g); }; +X9ECParameters.prototype.getN = function () { return (this.n); }; +X9ECParameters.prototype.getH = function () { return (this.h); }; -"use strict"; +function ECPublic(params, buffer) { + this._params = params; + if (buffer[0] === 0x00) + buffer = buffer.slice(1); + this._pub = params.getCurve().decodePointHex(buffer.toString('hex')); +} +function ECPrivate(params, buffer) { + this._params = params; + this._priv = new jsbn(utils.mpNormalize(buffer)); +} +ECPrivate.prototype.deriveSharedSecret = function (pubKey) { + assert.ok(pubKey instanceof ECPublic); + var S = pubKey._pub.multiply(this._priv); + return (new Buffer(S.getX().toBigInteger().toByteArray())); +}; -Object.defineProperty(exports, "__esModule", { - value: true -}); +function generateED25519() { + if (nacl === undefined) + nacl = __webpack_require__(139); -var _toConsumableArray2; + var pair = nacl.sign.keyPair(); + var priv = new Buffer(pair.secretKey); + var pub = new Buffer(pair.publicKey); + assert.strictEqual(priv.length, 64); + assert.strictEqual(pub.length, 32); -function _load_toConsumableArray() { - return _toConsumableArray2 = _interopRequireDefault(__webpack_require__(32)); + var parts = []; + parts.push({name: 'R', data: pub}); + parts.push({name: 'r', data: priv}); + var key = new PrivateKey({ + type: 'ed25519', + parts: parts + }); + return (key); } -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(33)); -} +/* Generates a new ECDSA private key on a given curve. */ +function generateECDSA(curve) { + var parts = []; + var key; -var _set; + if (CRYPTO_HAVE_ECDH) { + /* + * Node crypto doesn't expose key generation directly, but the + * ECDH instances can generate keys. It turns out this just + * calls into the OpenSSL generic key generator, and we can + * read its output happily without doing an actual DH. So we + * use that here. + */ + var osCurve = { + 'nistp256': 'prime256v1', + 'nistp384': 'secp384r1', + 'nistp521': 'secp521r1' + }[curve]; -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(11)); -} + var dh = crypto.createECDH(osCurve); + dh.generateKeys(); -exports.getRcConfigForCwd = getRcConfigForCwd; -exports.getRcArgs = getRcArgs; + parts.push({name: 'curve', + data: new Buffer(curve)}); + parts.push({name: 'Q', data: dh.getPublicKey()}); + parts.push({name: 'd', data: dh.getPrivateKey()}); -var _path; + key = new PrivateKey({ + type: 'ecdsa', + curve: curve, + parts: parts + }); + return (key); -function _load_path() { - return _path = __webpack_require__(1); -} + } else { + if (ecdh === undefined) + ecdh = __webpack_require__(277); + if (ec === undefined) + ec = __webpack_require__(122); + if (jsbn === undefined) + jsbn = __webpack_require__(60).BigInteger; -var _commander; + var ecParams = new X9ECParameters(curve); -function _load_commander() { - return _commander = _interopRequireDefault(__webpack_require__(193)); -} + /* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */ + var n = ecParams.getN(); + /* + * The crypto.randomBytes() function can only give us whole + * bytes, so taking a nod from X9.62, we round up. + */ + var cByteLen = Math.ceil((n.bitLength() + 64) / 8); + var c = new jsbn(crypto.randomBytes(cByteLen)); -var _lockfile; + var n1 = n.subtract(jsbn.ONE); + var priv = c.mod(n1).add(jsbn.ONE); + var pub = ecParams.getG().multiply(priv); -function _load_lockfile() { - return _lockfile = __webpack_require__(16); -} + priv = new Buffer(priv.toByteArray()); + pub = new Buffer(ecParams.getCurve(). + encodePointHex(pub), 'hex'); -var _rc; + parts.push({name: 'curve', data: new Buffer(curve)}); + parts.push({name: 'Q', data: pub}); + parts.push({name: 'd', data: priv}); -function _load_rc() { - return _rc = _interopRequireWildcard(__webpack_require__(431)); + key = new PrivateKey({ + type: 'ecdsa', + curve: curve, + parts: parts + }); + return (key); + } } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -// Keys that will get resolved relative to the path of the rc file they belong to -const PATH_KEYS = new (_set || _load_set()).default(['yarn-path', 'cache-folder', 'global-folder', 'modules-folder', 'cwd']); +/***/ }), +/* 316 */ +/***/ (function(module, exports, __webpack_require__) { -// given a cwd, load all .yarnrc files relative to it -function getRcConfigForCwd(cwd) { - return (_rc || _load_rc()).findRc('yarn', cwd, (fileText, filePath) => { - var _parse = (0, (_lockfile || _load_lockfile()).parse)(fileText, 'yarnrc'); +// Copyright 2015 Joyent, Inc. - const values = _parse.object; +module.exports = { + Verifier: Verifier, + Signer: Signer +}; - // some keys reference directories so keep their relativity +var nacl; +var stream = __webpack_require__(29); +var util = __webpack_require__(4); +var assert = __webpack_require__(16); +var Signature = __webpack_require__(50); - for (const key in values) { - if (PATH_KEYS.has(key.replace(/^(--)?([^.]+\.)*/, ''))) { - values[key] = (0, (_path || _load_path()).resolve)((0, (_path || _load_path()).dirname)(filePath), values[key]); - } - } +function Verifier(key, hashAlgo) { + if (nacl === undefined) + nacl = __webpack_require__(139); - return values; - }); -} + if (hashAlgo.toLowerCase() !== 'sha512') + throw (new Error('ED25519 only supports the use of ' + + 'SHA-512 hashes')); -// get the built of arguments of a .yarnrc chain of the passed cwd -function buildRcArgs(cwd) { - const config = getRcConfigForCwd(cwd); + this.key = key; + this.chunks = []; - const argsForCommands = new (_map || _load_map()).default(); + stream.Writable.call(this, {}); +} +util.inherits(Verifier, stream.Writable); - for (const key in config) { - // args can be prefixed with the command name they're meant for, eg. - // `--install.check-files true` - const keyMatch = key.match(/^--(?:([^.]+)\.)?(.*)$/); - if (!keyMatch) { - continue; - } +Verifier.prototype._write = function (chunk, enc, cb) { + this.chunks.push(chunk); + cb(); +}; - const commandName = keyMatch[1] || '*'; - const arg = keyMatch[2]; - const value = config[key]; +Verifier.prototype.update = function (chunk) { + if (typeof (chunk) === 'string') + chunk = new Buffer(chunk, 'binary'); + this.chunks.push(chunk); +}; - // create args for this command name if we didn't previously have them - const args = argsForCommands.get(commandName) || []; - argsForCommands.set(commandName, args); +Verifier.prototype.verify = function (signature, fmt) { + var sig; + if (Signature.isSignature(signature, [2, 0])) { + if (signature.type !== 'ed25519') + return (false); + sig = signature.toBuffer('raw'); - // turn config value into appropriate cli flag - const option = (_commander || _load_commander()).default.optionFor(`--${arg}`); + } else if (typeof (signature) === 'string') { + sig = new Buffer(signature, 'base64'); - // If commander doesn't recognize the option or it takes a value after it - if (!option || option.optional || option.required) { - args.push(`--${arg}`, value); - } else if (value === true) { - // we can't force remove an arg from cli - args.push(`--${arg}`); - } - } + } else if (Signature.isSignature(signature, [1, 0])) { + throw (new Error('signature was created by too old ' + + 'a version of sshpk and cannot be verified')); + } - return argsForCommands; -} + assert.buffer(sig); + return (nacl.sign.detached.verify( + new Uint8Array(Buffer.concat(this.chunks)), + new Uint8Array(sig), + new Uint8Array(this.key.part.R.data))); +}; -// extract the value of a --cwd arg if present -function extractCwdArg(args) { - for (let i = 0, I = args.length; i < I; ++i) { - const arg = args[i]; - if (arg === '--') { - return null; - } else if (arg === '--cwd') { - return args[i + 1]; - } - } - return null; -} +function Signer(key, hashAlgo) { + if (nacl === undefined) + nacl = __webpack_require__(139); -// get a list of arguments from .yarnrc that apply to this commandName -function getRcArgs(commandName, args) { - let previousCwds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + if (hashAlgo.toLowerCase() !== 'sha512') + throw (new Error('ED25519 only supports the use of ' + + 'SHA-512 hashes')); - // for the cwd, use the --cwd arg if it was passed or else use process.cwd() - const origCwd = extractCwdArg(args) || process.cwd(); + this.key = key; + this.chunks = []; - // get a map of command names and their arguments - const argMap = buildRcArgs(origCwd); + stream.Writable.call(this, {}); +} +util.inherits(Signer, stream.Writable); - // concat wildcard arguments and arguments meant for this specific command - const newArgs = [].concat((0, (_toConsumableArray2 || _load_toConsumableArray()).default)(argMap.get('*') || []), (0, (_toConsumableArray2 || _load_toConsumableArray()).default)(argMap.get(commandName) || [])); +Signer.prototype._write = function (chunk, enc, cb) { + this.chunks.push(chunk); + cb(); +}; - // check if the .yarnrc args specified a cwd - const newCwd = extractCwdArg(newArgs); - if (newCwd && newCwd !== origCwd) { - // ensure that we don't enter into a loop - if (previousCwds.indexOf(newCwd) !== -1) { - throw new Error(`Recursive .yarnrc files specifying --cwd flags. Bailing out.`); - } +Signer.prototype.update = function (chunk) { + if (typeof (chunk) === 'string') + chunk = new Buffer(chunk, 'binary'); + this.chunks.push(chunk); +}; - // if we have a new cwd then let's refetch the .yarnrc args relative to it - return getRcArgs(commandName, newArgs, previousCwds.concat(origCwd)); - } +Signer.prototype.sign = function () { + var sig = nacl.sign.detached( + new Uint8Array(Buffer.concat(this.chunks)), + new Uint8Array(this.key.part.r.data)); + var sigBuf = new Buffer(sig); + var sigObj = Signature.parse(sigBuf, 'ed25519', 'raw'); + sigObj.hashAlgorithm = 'sha512'; + return (sigObj); +}; - return newArgs; -} /***/ }), -/* 319 */ +/* 317 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +// Copyright 2015 Joyent, Inc. +module.exports = { + read: read, + write: write +}; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = handleSignals; +var assert = __webpack_require__(16); +var utils = __webpack_require__(24); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(28); -var _child; +var pem = __webpack_require__(61); +var ssh = __webpack_require__(318); +var rfc4253 = __webpack_require__(68); -function _load_child() { - return _child = __webpack_require__(44); +function read(buf, options) { + if (typeof (buf) === 'string') { + if (buf.trim().match(/^[-]+[ ]*BEGIN/)) + return (pem.read(buf, options)); + if (buf.match(/^\s*ssh-[a-z]/)) + return (ssh.read(buf, options)); + if (buf.match(/^\s*ecdsa-/)) + return (ssh.read(buf, options)); + buf = new Buffer(buf, 'binary'); + } else { + assert.buffer(buf); + if (findPEMHeader(buf)) + return (pem.read(buf, options)); + if (findSSHHeader(buf)) + return (ssh.read(buf, options)); + } + if (buf.readUInt32BE(0) < buf.length) + return (rfc4253.read(buf, options)); + throw (new Error('Failed to auto-detect format of key')); } -function forwardSignalAndExit(signal) { - (0, (_child || _load_child()).forwardSignalToSpawnedProcesses)(signal); - // We want to exit immediately here since `SIGTERM` means that - // If we lose stdout messages due to abrupt exit, shoot the messenger? - process.exit(1); // eslint-disable-line no-process-exit +function findSSHHeader(buf) { + var offset = 0; + while (offset < buf.length && + (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9)) + ++offset; + if (offset + 4 <= buf.length && + buf.slice(offset, offset + 4).toString('ascii') === 'ssh-') + return (true); + if (offset + 6 <= buf.length && + buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-') + return (true); + return (false); } -function handleSignals() { - process.on('SIGTERM', () => { - forwardSignalAndExit('SIGTERM'); - }); + +function findPEMHeader(buf) { + var offset = 0; + while (offset < buf.length && + (buf[offset] === 32 || buf[offset] === 10)) + ++offset; + if (buf[offset] !== 45) + return (false); + while (offset < buf.length && + (buf[offset] === 45)) + ++offset; + while (offset < buf.length && + (buf[offset] === 32)) + ++offset; + if (offset + 5 > buf.length || + buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN') + return (false); + return (true); } -/***/ }), -/* 320 */ -/***/ (function(module, exports) { +function write(key, options) { + throw (new Error('"auto" format cannot be used for writing')); +} -var defaultConfig = { - uncaughtException: false, - SIGINT: true, - SIGTERM: true, - SIGQUIT: true -} +/***/ }), +/* 318 */ +/***/ (function(module, exports, __webpack_require__) { -var DEBUG = false +// Copyright 2015 Joyent, Inc. -function ON_DEATH (callback) { - var handlers = []; - Object.keys(defaultConfig).forEach(function(key) { - var val = defaultConfig[key] - var handler = null; - if (val) { - if (DEBUG) { - handler = function() { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift(key) - console.log('Trapped ' + key) - callback.apply(null, args) - }; - process.on(key, handler) - } else { - handler = function() { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift(key) - callback.apply(null, args) - } - process.on(key, handler) - } - handlers.push([key, handler]) - } - }) - return function OFF_DEATH() { - handlers.forEach(function (args) { - var key = args[0]; - var handler = args[1]; - process.removeListener(key, handler); - }) - } -} +module.exports = { + read: read, + write: write +}; -module.exports = function (arg) { - if (typeof arg === 'object') { - if (arg['debug']) - DEBUG = arg.debug - if (arg['DEBUG']) - DEBUG = arg.DEBUG - delete arg.debug; delete arg.DEBUG; +var assert = __webpack_require__(16); +var rfc4253 = __webpack_require__(68); +var utils = __webpack_require__(24); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(28); - Object.keys(arg).forEach(function(key) { - defaultConfig[key] = arg[key] - }) +var sshpriv = __webpack_require__(136); - if (DEBUG) - console.log('ON_DEATH: debug mode enabled for pid [%d]', process.pid) +/*JSSTYLED*/ +var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([\n \t]+([^\n]+))?$/; +/*JSSTYLED*/ +var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/ \t\n]+[=]*)(.*)$/; - return ON_DEATH - } else if (typeof arg === 'function') { - return ON_DEATH(arg) - } -} +function read(buf, options) { + if (typeof (buf) !== 'string') { + assert.buffer(buf, 'buf'); + buf = buf.toString('ascii'); + } + var trimmed = buf.trim().replace(/[\\\r]/g, ''); + var m = trimmed.match(SSHKEY_RE); + if (!m) + m = trimmed.match(SSHKEY_RE2); + assert.ok(m, 'key must match regex'); + var type = rfc4253.algToKeyType(m[1]); + var kbuf = new Buffer(m[2], 'base64'); -/***/ }), -/* 321 */ -/***/ (function(module, exports, __webpack_require__) { + /* + * This is a bit tricky. If we managed to parse the key and locate the + * key comment with the regex, then do a non-partial read and assert + * that we have consumed all bytes. If we couldn't locate the key + * comment, though, there may be whitespace shenanigans going on that + * have conjoined the comment to the rest of the key. We do a partial + * read in this case to try to make the best out of a sorry situation. + */ + var key; + var ret = {}; + if (m[4]) { + try { + key = rfc4253.read(kbuf); -"use strict"; + } catch (e) { + m = trimmed.match(SSHKEY_RE2); + assert.ok(m, 'key must match regex'); + kbuf = new Buffer(m[2], 'base64'); + key = rfc4253.readInternal(ret, 'public', kbuf); + } + } else { + key = rfc4253.readInternal(ret, 'public', kbuf); + } -var util = __webpack_require__(2); -var onExit = __webpack_require__(296); -var currentlyUnhandled = __webpack_require__(501); + assert.strictEqual(type, key.type); -var installed = false; + if (m[4] && m[4].length > 0) { + key.comment = m[4]; -module.exports = function (log) { - if (installed) { - return; - } + } else if (ret.consumed) { + /* + * Now the magic: trying to recover the key comment when it's + * gotten conjoined to the key or otherwise shenanigan'd. + * + * Work out how much base64 we used, then drop all non-base64 + * chars from the beginning up to this point in the the string. + * Then offset in this and try to make up for missing = chars. + */ + var data = m[2] + m[3]; + var realOffset = Math.ceil(ret.consumed / 3) * 4; + data = data.slice(0, realOffset - 2). /*JSSTYLED*/ + replace(/[^a-zA-Z0-9+\/=]/g, '') + + data.slice(realOffset - 2); - installed = true; + var padding = ret.consumed % 3; + if (padding > 0 && + data.slice(realOffset - 1, realOffset) !== '=') + realOffset--; + while (data.slice(realOffset, realOffset + 1) === '=') + realOffset++; - log = log || console.error; + /* Finally, grab what we think is the comment & clean it up. */ + var trailer = data.slice(realOffset); + trailer = trailer.replace(/[\r\n]/g, ' '). + replace(/^\s+/, ''); + if (trailer.match(/^[a-zA-Z0-9]/)) + key.comment = trailer; + } - var listUnhandled = currentlyUnhandled(); + return (key); +} - onExit(function () { - var unhandledRejections = listUnhandled(); +function write(key, options) { + assert.object(key); + if (!Key.isKey(key)) + throw (new Error('Must be a public key')); - if (unhandledRejections.length > 0) { - unhandledRejections.forEach(function (x) { - var err = x.reason; + var parts = []; + var alg = rfc4253.keyTypeToAlg(key); + parts.push(alg); - if (!(err instanceof Error)) { - err = new Error('Promise rejected with value: ' + util.inspect(err)); - } + var buf = rfc4253.write(key); + parts.push(buf.toString('base64')); - log(err.stack); - }); + if (key.comment) + parts.push(key.comment); - process.exitCode = 1; - } - }); -}; + return (new Buffer(parts.join(' '))); +} /***/ }), -/* 322 */ +/* 319 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +// Copyright 2017 Joyent, Inc. +module.exports = { + read: read, + verify: verify, + sign: sign, + signAsync: signAsync, + write: write +}; -const fs = __webpack_require__(271); -const path = __webpack_require__(1); -const retry = __webpack_require__(659); -const syncFs = __webpack_require__(631); +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(52); +var algs = __webpack_require__(26); +var utils = __webpack_require__(24); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(28); +var pem = __webpack_require__(61); +var Identity = __webpack_require__(103); +var Signature = __webpack_require__(50); +var Certificate = __webpack_require__(100); +var pkcs8 = __webpack_require__(102); -const locks = {}; +/* + * This file is based on RFC5280 (X.509). + */ -function getLockFile(file) { - return `${file}.lock`; +/* Helper to read in a single mpint */ +function readMPInt(der, nm) { + assert.strictEqual(der.peek(), asn1.Ber.Integer, + nm + ' is not an Integer'); + return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } -function canonicalPath(file, options, callback) { - if (!options.realpath) { - return callback(null, path.resolve(file)); - } +function verify(cert, key) { + var sig = cert.signatures.x509; + assert.object(sig, 'x509 signature'); - // Use realpath to resolve symlinks - // It also resolves relative paths - options.fs.realpath(file, callback); + var algParts = sig.algo.split('-'); + if (algParts[0] !== key.type) + return (false); + + var blob = sig.cache; + if (blob === undefined) { + var der = new asn1.BerWriter(); + writeTBSCert(cert, der); + blob = der.buffer; + } + + var verifier = key.createVerify(algParts[1]); + verifier.write(blob); + return (verifier.verify(sig.signature)); } -function acquireLock(file, options, callback) { - // Use mkdir to create the lockfile (atomic operation) - options.fs.mkdir(getLockFile(file), (err) => { - // If successful, we are done - if (!err) { - return callback(); - } +function Local(i) { + return (asn1.Ber.Context | asn1.Ber.Constructor | i); +} - // If error is not EEXIST then some other error occurred while locking - if (err.code !== 'EEXIST') { - return callback(err); - } +function Context(i) { + return (asn1.Ber.Context | i); +} - // Otherwise, check if lock is stale by analyzing the file mtime - if (options.stale <= 0) { - return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file })); - } +var SIGN_ALGS = { + 'rsa-md5': '1.2.840.113549.1.1.4', + 'rsa-sha1': '1.2.840.113549.1.1.5', + 'rsa-sha256': '1.2.840.113549.1.1.11', + 'rsa-sha384': '1.2.840.113549.1.1.12', + 'rsa-sha512': '1.2.840.113549.1.1.13', + 'dsa-sha1': '1.2.840.10040.4.3', + 'dsa-sha256': '2.16.840.1.101.3.4.3.2', + 'ecdsa-sha1': '1.2.840.10045.4.1', + 'ecdsa-sha256': '1.2.840.10045.4.3.2', + 'ecdsa-sha384': '1.2.840.10045.4.3.3', + 'ecdsa-sha512': '1.2.840.10045.4.3.4' +}; +Object.keys(SIGN_ALGS).forEach(function (k) { + SIGN_ALGS[SIGN_ALGS[k]] = k; +}); +SIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5'; +SIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1'; - options.fs.stat(getLockFile(file), (err, stat) => { - if (err) { - // Retry if the lockfile has been removed (meanwhile) - // Skip stale check to avoid recursiveness - if (err.code === 'ENOENT') { - return acquireLock(file, Object.assign({}, options, { stale: 0 }), callback); - } +var EXTS = { + 'issuerKeyId': '2.5.29.35', + 'altName': '2.5.29.17', + 'basicConstraints': '2.5.29.19', + 'keyUsage': '2.5.29.15', + 'extKeyUsage': '2.5.29.37' +}; - return callback(err); - } +function read(buf, options) { + if (typeof (buf) === 'string') { + buf = new Buffer(buf, 'binary'); + } + assert.buffer(buf, 'buf'); - if (!isLockStale(stat, options)) { - return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file })); - } + var der = new asn1.BerReader(buf); - // If it's stale, remove it and try again! - // Skip stale check to avoid recursiveness - removeLock(file, options, (err) => { - if (err) { - return callback(err); - } + der.readSequence(); + if (Math.abs(der.length - der.remain) > 1) { + throw (new Error('DER sequence does not contain whole byte ' + + 'stream')); + } - acquireLock(file, Object.assign({}, options, { stale: 0 }), callback); - }); - }); - }); -} + var tbsStart = der.offset; + der.readSequence(); + var sigOffset = der.offset + der.length; + var tbsEnd = sigOffset; -function isLockStale(stat, options) { - return stat.mtime.getTime() < Date.now() - options.stale; -} + if (der.peek() === Local(0)) { + der.readSequence(Local(0)); + var version = der.readInt(); + assert.ok(version <= 3, + 'only x.509 versions up to v3 supported'); + } -function removeLock(file, options, callback) { - // Remove lockfile, ignoring ENOENT errors - options.fs.rmdir(getLockFile(file), (err) => { - if (err && err.code !== 'ENOENT') { - return callback(err); - } + var cert = {}; + cert.signatures = {}; + var sig = (cert.signatures.x509 = {}); + sig.extras = {}; - callback(); - }); -} + cert.serial = readMPInt(der, 'serial'); -function updateLock(file, options) { - const lock = locks[file]; + der.readSequence(); + var after = der.offset + der.length; + var certAlgOid = der.readOID(); + var certAlg = SIGN_ALGS[certAlgOid]; + if (certAlg === undefined) + throw (new Error('unknown signature algorithm ' + certAlgOid)); - /* istanbul ignore next */ - if (lock.updateTimeout) { - return; - } + der._offset = after; + cert.issuer = Identity.parseAsn1(der); - lock.updateDelay = lock.updateDelay || options.update; - lock.updateTimeout = setTimeout(() => { - const mtime = Date.now() / 1000; + der.readSequence(); + cert.validFrom = readDate(der); + cert.validUntil = readDate(der); - lock.updateTimeout = null; + cert.subjects = [Identity.parseAsn1(der)]; - options.fs.utimes(getLockFile(file), mtime, mtime, (err) => { - // Ignore if the lock was released - if (lock.released) { - return; - } + der.readSequence(); + after = der.offset + der.length; + cert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der); + der._offset = after; - // Verify if we are within the stale threshold - if (lock.lastUpdate <= Date.now() - options.stale && - lock.lastUpdate > Date.now() - options.stale * 2) { - return compromisedLock(file, lock, Object.assign(new Error(lock.updateError || 'Unable to update lock within the stale \ -threshold'), { code: 'ECOMPROMISED' })); - } + /* issuerUniqueID */ + if (der.peek() === Local(1)) { + der.readSequence(Local(1)); + sig.extras.issuerUniqueID = + buf.slice(der.offset, der.offset + der.length); + der._offset += der.length; + } - // If the file is older than (stale * 2), we assume the clock is moved manually, - // which we consider a valid case + /* subjectUniqueID */ + if (der.peek() === Local(2)) { + der.readSequence(Local(2)); + sig.extras.subjectUniqueID = + buf.slice(der.offset, der.offset + der.length); + der._offset += der.length; + } - // If it failed to update the lockfile, keep trying unless - // the lockfile was deleted! - if (err) { - if (err.code === 'ENOENT') { - return compromisedLock(file, lock, Object.assign(err, { code: 'ECOMPROMISED' })); - } + /* extensions */ + if (der.peek() === Local(3)) { + der.readSequence(Local(3)); + var extEnd = der.offset + der.length; + der.readSequence(); - lock.updateError = err; - lock.updateDelay = 1000; - return updateLock(file, options); - } + while (der.offset < extEnd) + readExtension(cert, buf, der); - // All ok, keep updating.. - lock.lastUpdate = Date.now(); - lock.updateError = null; - lock.updateDelay = null; - updateLock(file, options); - }); - }, lock.updateDelay); + assert.strictEqual(der.offset, extEnd); + } - // Unref the timer so that the nodejs process can exit freely - // This is safe because all acquired locks will be automatically released - // on process exit + assert.strictEqual(der.offset, sigOffset); - // We first check that `lock.updateTimeout.unref` exists because some users - // may be using this module outside of NodeJS (e.g., in an electron app), - // and in those cases `setTimeout` return an integer. - if (lock.updateTimeout.unref) { - lock.updateTimeout.unref(); - } -} + der.readSequence(); + after = der.offset + der.length; + var sigAlgOid = der.readOID(); + var sigAlg = SIGN_ALGS[sigAlgOid]; + if (sigAlg === undefined) + throw (new Error('unknown signature algorithm ' + sigAlgOid)); + der._offset = after; -function compromisedLock(file, lock, err) { - lock.released = true; // Signal the lock has been released - /* istanbul ignore next */ - lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update + var sigData = der.readString(asn1.Ber.BitString, true); + if (sigData[0] === 0) + sigData = sigData.slice(1); + var algParts = sigAlg.split('-'); - if (locks[file] === lock) { - delete locks[file]; - } + sig.signature = Signature.parse(sigData, algParts[0], 'asn1'); + sig.signature.hashAlgorithm = algParts[1]; + sig.algo = sigAlg; + sig.cache = buf.slice(tbsStart, tbsEnd); - lock.compromised(err); + return (new Certificate(cert)); } -// ----------------------------------------- - -function lock(file, options, compromised, callback) { - if (typeof options === 'function') { - callback = compromised; - compromised = options; - options = null; - } +function readDate(der) { + if (der.peek() === asn1.Ber.UTCTime) { + return (utcTimeToDate(der.readString(asn1.Ber.UTCTime))); + } else if (der.peek() === asn1.Ber.GeneralizedTime) { + return (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime))); + } else { + throw (new Error('Unsupported date format')); + } +} - if (!callback) { - callback = compromised; - compromised = null; - } +/* RFC5280, section 4.2.1.6 (GeneralName type) */ +var ALTNAME = { + OtherName: Local(0), + RFC822Name: Context(1), + DNSName: Context(2), + X400Address: Local(3), + DirectoryName: Local(4), + EDIPartyName: Local(5), + URI: Context(6), + IPAddress: Context(7), + OID: Context(8) +}; - options = Object.assign({ - stale: 10000, - update: null, - realpath: true, - retries: 0, - fs, - }, options); +/* RFC5280, section 4.2.1.12 (KeyPurposeId) */ +var EXTPURPOSE = { + 'serverAuth': '1.3.6.1.5.5.7.3.1', + 'clientAuth': '1.3.6.1.5.5.7.3.2', + 'codeSigning': '1.3.6.1.5.5.7.3.3', - options.retries = options.retries || 0; - options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries; - options.stale = Math.max(options.stale || 0, 2000); - options.update = options.update == null ? options.stale / 2 : options.update || 0; - options.update = Math.max(Math.min(options.update, options.stale / 2), 1000); - compromised = compromised || function (err) { throw err; }; + /* See https://github.com/joyent/oid-docs/blob/master/root.md */ + 'joyentDocker': '1.3.6.1.4.1.38678.1.4.1', + 'joyentCmon': '1.3.6.1.4.1.38678.1.4.2' +}; +var EXTPURPOSE_REV = {}; +Object.keys(EXTPURPOSE).forEach(function (k) { + EXTPURPOSE_REV[EXTPURPOSE[k]] = k; +}); - // Resolve to a canonical file path - canonicalPath(file, options, (err, file) => { - if (err) { - return callback(err); - } +var KEYUSEBITS = [ + 'signature', 'identity', 'keyEncryption', + 'encryption', 'keyAgreement', 'ca', 'crl' +]; - // Attempt to acquire the lock - const operation = retry.operation(options.retries); +function readExtension(cert, buf, der) { + der.readSequence(); + var after = der.offset + der.length; + var extId = der.readOID(); + var id; + var sig = cert.signatures.x509; + sig.extras.exts = []; - operation.attempt(() => { - acquireLock(file, options, (err) => { - if (operation.retry(err)) { - return; - } + var critical; + if (der.peek() === asn1.Ber.Boolean) + critical = der.readBoolean(); - if (err) { - return callback(operation.mainError()); - } + switch (extId) { + case (EXTS.basicConstraints): + der.readSequence(asn1.Ber.OctetString); + der.readSequence(); + var bcEnd = der.offset + der.length; + var ca = false; + if (der.peek() === asn1.Ber.Boolean) + ca = der.readBoolean(); + if (cert.purposes === undefined) + cert.purposes = []; + if (ca === true) + cert.purposes.push('ca'); + var bc = { oid: extId, critical: critical }; + if (der.offset < bcEnd && der.peek() === asn1.Ber.Integer) + bc.pathLen = der.readInt(); + sig.extras.exts.push(bc); + break; + case (EXTS.extKeyUsage): + der.readSequence(asn1.Ber.OctetString); + der.readSequence(); + if (cert.purposes === undefined) + cert.purposes = []; + var ekEnd = der.offset + der.length; + while (der.offset < ekEnd) { + var oid = der.readOID(); + cert.purposes.push(EXTPURPOSE_REV[oid] || oid); + } + /* + * This is a bit of a hack: in the case where we have a cert + * that's only allowed to do serverAuth or clientAuth (and not + * the other), we want to make sure all our Subjects are of + * the right type. But we already parsed our Subjects and + * decided if they were hosts or users earlier (since it appears + * first in the cert). + * + * So we go through and mutate them into the right kind here if + * it doesn't match. This might not be hugely beneficial, as it + * seems that single-purpose certs are not often seen in the + * wild. + */ + if (cert.purposes.indexOf('serverAuth') !== -1 && + cert.purposes.indexOf('clientAuth') === -1) { + cert.subjects.forEach(function (ide) { + if (ide.type !== 'host') { + ide.type = 'host'; + ide.hostname = ide.uid || + ide.email || + ide.components[0].value; + } + }); + } else if (cert.purposes.indexOf('clientAuth') !== -1 && + cert.purposes.indexOf('serverAuth') === -1) { + cert.subjects.forEach(function (ide) { + if (ide.type !== 'user') { + ide.type = 'user'; + ide.uid = ide.hostname || + ide.email || + ide.components[0].value; + } + }); + } + sig.extras.exts.push({ oid: extId, critical: critical }); + break; + case (EXTS.keyUsage): + der.readSequence(asn1.Ber.OctetString); + var bits = der.readString(asn1.Ber.BitString, true); + var setBits = readBitField(bits, KEYUSEBITS); + setBits.forEach(function (bit) { + if (cert.purposes === undefined) + cert.purposes = []; + if (cert.purposes.indexOf(bit) === -1) + cert.purposes.push(bit); + }); + sig.extras.exts.push({ oid: extId, critical: critical, + bits: bits }); + break; + case (EXTS.altName): + der.readSequence(asn1.Ber.OctetString); + der.readSequence(); + var aeEnd = der.offset + der.length; + while (der.offset < aeEnd) { + switch (der.peek()) { + case ALTNAME.OtherName: + case ALTNAME.EDIPartyName: + der.readSequence(); + der._offset += der.length; + break; + case ALTNAME.OID: + der.readOID(ALTNAME.OID); + break; + case ALTNAME.RFC822Name: + /* RFC822 specifies email addresses */ + var email = der.readString(ALTNAME.RFC822Name); + id = Identity.forEmail(email); + if (!cert.subjects[0].equals(id)) + cert.subjects.push(id); + break; + case ALTNAME.DirectoryName: + der.readSequence(ALTNAME.DirectoryName); + id = Identity.parseAsn1(der); + if (!cert.subjects[0].equals(id)) + cert.subjects.push(id); + break; + case ALTNAME.DNSName: + var host = der.readString( + ALTNAME.DNSName); + id = Identity.forHost(host); + if (!cert.subjects[0].equals(id)) + cert.subjects.push(id); + break; + default: + der.readString(der.peek()); + break; + } + } + sig.extras.exts.push({ oid: extId, critical: critical }); + break; + default: + sig.extras.exts.push({ + oid: extId, + critical: critical, + data: der.readString(asn1.Ber.OctetString, true) + }); + break; + } - // We now own the lock - const lock = locks[file] = { - options, - compromised, - lastUpdate: Date.now(), - }; + der._offset = after; +} - // We must keep the lock fresh to avoid staleness - updateLock(file, options); +var UTCTIME_RE = + /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; +function utcTimeToDate(t) { + var m = t.match(UTCTIME_RE); + assert.ok(m, 'timestamps must be in UTC'); + var d = new Date(); - callback(null, (releasedCallback) => { - if (lock.released) { - return releasedCallback && - releasedCallback(Object.assign(new Error('Lock is already released'), { code: 'ERELEASED' })); - } + var thisYear = d.getUTCFullYear(); + var century = Math.floor(thisYear / 100) * 100; - // Not necessary to use realpath twice when unlocking - unlock(file, Object.assign({}, options, { realpath: false }), releasedCallback); - }); - }); - }); - }); + var year = parseInt(m[1], 10); + if (thisYear % 100 < 50 && year >= 60) + year += (century - 1); + else + year += century; + d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10)); + d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); + if (m[6] && m[6].length > 0) + d.setUTCSeconds(parseInt(m[6], 10)); + return (d); } -function unlock(file, options, callback) { - if (typeof options === 'function') { - callback = options; - options = null; - } +var GTIME_RE = + /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; +function gTimeToDate(t) { + var m = t.match(GTIME_RE); + assert.ok(m); + var d = new Date(); - options = Object.assign({ - fs, - realpath: true, - }, options); + d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1, + parseInt(m[3], 10)); + d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); + if (m[6] && m[6].length > 0) + d.setUTCSeconds(parseInt(m[6], 10)); + return (d); +} - callback = callback || function () {}; +function zeroPad(n) { + var s = '' + n; + while (s.length < 2) + s = '0' + s; + return (s); +} - // Resolve to a canonical file path - canonicalPath(file, options, (err, file) => { - if (err) { - return callback(err); - } +function dateToUTCTime(d) { + var s = ''; + s += zeroPad(d.getUTCFullYear() % 100); + s += zeroPad(d.getUTCMonth() + 1); + s += zeroPad(d.getUTCDate()); + s += zeroPad(d.getUTCHours()); + s += zeroPad(d.getUTCMinutes()); + s += zeroPad(d.getUTCSeconds()); + s += 'Z'; + return (s); +} - // Skip if the lock is not acquired - const lock = locks[file]; +function sign(cert, key) { + if (cert.signatures.x509 === undefined) + cert.signatures.x509 = {}; + var sig = cert.signatures.x509; - if (!lock) { - return callback(Object.assign(new Error('Lock is not acquired/owned by you'), { code: 'ENOTACQUIRED' })); - } + sig.algo = key.type + '-' + key.defaultHashAlgorithm(); + if (SIGN_ALGS[sig.algo] === undefined) + return (false); - lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update - lock.released = true; // Signal the lock has been released - delete locks[file]; // Delete from locks + var der = new asn1.BerWriter(); + writeTBSCert(cert, der); + var blob = der.buffer; + sig.cache = blob; - removeLock(file, options, callback); - }); + var signer = key.createSign(); + signer.write(blob); + cert.signatures.x509.signature = signer.sign(); + + return (true); } -function lockSync(file, options, compromised) { - if (typeof options === 'function') { - compromised = options; - options = null; - } +function signAsync(cert, signer, done) { + if (cert.signatures.x509 === undefined) + cert.signatures.x509 = {}; + var sig = cert.signatures.x509; - options = options || {}; - options.fs = syncFs(options.fs || fs); - options.retries = options.retries || 0; - options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries; + var der = new asn1.BerWriter(); + writeTBSCert(cert, der); + var blob = der.buffer; + sig.cache = blob; - // Retries are not allowed because it requires the flow to be sync - if (options.retries.retries) { - throw Object.assign(new Error('Cannot use retries with the sync api'), { code: 'ESYNC' }); - } + signer(blob, function (err, signature) { + if (err) { + done(err); + return; + } + sig.algo = signature.type + '-' + signature.hashAlgorithm; + if (SIGN_ALGS[sig.algo] === undefined) { + done(new Error('Invalid signing algorithm "' + + sig.algo + '"')); + return; + } + sig.signature = signature; + done(); + }); +} - let err; - let release; +function write(cert, options) { + var sig = cert.signatures.x509; + assert.object(sig, 'x509 signature'); - lock(file, options, compromised, (_err, _release) => { - err = _err; - release = _release; - }); + var der = new asn1.BerWriter(); + der.startSequence(); + if (sig.cache) { + der._ensure(sig.cache.length); + sig.cache.copy(der._buf, der._offset); + der._offset += sig.cache.length; + } else { + writeTBSCert(cert, der); + } - if (err) { - throw err; - } + der.startSequence(); + der.writeOID(SIGN_ALGS[sig.algo]); + if (sig.algo.match(/^rsa-/)) + der.writeNull(); + der.endSequence(); - return release; + var sigData = sig.signature.toBuffer('asn1'); + var data = new Buffer(sigData.length + 1); + data[0] = 0; + sigData.copy(data, 1); + der.writeBuffer(data, asn1.Ber.BitString); + der.endSequence(); + + return (der.buffer); } -function unlockSync(file, options) { - options = options || {}; - options.fs = syncFs(options.fs || fs); +function writeTBSCert(cert, der) { + var sig = cert.signatures.x509; + assert.object(sig, 'x509 signature'); - let err; + der.startSequence(); - unlock(file, options, (_err) => { - err = _err; - }); + der.startSequence(Local(0)); + der.writeInt(2); + der.endSequence(); - if (err) { - throw err; - } -} + der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer); -function check(file, options, callback) { - if (typeof options === 'function') { - callback = options; - options = null; - } + der.startSequence(); + der.writeOID(SIGN_ALGS[sig.algo]); + der.endSequence(); - options = Object.assign({ - stale: 10000, - realpath: true, - fs, - }, options); + cert.issuer.toAsn1(der); - options.stale = Math.max(options.stale || 0, 2000); + der.startSequence(); + der.writeString(dateToUTCTime(cert.validFrom), asn1.Ber.UTCTime); + der.writeString(dateToUTCTime(cert.validUntil), asn1.Ber.UTCTime); + der.endSequence(); - // Resolve to a canonical file path - canonicalPath(file, options, (err, file) => { - if (err) { - return callback(err); - } + var subject = cert.subjects[0]; + var altNames = cert.subjects.slice(1); + subject.toAsn1(der); - // Check if lockfile exists - options.fs.stat(getLockFile(file), (err, stat) => { - if (err) { - // if does not exist, file is not locked. Otherwise, callback with error - return (err.code === 'ENOENT') ? callback(null, false) : callback(err); - } + pkcs8.writePkcs8(der, cert.subjectKey); - if (options.stale <= 0) { return callback(null, true); } + if (sig.extras && sig.extras.issuerUniqueID) { + der.writeBuffer(sig.extras.issuerUniqueID, Local(1)); + } - // Otherwise, check if lock is stale by analyzing the file mtime - return callback(null, !isLockStale(stat, options)); - }); - }); -} + if (sig.extras && sig.extras.subjectUniqueID) { + der.writeBuffer(sig.extras.subjectUniqueID, Local(2)); + } -function checkSync(file, options) { - options = options || {}; - options.fs = syncFs(options.fs || fs); + if (altNames.length > 0 || subject.type === 'host' || + (cert.purposes !== undefined && cert.purposes.length > 0) || + (sig.extras && sig.extras.exts)) { + der.startSequence(Local(3)); + der.startSequence(); - let err; - let locked; + var exts = []; + if (cert.purposes !== undefined && cert.purposes.length > 0) { + exts.push({ + oid: EXTS.basicConstraints, + critical: true + }); + exts.push({ + oid: EXTS.keyUsage, + critical: true + }); + exts.push({ + oid: EXTS.extKeyUsage, + critical: true + }); + } + exts.push({ oid: EXTS.altName }); + if (sig.extras && sig.extras.exts) + exts = sig.extras.exts; - check(file, options, (_err, _locked) => { - err = _err; - locked = _locked; - }); + for (var i = 0; i < exts.length; ++i) { + der.startSequence(); + der.writeOID(exts[i].oid); - if (err) { - throw err; - } + if (exts[i].critical !== undefined) + der.writeBoolean(exts[i].critical); - return locked; -} + if (exts[i].oid === EXTS.altName) { + der.startSequence(asn1.Ber.OctetString); + der.startSequence(); + if (subject.type === 'host') { + der.writeString(subject.hostname, + Context(2)); + } + for (var j = 0; j < altNames.length; ++j) { + if (altNames[j].type === 'host') { + der.writeString( + altNames[j].hostname, + ALTNAME.DNSName); + } else if (altNames[j].type === + 'email') { + der.writeString( + altNames[j].email, + ALTNAME.RFC822Name); + } else { + /* + * Encode anything else as a + * DN style name for now. + */ + der.startSequence( + ALTNAME.DirectoryName); + altNames[j].toAsn1(der); + der.endSequence(); + } + } + der.endSequence(); + der.endSequence(); + } else if (exts[i].oid === EXTS.basicConstraints) { + der.startSequence(asn1.Ber.OctetString); + der.startSequence(); + var ca = (cert.purposes.indexOf('ca') !== -1); + var pathLen = exts[i].pathLen; + der.writeBoolean(ca); + if (pathLen !== undefined) + der.writeInt(pathLen); + der.endSequence(); + der.endSequence(); + } else if (exts[i].oid === EXTS.extKeyUsage) { + der.startSequence(asn1.Ber.OctetString); + der.startSequence(); + cert.purposes.forEach(function (purpose) { + if (purpose === 'ca') + return; + if (KEYUSEBITS.indexOf(purpose) !== -1) + return; + var oid = purpose; + if (EXTPURPOSE[purpose] !== undefined) + oid = EXTPURPOSE[purpose]; + der.writeOID(oid); + }); + der.endSequence(); + der.endSequence(); + } else if (exts[i].oid === EXTS.keyUsage) { + der.startSequence(asn1.Ber.OctetString); + /* + * If we parsed this certificate from a byte + * stream (i.e. we didn't generate it in sshpk) + * then we'll have a ".bits" property on the + * ext with the original raw byte contents. + * + * If we have this, use it here instead of + * regenerating it. This guarantees we output + * the same data we parsed, so signatures still + * validate. + */ + if (exts[i].bits !== undefined) { + der.writeBuffer(exts[i].bits, + asn1.Ber.BitString); + } else { + var bits = writeBitField(cert.purposes, + KEYUSEBITS); + der.writeBuffer(bits, + asn1.Ber.BitString); + } + der.endSequence(); + } else { + der.writeBuffer(exts[i].data, + asn1.Ber.OctetString); + } + der.endSequence(); + } -// Remove acquired locks on exit -/* istanbul ignore next */ -process.on('exit', () => { - Object.keys(locks).forEach((file) => { - try { locks[file].options.fs.rmdirSync(getLockFile(file)); } catch (e) { /* empty */ } - }); -}); + der.endSequence(); + der.endSequence(); + } -module.exports = lock; -module.exports.lock = lock; -module.exports.unlock = unlock; -module.exports.lockSync = lockSync; -module.exports.unlockSync = unlockSync; -module.exports.check = check; -module.exports.checkSync = checkSync; + der.endSequence(); +} + +/* + * Reads an ASN.1 BER bitfield out of the Buffer produced by doing + * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw + * contents of the BitString tag, which is a count of unused bits followed by + * the bits as a right-padded byte string. + * + * `bits` is the Buffer, `bitIndex` should contain an array of string names + * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec. + * + * Returns an array of Strings, the names of the bits that were set to 1. + */ +function readBitField(bits, bitIndex) { + var bitLen = 8 * (bits.length - 1) - bits[0]; + var setBits = {}; + for (var i = 0; i < bitLen; ++i) { + var byteN = 1 + Math.floor(i / 8); + var bit = 7 - (i % 8); + var mask = 1 << bit; + var bitVal = ((bits[byteN] & mask) !== 0); + var name = bitIndex[i]; + if (bitVal && typeof (name) === 'string') { + setBits[name] = true; + } + } + return (Object.keys(setBits)); +} + +/* + * `setBits` is an array of strings, containing the names for each bit that + * sould be set to 1. `bitIndex` is same as in `readBitField()`. + * + * Returns a Buffer, ready to be written out with `BerWriter#writeString()`. + */ +function writeBitField(setBits, bitIndex) { + var bitLen = bitIndex.length; + var blen = Math.ceil(bitLen / 8); + var unused = blen * 8 - bitLen; + var bits = new Buffer(1 + blen); + bits.fill(0); + bits[0] = unused; + for (var i = 0; i < bitLen; ++i) { + var byteN = 1 + Math.floor(i / 8); + var bit = 7 - (i % 8); + var mask = 1 << bit; + var name = bitIndex[i]; + if (name === undefined) + continue; + var bitVal = (setBits.indexOf(name) !== -1); + if (bitVal) { + bits[byteN] |= mask; + } + } + return (bits); +} /***/ }), -/* 323 */ +/* 320 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +module.exports = x => { + if (typeof x !== 'string') { + throw new TypeError('Expected a string, got ' + typeof x); + } + + // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string + // conversion translates it to FEFF (UTF-16 BOM) + if (x.charCodeAt(0) === 0xFEFF) { + return x.slice(1); + } -var compileSchema = __webpack_require__(328) - , resolve = __webpack_require__(197) - , Cache = __webpack_require__(324) - , SchemaObject = __webpack_require__(198) - , stableStringify = __webpack_require__(177) - , formats = __webpack_require__(327) - , rules = __webpack_require__(329) - , v5 = __webpack_require__(353) - , util = __webpack_require__(59) - , async = __webpack_require__(195) - , co = __webpack_require__(241); + return x; +}; -module.exports = Ajv; -Ajv.prototype.compileAsync = async.compile; +/***/ }), +/* 321 */ +/***/ (function(module, exports) { -var customKeyword = __webpack_require__(350); -Ajv.prototype.addKeyword = customKeyword.add; -Ajv.prototype.getKeyword = customKeyword.get; -Ajv.prototype.removeKeyword = customKeyword.remove; -Ajv.ValidationError = __webpack_require__(199); +var ZEROS = '0000000000000000000' +var SEVENS = '7777777777777777777' +var ZERO_OFFSET = '0'.charCodeAt(0) +var USTAR = 'ustar\x0000' +var MASK = parseInt('7777', 8) -var META_SCHEMA_ID = 'http://json-schema.org/draft-04/schema'; -var SCHEMA_URI_FORMAT = /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i; -function SCHEMA_URI_FORMAT_FUNC(str) { - return SCHEMA_URI_FORMAT.test(str); +var clamp = function (index, len, defaultValue) { + if (typeof index !== 'number') return defaultValue + index = ~~index // Coerce to integer. + if (index >= len) return len + if (index >= 0) return index + index += len + if (index >= 0) return index + return 0 } -var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ]; +var toType = function (flag) { + switch (flag) { + case 0: + return 'file' + case 1: + return 'link' + case 2: + return 'symlink' + case 3: + return 'character-device' + case 4: + return 'block-device' + case 5: + return 'directory' + case 6: + return 'fifo' + case 7: + return 'contiguous-file' + case 72: + return 'pax-header' + case 55: + return 'pax-global-header' + case 27: + return 'gnu-long-link-path' + case 28: + case 30: + return 'gnu-long-path' + } -/** - * Creates validator instance. - * Usage: `Ajv(opts)` - * @param {Object} opts optional options - * @return {Object} ajv instance - */ -function Ajv(opts) { - if (!(this instanceof Ajv)) return new Ajv(opts); - var self = this; + return null +} - opts = this._opts = util.copy(opts) || {}; - this._schemas = {}; - this._refs = {}; - this._fragments = {}; - this._formats = formats(opts.format); - this._cache = opts.cache || new Cache; - this._loadingSchemas = {}; - this._compilations = []; - this.RULES = rules(); +var toTypeflag = function (flag) { + switch (flag) { + case 'file': + return 0 + case 'link': + return 1 + case 'symlink': + return 2 + case 'character-device': + return 3 + case 'block-device': + return 4 + case 'directory': + return 5 + case 'fifo': + return 6 + case 'contiguous-file': + return 7 + case 'pax-header': + return 72 + } - // this is done on purpose, so that methods are bound to the instance - // (without using bind) so that they can be used without the instance - this.validate = validate; - this.compile = compile; - this.addSchema = addSchema; - this.addMetaSchema = addMetaSchema; - this.validateSchema = validateSchema; - this.getSchema = getSchema; - this.removeSchema = removeSchema; - this.addFormat = addFormat; - this.errorsText = errorsText; + return 0 +} - this._addSchema = _addSchema; - this._compile = _compile; +var alloc = function (size) { + var buf = new Buffer(size) + buf.fill(0) + return buf +} - opts.loopRequired = opts.loopRequired || Infinity; - if (opts.async || opts.transpile) async.setup(opts); - if (opts.beautify === true) opts.beautify = { indent_size: 2 }; - if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; - this._metaOpts = getMetaSchemaOptions(); +var indexOf = function (block, num, offset, end) { + for (; offset < end; offset++) { + if (block[offset] === num) return offset + } + return end +} - if (opts.formats) addInitialFormats(); - addDraft4MetaSchema(); - if (opts.v5) v5.enable(this); - if (typeof opts.meta == 'object') addMetaSchema(opts.meta); - addInitialSchemas(); +var cksum = function (block) { + var sum = 8 * 32 + for (var i = 0; i < 148; i++) sum += block[i] + for (var j = 156; j < 512; j++) sum += block[j] + return sum +} +var encodeOct = function (val, n) { + val = val.toString(8) + if (val.length > n) return SEVENS.slice(0, n) + ' ' + else return ZEROS.slice(0, n - val.length) + val + ' ' +} - /** - * Validate data using schema - * Schema will be compiled and cached (using serialized JSON as key. [json-stable-stringify](https://github.com/substack/json-stable-stringify) is used to serialize. - * @param {String|Object} schemaKeyRef key, ref or schema object - * @param {Any} data to be validated - * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). - */ - function validate(schemaKeyRef, data) { - var v; - if (typeof schemaKeyRef == 'string') { - v = getSchema(schemaKeyRef); - if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); - } else { - var schemaObj = _addSchema(schemaKeyRef); - v = schemaObj.validate || _compile(schemaObj); - } +/* Copied from the node-tar repo and modified to meet + * tar-stream coding standard. + * + * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349 + */ +function parse256 (buf) { + // first byte MUST be either 80 or FF + // 80 for positive, FF for 2's comp + var positive + if (buf[0] === 0x80) positive = true + else if (buf[0] === 0xFF) positive = false + else return null - var valid = v(data); - if (v.$async === true) - return self._opts.async == '*' ? co(valid) : valid; - self.errors = v.errors; - return valid; + // build up a base-256 tuple from the least sig to the highest + var zero = false + var tuple = [] + for (var i = buf.length - 1; i > 0; i--) { + var byte = buf[i] + if (positive) tuple.push(byte) + else if (zero && byte === 0) tuple.push(0) + else if (zero) { + zero = false + tuple.push(0x100 - byte) + } else tuple.push(0xFF - byte) } - - /** - * Create validating function for passed schema. - * @param {Object} schema schema object - * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. - * @return {Function} validating function - */ - function compile(schema, _meta) { - var schemaObj = _addSchema(schema, undefined, _meta); - return schemaObj.validate || _compile(schemaObj); + var sum = 0 + var l = tuple.length + for (i = 0; i < l; i++) { + sum += tuple[i] * Math.pow(256, i) } + return positive ? sum : -1 * sum +} - /** - * Adds schema to the instance. - * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. - * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. - * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. - * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. - */ - function addSchema(schema, key, _skipValidation, _meta) { - if (Array.isArray(schema)){ - for (var i=0; i Math.pow(10, digits)) digits++ - function defaultMeta() { - var meta = self._opts.meta; - self._opts.defaultMeta = typeof meta == 'object' - ? meta.id || meta - : self._opts.v5 - ? v5.META_SCHEMA_ID - : META_SCHEMA_ID; - return self._opts.defaultMeta; - } + return (len + digits) + str +} +exports.decodeLongPath = function (buf) { + return decodeStr(buf, 0, buf.length) +} - /** - * Get compiled schema from the instance by `key` or `ref`. - * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id). - * @return {Function} schema validating function (with property `schema`). - */ - function getSchema(keyRef) { - var schemaObj = _getSchemaObj(keyRef); - switch (typeof schemaObj) { - case 'object': return schemaObj.validate || _compile(schemaObj); - case 'string': return getSchema(schemaObj); - case 'undefined': return _getSchemaFragment(keyRef); +exports.encodePax = function (opts) { // TODO: encode more stuff in pax + var result = '' + if (opts.name) result += addLength(' path=' + opts.name + '\n') + if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n') + var pax = opts.pax + if (pax) { + for (var key in pax) { + result += addLength(' ' + key + '=' + pax[key] + '\n') } } + return new Buffer(result) +} +exports.decodePax = function (buf) { + var result = {} - function _getSchemaFragment(ref) { - var res = resolve.schema.call(self, { schema: {} }, ref); - if (res) { - var schema = res.schema - , root = res.root - , baseId = res.baseId; - var v = compileSchema.call(self, schema, root, undefined, baseId); - self._fragments[ref] = new SchemaObject({ - ref: ref, - fragment: true, - schema: schema, - root: root, - baseId: baseId, - validate: v - }); - return v; - } - } + while (buf.length) { + var i = 0 + while (i < buf.length && buf[i] !== 32) i++ + var len = parseInt(buf.slice(0, i).toString(), 10) + if (!len) return result + var b = buf.slice(i + 1, len - 1).toString() + var keyIndex = b.indexOf('=') + if (keyIndex === -1) return result + result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1) - function _getSchemaObj(keyRef) { - keyRef = resolve.normalizeId(keyRef); - return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef]; + buf = buf.slice(len) } + return result +} - /** - * Remove cached schema(s). - * If no parameter is passed all schemas but meta-schemas are removed. - * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. - * Even if schema is referenced by other schemas it still can be removed as other schemas have local references. - * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object - */ - function removeSchema(schemaKeyRef) { - if (schemaKeyRef instanceof RegExp) { - _removeAllSchemas(self._schemas, schemaKeyRef); - _removeAllSchemas(self._refs, schemaKeyRef); - return; - } - switch (typeof schemaKeyRef) { - case 'undefined': - _removeAllSchemas(self._schemas); - _removeAllSchemas(self._refs); - self._cache.clear(); - return; - case 'string': - var schemaObj = _getSchemaObj(schemaKeyRef); - if (schemaObj) self._cache.del(schemaObj.jsonStr); - delete self._schemas[schemaKeyRef]; - delete self._refs[schemaKeyRef]; - return; - case 'object': - var jsonStr = stableStringify(schemaKeyRef); - self._cache.del(jsonStr); - var id = schemaKeyRef.id; - if (id) { - id = resolve.normalizeId(id); - delete self._schemas[id]; - delete self._refs[id]; - } - } - } +exports.encode = function (opts) { + var buf = alloc(512) + var name = opts.name + var prefix = '' + if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/' + if (Buffer.byteLength(name) !== name.length) return null // utf-8 - function _removeAllSchemas(schemas, regex) { - for (var keyRef in schemas) { - var schemaObj = schemas[keyRef]; - if (!schemaObj.meta && (!regex || regex.test(keyRef))) { - self._cache.del(schemaObj.jsonStr); - delete schemas[keyRef]; - } - } + while (Buffer.byteLength(name) > 100) { + var i = name.indexOf('/') + if (i === -1) return null + prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i) + name = name.slice(i + 1) } + if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null + if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null - function _addSchema(schema, skipValidation, meta, shouldAddSchema) { - if (typeof schema != 'object') throw new Error('schema should be object'); - var jsonStr = stableStringify(schema); - var cached = self._cache.get(jsonStr); - if (cached) return cached; - - shouldAddSchema = shouldAddSchema || self._opts.addUsedSchema !== false; + buf.write(name) + buf.write(encodeOct(opts.mode & MASK, 6), 100) + buf.write(encodeOct(opts.uid, 6), 108) + buf.write(encodeOct(opts.gid, 6), 116) + buf.write(encodeOct(opts.size, 11), 124) + buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136) - var id = resolve.normalizeId(schema.id); - if (id && shouldAddSchema) checkUnique(id); + buf[156] = ZERO_OFFSET + toTypeflag(opts.type) - var willValidate = self._opts.validateSchema !== false && !skipValidation; - var recursiveMeta; - if (willValidate && !(recursiveMeta = schema.id && schema.id == schema.$schema)) - validateSchema(schema, true); + if (opts.linkname) buf.write(opts.linkname, 157) - var localRefs = resolve.ids.call(self, schema); + buf.write(USTAR, 257) + if (opts.uname) buf.write(opts.uname, 265) + if (opts.gname) buf.write(opts.gname, 297) + buf.write(encodeOct(opts.devmajor || 0, 6), 329) + buf.write(encodeOct(opts.devminor || 0, 6), 337) - var schemaObj = new SchemaObject({ - id: id, - schema: schema, - localRefs: localRefs, - jsonStr: jsonStr, - meta: meta - }); + if (prefix) buf.write(prefix, 345) - if (id[0] != '#' && shouldAddSchema) self._refs[id] = schemaObj; - self._cache.put(jsonStr, schemaObj); + buf.write(encodeOct(cksum(buf), 6), 148) - if (willValidate && recursiveMeta) validateSchema(schema, true); + return buf +} - return schemaObj; - } +exports.decode = function (buf) { + var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET + var name = decodeStr(buf, 0, 100) + var mode = decodeOct(buf, 100, 8) + var uid = decodeOct(buf, 108, 8) + var gid = decodeOct(buf, 116, 8) + var size = decodeOct(buf, 124, 12) + var mtime = decodeOct(buf, 136, 12) + var type = toType(typeflag) + var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100) + var uname = decodeStr(buf, 265, 32) + var gname = decodeStr(buf, 297, 32) + var devmajor = decodeOct(buf, 329, 8) + var devminor = decodeOct(buf, 337, 8) - function _compile(schemaObj, root) { - if (schemaObj.compiling) { - schemaObj.validate = callValidate; - callValidate.schema = schemaObj.schema; - callValidate.errors = null; - callValidate.root = root ? root : callValidate; - if (schemaObj.schema.$async === true) - callValidate.$async = true; - return callValidate; - } - schemaObj.compiling = true; + if (buf[345]) name = decodeStr(buf, 345, 155) + '/' + name - var currentOpts; - if (schemaObj.meta) { - currentOpts = self._opts; - self._opts = self._metaOpts; - } + // to support old tar versions that use trailing / to indicate dirs + if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5 - var v; - try { v = compileSchema.call(self, schemaObj.schema, root, schemaObj.localRefs); } - finally { - schemaObj.compiling = false; - if (schemaObj.meta) self._opts = currentOpts; - } + var c = cksum(buf) - schemaObj.validate = v; - schemaObj.refs = v.refs; - schemaObj.refVal = v.refVal; - schemaObj.root = v.root; - return v; + // checksum is still initial value if header was null. + if (c === 8 * 32) return null + // valid checksum + if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?') - function callValidate() { - var _validate = schemaObj.validate; - var result = _validate.apply(null, arguments); - callValidate.errors = _validate.errors; - return result; - } + return { + name: name, + mode: mode, + uid: uid, + gid: gid, + size: size, + mtime: new Date(1000 * mtime), + type: type, + linkname: linkname, + uname: uname, + gname: gname, + devmajor: devmajor, + devminor: devminor } +} - /** - * Convert array of error message objects to string - * @param {Array} errors optional array of validation errors, if not passed errors from the instance are used. - * @param {Object} options optional options with properties `separator` and `dataVar`. - * @return {String} human readable string with all errors descriptions - */ - function errorsText(errors, options) { - errors = errors || self.errors; - if (!errors) return 'No errors'; - options = options || {}; - var separator = options.separator === undefined ? ', ' : options.separator; - var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; +/***/ }), +/* 322 */ +/***/ (function(module, exports, __webpack_require__) { - var text = ''; - for (var i=0; i=4.0.0" + }, + "repository": "yarnpkg/yarn", + "bin": { + "yarn": "./bin/yarn.js", + "yarnpkg": "./bin/yarn.js" + }, + "scripts": { + "build": "gulp build", + "build-bundle": "node ./scripts/build-webpack.js", + "build-chocolatey": "powershell ./scripts/build-chocolatey.ps1", + "build-deb": "./scripts/build-deb.sh", + "build-dist": "bash ./scripts/build-dist.sh", + "build-win-installer": "scripts\\build-windows-installer.bat", + "dupe-check": "yarn jsinspect ./src", + "lint": "eslint . && flow check", + "prettier": "eslint src __tests__ --fix", + "release-branch": "./scripts/release-branch.sh", + "test": "yarn lint && yarn test-only", + "test-only": "node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose", + "test-coverage": "node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose", + "watch": "gulp watch", + "commit": "git-cz" + }, + "jest": { + "collectCoverageFrom": [ + "src/**/*.js" + ], + "testEnvironment": "node", + "modulePathIgnorePatterns": [ + "__tests__/fixtures/" + ], + "testPathIgnorePatterns": [ + "__tests__/(fixtures|__mocks__)/", + "updates/", + "/_(temp|mock|install|init|helpers).js$" + ] + }, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } + } }; +/***/ }), +/* 328 */ +/***/ (function(module, exports) { -formats.compare = { - date: compareDate, - time: compareTime, - 'date-time': compareDateTime -}; +module.exports = require("constants"); +/***/ }), +/* 329 */ +/***/ (function(module, exports) { -function date(str) { - // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 - var matches = str.match(DATE); - if (!matches) return false; +module.exports = require("dns"); - var month = +matches[1]; - var day = +matches[2]; - return month >= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; -} +/***/ }), +/* 330 */ +/***/ (function(module, exports) { +module.exports = require("tls"); -function time(str, full) { - var matches = str.match(TIME); - if (!matches) return false; +/***/ }), +/* 331 */ +/***/ (function(module, exports, __webpack_require__) { - var hour = matches[1]; - var minute = matches[2]; - var second = matches[3]; - var timeZone = matches[5]; - return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); -} +"use strict"; -var DATE_TIME_SEPARATOR = /t|\s/i; -function date_time(str) { - // http://tools.ietf.org/html/rfc3339#section-5.6 - var dateTime = str.split(DATE_TIME_SEPARATOR); - return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); -} +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _map; -function hostname(str) { - // https://tools.ietf.org/html/rfc1034#section-3.5 - // https://tools.ietf.org/html/rfc1123#section-2 - return str.length <= 255 && HOSTNAME.test(str); +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(37)); } +var _set; -var NOT_URI_FRAGMENT = /\/|\:/; -function uri(str) { - // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." - return NOT_URI_FRAGMENT.test(str) && URI.test(str); +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); } +exports.getRcConfigForCwd = getRcConfigForCwd; +exports.getRcArgs = getRcArgs; -function regex(str) { - try { - new RegExp(str); - return true; - } catch(e) { - return false; - } -} - +var _path; -function compareDate(d1, d2) { - if (!(d1 && d2)) return; - if (d1 > d2) return 1; - if (d1 < d2) return -1; - if (d1 === d2) return 0; +function _load_path() { + return _path = __webpack_require__(0); } +var _commander; -function compareTime(t1, t2) { - if (!(t1 && t2)) return; - t1 = t1.match(TIME); - t2 = t2.match(TIME); - if (!(t1 && t2)) return; - t1 = t1[1] + t1[2] + t1[3] + (t1[4]||''); - t2 = t2[1] + t2[2] + t2[3] + (t2[4]||''); - if (t1 > t2) return 1; - if (t1 < t2) return -1; - if (t1 === t2) return 0; +function _load_commander() { + return _commander = _interopRequireDefault(__webpack_require__(204)); } +var _lockfile; -function compareDateTime(dt1, dt2) { - if (!(dt1 && dt2)) return; - dt1 = dt1.split(DATE_TIME_SEPARATOR); - dt2 = dt2.split(DATE_TIME_SEPARATOR); - var res = compareDate(dt1[0], dt2[0]); - if (res === undefined) return; - return res || compareTime(dt1[1], dt2[1]); +function _load_lockfile() { + return _lockfile = __webpack_require__(20); } +var _rc; -/***/ }), -/* 328 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; +function _load_rc() { + return _rc = _interopRequireWildcard(__webpack_require__(447)); +} +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -var resolve = __webpack_require__(197) - , util = __webpack_require__(59) - , stableStringify = __webpack_require__(177) - , async = __webpack_require__(195); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var beautify; +// Keys that will get resolved relative to the path of the rc file they belong to +var PATH_KEYS = new (_set || _load_set()).default(['yarn-path', 'cache-folder', 'global-folder', 'modules-folder', 'cwd']); -function loadBeautify(){ - if (beautify === undefined) { - var name = 'js-beautify'; - try { beautify = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()).js_beautify; } - catch(e) { beautify = false; } - } -} +// given a cwd, load all .yarnrc files relative to it +function getRcConfigForCwd(cwd) { + return (_rc || _load_rc()).findRc('yarn', cwd, function (fileText, filePath) { + var _parse = (0, (_lockfile || _load_lockfile()).parse)(fileText, 'yarnrc'), + values = _parse.object; -var validateGenerator = __webpack_require__(204); + // some keys reference directories so keep their relativity -/** - * Functions below are used inside compiled validations function - */ -var co = __webpack_require__(241); -var ucs2length = util.ucs2length; -var equal = __webpack_require__(196); + for (var _key in values) { + if (PATH_KEYS.has(_key.replace(/^(--)?([^.]+\.)*/, ''))) { + values[_key] = (0, (_path || _load_path()).resolve)((0, (_path || _load_path()).dirname)(filePath), values[_key]); + } + } -// this error is thrown by async schemas to return validation errors via exception -var ValidationError = __webpack_require__(199); + return values; + }); +} -module.exports = compile; +// get the built of arguments of a .yarnrc chain of the passed cwd +function buildRcArgs(cwd) { + var config = getRcConfigForCwd(cwd); + var argsForCommands = new (_map || _load_map()).default(); -/** - * Compiles schema to validation function - * @this Ajv - * @param {Object} schema schema object - * @param {Object} root object with information about the root schema for this schema - * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution - * @param {String} baseId base ID for IDs in the schema - * @return {Function} validation function - */ -function compile(schema, root, localRefs, baseId) { - /* jshint validthis: true, evil: true */ - /* eslint no-shadow: 0 */ - var self = this - , opts = this._opts - , refVal = [ undefined ] - , refs = {} - , patterns = [] - , patternsHash = {} - , defaults = [] - , defaultsHash = {} - , customRules = [] - , keepSourceCode = opts.sourceCode !== false; + for (var _key2 in config) { + // args can be prefixed with the command name they're meant for, eg. + // `--install.check-files true` + var keyMatch = _key2.match(/^--(?:([^.]+)\.)?(.*)$/); + if (!keyMatch) { + continue; + } - root = root || { schema: schema, refVal: refVal, refs: refs }; + var commandName = keyMatch[1] || '*'; + var arg = keyMatch[2]; + var value = config[_key2]; - var c = checkCompiling.call(this, schema, root, baseId); - var compilation = this._compilations[c.index]; - if (c.compiling) return (compilation.callValidate = callValidate); + // create args for this command name if we didn't previously have them + var args = argsForCommands.get(commandName) || []; + argsForCommands.set(commandName, args); - var formats = this._formats; - var RULES = this.RULES; + // turn config value into appropriate cli flag + var option = (_commander || _load_commander()).default.optionFor(`--${arg}`); - try { - var v = localCompile(schema, root, localRefs, baseId); - compilation.validate = v; - var cv = compilation.callValidate; - if (cv) { - cv.schema = v.schema; - cv.errors = null; - cv.refs = v.refs; - cv.refVal = v.refVal; - cv.root = v.root; - cv.$async = v.$async; - if (keepSourceCode) cv.sourceCode = v.sourceCode; + // If commander doesn't recognize the option or it takes a value after it + if (!option || option.optional || option.required) { + args.push(`--${arg}`, value); + } else if (value === true) { + // we can't force remove an arg from cli + args.push(`--${arg}`); } - return v; - } finally { - endCompiling.call(this, schema, root, baseId); } - function callValidate() { - var validate = compilation.validate; - var result = validate.apply(null, arguments); - callValidate.errors = validate.errors; - return result; + return argsForCommands; +} + +// extract the value of a --cwd arg if present +function extractCwdArg(args) { + for (var i = 0, I = args.length; i < I; ++i) { + var arg = args[i]; + if (arg === '--') { + return null; + } else if (arg === '--cwd') { + return args[i + 1]; + } } + return null; +} - function localCompile(_schema, _root, localRefs, baseId) { - var isRoot = !_root || (_root && _root.schema == _schema); - if (_root.schema != root.schema) - return compile.call(self, _schema, _root, localRefs, baseId); +// get a list of arguments from .yarnrc that apply to this commandName +function getRcArgs(commandName, args) { + var previousCwds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - var $async = _schema.$async === true; - if ($async && !opts.transpile) async.setup(opts); + // for the cwd, use the --cwd arg if it was passed or else use process.cwd() + var origCwd = extractCwdArg(args) || process.cwd(); - var sourceCode = validateGenerator({ - isTop: true, - schema: _schema, - isRoot: isRoot, - baseId: baseId, - root: _root, - schemaPath: '', - errSchemaPath: '#', - errorPath: '""', - RULES: RULES, - validate: validateGenerator, - util: util, - resolve: resolve, - resolveRef: resolveRef, - usePattern: usePattern, - useDefault: useDefault, - useCustomRule: useCustomRule, - opts: opts, - formats: formats, - self: self - }); + // get a map of command names and their arguments + var argMap = buildRcArgs(origCwd); - sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) - + vars(defaults, defaultCode) + vars(customRules, customRuleCode) - + sourceCode; + // concat wildcard arguments and arguments meant for this specific command + var newArgs = [].concat(argMap.get('*') || [], argMap.get(commandName) || []); - if (opts.beautify) { - loadBeautify(); - /* istanbul ignore else */ - if (beautify) sourceCode = beautify(sourceCode, opts.beautify); - else console.error('"npm install js-beautify" to use beautify option'); + // check if the .yarnrc args specified a cwd + var newCwd = extractCwdArg(newArgs); + if (newCwd && newCwd !== origCwd) { + // ensure that we don't enter into a loop + if (previousCwds.indexOf(newCwd) !== -1) { + throw new Error(`Recursive .yarnrc files specifying --cwd flags. Bailing out.`); } - // console.log('\n\n\n *** \n', sourceCode); - var validate, validateCode - , transpile = opts._transpileFunc; - try { - validateCode = $async && transpile - ? transpile(sourceCode) - : sourceCode; - var makeValidate = new Function( - 'self', - 'RULES', - 'formats', - 'root', - 'refVal', - 'defaults', - 'customRules', - 'co', - 'equal', - 'ucs2length', - 'ValidationError', - validateCode - ); + // if we have a new cwd then let's refetch the .yarnrc args relative to it + return getRcArgs(commandName, newArgs, previousCwds.concat(origCwd)); + } - validate = makeValidate( - self, - RULES, - formats, - root, - refVal, - defaults, - customRules, - co, - equal, - ucs2length, - ValidationError - ); + return newArgs; +} - refVal[0] = validate; - } catch(e) { - console.error('Error compiling schema, function code:', validateCode); - throw e; - } +/***/ }), +/* 332 */ +/***/ (function(module, exports, __webpack_require__) { - validate.schema = _schema; - validate.errors = null; - validate.refs = refs; - validate.refVal = refVal; - validate.root = isRoot ? validate : _root; - if ($async) validate.$async = true; - if (keepSourceCode) validate.sourceCode = sourceCode; - if (opts.sourceCode === true) { - validate.source = { - patterns: patterns, - defaults: defaults - }; - } +"use strict"; - return validate; - } - function resolveRef(baseId, ref, isRoot) { - ref = resolve.url(baseId, ref); - var refIndex = refs[ref]; - var _refVal, refCode; - if (refIndex !== undefined) { - _refVal = refVal[refIndex]; - refCode = 'refVal[' + refIndex + ']'; - return resolvedRef(_refVal, refCode); - } - if (!isRoot && root.refs) { - var rootRefId = root.refs[ref]; - if (rootRefId !== undefined) { - _refVal = root.refVal[rootRefId]; - refCode = addLocalRef(ref, _refVal); - return resolvedRef(_refVal, refCode); - } - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = handleSignals; - refCode = addLocalRef(ref); - var v = resolve.call(self, localCompile, root, ref); - if (!v) { - var localSchema = localRefs && localRefs[ref]; - if (localSchema) { - v = resolve.inlineRef(localSchema, opts.inlineRefs) - ? localSchema - : compile.call(self, localSchema, root, localRefs, baseId); - } - } +var _child; - if (v) { - replaceLocalRef(ref, v); - return resolvedRef(v, refCode); - } - } +function _load_child() { + return _child = __webpack_require__(45); +} - function addLocalRef(ref, v) { - var refId = refVal.length; - refVal[refId] = v; - refs[ref] = refId; - return 'refVal' + refId; - } +function forwardSignalAndExit(signal) { + (0, (_child || _load_child()).forwardSignalToSpawnedProcesses)(signal); + // We want to exit immediately here since `SIGTERM` means that + // If we lose stdout messages due to abrupt exit, shoot the messenger? + process.exit(1); // eslint-disable-line no-process-exit +} +function handleSignals() { + process.on('SIGTERM', function () { + forwardSignalAndExit('SIGTERM'); + }); +} - function replaceLocalRef(ref, v) { - var refId = refs[ref]; - refVal[refId] = v; - } +/***/ }), +/* 333 */ +/***/ (function(module, exports) { - function resolvedRef(refVal, code) { - return typeof refVal == 'object' - ? { code: code, schema: refVal, inline: true } - : { code: code, $async: refVal && refVal.$async }; - } - function usePattern(regexStr) { - var index = patternsHash[regexStr]; - if (index === undefined) { - index = patternsHash[regexStr] = patterns.length; - patterns[index] = regexStr; - } - return 'pattern' + index; - } +var defaultConfig = { + uncaughtException: false, + SIGINT: true, + SIGTERM: true, + SIGQUIT: true +} - function useDefault(value) { - switch (typeof value) { - case 'boolean': - case 'number': - return '' + value; - case 'string': - return util.toQuotedString(value); - case 'object': - if (value === null) return 'null'; - var valueStr = stableStringify(value); - var index = defaultsHash[valueStr]; - if (index === undefined) { - index = defaultsHash[valueStr] = defaults.length; - defaults[index] = value; - } - return 'default' + index; - } - } +var DEBUG = false - function useCustomRule(rule, schema, parentSchema, it) { - var validateSchema = rule.definition.validateSchema; - if (validateSchema && self._opts.validateSchema !== false) { - var valid = validateSchema(schema); - if (!valid) { - var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); - if (self._opts.validateSchema == 'log') console.error(message); - else throw new Error(message); +function ON_DEATH (callback) { + var handlers = []; + Object.keys(defaultConfig).forEach(function(key) { + var val = defaultConfig[key] + var handler = null; + if (val) { + if (DEBUG) { + handler = function() { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift(key) + console.log('Trapped ' + key) + callback.apply(null, args) + }; + process.on(key, handler) + } else { + handler = function() { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift(key) + callback.apply(null, args) + } + process.on(key, handler) } + handlers.push([key, handler]) } + }) + return function OFF_DEATH() { + handlers.forEach(function (args) { + var key = args[0]; + var handler = args[1]; + process.removeListener(key, handler); + }) + } +} - var compile = rule.definition.compile - , inline = rule.definition.inline - , macro = rule.definition.macro; +module.exports = function (arg) { + if (typeof arg === 'object') { + if (arg['debug']) + DEBUG = arg.debug + if (arg['DEBUG']) + DEBUG = arg.DEBUG + delete arg.debug; delete arg.DEBUG; - var validate; - if (compile) { - validate = compile.call(self, schema, parentSchema, it); - } else if (macro) { - validate = macro.call(self, schema, parentSchema, it); - if (opts.validateSchema !== false) self.validateSchema(validate, true); - } else if (inline) { - validate = inline.call(self, it, rule.keyword, schema, parentSchema); - } else { - validate = rule.definition.validate; - } + Object.keys(arg).forEach(function(key) { + defaultConfig[key] = arg[key] + }) - var index = customRules.length; - customRules[index] = validate; + if (DEBUG) + console.log('ON_DEATH: debug mode enabled for pid [%d]', process.pid) - return { - code: 'customRule' + index, - validate: validate - }; + return ON_DEATH + } else if (typeof arg === 'function') { + return ON_DEATH(arg) } } -/** - * Checks if the schema is currently compiled - * @this Ajv - * @param {Object} schema schema to compile - * @param {Object} root root object - * @param {String} baseId base schema ID - * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) - */ -function checkCompiling(schema, root, baseId) { - /* jshint validthis: true */ - var index = compIndex.call(this, schema, root, baseId); - if (index >= 0) return { index: index, compiling: true }; - index = this._compilations.length; - this._compilations[index] = { - schema: schema, - root: root, - baseId: baseId - }; - return { index: index, compiling: false }; -} +/***/ }), +/* 334 */ +/***/ (function(module, exports, __webpack_require__) { -/** - * Removes the schema from the currently compiled list - * @this Ajv - * @param {Object} schema schema to compile - * @param {Object} root root object - * @param {String} baseId base schema ID - */ -function endCompiling(schema, root, baseId) { - /* jshint validthis: true */ - var i = compIndex.call(this, schema, root, baseId); - if (i >= 0) this._compilations.splice(i, 1); -} +"use strict"; +var util = __webpack_require__(4); +var onExit = __webpack_require__(313); +var currentlyUnhandled = __webpack_require__(521); -/** - * Index of schema compilation in the currently compiled list - * @this Ajv - * @param {Object} schema schema to compile - * @param {Object} root root object - * @param {String} baseId base schema ID - * @return {Integer} compilation index - */ -function compIndex(schema, root, baseId) { - /* jshint validthis: true */ - for (var i=0; i 0) { + unhandledRejections.forEach(function (x) { + var err = x.reason; -function customRuleCode(i) { - return 'var customRule' + i + ' = customRules[' + i + '];'; -} + if (!(err instanceof Error)) { + err = new Error('Promise rejected with value: ' + util.inspect(err)); + } + log(err.stack); + }); -function vars(arr, statement) { - if (!arr.length) return ''; - var code = ''; - for (var i=0; i { + // If successful, we are done + if (!err) { + return callback(); + } + // If error is not EEXIST then some other error occurred while locking + if (err.code !== 'EEXIST') { + return callback(err); + } -/***/ }), -/* 330 */ -/***/ (function(module, exports, __webpack_require__) { + // Otherwise, check if lock is stale by analyzing the file mtime + if (options.stale <= 0) { + return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file })); + } -"use strict"; + options.fs.stat(getLockFile(file), (err, stat) => { + if (err) { + // Retry if the lockfile has been removed (meanwhile) + // Skip stale check to avoid recursiveness + if (err.code === 'ENOENT') { + return acquireLock(file, Object.assign({}, options, { stale: 0 }), callback); + } + return callback(err); + } -// https://mathiasbynens.be/notes/javascript-encoding -// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode -module.exports = function ucs2length(str) { - var length = 0 - , len = str.length - , pos = 0 - , value; - while (pos < len) { - length++; - value = str.charCodeAt(pos++); - if (value >= 0xD800 && value <= 0xDBFF && pos < len) { - // high surrogate, and there is a next character - value = str.charCodeAt(pos); - if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate - } - } - return length; -}; + if (!isLockStale(stat, options)) { + return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file })); + } + + // If it's stale, remove it and try again! + // Skip stale check to avoid recursiveness + removeLock(file, options, (err) => { + if (err) { + return callback(err); + } + acquireLock(file, Object.assign({}, options, { stale: 0 }), callback); + }); + }); + }); +} -/***/ }), -/* 331 */ -/***/ (function(module, exports, __webpack_require__) { +function isLockStale(stat, options) { + return stat.mtime.getTime() < Date.now() - options.stale; +} -"use strict"; +function removeLock(file, options, callback) { + // Remove lockfile, ignoring ENOENT errors + options.fs.rmdir(getLockFile(file), (err) => { + if (err && err.code !== 'ENOENT') { + return callback(err); + } -module.exports = function generate__formatLimit(it, $keyword) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - out += 'var ' + ($valid) + ' = undefined;'; - if (it.opts.format === false) { - out += ' ' + ($valid) + ' = true; '; - return out; - } - var $schemaFormat = it.schema.format, - $isDataFormat = it.opts.v5 && $schemaFormat.$data, - $closingBraces = ''; - if ($isDataFormat) { - var $schemaValueFormat = it.util.getData($schemaFormat.$data, $dataLvl, it.dataPathArr), - $format = 'format' + $lvl, - $compare = 'compare' + $lvl; - out += ' var ' + ($format) + ' = formats[' + ($schemaValueFormat) + '] , ' + ($compare) + ' = ' + ($format) + ' && ' + ($format) + '.compare;'; - } else { - var $format = it.formats[$schemaFormat]; - if (!($format && $format.compare)) { - out += ' ' + ($valid) + ' = true; '; - return out; - } - var $compare = 'formats' + it.util.getProperty($schemaFormat) + '.compare'; - } - var $isMax = $keyword == 'formatMaximum', - $exclusiveKeyword = 'formatExclusive' + ($isMax ? 'Maximum' : 'Minimum'), - $schemaExcl = it.schema[$exclusiveKeyword], - $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data, - $op = $isMax ? '<' : '>', - $result = 'result' + $lvl; - var $isData = it.opts.v5 && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - if ($isDataExcl) { - var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), - $exclusive = 'exclusive' + $lvl, - $opExpr = 'op' + $lvl, - $opStr = '\' + ' + $opExpr + ' + \''; - out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; - $schemaValueExcl = 'schemaExcl' + $lvl; - out += ' if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && ' + ($schemaValueExcl) + ' !== undefined) { ' + ($valid) + ' = false; '; - var $errorKeyword = $exclusiveKeyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_formatExclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($breakOnError) { - $closingBraces += '}'; - out += ' else { '; - } - if ($isData) { - out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; - $closingBraces += '}'; - } - if ($isDataFormat) { - out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; - $closingBraces += '}'; + callback(); + }); +} + +function updateLock(file, options) { + const lock = locks[file]; + + /* istanbul ignore next */ + if (lock.updateTimeout) { + return; } - out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); + + lock.updateDelay = lock.updateDelay || options.update; + lock.updateTimeout = setTimeout(() => { + const mtime = Date.now() / 1000; + + lock.updateTimeout = null; + + options.fs.utimes(getLockFile(file), mtime, mtime, (err) => { + // Ignore if the lock was released + if (lock.released) { + return; + } + + // Verify if we are within the stale threshold + if (lock.lastUpdate <= Date.now() - options.stale && + lock.lastUpdate > Date.now() - options.stale * 2) { + return compromisedLock(file, lock, Object.assign(new Error(lock.updateError || 'Unable to update lock within the stale \ +threshold'), { code: 'ECOMPROMISED' })); + } + + // If the file is older than (stale * 2), we assume the clock is moved manually, + // which we consider a valid case + + // If it failed to update the lockfile, keep trying unless + // the lockfile was deleted! + if (err) { + if (err.code === 'ENOENT') { + return compromisedLock(file, lock, Object.assign(err, { code: 'ECOMPROMISED' })); + } + + lock.updateError = err; + lock.updateDelay = 1000; + return updateLock(file, options); + } + + // All ok, keep updating.. + lock.lastUpdate = Date.now(); + lock.updateError = null; + lock.updateDelay = null; + updateLock(file, options); + }); + }, lock.updateDelay); + + // Unref the timer so that the nodejs process can exit freely + // This is safe because all acquired locks will be automatically released + // on process exit + + // We first check that `lock.updateTimeout.unref` exists because some users + // may be using this module outside of NodeJS (e.g., in an electron app), + // and in those cases `setTimeout` return an integer. + if (lock.updateTimeout.unref) { + lock.updateTimeout.unref(); } - out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; var ' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true; if (' + ($valid) + ' === undefined) { ' + ($valid) + ' = ' + ($exclusive) + ' ? ' + ($result) + ' ' + ($op) + ' 0 : ' + ($result) + ' ' + ($op) + '= 0; } if (!' + ($valid) + ') var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; - } else { - var $exclusive = $schemaExcl === true, - $opStr = $op; - if (!$exclusive) $opStr += '='; - var $opExpr = '\'' + $opStr + '\''; - if ($isData) { - out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; - $closingBraces += '}'; +} + +function compromisedLock(file, lock, err) { + lock.released = true; // Signal the lock has been released + /* istanbul ignore next */ + lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update + + if (locks[file] === lock) { + delete locks[file]; } - if ($isDataFormat) { - out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; - $closingBraces += '}'; + + lock.compromised(err); +} + +// ----------------------------------------- + +function lock(file, options, compromised, callback) { + if (typeof options === 'function') { + callback = compromised; + compromised = options; + options = null; } - out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); + + if (!callback) { + callback = compromised; + compromised = null; } - out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; if (' + ($valid) + ' === undefined) ' + ($valid) + ' = ' + ($result) + ' ' + ($op); - if (!$exclusive) { - out += '='; + + options = Object.assign({ + stale: 10000, + update: null, + realpath: true, + retries: 0, + fs, + }, options); + + options.retries = options.retries || 0; + options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries; + options.stale = Math.max(options.stale || 0, 2000); + options.update = options.update == null ? options.stale / 2 : options.update || 0; + options.update = Math.max(Math.min(options.update, options.stale / 2), 1000); + compromised = compromised || function (err) { throw err; }; + + // Resolve to a canonical file path + canonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } + + // Attempt to acquire the lock + const operation = retry.operation(options.retries); + + operation.attempt(() => { + acquireLock(file, options, (err) => { + if (operation.retry(err)) { + return; + } + + if (err) { + return callback(operation.mainError()); + } + + // We now own the lock + const lock = locks[file] = { + options, + compromised, + lastUpdate: Date.now(), + }; + + // We must keep the lock fresh to avoid staleness + updateLock(file, options); + + callback(null, (releasedCallback) => { + if (lock.released) { + return releasedCallback && + releasedCallback(Object.assign(new Error('Lock is already released'), { code: 'ERELEASED' })); + } + + // Not necessary to use realpath twice when unlocking + unlock(file, Object.assign({}, options, { realpath: false }), releasedCallback); + }); + }); + }); + }); +} + +function unlock(file, options, callback) { + if (typeof options === 'function') { + callback = options; + options = null; } - out += ' 0;'; - } - out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; - var $errorKeyword = $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_formatLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); + + options = Object.assign({ + fs, + realpath: true, + }, options); + + callback = callback || function () {}; + + // Resolve to a canonical file path + canonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } + + // Skip if the lock is not acquired + const lock = locks[file]; + + if (!lock) { + return callback(Object.assign(new Error('Lock is not acquired/owned by you'), { code: 'ENOTACQUIRED' })); + } + + lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update + lock.released = true; // Signal the lock has been released + delete locks[file]; // Delete from locks + + removeLock(file, options, callback); + }); +} + +function lockSync(file, options, compromised) { + if (typeof options === 'function') { + compromised = options; + options = null; } - out += ' , exclusive: ' + ($exclusive) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be ' + ($opStr) + ' "'; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + (it.util.escapeQuotes($schema)); - } - out += '"\' '; + + options = options || {}; + options.fs = syncFs(options.fs || fs); + options.retries = options.retries || 0; + options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries; + + // Retries are not allowed because it requires the flow to be sync + if (options.retries.retries) { + throw Object.assign(new Error('Cannot use retries with the sync api'), { code: 'ESYNC' }); } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + + let err; + let release; + + lock(file, options, compromised, (_err, _release) => { + err = _err; + release = _release; + }); + + if (err) { + throw err; } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; + + return release; +} + +function unlockSync(file, options) { + options = options || {}; + options.fs = syncFs(options.fs || fs); + + let err; + + unlock(file, options, (_err) => { + err = _err; + }); + + if (err) { + throw err; } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '}'; - return out; } +function check(file, options, callback) { + if (typeof options === 'function') { + callback = options; + options = null; + } -/***/ }), -/* 332 */ -/***/ (function(module, exports, __webpack_require__) { + options = Object.assign({ + stale: 10000, + realpath: true, + fs, + }, options); -"use strict"; + options.stale = Math.max(options.stale || 0, 2000); -module.exports = function generate_allOf(it, $keyword) { - var out = ' '; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $currentBaseId = $it.baseId, - $allSchemasEmpty = true; - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $allSchemasEmpty = false; - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; + // Resolve to a canonical file path + canonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); } - } - } - } - if ($breakOnError) { - if ($allSchemasEmpty) { - out += ' if (true) { '; - } else { - out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + + // Check if lockfile exists + options.fs.stat(getLockFile(file), (err, stat) => { + if (err) { + // if does not exist, file is not locked. Otherwise, callback with error + return (err.code === 'ENOENT') ? callback(null, false) : callback(err); + } + + if (options.stale <= 0) { return callback(null, true); } + + // Otherwise, check if lock is stale by analyzing the file mtime + return callback(null, !isLockStale(stat, options)); + }); + }); +} + +function checkSync(file, options) { + options = options || {}; + options.fs = syncFs(options.fs || fs); + + let err; + let locked; + + check(file, options, (_err, _locked) => { + err = _err; + locked = _locked; + }); + + if (err) { + throw err; } - } - out = it.util.cleanUpCode(out); - return out; + + return locked; } +// Remove acquired locks on exit +/* istanbul ignore next */ +process.on('exit', () => { + Object.keys(locks).forEach((file) => { + try { locks[file].options.fs.rmdirSync(getLockFile(file)); } catch (e) { /* empty */ } + }); +}); + +module.exports = lock; +module.exports.lock = lock; +module.exports.unlock = unlock; +module.exports.lockSync = lockSync; +module.exports.unlockSync = unlockSync; +module.exports.check = check; +module.exports.checkSync = checkSync; + + /***/ }), -/* 333 */ +/* 336 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = function generate_anyOf(it, $keyword) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $noEmptySchema = $schema.every(function($sch) { - return it.util.schemaHasRules($sch, it.RULES.all); - }); - if ($noEmptySchema) { - var $currentBaseId = $it.baseId; - out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; - $closingBraces += '}'; - } - } - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should match some schema in anyOf\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; + +var compileSchema = __webpack_require__(341) + , resolve = __webpack_require__(208) + , Cache = __webpack_require__(337) + , SchemaObject = __webpack_require__(209) + , stableStringify = __webpack_require__(189) + , formats = __webpack_require__(340) + , rules = __webpack_require__(342) + , v5 = __webpack_require__(366) + , util = __webpack_require__(62) + , async = __webpack_require__(206) + , co = __webpack_require__(255); + +module.exports = Ajv; + +Ajv.prototype.compileAsync = async.compile; + +var customKeyword = __webpack_require__(363); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.ValidationError = __webpack_require__(210); + +var META_SCHEMA_ID = 'http://json-schema.org/draft-04/schema'; +var SCHEMA_URI_FORMAT = /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i; +function SCHEMA_URI_FORMAT_FUNC(str) { + return SCHEMA_URI_FORMAT.test(str); +} + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ]; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + var self = this; + + opts = this._opts = util.copy(opts) || {}; + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + + // this is done on purpose, so that methods are bound to the instance + // (without using bind) so that they can be used without the instance + this.validate = validate; + this.compile = compile; + this.addSchema = addSchema; + this.addMetaSchema = addMetaSchema; + this.validateSchema = validateSchema; + this.getSchema = getSchema; + this.removeSchema = removeSchema; + this.addFormat = addFormat; + this.errorsText = errorsText; + + this._addSchema = _addSchema; + this._compile = _compile; + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.async || opts.transpile) async.setup(opts); + if (opts.beautify === true) opts.beautify = { indent_size: 2 }; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + this._metaOpts = getMetaSchemaOptions(); + + if (opts.formats) addInitialFormats(); + addDraft4MetaSchema(); + if (opts.v5) v5.enable(this); + if (typeof opts.meta == 'object') addMetaSchema(opts.meta); + addInitialSchemas(); + + + /** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [json-stable-stringify](https://github.com/substack/json-stable-stringify) is used to serialize. + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ + function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; - if (it.opts.allErrors) { - out += ' } '; - } - out = it.util.cleanUpCode(out); - } else { - if ($breakOnError) { - out += ' if (true) { '; + var schemaObj = _addSchema(schemaKeyRef); + v = schemaObj.validate || _compile(schemaObj); } + + var valid = v(data); + if (v.$async === true) + return self._opts.async == '*' ? co(valid) : valid; + self.errors = v.errors; + return valid; } - return out; -} -/***/ }), -/* 334 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Create validating function for passed schema. + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ + function compile(schema, _meta) { + var schemaObj = _addSchema(schema, undefined, _meta); + return schemaObj.validate || _compile(schemaObj); + } -"use strict"; -module.exports = function generate_constant(it, $keyword) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $isData = it.opts.v5 && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; + /** + * Adds schema to the instance. + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + */ + function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ + function errorsText(errors, options) { + errors = errors || self.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i ' + ($i) + ') { '; - var $passData = $data + '[' + $i + ']'; - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); - $it.dataPathArr[$dataNxt] = $i; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) { - $it.schema = $additionalItems; - $it.schemaPath = it.schemaPath + '.additionalItems'; - $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; - out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); - var $passData = $data + '[' + $idx + ']'; - $it.dataPathArr[$dataNxt] = $idx; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } else if (it.util.schemaHasRules($schema, it.RULES.all)) { - $it.schema = $schema; - $it.schemaPath = $schemaPath; - $it.errSchemaPath = $errSchemaPath; - out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); - var $passData = $data + '[' + $idx + ']'; - $it.dataPathArr[$dataNxt] = $idx; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - if ($breakOnError) { - out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; - } - out = it.util.cleanUpCode(out); - return out; -} + +//all requires must be explicit because browserify won't work with dynamic requires +module.exports = { + '$ref': __webpack_require__(359), + allOf: __webpack_require__(345), + anyOf: __webpack_require__(346), + dependencies: __webpack_require__(349), + 'enum': __webpack_require__(350), + format: __webpack_require__(351), + items: __webpack_require__(352), + maximum: __webpack_require__(211), + minimum: __webpack_require__(211), + maxItems: __webpack_require__(212), + minItems: __webpack_require__(212), + maxLength: __webpack_require__(213), + minLength: __webpack_require__(213), + maxProperties: __webpack_require__(214), + minProperties: __webpack_require__(214), + multipleOf: __webpack_require__(353), + not: __webpack_require__(354), + oneOf: __webpack_require__(355), + pattern: __webpack_require__(356), + properties: __webpack_require__(358), + required: __webpack_require__(360), + uniqueItems: __webpack_require__(362), + validate: __webpack_require__(215) +}; /***/ }), @@ -75842,263 +78025,649 @@ module.exports = function generate_items(it, $keyword) { "use strict"; -module.exports = function generate_multipleOf(it, $keyword) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.v5 && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - out += 'var division' + ($lvl) + ';if ('; - if ($isData) { - out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; - } - out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; - if (it.opts.multipleOfPrecision) { - out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; - } else { - out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; - } - out += ' ) '; - if ($isData) { - out += ' ) '; - } - out += ' ) { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be multiple of '; - if ($isData) { - out += '\' + ' + ($schemaValue); - } else { - out += '' + ($schema) + '\''; - } - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '} '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} +var util = __webpack_require__(62); -/***/ }), -/* 341 */ -/***/ (function(module, exports, __webpack_require__) { +var DATE = /^\d\d\d\d-(\d\d)-(\d\d)$/; +var DAYS = [0,31,29,31,30,31,30,31,31,30,31,30,31]; +var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i; +var HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i; +var URI = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@\/?]|%[0-9a-f]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@\/?]|%[0-9a-f]{2})*)?$/i; +var UUID = /^(?:urn\:uuid\:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; +var JSON_POINTER = /^(?:\/(?:[^~\/]|~0|~1)*)*$|^\#(?:\/(?:[a-z0-9_\-\.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; +var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:\#|(?:\/(?:[^~\/]|~0|~1)*)*)$/; -"use strict"; -module.exports = function generate_not(it, $keyword) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - $it.level++; - var $nextValid = 'valid' + $it.level; - if (it.util.schemaHasRules($schema, it.RULES.all)) { - $it.schema = $schema; - $it.schemaPath = $schemaPath; - $it.errSchemaPath = $errSchemaPath; - out += ' var ' + ($errs) + ' = errors; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - $it.createErrors = false; - var $allErrorsOption; - if ($it.opts.allErrors) { - $allErrorsOption = $it.opts.allErrors; - $it.opts.allErrors = false; - } - out += ' ' + (it.validate($it)) + ' '; - $it.createErrors = true; - if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' if (' + ($nextValid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT be valid\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; - if (it.opts.allErrors) { - out += ' } '; - } - } else { - out += ' var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT be valid\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if ($breakOnError) { - out += ' if (false) { '; - } +module.exports = formats; + +function formats(mode) { + mode = mode == 'full' ? 'full' : 'fast'; + var formatDefs = util.copy(formats[mode]); + for (var fName in formats.compare) { + formatDefs[fName] = { + validate: formatDefs[fName], + compare: formats.compare[fName] + }; } - return out; + return formatDefs; } -/***/ }), -/* 342 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_oneOf(it, $keyword) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;'; - var $currentBaseId = $it.baseId; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - } else { - out += ' var ' + ($nextValid) + ' = true; '; +formats.fast = { + // date: http://tools.ietf.org/html/rfc3339#section-5.6 + date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 + time: /^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, + 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js + uri: /^(?:[a-z][a-z0-9+-.]*)?(?:\:|\/)\/?[^\s]*$/i, + // email (sources from jsen validator): + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') + email: /^[a-z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, + hostname: HOSTNAME, + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + // uuid: http://tools.ietf.org/html/rfc4122 + uuid: UUID, + // JSON-pointer: https://tools.ietf.org/html/rfc6901 + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A + 'json-pointer': JSON_POINTER, + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +formats.full = { + date: date, + time: time, + 'date-time': date_time, + uri: uri, + email: /^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: hostname, + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + uuid: UUID, + 'json-pointer': JSON_POINTER, + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +formats.compare = { + date: compareDate, + time: compareTime, + 'date-time': compareDateTime +}; + + +function date(str) { + // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 + var matches = str.match(DATE); + if (!matches) return false; + + var month = +matches[1]; + var day = +matches[2]; + return month >= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +function hostname(str) { + // https://tools.ietf.org/html/rfc1034#section-3.5 + // https://tools.ietf.org/html/rfc1123#section-2 + return str.length <= 255 && HOSTNAME.test(str); +} + + +var NOT_URI_FRAGMENT = /\/|\:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +function regex(str) { + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} + + +function compareDate(d1, d2) { + if (!(d1 && d2)) return; + if (d1 > d2) return 1; + if (d1 < d2) return -1; + if (d1 === d2) return 0; +} + + +function compareTime(t1, t2) { + if (!(t1 && t2)) return; + t1 = t1.match(TIME); + t2 = t2.match(TIME); + if (!(t1 && t2)) return; + t1 = t1[1] + t1[2] + t1[3] + (t1[4]||''); + t2 = t2[1] + t2[2] + t2[3] + (t2[4]||''); + if (t1 > t2) return 1; + if (t1 < t2) return -1; + if (t1 === t2) return 0; +} + + +function compareDateTime(dt1, dt2) { + if (!(dt1 && dt2)) return; + dt1 = dt1.split(DATE_TIME_SEPARATOR); + dt2 = dt2.split(DATE_TIME_SEPARATOR); + var res = compareDate(dt1[0], dt2[0]); + if (res === undefined) return; + return res || compareTime(dt1[1], dt2[1]); +} + + +/***/ }), +/* 341 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var resolve = __webpack_require__(208) + , util = __webpack_require__(62) + , stableStringify = __webpack_require__(189) + , async = __webpack_require__(206); + +var beautify; + +function loadBeautify(){ + if (beautify === undefined) { + var name = 'js-beautify'; + try { beautify = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()).js_beautify; } + catch(e) { beautify = false; } + } +} + +var validateGenerator = __webpack_require__(215); + +/** + * Functions below are used inside compiled validations function + */ + +var co = __webpack_require__(255); +var ucs2length = util.ucs2length; +var equal = __webpack_require__(207); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = __webpack_require__(210); + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = [] + , keepSourceCode = opts.sourceCode !== false; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (keepSourceCode) cv.sourceCode = v.sourceCode; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + function callValidate() { + var validate = compilation.validate; + var result = validate.apply(null, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + if ($async && !opts.transpile) async.setup(opts); + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.beautify) { + loadBeautify(); + /* istanbul ignore else */ + if (beautify) sourceCode = beautify(sourceCode, opts.beautify); + else console.error('"npm install js-beautify" to use beautify option'); + } + // console.log('\n\n\n *** \n', sourceCode); + var validate, validateCode + , transpile = opts._transpileFunc; + try { + validateCode = $async && transpile + ? transpile(sourceCode) + : sourceCode; + + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'co', + 'equal', + 'ucs2length', + 'ValidationError', + validateCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + co, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + console.error('Error compiling schema, function code:', validateCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (keepSourceCode) validate.sourceCode = sourceCode; + if (opts.sourceCode === true) { + validate.source = { + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); } - if ($i) { - out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { '; - $closingBraces += '}'; + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (!v) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); } - out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;'; + } + + if (v) { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); } } - it.compositeRule = $it.compositeRule = $wasComposite; - out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should match exactly one schema in oneOf\' '; + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; } - out += ' } '; - } else { - out += ' {} '; } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; + + function useCustomRule(rule, schema, parentSchema, it) { + var validateSchema = rule.definition.validateSchema; + if (validateSchema && self._opts.validateSchema !== false) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') console.error(message); + else throw new Error(message); + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; + validate = rule.definition.validate; } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; } - out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; - if (it.opts.allErrors) { - out += ' } '; +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; + + +/***/ }), +/* 344 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate__formatLimit(it, $keyword) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; @@ -76106,7 +78675,36 @@ module.exports = function generate_pattern(it, $keyword) { var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; + var $errorKeyword; var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + out += 'var ' + ($valid) + ' = undefined;'; + if (it.opts.format === false) { + out += ' ' + ($valid) + ' = true; '; + return out; + } + var $schemaFormat = it.schema.format, + $isDataFormat = it.opts.v5 && $schemaFormat.$data, + $closingBraces = ''; + if ($isDataFormat) { + var $schemaValueFormat = it.util.getData($schemaFormat.$data, $dataLvl, it.dataPathArr), + $format = 'format' + $lvl, + $compare = 'compare' + $lvl; + out += ' var ' + ($format) + ' = formats[' + ($schemaValueFormat) + '] , ' + ($compare) + ' = ' + ($format) + ' && ' + ($format) + '.compare;'; + } else { + var $format = it.formats[$schemaFormat]; + if (!($format && $format.compare)) { + out += ' ' + ($valid) + ' = true; '; + return out; + } + var $compare = 'formats' + it.util.getProperty($schemaFormat) + '.compare'; + } + var $isMax = $keyword == 'formatMaximum', + $exclusiveKeyword = 'formatExclusive' + ($isMax ? 'Maximum' : 'Minimum'), + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $result = 'result' + $lvl; var $isData = it.opts.v5 && $schema && $schema.$data, $schemaValue; if ($isData) { @@ -76115,25 +78713,101 @@ module.exports = function generate_pattern(it, $keyword) { } else { $schemaValue = $schema; } - var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); - out += 'if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && ' + ($schemaValueExcl) + ' !== undefined) { ' + ($valid) + ' = false; '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_formatExclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + if ($isData) { + out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + if ($isDataFormat) { + out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; + $closingBraces += '}'; + } + out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; var ' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true; if (' + ($valid) + ' === undefined) { ' + ($valid) + ' = ' + ($exclusive) + ' ? ' + ($result) + ' ' + ($op) + ' 0 : ' + ($result) + ' ' + ($op) + '= 0; } if (!' + ($valid) + ') var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + } else { + var $exclusive = $schemaExcl === true, + $opStr = $op; + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; + if ($isData) { + out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + if ($isDataFormat) { + out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; + $closingBraces += '}'; + } + out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; if (' + ($valid) + ' === undefined) ' + ($valid) + ' = ' + ($result) + ' ' + ($op); + if (!$exclusive) { + out += '='; + } + out += ' 0;'; } - out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; + var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { - out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + out += ' { keyword: \'' + ($errorKeyword || '_formatLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: '; if ($isData) { out += '' + ($schemaValue); } else { out += '' + (it.util.toQuotedString($schema)); } - out += ' } '; + out += ' , exclusive: ' + ($exclusive) + ' } '; if (it.opts.messages !== false) { - out += ' , message: \'should match pattern "'; + out += ' , message: \'should be ' + ($opStr) + ' "'; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { @@ -76165,79 +78839,68 @@ module.exports = function generate_pattern(it, $keyword) { } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } - out += '} '; - if ($breakOnError) { - out += ' else { '; - } + out += '}'; return out; } /***/ }), -/* 344 */ +/* 345 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = function generate_patternRequired(it, $keyword) { +module.exports = function generate_allOf(it, $keyword) { var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $key = 'key' + $lvl, - $matched = 'patternMatched' + $lvl, - $closingBraces = '', - $ownProperties = it.opts.ownProperties; - out += 'var ' + ($valid) + ' = true;'; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; var arr1 = $schema; if (arr1) { - var $pProperty, i1 = -1, + var $sch, $i = -1, l1 = arr1.length - 1; - while (i1 < l1) { - $pProperty = arr1[i1 += 1]; - out += ' var ' + ($matched) + ' = false; for (var ' + ($key) + ' in ' + ($data) + ') { '; - if ($ownProperties) { - out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; - } - out += ' ' + ($matched) + ' = ' + (it.usePattern($pProperty)) + '.test(' + ($key) + '); if (' + ($matched) + ') break; } '; - var $missingPattern = it.util.escapeQuotes($pProperty); - out += ' if (!' + ($matched) + ') { ' + ($valid) + ' = false; var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternRequired') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingPattern: \'' + ($missingPattern) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should have property matching pattern \\\'' + ($missingPattern) + '\\\'\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; - if ($breakOnError) { - $closingBraces += '}'; - out += ' else { '; } } } - out += '' + ($closingBraces); + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + out = it.util.cleanUpCode(out); return out; } /***/ }), -/* 345 */ +/* 346 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = function generate_properties(it, $keyword) { +module.exports = function generate_anyOf(it, $keyword) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; @@ -76252,570 +78915,123 @@ module.exports = function generate_properties(it, $keyword) { var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; - var $key = 'key' + $lvl, - $dataNxt = $it.dataLevel = it.dataLevel + 1, - $nextData = 'data' + $dataNxt; - var $schemaKeys = Object.keys($schema || {}), - $pProperties = it.schema.patternProperties || {}, - $pPropertyKeys = Object.keys($pProperties), - $aProperties = it.schema.additionalProperties, - $someProperties = $schemaKeys.length || $pPropertyKeys.length, - $noAdditional = $aProperties === false, - $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, - $removeAdditional = it.opts.removeAdditional, - $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, - $ownProperties = it.opts.ownProperties, - $currentBaseId = it.baseId; - var $required = it.schema.required; - if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); - if (it.opts.v5) { - var $pgProperties = it.schema.patternGroups || {}, - $pgPropertyKeys = Object.keys($pgProperties); - } - out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; - if ($checkAdditional) { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - if ($ownProperties) { - out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; - } - if ($someProperties) { - out += ' var isAdditional' + ($lvl) + ' = !(false '; - if ($schemaKeys.length) { - if ($schemaKeys.length > 5) { - out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] '; - } else { - var arr1 = $schemaKeys; - if (arr1) { - var $propertyKey, i1 = -1, - l1 = arr1.length - 1; - while (i1 < l1) { - $propertyKey = arr1[i1 += 1]; - out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; - } - } - } - } - if ($pPropertyKeys.length) { - var arr2 = $pPropertyKeys; - if (arr2) { - var $pProperty, $i = -1, - l2 = arr2.length - 1; - while ($i < l2) { - $pProperty = arr2[$i += 1]; - out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; - } - } - } - if (it.opts.v5 && $pgPropertyKeys && $pgPropertyKeys.length) { - var arr3 = $pgPropertyKeys; - if (arr3) { - var $pgProperty, $i = -1, - l3 = arr3.length - 1; - while ($i < l3) { - $pgProperty = arr3[$i += 1]; - out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') '; - } - } + var $noEmptySchema = $schema.every(function($sch) { + return it.util.schemaHasRules($sch, it.RULES.all); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; } - out += ' ); if (isAdditional' + ($lvl) + ') { '; } - if ($removeAdditional == 'all') { - out += ' delete ' + ($data) + '[' + ($key) + ']; '; - } else { - var $currentErrorPath = it.errorPath; - var $additionalProperty = '\' + ' + $key + ' + \''; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; } - if ($noAdditional) { - if ($removeAdditional) { - out += ' delete ' + ($data) + '[' + ($key) + ']; '; - } else { - out += ' ' + ($nextValid) + ' = false; '; - var $currErrSchemaPath = $errSchemaPath; - $errSchemaPath = it.errSchemaPath + '/additionalProperties'; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have additional properties\' '; - } - if (it.opts.verbose) { - out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - $errSchemaPath = $currErrSchemaPath; - if ($breakOnError) { - out += ' break; '; - } - } - } else if ($additionalIsSchema) { - if ($removeAdditional == 'failing') { - out += ' var ' + ($errs) + ' = errors; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - $it.schema = $aProperties; - $it.schemaPath = it.schemaPath + '.additionalProperties'; - $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; - $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; - it.compositeRule = $it.compositeRule = $wasComposite; - } else { - $it.schema = $aProperties; - $it.schemaPath = it.schemaPath + '.additionalProperties'; - $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; - $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } - it.errorPath = $currentErrorPath; + out += ' } '; + } else { + out += ' {} '; } - if ($someProperties) { + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { out += ' } '; } - out += ' } '; + out = it.util.cleanUpCode(out); + } else { if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; + out += ' if (true) { '; } } - var $useDefaults = it.opts.useDefaults && !it.compositeRule; - if ($schemaKeys.length) { - var arr4 = $schemaKeys; - if (arr4) { - var $propertyKey, i4 = -1, - l4 = arr4.length - 1; - while (i4 < l4) { - $propertyKey = arr4[i4 += 1]; - var $sch = $schema[$propertyKey]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - var $prop = it.util.getProperty($propertyKey), - $passData = $data + $prop, - $hasDefault = $useDefaults && $sch.default !== undefined; - $it.schema = $sch; - $it.schemaPath = $schemaPath + $prop; - $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); - $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); - $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - $code = it.util.varReplace($code, $nextData, $passData); - var $useData = $passData; - } else { - var $useData = $nextData; - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; - } - if ($hasDefault) { - out += ' ' + ($code) + ' '; - } else { - if ($requiredHash && $requiredHash[$propertyKey]) { - out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = false; '; - var $currentErrorPath = it.errorPath, - $currErrSchemaPath = $errSchemaPath, - $missingProperty = it.util.escapeQuotes($propertyKey); - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); - } - $errSchemaPath = it.errSchemaPath + '/required'; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - $errSchemaPath = $currErrSchemaPath; - it.errorPath = $currentErrorPath; - out += ' } else { '; - } else { - if ($breakOnError) { - out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = true; } else { '; - } else { - out += ' if (' + ($useData) + ' !== undefined) { '; - } - } - out += ' ' + ($code) + ' } '; - } - } - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - var arr5 = $pPropertyKeys; - if (arr5) { - var $pProperty, i5 = -1, - l5 = arr5.length - 1; - while (i5 < l5) { - $pProperty = arr5[i5 += 1]; - var $sch = $pProperties[$pProperty]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $it.schema = $sch; - $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); - $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - if ($ownProperties) { - out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; - } - out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else ' + ($nextValid) + ' = true; '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - if (it.opts.v5) { - var arr6 = $pgPropertyKeys; - if (arr6) { - var $pgProperty, i6 = -1, - l6 = arr6.length - 1; - while (i6 < l6) { - $pgProperty = arr6[i6 += 1]; - var $pgSchema = $pgProperties[$pgProperty], - $sch = $pgSchema.schema; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $it.schema = $sch; - $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; - $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema'; - out += ' var pgPropCount' + ($lvl) + ' = 0; for (var ' + ($key) + ' in ' + ($data) + ') { '; - if ($ownProperties) { - out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; - } - out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else ' + ($nextValid) + ' = true; '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - var $pgMin = $pgSchema.minimum, - $pgMax = $pgSchema.maximum; - if ($pgMin !== undefined || $pgMax !== undefined) { - out += ' var ' + ($valid) + ' = true; '; - var $currErrSchemaPath = $errSchemaPath; - if ($pgMin !== undefined) { - var $limit = $pgMin, - $reason = 'minimum', - $moreOrLess = 'less'; - out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; '; - $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($pgMax !== undefined) { - out += ' else '; - } - } - if ($pgMax !== undefined) { - var $limit = $pgMax, - $reason = 'maximum', - $moreOrLess = 'more'; - out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; '; - $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - } - $errSchemaPath = $currErrSchemaPath; - if ($breakOnError) { - out += ' if (' + ($valid) + ') { '; - $closingBraces += '}'; - } - } - } - } - } - } - if ($breakOnError) { - out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; - } - out = it.util.cleanUpCode(out); return out; } /***/ }), -/* 346 */ +/* 347 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = function generate_ref(it, $keyword) { +module.exports = function generate_constant(it, $keyword) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; - var $async, $refCode; - if ($schema == '#' || $schema == '#/') { - if (it.isRoot) { - $async = it.async; - $refCode = 'validate'; - } else { - $async = it.root.schema.$async === true; - $refCode = 'root.refVal[0]'; - } + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; } else { - var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); - if ($refVal === undefined) { - var $message = 'can\'t resolve reference ' + $schema + ' from id ' + it.baseId; - if (it.opts.missingRefs == 'fail') { - console.log($message); - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; - } - if (it.opts.verbose) { - out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - if ($breakOnError) { - out += ' if (false) { '; - } - } else if (it.opts.missingRefs == 'ignore') { - console.log($message); - if ($breakOnError) { - out += ' if (true) { '; - } - } else { - var $error = new Error($message); - $error.missingRef = it.resolve.url(it.baseId, $schema); - $error.missingSchema = it.resolve.normalizeId(it.resolve.fullPath($error.missingRef)); - throw $error; - } - } else if ($refVal.inline) { - var $it = it.util.copy(it); - $it.level++; - var $nextValid = 'valid' + $it.level; - $it.schema = $refVal.schema; - $it.schemaPath = ''; - $it.errSchemaPath = $schema; - var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); - out += ' ' + ($code) + ' '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - } - } else { - $async = $refVal.$async === true; - $refCode = $refVal.code; - } + $schemaValue = $schema; } - if ($refCode) { - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; - if (it.opts.passContext) { - out += ' ' + ($refCode) + '.call(this, '; - } else { - out += ' ' + ($refCode) + '( '; + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('constant') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; } - out += ' ' + ($data) + ', (dataPath || \'\')'; - if (it.errorPath != '""') { - out += ' + ' + (it.errorPath); + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } - var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', - $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; - out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; - var __callValidate = out; - out = $$outStack.pop(); - if ($async) { - if (!it.async) throw new Error('async schema referenced by sync schema'); - out += ' try { '; - if ($breakOnError) { - out += 'var ' + ($valid) + ' ='; - } - out += ' ' + (it.yieldAwait) + ' ' + (__callValidate) + '; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } '; - if ($breakOnError) { - out += ' if (' + ($valid) + ') { '; - } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; } else { - out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; - if ($breakOnError) { - out += ' else { '; - } + out += ' validate.errors = [' + (__err) + ']; return false; '; } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } + out += ' }'; return out; } /***/ }), -/* 347 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = function generate_required(it, $keyword) { +module.exports = function generate_custom(it, $keyword) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; @@ -76823,8 +79039,10 @@ module.exports = function generate_required(it, $keyword) { var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; + var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; var $isData = it.opts.v5 && $schema && $schema.$data, $schemaValue; if ($isData) { @@ -76833,245 +79051,214 @@ module.exports = function generate_required(it, $keyword) { } else { $schemaValue = $schema; } - var $vSchema = 'schema' + $lvl; - if (!$isData) { - if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { - var $required = []; - var arr1 = $schema; - if (arr1) { - var $property, i1 = -1, - l1 = arr1.length - 1; - while (i1 < l1) { - $property = arr1[i1 += 1]; - var $propertySch = it.schema.properties[$property]; - if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) { - $required[$required.length] = $property; - } - } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($validateSchema) { + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') {'; + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += '' + (it.yieldAwait); } + out += '' + (def_callRuleValidate) + '; '; } else { - var $required = $schema; + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } } } - if ($isData || $required.length) { - var $currentErrorPath = it.errorPath, - $loopRequired = $isData || $required.length >= it.opts.loopRequired; + if ($rDef.modifying) { + out += ' ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + if ($validateSchema) { + out += ' }'; + } + if ($rDef.valid) { if ($breakOnError) { - out += ' var missing' + ($lvl) + '; '; - if ($loopRequired) { - if (!$isData) { - out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; - } - var $i = 'i' + $lvl, - $propertyPath = 'schema' + $lvl + '[' + $i + ']', - $missingProperty = '\' + ' + $propertyPath + ' + \''; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); - } - out += ' var ' + ($valid) + ' = true; '; - if ($isData) { - out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; - } - out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined; if (!' + ($valid) + ') break; } '; - if ($isData) { - out += ' } '; - } - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } '; - if ($isData) { - out += ' } '; - } - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); + var $i = 'i' + $lvl, + $vSchema = 'schema' + $lvl; + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ';'; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to one of the allowed values\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + + +/***/ }), +/* 351 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate_format(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + if (it.opts.format === false) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $unknownFormats = it.opts.unknownFormats, + $allowUnknown = Array.isArray($unknownFormats); + if ($isData) { + var $format = 'format' + $lvl; + out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var isObject' + ($lvl) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; if (isObject' + ($lvl) + ') { '; + if (it.async) { + out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; + } + out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' ('; + if ($unknownFormats === true || $allowUnknown) { + out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; + if ($allowUnknown) { + out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; + } + out += ') || '; + } + out += ' (' + ($format) + ' && !(typeof ' + ($format) + ' == \'function\' ? '; + if (it.async) { + out += ' (async' + ($lvl) + ' ? ' + (it.yieldAwait) + ' ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; + } else { + out += ' ' + ($format) + '(' + ($data) + ') '; + } + out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; + } else { + var $format = it.formats[$schema]; + if (!$format) { + if ($unknownFormats === true || ($allowUnknown && $unknownFormats.indexOf($schema) == -1)) { + throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); + } else { + if (!$allowUnknown) { + console.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); + if ($unknownFormats !== 'ignore') console.warn('In the next major version it will throw exception. See option unknownFormats for more information'); + } + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + } + var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + if ($async) { + if (!it.async) throw new Error('async format in sync schema'); + var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; + out += ' if (!(' + (it.yieldAwait) + ' ' + ($formatRef) + '(' + ($data) + '))) { '; + } else { + out += ' if (! '; + var $formatRef = 'formats' + it.util.getProperty($schema); + if ($isObject) $formatRef += '.validate'; + if (typeof $format == 'function') { + out += ' ' + ($formatRef) + '(' + ($data) + ') '; + } else { + out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; + } + out += ') { '; + } + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match format "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + + +/***/ }), +/* 352 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate_items(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId; + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if (Array.isArray($schema)) { + var $additionalItems = it.schema.additionalItems; + if ($additionalItems === false) { + out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; } else { - out += '' + ($schema); + out += ' validate.errors = [' + (__err) + ']; return false; '; } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if (it.util.schemaHasRules($schema, it.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} + + +/***/ }), +/* 353 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate_multipleOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schema) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + + +/***/ }), +/* 354 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate_not(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if (it.util.schemaHasRules($schema, it.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { @@ -77265,13 +79920,27 @@ module.exports = function generate_uniqueItems(it, $keyword) { } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } - out += ' } '; - if ($breakOnError) { - out += ' else { '; + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; } } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if ($breakOnError) { - out += ' if (true) { '; + out += ' if (false) { '; } } return out; @@ -77279,2972 +79948,8435 @@ module.exports = function generate_uniqueItems(it, $keyword) { /***/ }), -/* 350 */ +/* 355 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +module.exports = function generate_oneOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;'; + var $currentBaseId = $it.baseId; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} -var IDENTIFIER = /^[a-z_$][a-z0-9_$\-]*$/i; -var customRuleCode = __webpack_require__(335); - -module.exports = { - add: addKeyword, - get: getKeyword, - remove: removeKeyword -}; - -/** - * Define custom keyword - * @this Ajv - * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). - * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. - */ -function addKeyword(keyword, definition) { - /* jshint validthis: true */ - /* eslint no-shadow: 0 */ - var RULES = this.RULES; - - if (RULES.keywords[keyword]) - throw new Error('Keyword ' + keyword + ' is already defined'); - if (!IDENTIFIER.test(keyword)) - throw new Error('Keyword ' + keyword + ' is not a valid identifier'); +/***/ }), +/* 356 */ +/***/ (function(module, exports, __webpack_require__) { - if (definition) { - if (definition.macro && definition.valid !== undefined) - throw new Error('"valid" option cannot be used with macro keywords'); +"use strict"; - var dataType = definition.type; - if (Array.isArray(dataType)) { - var i, len = dataType.length; - for (i=0; i 5) { + out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + if (it.opts.v5 && $pgPropertyKeys && $pgPropertyKeys.length) { + var arr3 = $pgPropertyKeys; + if (arr3) { + var $pgProperty, $i = -1, + l3 = arr3.length - 1; + while ($i < l3) { + $pgProperty = arr3[$i += 1]; + out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have additional properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr4 = $schemaKeys; + if (arr4) { + var $propertyKey, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $propertyKey = arr4[i4 += 1]; + var $sch = $schema[$propertyKey]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + var arr5 = $pPropertyKeys; + if (arr5) { + var $pProperty, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $pProperty = arr5[i5 += 1]; + var $sch = $pProperties[$pProperty]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (it.opts.v5) { + var arr6 = $pgPropertyKeys; + if (arr6) { + var $pgProperty, i6 = -1, + l6 = arr6.length - 1; + while (i6 < l6) { + $pgProperty = arr6[i6 += 1]; + var $pgSchema = $pgProperties[$pgProperty], + $sch = $pgSchema.schema; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; + $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema'; + out += ' var pgPropCount' + ($lvl) + ' = 0; for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + var $pgMin = $pgSchema.minimum, + $pgMax = $pgSchema.maximum; + if ($pgMin !== undefined || $pgMax !== undefined) { + out += ' var ' + ($valid) + ' = true; '; + var $currErrSchemaPath = $errSchemaPath; + if ($pgMin !== undefined) { + var $limit = $pgMin, + $reason = 'minimum', + $moreOrLess = 'less'; + out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; '; + $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($pgMax !== undefined) { + out += ' else '; + } + } + if ($pgMax !== undefined) { + var $limit = $pgMax, + $reason = 'maximum', + $moreOrLess = 'more'; + out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; '; + $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' if (' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} + + +/***/ }), +/* 359 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate_ref(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $async, $refCode; + if ($schema == '#' || $schema == '#/') { + if (it.isRoot) { + $async = it.async; + $refCode = 'validate'; + } else { + $async = it.root.schema.$async === true; + $refCode = 'root.refVal[0]'; + } + } else { + var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); + if ($refVal === undefined) { + var $message = 'can\'t resolve reference ' + $schema + ' from id ' + it.baseId; + if (it.opts.missingRefs == 'fail') { + console.log($message); + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; + } + if (it.opts.verbose) { + out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + if ($breakOnError) { + out += ' if (false) { '; + } + } else if (it.opts.missingRefs == 'ignore') { + console.log($message); + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + var $error = new Error($message); + $error.missingRef = it.resolve.url(it.baseId, $schema); + $error.missingSchema = it.resolve.normalizeId(it.resolve.fullPath($error.missingRef)); + throw $error; + } + } else if ($refVal.inline) { + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $refVal.schema; + $it.schemaPath = ''; + $it.errSchemaPath = $schema; + var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); + out += ' ' + ($code) + ' '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + } + } else { + $async = $refVal.$async === true; + $refCode = $refVal.code; + } + } + if ($refCode) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + if (it.opts.passContext) { + out += ' ' + ($refCode) + '.call(this, '; + } else { + out += ' ' + ($refCode) + '( '; + } + out += ' ' + ($data) + ', (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; + var __callValidate = out; + out = $$outStack.pop(); + if ($async) { + if (!it.async) throw new Error('async schema referenced by sync schema'); + out += ' try { '; + if ($breakOnError) { + out += 'var ' + ($valid) + ' ='; + } + out += ' ' + (it.yieldAwait) + ' ' + (__callValidate) + '; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } '; + if ($breakOnError) { + out += ' if (' + ($valid) + ') { '; + } + } else { + out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; + if ($breakOnError) { + out += ' else { '; + } + } + } + return out; +} + + +/***/ }), +/* 360 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate_required(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $vSchema = 'schema' + $lvl; + if (!$isData) { + if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { + var $required = []; + var arr1 = $schema; + if (arr1) { + var $property, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $property = arr1[i1 += 1]; + var $propertySch = it.schema.properties[$property]; + if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var _$property, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + _$property = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty(_$property); + out += ' ( ' + ($data) + ($prop) + ' === undefined && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? _$property : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $reqProperty, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $reqProperty = arr3[i3 += 1]; + var $prop = it.util.getProperty($reqProperty), + $missingProperty = it.util.escapeQuotes($reqProperty); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $reqProperty, it.opts.jsonPointers); + } + out += ' if (' + ($data) + ($prop) + ' === undefined) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} + + +/***/ }), +/* 361 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate_switch(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $ifPassed = 'ifPassed' + it.level, + $currentBaseId = $it.baseId, + $shouldContinue; + out += 'var ' + ($ifPassed) + ';'; + var arr1 = $schema; + if (arr1) { + var $sch, $caseIndex = -1, + l1 = arr1.length - 1; + while ($caseIndex < l1) { + $sch = arr1[$caseIndex += 1]; + if ($caseIndex && !$shouldContinue) { + out += ' if (!' + ($ifPassed) + ') { '; + $closingBraces += '}'; + } + if ($sch.if && it.util.schemaHasRules($sch.if, it.RULES.all)) { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + $it.schema = $sch.if; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].if'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/if'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($ifPassed) + ' = ' + ($nextValid) + '; if (' + ($ifPassed) + ') { '; + if (typeof $sch.then == 'boolean') { + if ($sch.then === false) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "switch" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; + } else { + $it.schema = $sch.then; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } } '; + } else { + out += ' ' + ($ifPassed) + ' = true; '; + if (typeof $sch.then == 'boolean') { + if ($sch.then === false) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "switch" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; + } else { + $it.schema = $sch.then; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } + } + $shouldContinue = $sch.continue + } + } + out += '' + ($closingBraces) + 'var ' + ($valid) + ' = ' + ($nextValid) + '; '; + out = it.util.cleanUpCode(out); + return out; +} + + +/***/ }), +/* 362 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate_uniqueItems(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + + +/***/ }), +/* 363 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var IDENTIFIER = /^[a-z_$][a-z0-9_$\-]*$/i; +var customRuleCode = __webpack_require__(348); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword +}; + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + if (definition.macro && definition.valid !== undefined) + throw new Error('"valid" option cannot be used with macro keywords'); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + var i, len = dataType.length; + for (i=0; i 0) { + ret += ESC + x + 'C'; + } + + if (y < 0) { + ret += ESC + (-y) + 'A'; + } else if (y > 0) { + ret += ESC + y + 'B'; + } + + return ret; +}; + +x.cursorUp = function (count) { + return ESC + (typeof count === 'number' ? count : 1) + 'A'; +}; + +x.cursorDown = function (count) { + return ESC + (typeof count === 'number' ? count : 1) + 'B'; +}; + +x.cursorForward = function (count) { + return ESC + (typeof count === 'number' ? count : 1) + 'C'; +}; + +x.cursorBackward = function (count) { + return ESC + (typeof count === 'number' ? count : 1) + 'D'; +}; + +x.cursorLeft = ESC + '1000D'; +x.cursorSavePosition = ESC + 's'; +x.cursorRestorePosition = ESC + 'u'; +x.cursorGetPosition = ESC + '6n'; +x.cursorNextLine = ESC + 'E'; +x.cursorPrevLine = ESC + 'F'; +x.cursorHide = ESC + '?25l'; +x.cursorShow = ESC + '?25h'; + +x.eraseLines = function (count) { + var clear = ''; + + for (var i = 0; i < count; i++) { + clear += x.cursorLeft + x.eraseEndLine + (i < count - 1 ? x.cursorUp() : ''); + } + + return clear; +}; + +x.eraseEndLine = ESC + 'K'; +x.eraseStartLine = ESC + '1K'; +x.eraseLine = ESC + '2K'; +x.eraseDown = ESC + 'J'; +x.eraseUp = ESC + '1J'; +x.eraseScreen = ESC + '2J'; +x.scrollUp = ESC + 'S'; +x.scrollDown = ESC + 'T'; + +x.clearScreen = '\u001bc'; +x.beep = '\u0007'; + +x.image = function (buf, opts) { + opts = opts || {}; + + var ret = '\u001b]1337;File=inline=1'; + + if (opts.width) { + ret += ';width=' + opts.width; + } + + if (opts.height) { + ret += ';height=' + opts.height; + } + + if (opts.preserveAspectRatio === false) { + ret += ';preserveAspectRatio=0'; + } + + return ret + ':' + buf.toString('base64') + '\u0007'; +}; + +x.iTerm = {}; + +x.iTerm.setCwd = function (cwd) { + return '\u001b]50;CurrentDir=' + (cwd || process.cwd()) + '\u0007'; +}; + + +/***/ }), +/* 368 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(module) { +const colorConvert = __webpack_require__(468); + +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Fix humans + styles.color.grey = styles.color.gray; + + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + + for (const styleName of Object.keys(group)) { + const style = group[styleName]; + + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } + + const rgb2rgb = (r, g, b) => [r, g, b]; + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = {}; + styles.color.ansi256 = {}; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + + styles.bgColor.ansi = {}; + styles.bgColor.ansi256 = {}; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (const key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)(module))) + +/***/ }), +/* 369 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * arr-diff + * + * Copyright (c) 2014 Jon Schlinkert, contributors. + * Licensed under the MIT License + */ + + + +var flatten = __webpack_require__(370); +var slice = [].slice; + +/** + * Return the difference between the first array and + * additional arrays. + * + * ```js + * var diff = require('{%= name %}'); + * + * var a = ['a', 'b', 'c', 'd']; + * var b = ['b', 'c']; + * + * console.log(diff(a, b)) + * //=> ['a', 'd'] + * ``` + * + * @param {Array} `a` + * @param {Array} `b` + * @return {Array} + * @api public + */ + +function diff(arr, arrays) { + var argsLen = arguments.length; + var len = arr.length, i = -1; + var res = [], arrays; + + if (argsLen === 1) { + return arr; + } + + if (argsLen > 2) { + arrays = flatten(slice.call(arguments, 1)); + } + + while (++i < len) { + if (!~arrays.indexOf(arr[i])) { + res.push(arr[i]); + } + } + return res; +} + +/** + * Expose `diff` + */ + +module.exports = diff; + + +/***/ }), +/* 370 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * arr-flatten + * + * Copyright (c) 2014-2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + + + +module.exports = function flatten(arr) { + return flat(arr, []); +}; + +function flat(arr, acc) { + var len = arr.length; + var idx = -1; + + while (++idx < len) { + var cur = arr[idx]; + if (Array.isArray(cur)) { + flat(cur, acc); + } else { + acc.push(cur); + } + } + return acc; +} + + +/***/ }), +/* 371 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function (arr, predicate, ctx) { + if (typeof Array.prototype.findIndex === 'function') { + return arr.findIndex(predicate, ctx); + } + + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + + var list = Object(arr); + var len = list.length; + + if (len === 0) { + return -1; + } + + for (var i = 0; i < len; i++) { + if (predicate.call(ctx, list[i], i, list)) { + return i; + } + } + + return -1; +}; + + +/***/ }), +/* 372 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * array-unique + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + +module.exports = function unique(arr) { + if (!Array.isArray(arr)) { + throw new TypeError('array-unique expects an array.'); + } + + var len = arr.length; + var i = -1; + + while (i++ < len) { + var j = i + 1; + + for (; j < arr.length; ++j) { + if (arr[i] === arr[j]) { + arr.splice(j--, 1); + } + } + } + return arr; +}; + + +/***/ }), +/* 373 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var rawAsap = __webpack_require__(374); +var freeTasks = []; + +/** + * Calls a task as soon as possible after returning, in its own event, with + * priority over IO events. An exception thrown in a task can be handled by + * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise + * crash the process. If the error is handled, all subsequent tasks will + * resume. + * + * @param {{call}} task A callable object, typically a function that takes no + * arguments. + */ +module.exports = asap; +function asap(task) { + var rawTask; + if (freeTasks.length) { + rawTask = freeTasks.pop(); + } else { + rawTask = new RawTask(); + } + rawTask.task = task; + rawTask.domain = process.domain; + rawAsap(rawTask); +} + +function RawTask() { + this.task = null; + this.domain = null; +} + +RawTask.prototype.call = function () { + if (this.domain) { + this.domain.enter(); + } + var threw = true; + try { + this.task.call(); + threw = false; + // If the task throws an exception (presumably) Node.js restores the + // domain stack for the next event. + if (this.domain) { + this.domain.exit(); + } + } finally { + // We use try/finally and a threw flag to avoid messing up stack traces + // when we catch and release errors. + if (threw) { + // In Node.js, uncaught exceptions are considered fatal errors. + // Re-throw them to interrupt flushing! + // Ensure that flushing continues if an uncaught exception is + // suppressed listening process.on("uncaughtException") or + // domain.on("error"). + rawAsap.requestFlush(); + } + // If the task threw an error, we do not want to exit the domain here. + // Exiting the domain would prevent the domain from catching the error. + this.task = null; + this.domain = null; + freeTasks.push(this); + } +}; + + + +/***/ }), +/* 374 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var domain; // The domain module is executed on demand +var hasSetImmediate = typeof setImmediate === "function"; + +// Use the fastest means possible to execute a task in its own turn, with +// priority over other events including network IO events in Node.js. +// +// An exception thrown by a task will permanently interrupt the processing of +// subsequent tasks. The higher level `asap` function ensures that if an +// exception is thrown by a task, that the task queue will continue flushing as +// soon as possible, but if you use `rawAsap` directly, you are responsible to +// either ensure that no exceptions are thrown from your task, or to manually +// call `rawAsap.requestFlush` if an exception is thrown. +module.exports = rawAsap; +function rawAsap(task) { + if (!queue.length) { + requestFlush(); + flushing = true; + } + // Avoids a function call + queue[queue.length] = task; +} + +var queue = []; +// Once a flush has been requested, no further calls to `requestFlush` are +// necessary until the next `flush` completes. +var flushing = false; +// The position of the next task to execute in the task queue. This is +// preserved between calls to `flush` so that it can be resumed if +// a task throws an exception. +var index = 0; +// If a task schedules additional tasks recursively, the task queue can grow +// unbounded. To prevent memory excaustion, the task queue will periodically +// truncate already-completed tasks. +var capacity = 1024; + +// The flush function processes all tasks that have been scheduled with +// `rawAsap` unless and until one of those tasks throws an exception. +// If a task throws an exception, `flush` ensures that its state will remain +// consistent and will resume where it left off when called again. +// However, `flush` does not make any arrangements to be called again if an +// exception is thrown. +function flush() { + while (index < queue.length) { + var currentIndex = index; + // Advance the index before calling the task. This ensures that we will + // begin flushing on the next task the task throws an error. + index = index + 1; + queue[currentIndex].call(); + // Prevent leaking memory for long chains of recursive calls to `asap`. + // If we call `asap` within tasks scheduled by `asap`, the queue will + // grow, but to avoid an O(n) walk for every task we execute, we don't + // shift tasks off the queue after they have been executed. + // Instead, we periodically shift 1024 tasks off the queue. + if (index > capacity) { + // Manually shift all values starting at the index back to the + // beginning of the queue. + for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { + queue[scan] = queue[scan + index]; + } + queue.length -= index; + index = 0; + } + } + queue.length = 0; + index = 0; + flushing = false; +} + +rawAsap.requestFlush = requestFlush; +function requestFlush() { + // Ensure flushing is not bound to any domain. + // It is not sufficient to exit the domain, because domains exist on a stack. + // To execute code outside of any domain, the following dance is necessary. + var parentDomain = process.domain; + if (parentDomain) { + if (!domain) { + // Lazy execute the domain module. + // Only employed if the user elects to use domains. + domain = __webpack_require__(729); + } + domain.active = process.domain = null; + } + + // `setImmediate` is slower that `process.nextTick`, but `process.nextTick` + // cannot handle recursion. + // `requestFlush` will only be called recursively from `asap.js`, to resume + // flushing after an error is thrown into a domain. + // Conveniently, `setImmediate` was introduced in the same version + // `process.nextTick` started throwing recursion errors. + if (flushing && hasSetImmediate) { + setImmediate(flush); + } else { + process.nextTick(flush); + } + + if (parentDomain) { + domain.active = process.domain = parentDomain; + } +} + + +/***/ }), +/* 375 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2011 Mark Cavage All rights reserved. + +var errors = __webpack_require__(145); +var types = __webpack_require__(146); + +var Reader = __webpack_require__(376); +var Writer = __webpack_require__(377); + + +///--- Exports + +module.exports = { + + Reader: Reader, + + Writer: Writer + +}; + +for (var t in types) { + if (types.hasOwnProperty(t)) + module.exports[t] = types[t]; +} +for (var e in errors) { + if (errors.hasOwnProperty(e)) + module.exports[e] = errors[e]; +} + + +/***/ }), +/* 376 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = __webpack_require__(36); + +var ASN1 = __webpack_require__(146); +var errors = __webpack_require__(145); + + +///--- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + + + +///--- API + +function Reader(data) { + if (!data || !Buffer.isBuffer(data)) + throw new TypeError('data must be a node Buffer'); + + this._buf = data; + this._size = data.length; + + // These hold the "current" state + this._len = 0; + this._offset = 0; +} + +Object.defineProperty(Reader.prototype, 'length', { + enumerable: true, + get: function () { return (this._len); } +}); + +Object.defineProperty(Reader.prototype, 'offset', { + enumerable: true, + get: function () { return (this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'remain', { + get: function () { return (this._size - this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'buffer', { + get: function () { return (this._buf.slice(this._offset)); } +}); + + +/** + * Reads a single byte and advances offset; you can pass in `true` to make this + * a "peek" operation (i.e., get the byte, but don't advance the offset). + * + * @param {Boolean} peek true means don't move offset. + * @return {Number} the next byte, null if not enough data. + */ +Reader.prototype.readByte = function(peek) { + if (this._size - this._offset < 1) + return null; + + var b = this._buf[this._offset] & 0xff; + + if (!peek) + this._offset += 1; + + return b; +}; + + +Reader.prototype.peek = function() { + return this.readByte(true); +}; + + +/** + * Reads a (potentially) variable length off the BER buffer. This call is + * not really meant to be called directly, as callers have to manipulate + * the internal buffer afterwards. + * + * As a result of this call, you can call `Reader.length`, until the + * next thing called that does a readLength. + * + * @return {Number} the amount of offset to advance the buffer. + * @throws {InvalidAsn1Error} on bad ASN.1 + */ +Reader.prototype.readLength = function(offset) { + if (offset === undefined) + offset = this._offset; + + if (offset >= this._size) + return null; + + var lenB = this._buf[offset++] & 0xff; + if (lenB === null) + return null; + + if ((lenB & 0x80) == 0x80) { + lenB &= 0x7f; + + if (lenB == 0) + throw newInvalidAsn1Error('Indefinite length not supported'); + + if (lenB > 4) + throw newInvalidAsn1Error('encoding too long'); + + if (this._size - offset < lenB) + return null; + + this._len = 0; + for (var i = 0; i < lenB; i++) + this._len = (this._len << 8) + (this._buf[offset++] & 0xff); + + } else { + // Wasn't a variable length + this._len = lenB; + } + + return offset; +}; + + +/** + * Parses the next sequence in this BER buffer. + * + * To get the length of the sequence, call `Reader.length`. + * + * @return {Number} the sequence's tag. + */ +Reader.prototype.readSequence = function(tag) { + var seq = this.peek(); + if (seq === null) + return null; + if (tag !== undefined && tag !== seq) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + seq.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + this._offset = o; + return seq; +}; + + +Reader.prototype.readInt = function() { + return this._readTag(ASN1.Integer); +}; + + +Reader.prototype.readBoolean = function() { + return (this._readTag(ASN1.Boolean) === 0 ? false : true); +}; + + +Reader.prototype.readEnumeration = function() { + return this._readTag(ASN1.Enumeration); +}; + + +Reader.prototype.readString = function(tag, retbuf) { + if (!tag) + tag = ASN1.OctetString; + + var b = this.peek(); + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + + if (o === null) + return null; + + if (this.length > this._size - o) + return null; + + this._offset = o; + + if (this.length === 0) + return retbuf ? new Buffer(0) : ''; + + var str = this._buf.slice(this._offset, this._offset + this.length); + this._offset += this.length; + + return retbuf ? str : str.toString('utf8'); +}; + +Reader.prototype.readOID = function(tag) { + if (!tag) + tag = ASN1.OID; + + var b = this.readString(tag, true); + if (b === null) + return null; + + var values = []; + var value = 0; + + for (var i = 0; i < b.length; i++) { + var byte = b[i] & 0xff; + + value <<= 7; + value += byte & 0x7f; + if ((byte & 0x80) == 0) { + values.push(value); + value = 0; + } + } + + value = values.shift(); + values.unshift(value % 40); + values.unshift((value / 40) >> 0); + + return values.join('.'); +}; + + +Reader.prototype._readTag = function(tag) { + assert.ok(tag !== undefined); + + var b = this.peek(); + + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + if (this.length > 4) + throw newInvalidAsn1Error('Integer too long: ' + this.length); + + if (this.length > this._size - o) + return null; + this._offset = o; + + var fb = this._buf[this._offset]; + var value = 0; + + for (var i = 0; i < this.length; i++) { + value <<= 8; + value |= (this._buf[this._offset++] & 0xff); + } + + if ((fb & 0x80) == 0x80 && i !== 4) + value -= (1 << (i * 8)); + + return value >> 0; +}; + + + +///--- Exported API + +module.exports = Reader; + + +/***/ }), +/* 377 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = __webpack_require__(36); +var ASN1 = __webpack_require__(146); +var errors = __webpack_require__(145); + + +///--- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + +var DEFAULT_OPTS = { + size: 1024, + growthFactor: 8 +}; + + +///--- Helpers + +function merge(from, to) { + assert.ok(from); + assert.equal(typeof(from), 'object'); + assert.ok(to); + assert.equal(typeof(to), 'object'); + + var keys = Object.getOwnPropertyNames(from); + keys.forEach(function(key) { + if (to[key]) + return; + + var value = Object.getOwnPropertyDescriptor(from, key); + Object.defineProperty(to, key, value); + }); + + return to; +} + + + +///--- API + +function Writer(options) { + options = merge(DEFAULT_OPTS, options || {}); + + this._buf = new Buffer(options.size || 1024); + this._size = this._buf.length; + this._offset = 0; + this._options = options; + + // A list of offsets in the buffer where we need to insert + // sequence tag/len pairs. + this._seq = []; +} + +Object.defineProperty(Writer.prototype, 'buffer', { + get: function () { + if (this._seq.length) + throw new InvalidAsn1Error(this._seq.length + ' unended sequence(s)'); + + return (this._buf.slice(0, this._offset)); + } +}); + +Writer.prototype.writeByte = function(b) { + if (typeof(b) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(1); + this._buf[this._offset++] = b; +}; + + +Writer.prototype.writeInt = function(i, tag) { + if (typeof(i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof(tag) !== 'number') + tag = ASN1.Integer; + + var sz = 4; + + while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && + (sz > 1)) { + sz--; + i <<= 8; + } + + if (sz > 4) + throw new InvalidAsn1Error('BER ints cannot be > 0xffffffff'); + + this._ensure(2 + sz); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = sz; + + while (sz-- > 0) { + this._buf[this._offset++] = ((i & 0xff000000) >>> 24); + i <<= 8; + } + +}; + + +Writer.prototype.writeNull = function() { + this.writeByte(ASN1.Null); + this.writeByte(0x00); +}; + + +Writer.prototype.writeEnumeration = function(i, tag) { + if (typeof(i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof(tag) !== 'number') + tag = ASN1.Enumeration; + + return this.writeInt(i, tag); +}; + + +Writer.prototype.writeBoolean = function(b, tag) { + if (typeof(b) !== 'boolean') + throw new TypeError('argument must be a Boolean'); + if (typeof(tag) !== 'number') + tag = ASN1.Boolean; + + this._ensure(3); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = 0x01; + this._buf[this._offset++] = b ? 0xff : 0x00; +}; + + +Writer.prototype.writeString = function(s, tag) { + if (typeof(s) !== 'string') + throw new TypeError('argument must be a string (was: ' + typeof(s) + ')'); + if (typeof(tag) !== 'number') + tag = ASN1.OctetString; + + var len = Buffer.byteLength(s); + this.writeByte(tag); + this.writeLength(len); + if (len) { + this._ensure(len); + this._buf.write(s, this._offset); + this._offset += len; + } +}; + + +Writer.prototype.writeBuffer = function(buf, tag) { + if (typeof(tag) !== 'number') + throw new TypeError('tag must be a number'); + if (!Buffer.isBuffer(buf)) + throw new TypeError('argument must be a buffer'); + + this.writeByte(tag); + this.writeLength(buf.length); + this._ensure(buf.length); + buf.copy(this._buf, this._offset, 0, buf.length); + this._offset += buf.length; +}; + + +Writer.prototype.writeStringArray = function(strings) { + if ((!strings instanceof Array)) + throw new TypeError('argument must be an Array[String]'); + + var self = this; + strings.forEach(function(s) { + self.writeString(s); + }); +}; + +// This is really to solve DER cases, but whatever for now +Writer.prototype.writeOID = function(s, tag) { + if (typeof(s) !== 'string') + throw new TypeError('argument must be a string'); + if (typeof(tag) !== 'number') + tag = ASN1.OID; + + if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) + throw new Error('argument is not a valid OID string'); + + function encodeOctet(bytes, octet) { + if (octet < 128) { + bytes.push(octet); + } else if (octet < 16384) { + bytes.push((octet >>> 7) | 0x80); + bytes.push(octet & 0x7F); + } else if (octet < 2097152) { + bytes.push((octet >>> 14) | 0x80); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else if (octet < 268435456) { + bytes.push((octet >>> 21) | 0x80); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else { + bytes.push(((octet >>> 28) | 0x80) & 0xFF); + bytes.push(((octet >>> 21) | 0x80) & 0xFF); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } + } + + var tmp = s.split('.'); + var bytes = []; + bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); + tmp.slice(2).forEach(function(b) { + encodeOctet(bytes, parseInt(b, 10)); + }); + + var self = this; + this._ensure(2 + bytes.length); + this.writeByte(tag); + this.writeLength(bytes.length); + bytes.forEach(function(b) { + self.writeByte(b); + }); +}; + + +Writer.prototype.writeLength = function(len) { + if (typeof(len) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(4); + + if (len <= 0x7f) { + this._buf[this._offset++] = len; + } else if (len <= 0xff) { + this._buf[this._offset++] = 0x81; + this._buf[this._offset++] = len; + } else if (len <= 0xffff) { + this._buf[this._offset++] = 0x82; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else if (len <= 0xffffff) { + this._buf[this._offset++] = 0x83; + this._buf[this._offset++] = len >> 16; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else { + throw new InvalidAsn1ERror('Length too long (> 4 bytes)'); + } +}; + +Writer.prototype.startSequence = function(tag) { + if (typeof(tag) !== 'number') + tag = ASN1.Sequence | ASN1.Constructor; + + this.writeByte(tag); + this._seq.push(this._offset); + this._ensure(3); + this._offset += 3; +}; + + +Writer.prototype.endSequence = function() { + var seq = this._seq.pop(); + var start = seq + 3; + var len = this._offset - start; + + if (len <= 0x7f) { + this._shift(start, len, -2); + this._buf[seq] = len; + } else if (len <= 0xff) { + this._shift(start, len, -1); + this._buf[seq] = 0x81; + this._buf[seq + 1] = len; + } else if (len <= 0xffff) { + this._buf[seq] = 0x82; + this._buf[seq + 1] = len >> 8; + this._buf[seq + 2] = len; + } else if (len <= 0xffffff) { + this._shift(start, len, 1); + this._buf[seq] = 0x83; + this._buf[seq + 1] = len >> 16; + this._buf[seq + 2] = len >> 8; + this._buf[seq + 3] = len; + } else { + throw new InvalidAsn1Error('Sequence too long'); + } +}; + + +Writer.prototype._shift = function(start, len, shift) { + assert.ok(start !== undefined); + assert.ok(len !== undefined); + assert.ok(shift); + + this._buf.copy(this._buf, start + shift, start, start + len); + this._offset += shift; +}; + +Writer.prototype._ensure = function(len) { + assert.ok(len); + + if (this._size - this._offset < len) { + var sz = this._size * this._options.growthFactor; + if (sz - this._offset < len) + sz += len; + + var buf = new Buffer(sz); + + this._buf.copy(buf, 0, 0, this._offset); + this._buf = buf; + this._size = sz; + } +}; + + + +///--- Exported API + +module.exports = Writer; + + +/***/ }), +/* 378 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = +{ + parallel : __webpack_require__(380), + serial : __webpack_require__(381), + serialOrdered : __webpack_require__(222) +}; + + +/***/ }), +/* 379 */ /***/ (function(module, exports) { -module.exports = { - "id": "https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Core schema meta-schema (v5 proposals)", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#" - } - }, - "positiveInteger": { - "type": "integer", - "minimum": 0 - }, - "positiveIntegerDefault0": { - "allOf": [ - { - "$ref": "#/definitions/positiveInteger" - }, - { - "default": 0 - } - ] - }, - "simpleTypes": { - "enum": [ - "array", - "boolean", - "integer", - "null", - "number", - "object", - "string" - ] - }, - "stringArray": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "uniqueItems": true - }, - "$data": { - "type": "object", - "required": [ - "$data" - ], - "properties": { - "$data": { - "type": "string", - "anyOf": [ - { - "format": "relative-json-pointer" - }, - { - "format": "json-pointer" - } - ] - } - }, - "additionalProperties": false - } - }, - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uri" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": {}, - "multipleOf": { - "anyOf": [ - { - "type": "number", - "minimum": 0, - "exclusiveMinimum": true - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "maximum": { - "anyOf": [ - { - "type": "number" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "exclusiveMaximum": { - "anyOf": [ - { - "type": "boolean", - "default": false - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "minimum": { - "anyOf": [ - { - "type": "number" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "exclusiveMinimum": { - "anyOf": [ - { - "type": "boolean", - "default": false - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "maxLength": { - "anyOf": [ - { - "$ref": "#/definitions/positiveInteger" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "minLength": { - "anyOf": [ - { - "$ref": "#/definitions/positiveIntegerDefault0" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "pattern": { - "anyOf": [ - { - "type": "string", - "format": "regex" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "additionalItems": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#" - }, - { - "$ref": "#/definitions/$data" - } - ], - "default": {} - }, - "items": { - "anyOf": [ - { - "$ref": "#" - }, - { - "$ref": "#/definitions/schemaArray" - } - ], - "default": {} - }, - "maxItems": { - "anyOf": [ - { - "$ref": "#/definitions/positiveInteger" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "minItems": { - "anyOf": [ - { - "$ref": "#/definitions/positiveIntegerDefault0" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "uniqueItems": { - "anyOf": [ - { - "type": "boolean", - "default": false - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "maxProperties": { - "anyOf": [ - { - "$ref": "#/definitions/positiveInteger" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "minProperties": { - "anyOf": [ - { - "$ref": "#/definitions/positiveIntegerDefault0" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "required": { - "anyOf": [ - { - "$ref": "#/definitions/stringArray" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#" - }, - { - "$ref": "#/definitions/$data" - } - ], - "default": {} - }, - "definitions": { - "type": "object", - "additionalProperties": { - "$ref": "#" - }, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#" - }, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#" - }, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "$ref": "#" - }, - { - "$ref": "#/definitions/stringArray" - } - ] - } - }, - "enum": { - "anyOf": [ - { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "type": { - "anyOf": [ - { - "$ref": "#/definitions/simpleTypes" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/simpleTypes" - }, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "allOf": { - "$ref": "#/definitions/schemaArray" - }, - "anyOf": { - "$ref": "#/definitions/schemaArray" - }, - "oneOf": { - "$ref": "#/definitions/schemaArray" - }, - "not": { - "$ref": "#" - }, - "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "formatMaximum": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "formatMinimum": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "formatExclusiveMaximum": { - "anyOf": [ - { - "type": "boolean", - "default": false - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "formatExclusiveMinimum": { - "anyOf": [ - { - "type": "boolean", - "default": false - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "constant": { - "anyOf": [ - {}, - { - "$ref": "#/definitions/$data" - } - ] - }, - "contains": { - "$ref": "#" - }, - "patternGroups": { - "type": "object", - "additionalProperties": { - "type": "object", - "required": [ - "schema" - ], - "properties": { - "maximum": { - "anyOf": [ - { - "$ref": "#/definitions/positiveInteger" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "minimum": { - "anyOf": [ - { - "$ref": "#/definitions/positiveIntegerDefault0" - }, - { - "$ref": "#/definitions/$data" - } - ] - }, - "schema": { - "$ref": "#" - } - }, - "additionalProperties": false - }, - "default": {} - }, - "switch": { - "type": "array", - "items": { - "required": [ - "then" - ], - "properties": { - "if": { - "$ref": "#" - }, - "then": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#" - } - ] - }, - "continue": { - "type": "boolean" - } - }, - "additionalProperties": false, - "dependencies": { - "continue": [ - "if" - ] - } - } - } - }, - "dependencies": { - "exclusiveMaximum": [ - "maximum" - ], - "exclusiveMinimum": [ - "minimum" - ], - "formatMaximum": [ - "format" - ], - "formatMinimum": [ - "format" - ], - "formatExclusiveMaximum": [ - "formatMaximum" - ], - "formatExclusiveMinimum": [ - "formatMinimum" - ] - }, - "default": {} +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} + + +/***/ }), +/* 380 */ +/***/ (function(module, exports, __webpack_require__) { + +var iterate = __webpack_require__(219) + , initState = __webpack_require__(220) + , terminator = __webpack_require__(221) + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} + + +/***/ }), +/* 381 */ +/***/ (function(module, exports, __webpack_require__) { + +var serialOrdered = __webpack_require__(222); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} + + +/***/ }), +/* 382 */ +/***/ (function(module, exports, __webpack_require__) { + + +/*! + * Copyright 2010 LearnBoost + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Module dependencies. + */ + +var crypto = __webpack_require__(13) + , parse = __webpack_require__(18).parse + ; + +/** + * Valid keys. + */ + +var keys = + [ 'acl' + , 'location' + , 'logging' + , 'notification' + , 'partNumber' + , 'policy' + , 'requestPayment' + , 'torrent' + , 'uploadId' + , 'uploads' + , 'versionId' + , 'versioning' + , 'versions' + , 'website' + ] + +/** + * Return an "Authorization" header value with the given `options` + * in the form of "AWS :" + * + * @param {Object} options + * @return {String} + * @api private + */ + +function authorization (options) { + return 'AWS ' + options.key + ':' + sign(options) +} + +module.exports = authorization +module.exports.authorization = authorization + +/** + * Simple HMAC-SHA1 Wrapper + * + * @param {Object} options + * @return {String} + * @api private + */ + +function hmacSha1 (options) { + return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +} + +module.exports.hmacSha1 = hmacSha1 + +/** + * Create a base64 sha1 HMAC for `options`. + * + * @param {Object} options + * @return {String} + * @api private + */ + +function sign (options) { + options.message = stringToSign(options) + return hmacSha1(options) +} +module.exports.sign = sign + +/** + * Create a base64 sha1 HMAC for `options`. + * + * Specifically to be used with S3 presigned URLs + * + * @param {Object} options + * @return {String} + * @api private + */ + +function signQuery (options) { + options.message = queryStringToSign(options) + return hmacSha1(options) +} +module.exports.signQuery= signQuery + +/** + * Return a string for sign() with the given `options`. + * + * Spec: + * + * \n + * \n + * \n + * \n + * [headers\n] + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function stringToSign (options) { + var headers = options.amazonHeaders || '' + if (headers) headers += '\n' + var r = + [ options.verb + , options.md5 + , options.contentType + , options.date ? options.date.toUTCString() : '' + , headers + options.resource + ] + return r.join('\n') +} +module.exports.queryStringToSign = stringToSign + +/** + * Return a string for sign() with the given `options`, but is meant exclusively + * for S3 presigned URLs + * + * Spec: + * + * \n + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function queryStringToSign (options){ + return 'GET\n\n\n' + options.date + '\n' + options.resource +} +module.exports.queryStringToSign = queryStringToSign + +/** + * Perform the following: + * + * - ignore non-amazon headers + * - lowercase fields + * - sort lexicographically + * - trim whitespace between ":" + * - join with newline + * + * @param {Object} headers + * @return {String} + * @api private + */ + +function canonicalizeHeaders (headers) { + var buf = [] + , fields = Object.keys(headers) + ; + for (var i = 0, len = fields.length; i < len; ++i) { + var field = fields[i] + , val = headers[field] + , field = field.toLowerCase() + ; + if (0 !== field.indexOf('x-amz')) continue + buf.push(field + ':' + val) + } + return buf.sort().join('\n') +} +module.exports.canonicalizeHeaders = canonicalizeHeaders + +/** + * Perform the following: + * + * - ignore non sub-resources + * - sort lexicographically + * + * @param {String} resource + * @return {String} + * @api private + */ + +function canonicalizeResource (resource) { + var url = parse(resource, true) + , path = url.pathname + , buf = [] + ; + + Object.keys(url.query).forEach(function(key){ + if (!~keys.indexOf(key)) return + var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) + buf.push(key + val) + }) + + return path + (buf.length ? '?' + buf.sort().join('&') : '') +} +module.exports.canonicalizeResource = canonicalizeResource + + +/***/ }), +/* 383 */ +/***/ (function(module, exports, __webpack_require__) { + +var aws4 = exports, + url = __webpack_require__(18), + querystring = __webpack_require__(142), + crypto = __webpack_require__(13), + lru = __webpack_require__(384), + credentialsCache = lru(1000) + +// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html + +function hmac(key, string, encoding) { + return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) +} + +function hash(string, encoding) { + return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +} + +// This function assumes the string has already been percent encoded +function encodeRfc3986(urlEncodedString) { + return urlEncodedString.replace(/[!'()*]/g, function(c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +// request: { path | body, [host], [method], [headers], [service], [region] } +// credentials: { accessKeyId, secretAccessKey, [sessionToken] } +function RequestSigner(request, credentials) { + + if (typeof request === 'string') request = url.parse(request) + + var headers = request.headers = (request.headers || {}), + hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) + + this.request = request + this.credentials = credentials || this.defaultCredentials() + + this.service = request.service || hostParts[0] || '' + this.region = request.region || hostParts[1] || 'us-east-1' + + // SES uses a different domain from the service name + if (this.service === 'email') this.service = 'ses' + + if (!request.method && request.body) + request.method = 'POST' + + if (!headers.Host && !headers.host) { + headers.Host = request.hostname || request.host || this.createHost() + + // If a port is specified explicitly, use it as is + if (request.port) + headers.Host += ':' + request.port + } + if (!request.hostname && !request.host) + request.hostname = headers.Host || headers.host + + this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' +} + +RequestSigner.prototype.matchHost = function(host) { + var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/) + var hostParts = (match || []).slice(1, 3) + + // ES's hostParts are sometimes the other way round, if the value that is expected + // to be region equals ‘es’ switch them back + // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com + if (hostParts[1] === 'es') + hostParts = hostParts.reverse() + + return hostParts +} + +// http://docs.aws.amazon.com/general/latest/gr/rande.html +RequestSigner.prototype.isSingleRegion = function() { + // Special case for S3 and SimpleDB in us-east-1 + if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true + + return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] + .indexOf(this.service) >= 0 +} + +RequestSigner.prototype.createHost = function() { + var region = this.isSingleRegion() ? '' : + (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, + service = this.service === 'ses' ? 'email' : this.service + return service + region + '.amazonaws.com' +} + +RequestSigner.prototype.prepareRequest = function() { + this.parsePath() + + var request = this.request, headers = request.headers, query + + if (request.signQuery) { + + this.parsedPath.query = query = this.parsedPath.query || {} + + if (this.credentials.sessionToken) + query['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !query['X-Amz-Expires']) + query['X-Amz-Expires'] = 86400 + + if (query['X-Amz-Date']) + this.datetime = query['X-Amz-Date'] + else + query['X-Amz-Date'] = this.getDateTime() + + query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' + query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() + query['X-Amz-SignedHeaders'] = this.signedHeaders() + + } else { + + if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { + if (request.body && !headers['Content-Type'] && !headers['content-type']) + headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' + + if (request.body && !headers['Content-Length'] && !headers['content-length']) + headers['Content-Length'] = Buffer.byteLength(request.body) + + if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) + headers['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) + headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') + + if (headers['X-Amz-Date'] || headers['x-amz-date']) + this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] + else + headers['X-Amz-Date'] = this.getDateTime() + } + + delete headers.Authorization + delete headers.authorization + } +} + +RequestSigner.prototype.sign = function() { + if (!this.parsedPath) this.prepareRequest() + + if (this.request.signQuery) { + this.parsedPath.query['X-Amz-Signature'] = this.signature() + } else { + this.request.headers.Authorization = this.authHeader() + } + + this.request.path = this.formatPath() + + return this.request +} + +RequestSigner.prototype.getDateTime = function() { + if (!this.datetime) { + var headers = this.request.headers, + date = new Date(headers.Date || headers.date || new Date) + + this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + + // Remove the trailing 'Z' on the timestamp string for CodeCommit git access + if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) + } + return this.datetime +} + +RequestSigner.prototype.getDate = function() { + return this.getDateTime().substr(0, 8) +} + +RequestSigner.prototype.authHeader = function() { + return [ + 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), + 'SignedHeaders=' + this.signedHeaders(), + 'Signature=' + this.signature(), + ].join(', ') +} + +RequestSigner.prototype.signature = function() { + var date = this.getDate(), + cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), + kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) + if (!kCredentials) { + kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) + kRegion = hmac(kDate, this.region) + kService = hmac(kRegion, this.service) + kCredentials = hmac(kService, 'aws4_request') + credentialsCache.set(cacheKey, kCredentials) + } + return hmac(kCredentials, this.stringToSign(), 'hex') +} + +RequestSigner.prototype.stringToSign = function() { + return [ + 'AWS4-HMAC-SHA256', + this.getDateTime(), + this.credentialString(), + hash(this.canonicalString(), 'hex'), + ].join('\n') +} + +RequestSigner.prototype.canonicalString = function() { + if (!this.parsedPath) this.prepareRequest() + + var pathStr = this.parsedPath.path, + query = this.parsedPath.query, + headers = this.request.headers, + queryStr = '', + normalizePath = this.service !== 's3', + decodePath = this.service === 's3' || this.request.doNotEncodePath, + decodeSlashesInPath = this.service === 's3', + firstValOnly = this.service === 's3', + bodyHash + + if (this.service === 's3' && this.request.signQuery) { + bodyHash = 'UNSIGNED-PAYLOAD' + } else if (this.isCodeCommitGit) { + bodyHash = '' + } else { + bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || + hash(this.request.body || '', 'hex') + } + + if (query) { + queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { + if (!key) return obj + obj[key] = !Array.isArray(query[key]) ? query[key] : + (firstValOnly ? query[key][0] : query[key].slice().sort()) + return obj + }, {}))) + } + if (pathStr !== '/') { + if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') + pathStr = pathStr.split('/').reduce(function(path, piece) { + if (normalizePath && piece === '..') { + path.pop() + } else if (!normalizePath || piece !== '.') { + if (decodePath) piece = querystring.unescape(piece) + path.push(encodeRfc3986(querystring.escape(piece))) + } + return path + }, []).join('/') + if (pathStr[0] !== '/') pathStr = '/' + pathStr + if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') + } + + return [ + this.request.method || 'GET', + pathStr, + queryStr, + this.canonicalHeaders() + '\n', + this.signedHeaders(), + bodyHash, + ].join('\n') +} + +RequestSigner.prototype.canonicalHeaders = function() { + var headers = this.request.headers + function trimAll(header) { + return header.toString().trim().replace(/\s+/g, ' ') + } + return Object.keys(headers) + .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) + .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) + .join('\n') +} + +RequestSigner.prototype.signedHeaders = function() { + return Object.keys(this.request.headers) + .map(function(key) { return key.toLowerCase() }) + .sort() + .join(';') +} + +RequestSigner.prototype.credentialString = function() { + return [ + this.getDate(), + this.region, + this.service, + 'aws4_request', + ].join('/') +} + +RequestSigner.prototype.defaultCredentials = function() { + var env = process.env + return { + accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, + secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, + sessionToken: env.AWS_SESSION_TOKEN, + } +} + +RequestSigner.prototype.parsePath = function() { + var path = this.request.path || '/', + queryIx = path.indexOf('?'), + query = null + + if (queryIx >= 0) { + query = querystring.parse(path.slice(queryIx + 1)) + path = path.slice(0, queryIx) + } + + // S3 doesn't always encode characters > 127 correctly and + // all services don't encode characters > 255 correctly + // So if there are non-reserved chars (and it's not already all % encoded), just encode them all + if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { + path = path.split('/').map(function(piece) { + return querystring.escape(querystring.unescape(piece)) + }).join('/') + } + + this.parsedPath = { + path: path, + query: query, + } +} + +RequestSigner.prototype.formatPath = function() { + var path = this.parsedPath.path, + query = this.parsedPath.query + + if (!query) return path + + // Services don't support empty query string keys + if (query[''] != null) delete query[''] + + return path + '?' + encodeRfc3986(querystring.stringify(query)) +} + +aws4.RequestSigner = RequestSigner + +aws4.sign = function(request, credentials) { + return new RequestSigner(request, credentials).sign() +} + + +/***/ }), +/* 384 */ +/***/ (function(module, exports) { + +module.exports = function(size) { + return new LruCache(size) +} + +function LruCache(size) { + this.capacity = size | 0 + this.map = Object.create(null) + this.list = new DoublyLinkedList() +} + +LruCache.prototype.get = function(key) { + var node = this.map[key] + if (node == null) return undefined + this.used(node) + return node.val +} + +LruCache.prototype.set = function(key, val) { + var node = this.map[key] + if (node != null) { + node.val = val + } else { + if (!this.capacity) this.prune() + if (!this.capacity) return false + node = new DoublyLinkedNode(key, val) + this.map[key] = node + this.capacity-- + } + this.used(node) + return true +} + +LruCache.prototype.used = function(node) { + this.list.moveToFront(node) +} + +LruCache.prototype.prune = function() { + var node = this.list.pop() + if (node != null) { + delete this.map[node.key] + this.capacity++ + } +} + + +function DoublyLinkedList() { + this.firstNode = null + this.lastNode = null +} + +DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.firstNode == node) return + + this.remove(node) + + if (this.firstNode == null) { + this.firstNode = node + this.lastNode = node + node.prev = null + node.next = null + } else { + node.prev = null + node.next = this.firstNode + node.next.prev = node + this.firstNode = node + } +} + +DoublyLinkedList.prototype.pop = function() { + var lastNode = this.lastNode + if (lastNode != null) { + this.remove(lastNode) + } + return lastNode +} + +DoublyLinkedList.prototype.remove = function(node) { + if (this.firstNode == node) { + this.firstNode = node.next + } else if (node.prev != null) { + node.prev.next = node.next + } + if (this.lastNode == node) { + this.lastNode = node.prev + } else if (node.next != null) { + node.next.prev = node.prev + } +} + + +function DoublyLinkedNode(key, val) { + this.key = key + this.val = val + this.prev = null + this.next = null +} + + +/***/ }), +/* 385 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (message) { + return { + useless: true, + run() { + throw new (_errors || _load_errors()).MessageError(message); + }, + setFlags: function setFlags() {}, + hasWrapper: function hasWrapper() { + return true; + } + }; +}; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +/***/ }), +/* 386 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.examples = exports.hasWrapper = exports.run = undefined; + +var _promise; + +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} + +exports.setFlags = setFlags; + +var _buildSubCommands2; + +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(46)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var notYetImplemented = function notYetImplemented() { + return (_promise || _load_promise()).default.reject(new Error('This command is not implemented yet.')); }; +function setFlags(commander) { + commander.description('Has not been implemented yet'); +} + +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('access', { + public: notYetImplemented, + restricted: notYetImplemented, + grant: notYetImplemented, + revoke: notYetImplemented, + lsPackages: notYetImplemented, + lsCollaborators: notYetImplemented, + edit: notYetImplemented +}, ['WARNING: This command yet to be implemented.', 'public []', 'restricted []', 'grant []', 'revoke []', 'ls-packages [||]', 'ls-collaborators [ []]', 'edit []']), + run = _buildSubCommands.run, + hasWrapper = _buildSubCommands.hasWrapper, + examples = _buildSubCommands.examples; + +exports.run = run; +exports.hasWrapper = hasWrapper; +exports.examples = examples; + +/***/ }), +/* 387 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _promise; + +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; +exports.run = run; + +var _yarnResolver; + +function _load_yarnResolver() { + return _yarnResolver = _interopRequireDefault(__webpack_require__(242)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var path = __webpack_require__(0); + +function hasWrapper(commander) { + return false; +} + +function setFlags(commander) { + commander.description('Displays the location of the yarn bin folder.'); +} + +function run(config, reporter, flags, args) { + var binFolder = path.join(config.cwd, config.registries[(_yarnResolver || _load_yarnResolver()).default.registry].folder, '.bin'); + reporter.log(binFolder, { force: true }); + return (_promise || _load_promise()).default.resolve(); +} + +/***/ }), +/* 388 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.examples = exports.run = undefined; + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var list = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var readCacheMetadata = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var parentDir = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : config.cacheFolder; + + var folders = yield (_fs || _load_fs()).readdir(parentDir); + var packagesMetadata = []; + + for (var _iterator = folders, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref3; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } + + var folder = _ref3; + + if (folder[0] === '.') { + continue; + } + + var loc = path.join(parentDir, folder); + // Check if this is a scoped package + if (folder.indexOf('@') > -1) { + // If so, recurrently read scoped packages metadata + packagesMetadata.push.apply(packagesMetadata, (yield readCacheMetadata(loc))); + } else { + var _ref4 = yield config.readPackageMetadata(loc), + registry = _ref4.registry, + manifest = _ref4.package, + remote = _ref4.remote; + + if (flags.pattern && !micromatch.contains(manifest.name, flags.pattern)) { + continue; + } + packagesMetadata.push([manifest.name, manifest.version, registry, remote && remote.resolved || '']); + } + } + + return packagesMetadata; + }); + + return function readCacheMetadata() { + return _ref2.apply(this, arguments); + }; + }(); + + var body = yield readCacheMetadata(); + + reporter.table(['Name', 'Version', 'Registry', 'Resolved'], body); + }); + + return function list(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _buildSubCommands2; + +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(46)); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(7)); +} + +var _constants; + +function _load_constants() { + return _constants = __webpack_require__(8); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var path = __webpack_require__(0); + +var micromatch = __webpack_require__(77); + +function hasWrapper(flags, args) { + return args[0] !== 'dir'; +} + +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('cache', { + ls(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + reporter.warn(`\`yarn cache ls\` is deprecated. Please use \`yarn cache list\`.`); + yield list(config, reporter, flags, args); + })(); + }, + + list, + + dir(config, reporter) { + reporter.log(config.cacheFolder, { force: true }); + }, + + clean(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var getPackageCachefolders = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (packageName) { + var parentDir = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : config.cacheFolder; + var metadataFile = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (_constants || _load_constants()).METADATA_FILENAME; + + var folders = yield (_fs || _load_fs()).readdir(parentDir); + var packageFolders = []; + + for (var _iterator2 = folders, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref6; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref6 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref6 = _i2.value; + } + + var folder = _ref6; + + if (folder[0] === '.') { + continue; + } + + var loc = path.join(config.cacheFolder, parentDir.replace(config.cacheFolder, ''), folder); + // Check if this is a scoped package + if (!(yield (_fs || _load_fs()).exists(path.join(loc, metadataFile)))) { + // If so, recurrently read scoped packages metadata + packageFolders.push.apply(packageFolders, (yield getPackageCachefolders(packageName, loc))); + } else { + var _ref7 = yield config.readPackageMetadata(loc), + manifest = _ref7.package; + + if (packageName === manifest.name) { + packageFolders.push(loc); + } + } + } + + return packageFolders; + }); + + return function getPackageCachefolders(_x6) { + return _ref5.apply(this, arguments); + }; + }(); + + if (config.cacheFolder) { + var activity = reporter.activity(); + + if (args.length > 0) { + for (var _iterator3 = args, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref8; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref8 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref8 = _i3.value; + } + + var arg = _ref8; + + // Clear named package from cache + var folders = yield getPackageCachefolders(arg); + + if (folders.length === 0) { + activity.end(); + reporter.warn(reporter.lang('couldntClearPackageFromCache', arg)); + continue; + } + + for (var _iterator4 = folders, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref9; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref9 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref9 = _i4.value; + } + + var folder = _ref9; + + yield (_fs || _load_fs()).unlink(folder); + } + activity.end(); + reporter.success(reporter.lang('clearedPackageFromCache', arg)); + } + } else { + // Clear all cache + yield (_fs || _load_fs()).unlink(config._cacheRootFolder); + yield (_fs || _load_fs()).mkdirp(config.cacheFolder); + activity.end(); + reporter.success(reporter.lang('clearedCache')); + } + } + })(); + } +}), + run = _buildSubCommands.run, + _setFlags = _buildSubCommands.setFlags, + examples = _buildSubCommands.examples; + +exports.run = run; +exports.examples = examples; +function setFlags(commander) { + _setFlags(commander); + commander.description('Yarn cache list will print out every cached package.'); + commander.option('--pattern [pattern]', 'filter cached packages by pattern'); +} + +/***/ }), +/* 389 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.examples = exports.run = undefined; + +var _stringify; + +function _load_stringify() { + return _stringify = _interopRequireDefault(__webpack_require__(32)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _buildSubCommands2; + +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(46)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var CONFIG_KEYS = [ +// 'reporter', +'rootModuleFolders', 'registryFolders', 'linkedModules', +// 'registries', +'cache', 'cwd', 'looseSemver', 'commandName', 'preferOffline', 'modulesFolder', 'globalFolder', 'linkFolder', 'offline', 'binLinks', 'ignorePlatform', 'ignoreScripts', 'disablePrepublish', 'nonInteractive', 'workspaceRootFolder', 'lockfileFolder', 'networkConcurrency', 'childConcurrency', 'networkTimeout', 'workspacesEnabled', 'workspacesNohoistEnabled', 'pruneOfflineMirror', 'enableMetaFolder', 'enableLockfileVersions', 'linkFileDependencies', 'cacheFolder', 'tempFolder', 'production']; +/* eslint object-shorthand: 0 */ + +function hasWrapper(flags, args) { + return args[0] !== 'get'; +} + +function setFlags(commander) { + commander.description('Manages the yarn configuration files.'); +} + +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('config', { + set(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (args.length === 0 || args.length > 2) { + return false; + } + var key = args[0], + _args$ = args[1], + val = _args$ === undefined ? true : _args$; + + var yarnConfig = config.registries.yarn; + yield yarnConfig.saveHomeConfig({ [key]: val }); + reporter.success(reporter.lang('configSet', key, val)); + return true; + })(); + }, + + get(config, reporter, flags, args) { + if (args.length !== 1) { + return false; + } + + reporter.log(String(config.getOption(args[0])), { force: true }); + return true; + }, + + delete: function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (args.length !== 1) { + return false; + } + + var key = args[0]; + var yarnConfig = config.registries.yarn; + yield yarnConfig.saveHomeConfig({ [key]: undefined }); + reporter.success(reporter.lang('configDelete', key)); + return true; + }); + + function _delete(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + } + + return _delete; + }(), + + list(config, reporter, flags, args) { + if (args.length) { + return false; + } + + reporter.info(reporter.lang('configYarn')); + reporter.inspect(config.registries.yarn.config); + + reporter.info(reporter.lang('configNpm')); + reporter.inspect(config.registries.npm.config); + + return true; + }, + + current(config, reporter, flags, args) { + if (args.length) { + return false; + } + + reporter.log((0, (_stringify || _load_stringify()).default)(config, CONFIG_KEYS, 2), { force: true }); + + return true; + } +}), + run = _buildSubCommands.run, + examples = _buildSubCommands.examples; + +exports.run = run; +exports.examples = examples; + +/***/ }), +/* 390 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var builderName = args[0], + rest = args.slice(1); + + + if (!builderName) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName')); + } + + var packageName = builderName.replace(/^(@[^\/]+\/)?/, '$1create-'); + var commandName = packageName.replace(/^@[^\/]+\//, ''); + + yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', packageName]); + + var binFolder = yield (0, (_global || _load_global()).getBinFolder)(config, {}); + var command = path.resolve(binFolder, path.basename(commandName)); + + yield (_child || _load_child()).spawn(command, rest, { stdio: `inherit`, shell: true }); + }); + + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); + +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _child; + +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(45)); +} + +var _global; + +function _load_global() { + return _global = __webpack_require__(83); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var path = __webpack_require__(0); + +function setFlags(commander) { + commander.description('Creates new projects from any create-* starter kits.'); +} + +function hasWrapper(commander, args) { + return true; +} + +/***/ }), +/* 391 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)(`exec`, config.cwd, config); + + if (args.length < 1) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('execMissingCommand')); + } + + var execName = args[0], + rest = args.slice(1); + + yield (_child || _load_child()).spawn(execName, rest, { stdio: 'inherit', env }); + }); + + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); + +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _child; + +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(45)); +} + +var _executeLifecycleScript; + +function _load_executeLifecycleScript() { + return _executeLifecycleScript = __webpack_require__(89); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function setFlags(commander) {} + +function hasWrapper(commander, args) { + return true; +} + +/***/ }), +/* 392 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.examples = exports.run = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var manifest = void 0; + if (flags.useManifest) { + manifest = yield config.readJson(flags.useManifest); + } else { + manifest = yield config.readRootManifest(); + } + if (!manifest.name) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); + } + if (!manifest.version) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion')); + } + + var entry = { + name: manifest.name, + version: manifest.version, + resolved: flags.resolved, + registry: flags.registry || manifest._registry, + optionalDependencies: manifest.optionalDependencies, + dependencies: manifest.dependencies + }; + var pattern = flags.pattern || `${entry.name}@${entry.version}`; + reporter.log((0, (_lockfile || _load_lockfile()).stringify)({ + [pattern]: (0, (_lockfile || _load_lockfile()).implodeEntry)(pattern, entry) + })); + }); + + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _lockfile; + +function _load_lockfile() { + return _lockfile = __webpack_require__(20); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function hasWrapper(commander, args) { + return false; +} + +function setFlags(commander) { + commander.description('Generates a lock file entry.'); + commander.option('--use-manifest ', 'description'); + commander.option('--resolved ', 'description'); + commander.option('--registry ', 'description'); +} + +var examples = exports.examples = ['generate-lock-entry', 'generate-lock-entry --use-manifest ./package.json', 'generate-lock-entry --resolved local-file.tgz#hash']; + +/***/ }), +/* 393 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + +var _keys; + +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); +} + +var _promise; + +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; +exports.run = run; + +var _index; + +function _load_index() { + return _index = _interopRequireDefault(__webpack_require__(202)); +} + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _misc; + +function _load_misc() { + return _misc = __webpack_require__(19); +} + +var _aliases; + +function _load_aliases() { + return _aliases = _interopRequireDefault(__webpack_require__(223)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var chalk = __webpack_require__(113); + +function hasWrapper(flags, args) { + return false; +} + +function setFlags(commander) { + commander.description('Displays help information.'); +} + +function run(config, reporter, commander, args) { + if (args.length) { + var commandName = args.shift(); + if (Object.prototype.hasOwnProperty.call((_index || _load_index()).default, commandName)) { + var command = (_index || _load_index()).default[commandName]; + if (command) { + command.setFlags(commander); + var examples = (command && command.examples || []).map(function (example) { + return ` $ yarn ${example}`; + }); + if (examples.length) { + commander.on('--help', function () { + reporter.log(reporter.lang('helpExamples', reporter.rawText(examples.join('\n')))); + }); + } + // eslint-disable-next-line yarn-internal/warn-language + commander.on('--help', function () { + return reporter.log(' ' + command.getDocsInfo + '\n'); + }); + commander.help(); + return (_promise || _load_promise()).default.resolve(); + } + } + } + + commander.on('--help', function () { + var commandsText = []; + for (var _iterator = (0, (_keys || _load_keys()).default)((_index || _load_index()).default).sort((_misc || _load_misc()).sortAlpha), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var name = _ref; + + if ((_index || _load_index()).default[name].useless || (0, (_keys || _load_keys()).default)((_aliases || _load_aliases()).default).map(function (key) { + return (_aliases || _load_aliases()).default[key]; + }).indexOf(name) > -1) { + continue; + } + if ((_aliases || _load_aliases()).default[name]) { + commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)} / ${(_aliases || _load_aliases()).default[name]}`); + } else { + commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)}`); + } + } + reporter.log(reporter.lang('helpCommands', reporter.rawText(commandsText.join('\n')))); + reporter.log(reporter.lang('helpCommandsMore', reporter.rawText(chalk.bold('yarn help COMMAND')))); + reporter.log(reporter.lang('helpLearnMore', reporter.rawText(chalk.bold((_constants || _load_constants()).YARN_DOCS)))); + }); + + commander.help(); + return (_promise || _load_promise()).default.resolve(); +} + +/***/ }), +/* 394 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.Import = exports.noArguments = undefined; + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + +var _promise; + +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var _classCallCheck2; + +function _load_classCallCheck() { + return _classCallCheck2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _possibleConstructorReturn2; + +function _load_possibleConstructorReturn() { + return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(12)); +} + +var _inherits2; + +function _load_inherits() { + return _inherits2 = _interopRequireDefault(__webpack_require__(11)); +} + +var run = exports.run = function () { + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var imp = new Import(flags, config, reporter, new (_lockfile || _load_lockfile()).default({ cache: {} })); + yield imp.init(); + }); + + return function run(_x6, _x7, _x8, _x9) { + return _ref10.apply(this, arguments); + }; +}(); + +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; + +var _install; + +function _load_install() { + return _install = __webpack_require__(33); +} + +var _check; + +function _load_check() { + return _check = __webpack_require__(225); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _index; + +function _load_index() { + return _index = __webpack_require__(41); +} + +var _baseResolver; + +function _load_baseResolver() { + return _baseResolver = _interopRequireDefault(__webpack_require__(86)); +} + +var _hostedGitResolver; + +function _load_hostedGitResolver() { + return _hostedGitResolver = _interopRequireDefault(__webpack_require__(72)); +} + +var _hostedGitResolver2; + +function _load_hostedGitResolver2() { + return _hostedGitResolver2 = __webpack_require__(72); +} + +var _gistResolver; + +function _load_gistResolver() { + return _gistResolver = _interopRequireDefault(__webpack_require__(153)); +} + +var _gistResolver2; + +function _load_gistResolver2() { + return _gistResolver2 = __webpack_require__(153); +} + +var _gitResolver; + +function _load_gitResolver() { + return _gitResolver = _interopRequireDefault(__webpack_require__(87)); +} + +var _fileResolver; + +function _load_fileResolver() { + return _fileResolver = _interopRequireDefault(__webpack_require__(152)); +} + +var _packageResolver; + +function _load_packageResolver() { + return _packageResolver = _interopRequireDefault(__webpack_require__(236)); +} + +var _packageRequest; + +function _load_packageRequest() { + return _packageRequest = _interopRequireDefault(__webpack_require__(85)); +} + +var _packageFetcher; + +function _load_packageFetcher() { + return _packageFetcher = _interopRequireWildcard(__webpack_require__(235)); +} + +var _packageLinker; + +function _load_packageLinker() { + return _packageLinker = _interopRequireDefault(__webpack_require__(149)); +} + +var _packageCompatibility; + +function _load_packageCompatibility() { + return _packageCompatibility = _interopRequireWildcard(__webpack_require__(234)); +} + +var _lockfile; + +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(20)); +} + +var _normalizePattern6; + +function _load_normalizePattern() { + return _normalizePattern6 = __webpack_require__(42); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(7)); +} + +var _misc; + +function _load_misc() { + return _misc = _interopRequireWildcard(__webpack_require__(19)); +} + +var _constants; + +function _load_constants() { + return _constants = __webpack_require__(8); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var NPM_REGISTRY = /http[s]:\/\/registry.npmjs.org/g; + +var invariant = __webpack_require__(9); +var path = __webpack_require__(0); +var uuid = __webpack_require__(80); + +var noArguments = exports.noArguments = true; + +var ImportResolver = function (_BaseResolver) { + (0, (_inherits2 || _load_inherits()).default)(ImportResolver, _BaseResolver); + + function ImportResolver() { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportResolver); + return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.apply(this, arguments)); + } + + ImportResolver.prototype.getCwd = function getCwd() { + if (this.request.parentRequest) { + var parent = this.resolver.getStrictResolvedPattern(this.request.parentRequest.pattern); + invariant(parent._loc, 'expected package location'); + return path.dirname(parent._loc); + } + return this.config.cwd; + }; + + ImportResolver.prototype.resolveHostedGit = function resolveHostedGit(info, Resolver) { + var _normalizePattern = (0, (_normalizePattern6 || _load_normalizePattern()).normalizePattern)(this.pattern), + range = _normalizePattern.range; + + var exploded = (0, (_hostedGitResolver2 || _load_hostedGitResolver2()).explodeHostedGitFragment)(range, this.reporter); + var hash = info.gitHead; + invariant(hash, 'expected package gitHead'); + var url = Resolver.getTarballUrl(exploded, hash); + info._uid = hash; + info._remote = { + resolved: url, + type: 'tarball', + registry: this.registry, + reference: url, + hash: null + }; + return info; + }; + + ImportResolver.prototype.resolveGist = function resolveGist(info, Resolver) { + var _normalizePattern2 = (0, (_normalizePattern6 || _load_normalizePattern()).normalizePattern)(this.pattern), + range = _normalizePattern2.range; + + var _explodeGistFragment = (0, (_gistResolver2 || _load_gistResolver2()).explodeGistFragment)(range, this.reporter), + id = _explodeGistFragment.id; + + var hash = info.gitHead; + invariant(hash, 'expected package gitHead'); + var url = `https://gist.github.com/${id}.git`; + info._uid = hash; + info._remote = { + resolved: `${url}#${hash}`, + type: 'git', + registry: this.registry, + reference: url, + hash + }; + return info; + }; + + ImportResolver.prototype.resolveGit = function resolveGit(info, Resolver) { + var url = info._resolved; + var hash = info.gitHead; + invariant(url, 'expected package _resolved'); + invariant(hash, 'expected package gitHead'); + info._uid = hash; + info._remote = { + resolved: `${url}#${hash}`, + type: 'git', + registry: this.registry, + reference: url, + hash + }; + return info; + }; + + ImportResolver.prototype.resolveFile = function resolveFile(info, Resolver) { + var _normalizePattern3 = (0, (_normalizePattern6 || _load_normalizePattern()).normalizePattern)(this.pattern), + range = _normalizePattern3.range; + + var loc = (_misc || _load_misc()).removePrefix(range, 'file:'); + if (!path.isAbsolute(loc)) { + loc = path.join(this.config.cwd, loc); + } + info._uid = info.version; + info._remote = { + type: 'copy', + registry: this.registry, + hash: `${uuid.v4()}-${new Date().getTime()}`, + reference: loc + }; + return info; + }; + + ImportResolver.prototype.resolveRegistry = function resolveRegistry(info) { + var url = info._resolved; + var hash = info._shasum; + invariant(url, 'expected package _resolved'); + invariant(hash, 'expected package _shasum'); + if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) { + url = url.replace(NPM_REGISTRY, (_constants || _load_constants()).YARN_REGISTRY); + } + info._uid = info.version; + info._remote = { + resolved: `${url}#${hash}`, + type: 'tarball', + registry: this.registry, + reference: url, + hash + }; + return info; + }; + + ImportResolver.prototype.resolveImport = function resolveImport(info) { + var _normalizePattern4 = (0, (_normalizePattern6 || _load_normalizePattern()).normalizePattern)(this.pattern), + range = _normalizePattern4.range; + + var Resolver = (0, (_index || _load_index()).getExoticResolver)(range); + if (Resolver && Resolver.prototype instanceof (_hostedGitResolver || _load_hostedGitResolver()).default) { + return this.resolveHostedGit(info, Resolver); + } else if (Resolver && Resolver === (_gistResolver || _load_gistResolver()).default) { + return this.resolveGist(info, Resolver); + } else if (Resolver && Resolver === (_gitResolver || _load_gitResolver()).default) { + return this.resolveGit(info, Resolver); + } else if (Resolver && Resolver === (_fileResolver || _load_fileResolver()).default) { + return this.resolveFile(info, Resolver); + } + return this.resolveRegistry(info); + }; + + ImportResolver.prototype.resolveLocation = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + var info = yield this.config.tryManifest(loc, 'npm', false); + if (!info) { + return null; + } + return this.resolveImport(info); + }); + + function resolveLocation(_x) { + return _ref.apply(this, arguments); + } + + return resolveLocation; + }(); + + ImportResolver.prototype.resolve = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _this2 = this; + + var _normalizePattern5 = (0, (_normalizePattern6 || _load_normalizePattern()).normalizePattern)(this.pattern), + name = _normalizePattern5.name; + + var cwd = this.getCwd(); + + var _loop = function* _loop() { + var loc = path.join(cwd, 'node_modules', name); + var info = yield _this2.config.getCache(`import-resolver-${loc}`, function () { + return _this2.resolveLocation(loc); + }); + if (info) { + return { + v: info + }; + } + cwd = path.resolve(cwd, '../..'); + }; + + while (!path.relative(this.config.cwd, cwd).startsWith('..')) { + var _ret = yield* _loop(); + + if (typeof _ret === "object") return _ret.v; + } + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importResolveFailed', name, this.getCwd())); + }); + + function resolve() { + return _ref2.apply(this, arguments); + } + + return resolve; + }(); + + return ImportResolver; +}((_baseResolver || _load_baseResolver()).default); + +var ImportPackageRequest = function (_PackageRequest) { + (0, (_inherits2 || _load_inherits()).default)(ImportPackageRequest, _PackageRequest); + + function ImportPackageRequest(req, resolver) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportPackageRequest); + + var _this3 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _PackageRequest.call(this, req, resolver)); + + _this3.import = _this3.parentRequest instanceof ImportPackageRequest ? _this3.parentRequest.import : true; + return _this3; + } + + ImportPackageRequest.prototype.getRootName = function getRootName() { + return this.resolver instanceof ImportPackageResolver && this.resolver.rootName || 'root'; + }; + + ImportPackageRequest.prototype.getParentHumanName = function getParentHumanName() { + return [this.getRootName()].concat(this.parentNames).join(' > '); + }; + + ImportPackageRequest.prototype.reportResolvedRangeMatch = function reportResolvedRangeMatch(info, resolved) { + if (info.version === resolved.version) { + return; + } + this.reporter.warn(this.reporter.lang('importResolvedRangeMatch', resolved.version, resolved.name, info.version, this.getParentHumanName())); + }; + + ImportPackageRequest.prototype.findVersionInfo = function findVersionInfo() { + var _this4 = this; + + if (!this.import) { + this.reporter.verbose(this.reporter.lang('skippingImport', this.pattern, this.getParentHumanName())); + return _PackageRequest.prototype.findVersionInfo.call(this); + } + var resolver = new ImportResolver(this, this.pattern); + return resolver.resolve().catch(function () { + _this4.import = false; + _this4.reporter.warn(_this4.reporter.lang('importFailed', _this4.pattern, _this4.getParentHumanName())); + return _PackageRequest.prototype.findVersionInfo.call(_this4); + }); + }; + + return ImportPackageRequest; +}((_packageRequest || _load_packageRequest()).default); + +var ImportPackageResolver = function (_PackageResolver) { + (0, (_inherits2 || _load_inherits()).default)(ImportPackageResolver, _PackageResolver); + + function ImportPackageResolver(config, lockfile) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportPackageResolver); + + var _this5 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _PackageResolver.call(this, config, lockfile)); + + _this5.next = []; + _this5.rootName = 'root'; + return _this5; + } + + ImportPackageResolver.prototype.find = function find(req) { + this.next.push(req); + return (_promise || _load_promise()).default.resolve(); + }; + + ImportPackageResolver.prototype.findOne = function () { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (req) { + if (this.activity) { + this.activity.tick(req.pattern); + } + var request = new ImportPackageRequest(req, this); + yield request.find({ fresh: false }); + }); + + function findOne(_x2) { + return _ref3.apply(this, arguments); + } + + return findOne; + }(); + + ImportPackageResolver.prototype.findAll = function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) { + var _this6 = this; + + yield (_promise || _load_promise()).default.all(deps.map(function (dep) { + return _this6.findOne(dep); + })); + deps = this.next; + this.next = []; + if (!deps.length) { + // all required package versions have been discovered, so now packages that + // resolved to existing versions can be resolved to their best available version + this.resolvePackagesWithExistingVersions(); + return; + } + yield this.findAll(deps); + }); + + function findAll(_x3) { + return _ref4.apply(this, arguments); + } + + return findAll; + }(); + + ImportPackageResolver.prototype.resetOptional = function resetOptional() { + for (var pattern in this.patterns) { + var ref = this.patterns[pattern]._reference; + invariant(ref, 'expected reference'); + ref.optional = null; + for (var _iterator = ref.requests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref5; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref5 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref5 = _i.value; + } + + var req = _ref5; + + ref.addOptional(req.optional); + } + } + }; + + ImportPackageResolver.prototype.init = function () { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) { + var _ref7 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { isFlat: false, isFrozen: false, workspaceLayout: undefined }, + isFlat = _ref7.isFlat, + isFrozen = _ref7.isFrozen, + workspaceLayout = _ref7.workspaceLayout; + + this.flat = Boolean(isFlat); + var activity = this.activity = this.reporter.activity(); + yield this.findAll(deps); + this.resetOptional(); + activity.end(); + this.activity = null; + }); + + function init(_x4) { + return _ref6.apply(this, arguments); + } + + return init; + }(); + + return ImportPackageResolver; +}((_packageResolver || _load_packageResolver()).default); + +var Import = exports.Import = function (_Install) { + (0, (_inherits2 || _load_inherits()).default)(Import, _Install); + + function Import(flags, config, reporter, lockfile) { + (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Import); + + var _this7 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Install.call(this, flags, config, reporter, lockfile)); + + _this7.resolver = new ImportPackageResolver(_this7.config, _this7.lockfile); + _this7.linker = new (_packageLinker || _load_packageLinker()).default(config, _this7.resolver); + return _this7; + } + + Import.prototype.init = function () { + var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (yield (_fs || _load_fs()).exists(path.join(this.config.cwd, (_constants || _load_constants()).LOCKFILE_FILENAME))) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('lockfileExists')); + } + yield (0, (_check || _load_check()).verifyTreeCheck)(this.config, this.reporter, {}, []); + + var _ref9 = yield this.fetchRequestFromCwd(), + requests = _ref9.requests, + patterns = _ref9.patterns, + manifest = _ref9.manifest; + + if (manifest.name && this.resolver instanceof ImportPackageResolver) { + this.resolver.rootName = manifest.name; + } + yield this.resolver.init(requests, { isFlat: this.flags.flat, isFrozen: this.flags.frozenLockfile }); + var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config); + this.resolver.updateManifests(manifests); + yield (_packageCompatibility || _load_packageCompatibility()).check(this.resolver.getManifests(), this.config, this.flags.ignoreEngines); + yield this.linker.resolvePeerModules(); + yield this.saveLockfileAndIntegrity(patterns); + return patterns; + }); + + function init() { + return _ref8.apply(this, arguments); + } + + return init; + }(); + + return Import; +}((_install || _load_install()).Install); + +function setFlags(commander) { + commander.description('Generates yarn.lock from an existing npm-installed node_modules folder.'); +} + +function hasWrapper(commander, args) { + return true; +} + /***/ }), -/* 353 */ +/* 395 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var META_SCHEMA_ID = 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json'; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; -module.exports = { - enable: enableV5, - META_SCHEMA_ID: META_SCHEMA_ID -}; +var _assign; + +function _load_assign() { + return _assign = _interopRequireDefault(__webpack_require__(17)); +} +var _keys; -function enableV5(ajv) { - var inlineFunctions = { - 'switch': __webpack_require__(348), - 'constant': __webpack_require__(334), - '_formatLimit': __webpack_require__(331), - 'patternRequired': __webpack_require__(344) +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (args.length > 2) { + reporter.error(reporter.lang('tooManyArguments', 2)); + return; + } + + var packageName = args.shift() || '.'; + + // Handle the case when we are referencing a local package. + if (packageName === '.') { + packageName = (yield config.readRootManifest()).name; + } + + var packageInput = (_npmRegistry || _load_npmRegistry()).default.escapeName(packageName); + + var _parsePackageName = (0, (_parsePackageName2 || _load_parsePackageName()).default)(packageInput), + name = _parsePackageName.name, + version = _parsePackageName.version; + + // pass application/json Accept to get full metadata for info command + + + var result = yield config.registries.npm.request(name, { + headers: { Accept: 'application/json' } + }); + if (!result) { + reporter.error(reporter.lang('infoFail')); + return; + } + + result = clean(result); + + var versions = result.versions; + // $FlowFixMe + result.versions = (0, (_keys || _load_keys()).default)(versions).sort(semver.compareLoose); + result.version = version || result['dist-tags'].latest; + result = (0, (_assign || _load_assign()).default)(result, versions[result.version]); + + var fieldPath = args.shift(); + var fields = fieldPath ? fieldPath.split('.') : []; + + // Readmes can be long so exclude them unless explicitly asked for. + if (fields[0] !== 'readme') { + delete result.readme; + } + + result = fields.reduce(function (prev, cur) { + return prev && prev[cur]; + }, result); + reporter.inspect(result); + }); + + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); }; +}(); - if (ajv._opts.meta !== false) { - var metaSchema = __webpack_require__(352); - ajv.addMetaSchema(metaSchema, META_SCHEMA_ID); - } - _addKeyword('constant'); - ajv.addKeyword('contains', { type: 'array', macro: containsMacro }); +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; - _addKeyword('formatMaximum', 'string', inlineFunctions._formatLimit); - _addKeyword('formatMinimum', 'string', inlineFunctions._formatLimit); - ajv.addKeyword('formatExclusiveMaximum'); - ajv.addKeyword('formatExclusiveMinimum'); +var _npmRegistry; - ajv.addKeyword('patternGroups'); // implemented in properties.jst - _addKeyword('patternRequired', 'object'); - _addKeyword('switch'); +function _load_npmRegistry() { + return _npmRegistry = _interopRequireDefault(__webpack_require__(53)); +} + +var _parsePackageName2; +function _load_parsePackageName() { + return _parsePackageName2 = _interopRequireDefault(__webpack_require__(446)); +} - function _addKeyword(keyword, types, inlineFunc) { - var definition = { - inline: inlineFunc || inlineFunctions[keyword], - statements: true, - errors: 'full' - }; - if (types) definition.type = types; - ajv.addKeyword(keyword, definition); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var semver = __webpack_require__(21); + +function clean(object) { + if (Array.isArray(object)) { + var result = []; + object.forEach(function (item) { + item = clean(item); + if (item) { + result.push(item); + } + }); + return result; + } else if (typeof object === 'object') { + var _result = {}; + for (var key in object) { + if (key.startsWith('_')) { + continue; + } + + var item = clean(object[key]); + if (item) { + _result[key] = item; + } + } + return _result; + } else if (object) { + return object; + } else { + return null; } } +function setFlags(commander) { + commander.description('Shows information about a package.'); +} -function containsMacro(schema) { - return { - not: { items: { not: schema } } +function hasWrapper(commander, args) { + return true; +} + +/***/ }), +/* 396 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getGitConfigInfo = exports.run = exports.shouldRunInCurrentCwd = undefined; + +var _assign; + +function _load_assign() { + return _assign = _interopRequireDefault(__webpack_require__(17)); +} + +var _getIterator2; + +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} + +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var manifests = yield config.getRootManifests(); + + var repository = {}; + var author = { + name: config.getOption('init-author-name'), + email: config.getOption('init-author-email'), + url: config.getOption('init-author-url') + }; + if (yield (_fs || _load_fs()).exists(path.join(config.cwd, '.git'))) { + // get git origin of the cwd + try { + repository = { + type: 'git', + url: yield (_child || _load_child()).spawn('git', ['config', 'remote.origin.url'], { + cwd: config.cwd + }) + }; + } catch (ex) { + // Ignore - Git repo may not have an origin URL yet (eg. if it only exists locally) + } + + if (author.name === undefined) { + author.name = yield getGitConfigInfo('user.name'); + } + + if (author.email === undefined) { + author.email = yield getGitConfigInfo('user.email'); + } + } + + var keys = [{ + key: 'name', + question: 'name', + default: path.basename(config.cwd), + validation: (_validate || _load_validate()).isValidPackageName, + validationError: 'invalidPackageName' + }, { + key: 'version', + question: 'version', + default: String(config.getOption('init-version')) + }, { + key: 'description', + question: 'description', + default: '' + }, { + key: 'main', + question: 'entry point', + default: 'index.js' + }, { + key: 'repository', + question: 'repository url', + default: (0, (_util || _load_util()).extractRepositoryUrl)(repository) + }, { + key: 'author', + question: 'author', + default: (0, (_util || _load_util()).stringifyPerson)(author) + }, { + key: 'license', + question: 'license', + default: String(config.getOption('init-license')) + }, { + key: 'private', + question: 'private', + default: config.getOption('init-private') || '', + inputFormatter: yn + }]; + + // get answers + var pkg = {}; + for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var entry = _ref2; + var yes = flags.yes, + privateFlag = flags.private; + var manifestKey = entry.key; + var question = entry.question, + def = entry.default; + + + for (var _iterator4 = (_index || _load_index()).registryNames, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref5; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } + + var _registryName = _ref5; + var object = manifests[_registryName].object; + + var val = objectPath.get(object, manifestKey); + if (!val) { + break; + } + if (typeof val === 'object') { + if (manifestKey === 'author') { + val = (0, (_util || _load_util()).stringifyPerson)(val); + } else if (manifestKey === 'repository') { + val = (0, (_util || _load_util()).extractRepositoryUrl)(val); + } + } + def = val; + } + + if (manifestKey === 'private' && privateFlag) { + def = true; + } + + if (def) { + question += ` (${String(def)})`; + } + + var answer = void 0; + var validAnswer = false; + + if (yes) { + answer = def; + } else { + // loop until a valid answer is provided, if validation is on entry + if (entry.validation) { + while (!validAnswer) { + answer = (yield reporter.question(question)) || def; + // validate answer + if (entry.validation(String(answer))) { + validAnswer = true; + } else { + reporter.error(reporter.lang('invalidPackageName')); + } + } + } else { + answer = (yield reporter.question(question)) || def; + } + } + + if (answer) { + if (entry.inputFormatter) { + answer = entry.inputFormatter(answer); + } + objectPath.set(pkg, manifestKey, answer); + } + } + + if (pkg.repository && (_githubResolver || _load_githubResolver()).default.isVersion(pkg.repository)) { + pkg.repository = `https://github.com/${pkg.repository}`; + } + + // save answers + var targetManifests = []; + for (var _iterator2 = (_index || _load_index()).registryNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var registryName = _ref3; + + var info = manifests[registryName]; + if (info.exists) { + targetManifests.push(info); + } + } + if (!targetManifests.length) { + targetManifests.push(manifests.npm); + } + for (var _iterator3 = targetManifests, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + var targetManifest = _ref4; + + (0, (_assign || _load_assign()).default)(targetManifest.object, pkg); + reporter.success(`Saved ${path.basename(targetManifest.loc)}`); + } + + yield config.saveRootManifests(manifests); + }); + + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); + +var getGitConfigInfo = exports.getGitConfigInfo = function () { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (credential) { + var spawn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_child || _load_child()).spawn; + + try { + // try to get author default based on git config + return yield spawn('git', ['config', credential]); + } catch (e) { + return ''; + } + }); + + return function getGitConfigInfo(_x5) { + return _ref6.apply(this, arguments); }; +}(); + +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; + +var _util; + +function _load_util() { + return _util = __webpack_require__(157); +} + +var _index; + +function _load_index() { + return _index = __webpack_require__(40); +} + +var _githubResolver; + +function _load_githubResolver() { + return _githubResolver = _interopRequireDefault(__webpack_require__(240)); +} + +var _child; + +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(45)); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(7)); +} + +var _validate; + +function _load_validate() { + return _validate = _interopRequireWildcard(__webpack_require__(90)); } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var objectPath = __webpack_require__(295); +var path = __webpack_require__(0); +var yn = __webpack_require__(726); + +function setFlags(commander) { + commander.description('Interactively creates or updates a package.json file.'); + commander.option('-y, --yes', 'use default options'); + commander.option('-p, --private', 'use default options and private true'); +} + +function hasWrapper(commander, args) { + return true; +} + +var shouldRunInCurrentCwd = exports.shouldRunInCurrentCwd = true; /***/ }), -/* 354 */ +/* 397 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ESC = '\u001b['; -var x = module.exports; -x.cursorTo = function (x, y) { - if (arguments.length === 0) { - return ESC + 'H'; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.examples = exports.run = undefined; - if (arguments.length === 1) { - return ESC + (x + 1) + 'G'; - } +var _getIterator2; - return ESC + (y + 1) + ';' + (x + 1) + 'H'; -}; +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} -x.cursorMove = function (x, y) { - var ret = ''; +var _map; - if (x < 0) { - ret += ESC + (-x) + 'D'; - } else if (x > 0) { - ret += ESC + x + 'C'; - } +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(37)); +} - if (y < 0) { - ret += ESC + (-y) + 'A'; - } else if (y > 0) { - ret += ESC + y + 'B'; - } +var _extends2; - return ret; -}; +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(25)); +} -x.cursorUp = function (count) { - return ESC + (typeof count === 'number' ? count : 1) + 'A'; -}; +var _asyncToGenerator2; -x.cursorDown = function (count) { - return ESC + (typeof count === 'number' ? count : 1) + 'B'; -}; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} -x.cursorForward = function (count) { - return ESC + (typeof count === 'number' ? count : 1) + 'C'; -}; +var getManifests = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); + var install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({ skipIntegrityCheck: true }, flags), config, new (_baseReporter || _load_baseReporter()).default(), lockfile); + yield install.hydrate(true); -x.cursorBackward = function (count) { - return ESC + (typeof count === 'number' ? count : 1) + 'D'; -}; + var manifests = install.resolver.getManifests(); -x.cursorLeft = ESC + '1000D'; -x.cursorSavePosition = ESC + 's'; -x.cursorRestorePosition = ESC + 'u'; -x.cursorGetPosition = ESC + '6n'; -x.cursorNextLine = ESC + 'E'; -x.cursorPrevLine = ESC + 'F'; -x.cursorHide = ESC + '?25l'; -x.cursorShow = ESC + '?25h'; + // sort by name + manifests = manifests.sort(function (a, b) { + if (!a.name && !b.name) { + return 0; + } -x.eraseLines = function (count) { - var clear = ''; + if (!a.name) { + return 1; + } - for (var i = 0; i < count; i++) { - clear += x.cursorLeft + x.eraseEndLine + (i < count - 1 ? x.cursorUp() : ''); - } + if (!b.name) { + return -1; + } - return clear; -}; + return a.name.localeCompare(b.name); + }); -x.eraseEndLine = ESC + 'K'; -x.eraseStartLine = ESC + '1K'; -x.eraseLine = ESC + '2K'; -x.eraseDown = ESC + 'J'; -x.eraseUp = ESC + '1J'; -x.eraseScreen = ESC + '2J'; -x.scrollUp = ESC + 'S'; -x.scrollDown = ESC + 'T'; + // filter ignored manifests + manifests = manifests.filter(function (manifest) { + var ref = manifest._reference; + return !!ref && !ref.ignore; + }); -x.clearScreen = '\u001bc'; -x.beep = '\u0007'; + return manifests; + }); -x.image = function (buf, opts) { - opts = opts || {}; + return function getManifests(_x, _x2) { + return _ref.apply(this, arguments); + }; +}(); - var ret = '\u001b]1337;File=inline=1'; +var list = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var manifests = yield getManifests(config, flags); + var manifestsByLicense = new (_map || _load_map()).default(); - if (opts.width) { - ret += ';width=' + opts.width; - } + for (var _iterator = manifests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref4; - if (opts.height) { - ret += ';height=' + opts.height; - } + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } + + var _ref3 = _ref4; + var name = _ref3.name, + version = _ref3.version, + license = _ref3.license, + repository = _ref3.repository, + homepage = _ref3.homepage, + author = _ref3.author; + + var licenseKey = license || 'UNKNOWN'; + var url = repository ? repository.url : homepage; + var vendorUrl = homepage || author && author.url; + var vendorName = author && author.name; + + if (!manifestsByLicense.has(licenseKey)) { + manifestsByLicense.set(licenseKey, new (_map || _load_map()).default()); + } + + var byLicense = manifestsByLicense.get(licenseKey); + invariant(byLicense, 'expected value'); + byLicense.set(`${name}@${version}`, { + name, + version, + url, + vendorUrl, + vendorName + }); + } - if (opts.preserveAspectRatio === false) { - ret += ';preserveAspectRatio=0'; - } + if (flags.json) { + var body = []; - return ret + ':' + buf.toString('base64') + '\u0007'; -}; + manifestsByLicense.forEach(function (license, licenseKey) { + license.forEach(function (_ref5) { + var name = _ref5.name, + version = _ref5.version, + url = _ref5.url, + vendorUrl = _ref5.vendorUrl, + vendorName = _ref5.vendorName; -x.iTerm = {}; + body.push([name, version, licenseKey, url || 'Unknown', vendorUrl || 'Unknown', vendorName || 'Unknown']); + }); + }); -x.iTerm.setCwd = function (cwd) { - return '\u001b]50;CurrentDir=' + (cwd || process.cwd()) + '\u0007'; -}; + reporter.table(['Name', 'Version', 'License', 'URL', 'VendorUrl', 'VendorName'], body); + } else { + var trees = []; + + manifestsByLicense.forEach(function (license, licenseKey) { + var licenseTree = []; + + license.forEach(function (_ref6) { + var name = _ref6.name, + version = _ref6.version, + url = _ref6.url, + vendorUrl = _ref6.vendorUrl, + vendorName = _ref6.vendorName; + + var children = []; + + if (url) { + children.push({ name: `${reporter.format.bold('URL:')} ${url}` }); + } + + if (vendorUrl) { + children.push({ name: `${reporter.format.bold('VendorUrl:')} ${vendorUrl}` }); + } + + if (vendorName) { + children.push({ name: `${reporter.format.bold('VendorName:')} ${vendorName}` }); + } + + licenseTree.push({ + name: `${name}@${version}`, + children + }); + }); + + trees.push({ + name: licenseKey, + children: licenseTree + }); + }); + + reporter.tree('licenses', trees); + } + }); + + return function list(_x3, _x4, _x5, _x6) { + return _ref2.apply(this, arguments); + }; +}(); + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _baseReporter; + +function _load_baseReporter() { + return _baseReporter = _interopRequireDefault(__webpack_require__(71)); +} +var _install; + +function _load_install() { + return _install = __webpack_require__(33); +} + +var _lockfile; + +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(20)); +} + +var _buildSubCommands2; + +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(46)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var invariant = __webpack_require__(9); + +function hasWrapper(flags, args) { + return args[0] != 'generate-disclaimer'; +} + +function setFlags(commander) { + commander.description('Lists licenses for installed packages.'); +} + +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('licenses', { + ls(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + reporter.warn(`\`yarn licenses ls\` is deprecated. Please use \`yarn licenses list\`.`); + yield list(config, reporter, flags, args); + })(); + }, + + list(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield list(config, reporter, flags, args); + })(); + }, + + generateDisclaimer(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + /* eslint-disable no-console */ + + // `reporter.log` dumps a bunch of ANSI escapes to clear the current line and + // is for abstracting the console output so it can be consumed by other tools + // (JSON output being the primary one). This command is only for text consumption + // and you should just be dumping it to a TXT file. Using a reporter here has the + // potential to mess up the output since it might print ansi escapes. + var manifests = yield getManifests(config, flags); + var manifest = yield config.readRootManifest(); + + // Create a map of license text to manifest so that packages with exactly + // the same license text are grouped together. + var manifestsByLicense = new (_map || _load_map()).default(); + for (var _iterator2 = manifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref7; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref7 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref7 = _i2.value; + } + + var _manifest = _ref7; + var licenseText = _manifest.licenseText, + noticeText = _manifest.noticeText; + + var licenseKey = void 0; + if (!licenseText) { + continue; + } + + if (!noticeText) { + licenseKey = licenseText; + } else { + licenseKey = `${licenseText}\n\nNOTICE\n\n${noticeText}`; + } + + if (!manifestsByLicense.has(licenseKey)) { + manifestsByLicense.set(licenseKey, new (_map || _load_map()).default()); + } + + var byLicense = manifestsByLicense.get(licenseKey); + invariant(byLicense, 'expected value'); + byLicense.set(_manifest.name, _manifest); + } + + console.log('THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED ' + `IN PORTIONS OF THE ${String(manifest.name).toUpperCase().replace(/-/g, ' ')} PRODUCT.`); + console.log(); + + for (var _iterator3 = manifestsByLicense, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref9; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref9 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref9 = _i3.value; + } + + var _ref8 = _ref9; + var licenseKey = _ref8[0]; + var _manifests = _ref8[1]; + + console.log('-----'); + console.log(); + + var names = []; + var urls = []; + for (var _iterator4 = _manifests, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref11; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref11 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref11 = _i4.value; + } + + var _ref10 = _ref11; + var name = _ref10[0]; + var repository = _ref10[1].repository; + + names.push(name); + if (repository && repository.url) { + urls.push(_manifests.size === 1 ? repository.url : `${repository.url} (${name})`); + } + } + + var heading = []; + heading.push(`The following software may be included in this product: ${names.join(', ')}.`); + if (urls.length > 0) { + heading.push(`A copy of the source code may be downloaded from ${urls.join(', ')}.`); + } + heading.push('This software contains the following license and notice below:'); + + console.log(heading.join(' ')); + console.log(); + + if (licenseKey) { + console.log(licenseKey.trim()); + } else { + // what do we do here? base it on `license`? + } + + console.log(); + } + })(); + } +}), + run = _buildSubCommands.run, + examples = _buildSubCommands.examples; + +exports.run = run; +exports.examples = examples; /***/ }), -/* 355 */ +/* 398 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(module) { -const colorConvert = __webpack_require__(451); -const wrapAnsi16 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${code + offset}m`; -}; -const wrapAnsi256 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};5;${code}m`; -}; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; -const wrapAnsi16m = (fn, offset) => function () { - const rgb = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; +var _asyncToGenerator2; -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39], +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} - // Bright color - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + yield config.registries.yarn.saveHomeConfig({ + username: undefined, + email: undefined + }); - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; + reporter.success(reporter.lang('clearedCredentials')); + }); - // Fix humans - styles.color.grey = styles.color.gray; + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; - for (const styleName of Object.keys(group)) { - const style = group[styleName]; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; +function setFlags(commander) { + commander.description('Clears registry username and email.'); +} - group[styleName] = styles[styleName]; +function hasWrapper(commander, args) { + return true; +} - codes.set(style[0], style[1]); - } +/***/ }), +/* 399 */ +/***/ (function(module, exports, __webpack_require__) { - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); +"use strict"; - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - } - const rgb2rgb = (r, g, b) => [r, g, b]; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; +var _asyncToGenerator2; - styles.color.ansi = {}; - styles.color.ansi256 = {}; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) - }; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} - styles.bgColor.ansi = {}; - styles.bgColor.ansi256 = {}; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) - }; +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + try { + yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, args, { + stdio: 'inherit', + cwd: config.cwd + }); + } catch (err) { + throw err; + } + }); - for (const key of Object.keys(colorConvert)) { - if (typeof colorConvert[key] !== 'object') { - continue; - } + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); - const suite = colorConvert[key]; +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; - if ('ansi16' in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); - } +var _child; - if ('ansi256' in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); - } +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(45)); +} - if ('rgb' in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); - } - } +var _constants; - return styles; +function _load_constants() { + return _constants = __webpack_require__(8); } -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)(module))) +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function setFlags(commander) {} + +function hasWrapper(commander, args) { + return true; +} /***/ }), -/* 356 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/*! - * arr-diff - * - * Copyright (c) 2014 Jon Schlinkert, contributors. - * Licensed under the MIT License - */ +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.requireLockfile = undefined; -var flatten = __webpack_require__(357); -var slice = [].slice; +var _set; -/** - * Return the difference between the first array and - * additional arrays. - * - * ```js - * var diff = require('{%= name %}'); - * - * var a = ['a', 'b', 'c', 'd']; - * var b = ['b', 'c']; - * - * console.log(diff(a, b)) - * //=> ['a', 'd'] - * ``` - * - * @param {Array} `a` - * @param {Array} `b` - * @return {Array} - * @api public - */ +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); +} -function diff(arr, arrays) { - var argsLen = arguments.length; - var len = arr.length, i = -1; - var res = [], arrays; +var _extends2; - if (argsLen === 1) { - return arr; - } +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(25)); +} - if (argsLen > 2) { - arrays = flatten(slice.call(arguments, 1)); - } +var _asyncToGenerator2; - while (++i < len) { - if (!~arrays.indexOf(arr[i])) { - res.push(arr[i]); - } - } - return res; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -/** - * Expose `diff` - */ +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder); + var install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({}, flags, { includeWorkspaceDeps: true }), config, reporter, lockfile); + var deps = yield (_packageRequest || _load_packageRequest()).default.getOutdatedPackages(lockfile, install, config, reporter); -module.exports = diff; + if (args.length) { + var requested = new (_set || _load_set()).default(args); + deps = deps.filter(function (_ref2) { + var name = _ref2.name; + return requested.has(name); + }); + } -/***/ }), -/* 357 */ -/***/ (function(module, exports, __webpack_require__) { + var getNameFromHint = function getNameFromHint(hint) { + return hint ? `${hint}Dependencies` : 'dependencies'; + }; + var colorizeName = function colorizeName(_ref3) { + var current = _ref3.current, + latest = _ref3.latest, + name = _ref3.name; + return reporter.format[(0, (_colorForVersions || _load_colorForVersions()).default)(current, latest)](name); + }; -"use strict"; -/*! - * arr-flatten - * - * Copyright (c) 2014-2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ + if (deps.length) { + var usesWorkspaces = !!config.workspaceRootFolder; + var body = deps.map(function (info) { + var row = [colorizeName(info), info.current, (0, (_colorizeDiff || _load_colorizeDiff()).default)(info.current, info.wanted, reporter), reporter.format.cyan(info.latest), info.workspaceName || '', getNameFromHint(info.hint), reporter.format.cyan(info.url)]; + if (!usesWorkspaces) { + row.splice(4, 1); + } + return row; + }); + + var red = reporter.format.red(''); + var yellow = reporter.format.yellow(''); + var green = reporter.format.green(''); + reporter.info(reporter.lang('legendColorsForVersionUpdates', red, yellow, green)); + var header = ['Package', 'Current', 'Wanted', 'Latest', 'Workspace', 'Package Type', 'URL']; + if (!usesWorkspaces) { + header.splice(4, 1); + } + reporter.table(header, body); + return 1; + } + return 0; + }); -module.exports = function flatten(arr) { - return flat(arr, []); -}; + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); -function flat(arr, acc) { - var len = arr.length; - var idx = -1; +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; - while (++idx < len) { - var cur = arr[idx]; - if (Array.isArray(cur)) { - flat(cur, acc); - } else { - acc.push(cur); - } - } - return acc; +var _packageRequest; + +function _load_packageRequest() { + return _packageRequest = _interopRequireDefault(__webpack_require__(85)); } +var _lockfile; -/***/ }), -/* 358 */ -/***/ (function(module, exports, __webpack_require__) { +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(20)); +} -"use strict"; +var _install; -module.exports = function (arr, predicate, ctx) { - if (typeof Array.prototype.findIndex === 'function') { - return arr.findIndex(predicate, ctx); - } +function _load_install() { + return _install = __webpack_require__(33); +} - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } +var _colorForVersions; - var list = Object(arr); - var len = list.length; +function _load_colorForVersions() { + return _colorForVersions = _interopRequireDefault(__webpack_require__(243)); +} - if (len === 0) { - return -1; - } +var _colorizeDiff; - for (var i = 0; i < len; i++) { - if (predicate.call(ctx, list[i], i, list)) { - return i; - } - } +function _load_colorizeDiff() { + return _colorizeDiff = _interopRequireDefault(__webpack_require__(244)); +} - return -1; -}; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var requireLockfile = exports.requireLockfile = true; + +function setFlags(commander) { + commander.description('Checks for outdated package dependencies.'); + commander.usage('outdated [packages ...]'); +} +function hasWrapper(commander, args) { + return true; +} /***/ }), -/* 359 */ +/* 401 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/*! - * array-unique - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.examples = exports.hasWrapper = exports.run = exports.mutate = undefined; -module.exports = function unique(arr) { - if (!Array.isArray(arr)) { - throw new TypeError('array-unique expects an array.'); - } +var _getIterator2; - var len = arr.length; - var i = -1; +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} - while (i++ < len) { - var j = i + 1; +var _asyncToGenerator2; - for (; j < arr.length; ++j) { - if (arr[i] === arr[j]) { - arr.splice(j--, 1); - } - } - } - return arr; -}; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} +var mutate = exports.mutate = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (args, config, reporter, buildMessages, mutator) { + if (args.length !== 2 && args.length !== 1) { + return false; + } -/***/ }), -/* 360 */ -/***/ (function(module, exports, __webpack_require__) { + var username = args.shift(); + var name = yield (0, (_tag || _load_tag()).getName)(args, config); + if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName')); + } -"use strict"; + var msgs = buildMessages(username, name); + reporter.step(1, 3, reporter.lang('loggingIn')); + var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); + reporter.step(2, 3, msgs.info); + var user = yield config.registries.npm.request(`-/user/org.couchdb.user:${username}`); + var error = false; + if (user) { + // get package + var _pkg = yield config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(name)); + if (_pkg) { + _pkg.maintainers = _pkg.maintainers || []; + error = mutator({ name: user.name, email: user.email }, _pkg); + } else { + error = true; + reporter.error(reporter.lang('unknownPackage', name)); + } -var rawAsap = __webpack_require__(361); -var freeTasks = []; + // update package + if (_pkg && !error) { + var res = yield config.registries.npm.request(`${(_npmRegistry || _load_npmRegistry()).default.escapeName(name)}/-rev/${_pkg._rev}`, { + method: 'PUT', + body: { + _id: _pkg._id, + _rev: _pkg._rev, + maintainers: _pkg.maintainers + } + }); -/** - * Calls a task as soon as possible after returning, in its own event, with - * priority over IO events. An exception thrown in a task can be handled by - * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise - * crash the process. If the error is handled, all subsequent tasks will - * resume. - * - * @param {{call}} task A callable object, typically a function that takes no - * arguments. - */ -module.exports = asap; -function asap(task) { - var rawTask; - if (freeTasks.length) { - rawTask = freeTasks.pop(); + if (res != null && res.success) { + reporter.success(msgs.success); + } else { + error = true; + reporter.error(msgs.error); + } + } } else { - rawTask = new RawTask(); + error = true; + reporter.error(reporter.lang('unknownUser', username)); } - rawTask.task = task; - rawTask.domain = process.domain; - rawAsap(rawTask); -} -function RawTask() { - this.task = null; - this.domain = null; -} + reporter.step(3, 3, reporter.lang('revokingToken')); + yield revoke(); -RawTask.prototype.call = function () { - if (this.domain) { - this.domain.enter(); - } - var threw = true; - try { - this.task.call(); - threw = false; - // If the task throws an exception (presumably) Node.js restores the - // domain stack for the next event. - if (this.domain) { - this.domain.exit(); - } - } finally { - // We use try/finally and a threw flag to avoid messing up stack traces - // when we catch and release errors. - if (threw) { - // In Node.js, uncaught exceptions are considered fatal errors. - // Re-throw them to interrupt flushing! - // Ensure that flushing continues if an uncaught exception is - // suppressed listening process.on("uncaughtException") or - // domain.on("error"). - rawAsap.requestFlush(); - } - // If the task threw an error, we do not want to exit the domain here. - // Exiting the domain would prevent the domain from catching the error. - this.task = null; - this.domain = null; - freeTasks.push(this); + if (error) { + throw new Error(); + } else { + return true; } -}; - + }); + return function mutate(_x, _x2, _x3, _x4, _x5) { + return _ref.apply(this, arguments); + }; +}(); -/***/ }), -/* 361 */ -/***/ (function(module, exports, __webpack_require__) { +var list = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (args.length > 1) { + return false; + } -"use strict"; + var name = yield (0, (_tag || _load_tag()).getName)(args, config); + reporter.step(1, 3, reporter.lang('loggingIn')); + var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); -var domain; // The domain module is executed on demand -var hasSetImmediate = typeof setImmediate === "function"; + reporter.step(2, 3, reporter.lang('ownerGetting', name)); + var pkg = yield config.registries.npm.request(name); + if (pkg) { + var owners = pkg.maintainers; + if (!owners || !owners.length) { + reporter.warn(reporter.lang('ownerNone')); + } else { + for (var _iterator = owners, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref3; -// Use the fastest means possible to execute a task in its own turn, with -// priority over other events including network IO events in Node.js. -// -// An exception thrown by a task will permanently interrupt the processing of -// subsequent tasks. The higher level `asap` function ensures that if an -// exception is thrown by a task, that the task queue will continue flushing as -// soon as possible, but if you use `rawAsap` directly, you are responsible to -// either ensure that no exceptions are thrown from your task, or to manually -// call `rawAsap.requestFlush` if an exception is thrown. -module.exports = rawAsap; -function rawAsap(task) { - if (!queue.length) { - requestFlush(); - flushing = true; - } - // Avoids a function call - queue[queue.length] = task; -} + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } -var queue = []; -// Once a flush has been requested, no further calls to `requestFlush` are -// necessary until the next `flush` completes. -var flushing = false; -// The position of the next task to execute in the task queue. This is -// preserved between calls to `flush` so that it can be resumed if -// a task throws an exception. -var index = 0; -// If a task schedules additional tasks recursively, the task queue can grow -// unbounded. To prevent memory excaustion, the task queue will periodically -// truncate already-completed tasks. -var capacity = 1024; + var owner = _ref3; -// The flush function processes all tasks that have been scheduled with -// `rawAsap` unless and until one of those tasks throws an exception. -// If a task throws an exception, `flush` ensures that its state will remain -// consistent and will resume where it left off when called again. -// However, `flush` does not make any arrangements to be called again if an -// exception is thrown. -function flush() { - while (index < queue.length) { - var currentIndex = index; - // Advance the index before calling the task. This ensures that we will - // begin flushing on the next task the task throws an error. - index = index + 1; - queue[currentIndex].call(); - // Prevent leaking memory for long chains of recursive calls to `asap`. - // If we call `asap` within tasks scheduled by `asap`, the queue will - // grow, but to avoid an O(n) walk for every task we execute, we don't - // shift tasks off the queue after they have been executed. - // Instead, we periodically shift 1024 tasks off the queue. - if (index > capacity) { - // Manually shift all values starting at the index back to the - // beginning of the queue. - for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { - queue[scan] = queue[scan + index]; - } - queue.length -= index; - index = 0; + reporter.info(`${owner.name} <${owner.email}>`); } + } + } else { + reporter.error(reporter.lang('ownerGettingFailed')); } - queue.length = 0; - index = 0; - flushing = false; -} -rawAsap.requestFlush = requestFlush; -function requestFlush() { - // Ensure flushing is not bound to any domain. - // It is not sufficient to exit the domain, because domains exist on a stack. - // To execute code outside of any domain, the following dance is necessary. - var parentDomain = process.domain; - if (parentDomain) { - if (!domain) { - // Lazy execute the domain module. - // Only employed if the user elects to use domains. - domain = __webpack_require__(703); - } - domain.active = process.domain = null; - } + reporter.step(3, 3, reporter.lang('revokingToken')); + yield revoke(); - // `setImmediate` is slower that `process.nextTick`, but `process.nextTick` - // cannot handle recursion. - // `requestFlush` will only be called recursively from `asap.js`, to resume - // flushing after an error is thrown into a domain. - // Conveniently, `setImmediate` was introduced in the same version - // `process.nextTick` started throwing recursion errors. - if (flushing && hasSetImmediate) { - setImmediate(flush); + if (pkg) { + return true; } else { - process.nextTick(flush); + throw new Error(); } + }); - if (parentDomain) { - domain.active = process.domain = parentDomain; - } + return function list(_x6, _x7, _x8, _x9) { + return _ref2.apply(this, arguments); + }; +}(); + +exports.setFlags = setFlags; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); } +var _buildSubCommands2; -/***/ }), -/* 362 */ -/***/ (function(module, exports, __webpack_require__) { +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(46)); +} -// Copyright 2011 Mark Cavage All rights reserved. +var _validate; -var errors = __webpack_require__(137); -var types = __webpack_require__(138); +function _load_validate() { + return _validate = __webpack_require__(90); +} -var Reader = __webpack_require__(363); -var Writer = __webpack_require__(364); +var _tag; +function _load_tag() { + return _tag = __webpack_require__(229); +} -///--- Exports +var _login; -module.exports = { +function _load_login() { + return _login = __webpack_require__(84); +} - Reader: Reader, +var _npmRegistry; - Writer: Writer +function _load_npmRegistry() { + return _npmRegistry = _interopRequireDefault(__webpack_require__(53)); +} -}; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -for (var t in types) { - if (types.hasOwnProperty(t)) - module.exports[t] = types[t]; +function remove(config, reporter, flags, args) { + return mutate(args, config, reporter, function (username, name) { + return { + info: reporter.lang('ownerRemoving', username, name), + success: reporter.lang('ownerRemoved'), + error: reporter.lang('ownerRemoveError') + }; + }, function (user, pkg) { + var found = false; + + pkg.maintainers = pkg.maintainers.filter(function (o) { + var match = o.name === user.name; + found = found || match; + return !match; + }); + + if (!found) { + reporter.error(reporter.lang('userNotAnOwner', user.name)); + } + + return found; + }); } -for (var e in errors) { - if (errors.hasOwnProperty(e)) - module.exports[e] = errors[e]; + +function setFlags(commander) { + commander.description('Manages package owners.'); } +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('owner', { + add(config, reporter, flags, args) { + return mutate(args, config, reporter, function (username, name) { + return { + info: reporter.lang('ownerAdding', username, name), + success: reporter.lang('ownerAdded'), + error: reporter.lang('ownerAddingFailed') + }; + }, function (user, pkg) { + for (var _iterator2 = pkg.maintainers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref4; -/***/ }), -/* 363 */ -/***/ (function(module, exports, __webpack_require__) { + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref4 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref4 = _i2.value; + } -// Copyright 2011 Mark Cavage All rights reserved. + var owner = _ref4; -var assert = __webpack_require__(31); + if (owner.name === user) { + reporter.error(reporter.lang('ownerAlready')); + return true; + } + } -var ASN1 = __webpack_require__(138); -var errors = __webpack_require__(137); + pkg.maintainers.push(user); + return false; + }); + }, -///--- Globals + rm(config, reporter, flags, args) { + reporter.warn(`\`yarn owner rm\` is deprecated. Please use \`yarn owner remove\`.`); + return remove(config, reporter, flags, args); + }, -var newInvalidAsn1Error = errors.newInvalidAsn1Error; + remove(config, reporter, flags, args) { + return remove(config, reporter, flags, args); + }, + ls(config, reporter, flags, args) { + reporter.warn(`\`yarn owner ls\` is deprecated. Please use \`yarn owner list\`.`); + return list(config, reporter, flags, args); + }, + list(config, reporter, flags, args) { + return list(config, reporter, flags, args); + } +}, ['add [[<@scope>/]]', 'remove [[<@scope>/]]', 'list [<@scope>/]']), + run = _buildSubCommands.run, + hasWrapper = _buildSubCommands.hasWrapper, + examples = _buildSubCommands.examples; -///--- API +exports.run = run; +exports.hasWrapper = hasWrapper; +exports.examples = examples; -function Reader(data) { - if (!data || !Buffer.isBuffer(data)) - throw new TypeError('data must be a node Buffer'); +/***/ }), +/* 402 */ +/***/ (function(module, exports, __webpack_require__) { - this._buf = data; - this._size = data.length; +"use strict"; - // These hold the "current" state - this._len = 0; - this._offset = 0; -} -Object.defineProperty(Reader.prototype, 'length', { - enumerable: true, - get: function () { return (this._len); } +Object.defineProperty(exports, "__esModule", { + value: true }); +exports.run = undefined; -Object.defineProperty(Reader.prototype, 'offset', { - enumerable: true, - get: function () { return (this._offset); } -}); +var _assign; -Object.defineProperty(Reader.prototype, 'remain', { - get: function () { return (this._size - this._offset); } -}); +function _load_assign() { + return _assign = _interopRequireDefault(__webpack_require__(17)); +} -Object.defineProperty(Reader.prototype, 'buffer', { - get: function () { return (this._buf.slice(this._offset)); } -}); +var _promise; +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} -/** - * Reads a single byte and advances offset; you can pass in `true` to make this - * a "peek" operation (i.e., get the byte, but don't advance the offset). - * - * @param {Boolean} peek true means don't move offset. - * @return {Number} the next byte, null if not enough data. - */ -Reader.prototype.readByte = function(peek) { - if (this._size - this._offset < 1) - return null; +var _asyncToGenerator2; - var b = this._buf[this._offset] & 0xff; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} - if (!peek) - this._offset += 1; +var publish = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, pkg, flags, dir) { + var access = flags.access; - return b; -}; + // if no access level is provided, check package.json for `publishConfig.access` + // see: https://docs.npmjs.com/files/package.json#publishconfig + if (!access && pkg && pkg.publishConfig && pkg.publishConfig.access) { + access = pkg.publishConfig.access; + } + // validate access argument + if (access && access !== 'public' && access !== 'restricted') { + throw new (_errors || _load_errors()).MessageError(config.reporter.lang('invalidAccess')); + } -Reader.prototype.peek = function() { - return this.readByte(true); -}; + // TODO this might modify package.json, do we need to reload it? + yield config.executeLifecycleScript('prepublish'); + yield config.executeLifecycleScript('prepare'); + yield config.executeLifecycleScript('prepublishOnly'); + // get tarball stream + var stat = yield (_fs || _load_fs()).lstat(dir); + var stream = void 0; + if (stat.isDirectory()) { + stream = yield (0, (_pack || _load_pack()).pack)(config, dir); + } else if (stat.isFile()) { + stream = fs2.createReadStream(dir); + } else { + throw new Error("Don't know how to handle this file type"); + } + var buffer = yield new (_promise || _load_promise()).default(function (resolve, reject) { + var data = []; + invariant(stream, 'expected stream'); + stream.on('data', data.push.bind(data)).on('end', function () { + return resolve(Buffer.concat(data)); + }).on('error', reject); + }); -/** - * Reads a (potentially) variable length off the BER buffer. This call is - * not really meant to be called directly, as callers have to manipulate - * the internal buffer afterwards. - * - * As a result of this call, you can call `Reader.length`, until the - * next thing called that does a readLength. - * - * @return {Number} the amount of offset to advance the buffer. - * @throws {InvalidAsn1Error} on bad ASN.1 - */ -Reader.prototype.readLength = function(offset) { - if (offset === undefined) - offset = this._offset; + // copy normalized package and remove internal keys as they may be sensitive or yarn specific + pkg = (0, (_assign || _load_assign()).default)({}, pkg); + for (var key in pkg) { + if (key[0] === '_') { + delete pkg[key]; + } + } - if (offset >= this._size) - return null; + var tag = flags.tag || 'latest'; + var tbName = `${pkg.name}-${pkg.version}.tgz`; + var tbURI = `${pkg.name}/-/${tbName}`; - var lenB = this._buf[offset++] & 0xff; - if (lenB === null) - return null; + // create body + var root = { + _id: pkg.name, + access, + name: pkg.name, + description: pkg.description, + 'dist-tags': { + [tag]: pkg.version + }, + versions: { + [pkg.version]: pkg + }, + readme: pkg.readme || '', + _attachments: { + [tbName]: { + content_type: 'application/octet-stream', + data: buffer.toString('base64'), + length: buffer.length + } + } + }; - if ((lenB & 0x80) == 0x80) { - lenB &= 0x7f; + pkg._id = `${pkg.name}@${pkg.version}`; + pkg.dist = pkg.dist || {}; + pkg.dist.shasum = crypto.createHash('sha1').update(buffer).digest('hex'); - if (lenB == 0) - throw newInvalidAsn1Error('Indefinite length not supported'); + var registry = String(config.getOption('registry')); + pkg.dist.tarball = url.resolve(registry, tbURI).replace(/^https:\/\//, 'http://'); - if (lenB > 4) - throw newInvalidAsn1Error('encoding too long'); + // publish package + var res = yield config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(pkg.name), { + method: 'PUT', + body: root + }); - if (this._size - offset < lenB) - return null; + if (res) { + yield config.executeLifecycleScript('publish'); + yield config.executeLifecycleScript('postpublish'); + } else { + throw new (_errors || _load_errors()).MessageError(config.reporter.lang('publishFail')); + } + }); - this._len = 0; - for (var i = 0; i < lenB; i++) - this._len = (this._len << 8) + (this._buf[offset++] & 0xff); + return function publish(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); - } else { - // Wasn't a variable length - this._len = lenB; - } +var run = exports.run = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + // validate package fields that are required for publishing + var pkg = yield config.readRootManifest(); + if (pkg.private) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('publishPrivate')); + } + if (!pkg.name) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); + } - return offset; -}; + // validate arguments + var dir = args[0] || config.cwd; + if (args.length > 1) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('tooManyArguments', 1)); + } + if (!(yield (_fs || _load_fs()).exists(dir))) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownFolderOrTarball')); + } + // + reporter.step(1, 4, reporter.lang('bumpingVersion')); + var commitVersion = yield (0, (_version || _load_version()).setVersion)(config, reporter, flags, args, false); -/** - * Parses the next sequence in this BER buffer. - * - * To get the length of the sequence, call `Reader.length`. - * - * @return {Number} the sequence's tag. - */ -Reader.prototype.readSequence = function(tag) { - var seq = this.peek(); - if (seq === null) - return null; - if (tag !== undefined && tag !== seq) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + seq.toString(16)); + // + reporter.step(2, 4, reporter.lang('loggingIn')); + var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, pkg.name, flags); - var o = this.readLength(this._offset + 1); // stored in `length` - if (o === null) - return null; + // + reporter.step(3, 4, reporter.lang('publishing')); + yield publish(config, pkg, flags, dir); + yield commitVersion(); + reporter.success(reporter.lang('published')); - this._offset = o; - return seq; -}; + // + reporter.step(4, 4, reporter.lang('revokingToken')); + yield revoke(); + }); + return function run(_x5, _x6, _x7, _x8) { + return _ref2.apply(this, arguments); + }; +}(); -Reader.prototype.readInt = function() { - return this._readTag(ASN1.Integer); -}; +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; +var _npmRegistry; -Reader.prototype.readBoolean = function() { - return (this._readTag(ASN1.Boolean) === 0 ? false : true); -}; +function _load_npmRegistry() { + return _npmRegistry = _interopRequireDefault(__webpack_require__(53)); +} +var _errors; -Reader.prototype.readEnumeration = function() { - return this._readTag(ASN1.Enumeration); -}; +function _load_errors() { + return _errors = __webpack_require__(5); +} +var _version; -Reader.prototype.readString = function(tag, retbuf) { - if (!tag) - tag = ASN1.OctetString; +function _load_version() { + return _version = __webpack_require__(231); +} - var b = this.peek(); - if (b === null) - return null; +var _fs; - if (b !== tag) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + b.toString(16)); +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(7)); +} - var o = this.readLength(this._offset + 1); // stored in `length` +var _pack; - if (o === null) - return null; +function _load_pack() { + return _pack = __webpack_require__(108); +} - if (this.length > this._size - o) - return null; +var _login; - this._offset = o; +function _load_login() { + return _login = __webpack_require__(84); +} - if (this.length === 0) - return retbuf ? new Buffer(0) : ''; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - var str = this._buf.slice(this._offset, this._offset + this.length); - this._offset += this.length; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - return retbuf ? str : str.toString('utf8'); -}; +var invariant = __webpack_require__(9); +var crypto = __webpack_require__(13); +var url = __webpack_require__(18); +var fs2 = __webpack_require__(10); -Reader.prototype.readOID = function(tag) { - if (!tag) - tag = ASN1.OID; +function setFlags(commander) { + (0, (_version || _load_version()).setFlags)(commander); + commander.description('Publishes a package to the npm registry.'); + commander.usage('publish [|] [--tag ] [--access ]'); + commander.option('--access [access]', 'access'); + commander.option('--tag [tag]', 'tag'); +} - var b = this.readString(tag, true); - if (b === null) - return null; +function hasWrapper(commander, args) { + return true; +} - var values = []; - var value = 0; +/***/ }), +/* 403 */ +/***/ (function(module, exports, __webpack_require__) { - for (var i = 0; i < b.length; i++) { - var byte = b[i] & 0xff; +"use strict"; - value <<= 7; - value += byte & 0x7f; - if ((byte & 0x80) == 0) { - values.push(value); - value = 0; - } - } - value = values.shift(); - values.unshift(value % 40); - values.unshift((value / 40) >> 0); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; - return values.join('.'); -}; +var _promise; +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} -Reader.prototype._readTag = function(tag) { - assert.ok(tag !== undefined); +var _stringify; - var b = this.peek(); +function _load_stringify() { + return _stringify = _interopRequireDefault(__webpack_require__(32)); +} - if (b === null) - return null; +var _getIterator2; - if (b !== tag) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + b.toString(16)); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} - var o = this.readLength(this._offset + 1); // stored in `length` - if (o === null) - return null; +var _assign; - if (this.length > 4) - throw newInvalidAsn1Error('Integer too long: ' + this.length); +function _load_assign() { + return _assign = _interopRequireDefault(__webpack_require__(17)); +} - if (this.length > this._size - o) - return null; - this._offset = o; +var _keys; - var fb = this._buf[this._offset]; - var value = 0; +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); +} - for (var i = 0; i < this.length; i++) { - value <<= 8; - value |= (this._buf[this._offset++] & 0xff); - } +var _set; - if ((fb & 0x80) == 0x80 && i !== 4) - value -= (1 << (i * 8)); +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); +} - return value >> 0; -}; +var _asyncToGenerator2; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var runCommand = function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (args) { + var action = args.shift(); -///--- Exported API + // build up list of commands + var cmds = []; -module.exports = Reader; + if (pkgScripts && action in pkgScripts) { + var preAction = `pre${action}`; + if (preAction in pkgScripts) { + cmds.push([preAction, pkgScripts[preAction]]); + } + cmds.push([action, scripts[action]]); -/***/ }), -/* 364 */ -/***/ (function(module, exports, __webpack_require__) { + var postAction = `post${action}`; + if (postAction in pkgScripts) { + cmds.push([postAction, pkgScripts[postAction]]); + } + } else if (scripts[action]) { + cmds.push([action, scripts[action]]); + } -// Copyright 2011 Mark Cavage All rights reserved. + if (cmds.length) { + // Disable wrapper in executed commands + process.env.YARN_WRAP_OUTPUT = 'false'; + for (var _iterator3 = cmds, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref6; -var assert = __webpack_require__(31); -var ASN1 = __webpack_require__(138); -var errors = __webpack_require__(137); + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref6 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref6 = _i3.value; + } + var _ref5 = _ref6; + var stage = _ref5[0]; + var _cmd = _ref5[1]; -///--- Globals + // only tack on trailing arguments for default script, ignore for pre and post - #1595 + var cmdWithArgs = stage === action ? sh`${unquoted(_cmd)} ${args}` : _cmd; + var customShell = config.getOption('script-shell'); + if (customShell) { + yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execCommand)(stage, config, cmdWithArgs, config.cwd, String(customShell)); + } else { + yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execCommand)(stage, config, cmdWithArgs, config.cwd); + } + } + } else if (action === 'env') { + reporter.log((0, (_stringify || _load_stringify()).default)((yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)('env', config.cwd, config)), null, 2), { force: true }); + } else { + var suggestion = void 0; -var newInvalidAsn1Error = errors.newInvalidAsn1Error; + for (var commandName in scripts) { + var steps = leven(commandName, action); + if (steps < 2) { + suggestion = commandName; + } + } -var DEFAULT_OPTS = { - size: 1024, - growthFactor: 8 -}; + var msg = `Command ${(0, (_stringify || _load_stringify()).default)(action)} not found.`; + if (suggestion) { + msg += ` Did you mean ${(0, (_stringify || _load_stringify()).default)(suggestion)}?`; + } + throw new (_errors || _load_errors()).MessageError(msg); + } + }); + return function runCommand(_x5) { + return _ref4.apply(this, arguments); + }; + }(); -///--- Helpers + // list possible scripts if none specified -function merge(from, to) { - assert.ok(from); - assert.equal(typeof(from), 'object'); - assert.ok(to); - assert.equal(typeof(to), 'object'); - var keys = Object.getOwnPropertyNames(from); - keys.forEach(function(key) { - if (to[key]) - return; + // build up a list of possible scripts + var pkg = yield config.readManifest(config.cwd); + var scripts = (0, (_map || _load_map()).default)(); + var binCommands = []; + var visitedBinFolders = new (_set || _load_set()).default(); + var pkgCommands = []; + for (var _iterator = (0, (_keys || _load_keys()).default)((_index || _load_index()).registries), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } - var value = Object.getOwnPropertyDescriptor(from, key); - Object.defineProperty(to, key, value); - }); + var registry = _ref2; - return to; -} + var binFolder = path.join(config.cwd, config.registries[registry].folder, '.bin'); + if (!visitedBinFolders.has(binFolder)) { + if (yield (_fs || _load_fs()).exists(binFolder)) { + for (var _iterator4 = yield (_fs || _load_fs()).readdir(binFolder), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref7; + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref7 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref7 = _i4.value; + } + var name = _ref7; -///--- API + binCommands.push(name); + scripts[name] = quoteForShell(path.join(binFolder, name)); + } + } + visitedBinFolders.add(binFolder); + } + } + var pkgScripts = pkg.scripts; + var cmdHints = {}; + if (pkgScripts) { + // inherit `scripts` from manifest + pkgCommands = (0, (_keys || _load_keys()).default)(pkgScripts).sort(); -function Writer(options) { - options = merge(DEFAULT_OPTS, options || {}); + // add command hints (what the actual yarn command will do) + for (var _iterator2 = pkgCommands, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref3; - this._buf = new Buffer(options.size || 1024); - this._size = this._buf.length; - this._offset = 0; - this._options = options; + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } - // A list of offsets in the buffer where we need to insert - // sequence tag/len pairs. - this._seq = []; -} + var cmd = _ref3; -Object.defineProperty(Writer.prototype, 'buffer', { - get: function () { - if (this._seq.length) - throw new InvalidAsn1Error(this._seq.length + ' unended sequence(s)'); + cmdHints[cmd] = pkgScripts[cmd] || ''; + } - return (this._buf.slice(0, this._offset)); - } -}); + (0, (_assign || _load_assign()).default)(scripts, pkgScripts); + } -Writer.prototype.writeByte = function(b) { - if (typeof(b) !== 'number') - throw new TypeError('argument must be a Number'); + if (args.length === 0) { + reporter.error(reporter.lang('commandNotSpecified')); - this._ensure(1); - this._buf[this._offset++] = b; -}; + if (binCommands.length) { + reporter.info(`${reporter.lang('binCommands') + binCommands.join(', ')}`); + } else { + reporter.error(reporter.lang('noBinAvailable')); + } + + if (pkgCommands.length) { + reporter.info(`${reporter.lang('possibleCommands')}`); + reporter.list('possibleCommands', pkgCommands, cmdHints); + yield reporter.question(reporter.lang('commandQuestion')).then(function (answer) { + return runCommand(answer.split(' ')); + }, function () { + return reporter.error(reporter.lang('commandNotSpecified')); + }); + } else { + reporter.error(reporter.lang('noScriptsAvailable')); + } + return (_promise || _load_promise()).default.resolve(); + } else { + return runCommand(args); + } + }); + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); -Writer.prototype.writeInt = function(i, tag) { - if (typeof(i) !== 'number') - throw new TypeError('argument must be a Number'); - if (typeof(tag) !== 'number') - tag = ASN1.Integer; +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; + +var _executeLifecycleScript; + +function _load_executeLifecycleScript() { + return _executeLifecycleScript = __webpack_require__(89); +} - var sz = 4; +var _errors; - while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && - (sz > 1)) { - sz--; - i <<= 8; - } +function _load_errors() { + return _errors = __webpack_require__(5); +} - if (sz > 4) - throw new InvalidAsn1Error('BER ints cannot be > 0xffffffff'); +var _index; - this._ensure(2 + sz); - this._buf[this._offset++] = tag; - this._buf[this._offset++] = sz; +function _load_index() { + return _index = __webpack_require__(41); +} - while (sz-- > 0) { - this._buf[this._offset++] = ((i & 0xff000000) >>> 24); - i <<= 8; - } +var _fs; -}; +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(7)); +} +var _map; -Writer.prototype.writeNull = function() { - this.writeByte(ASN1.Null); - this.writeByte(0x00); -}; +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(34)); +} +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -Writer.prototype.writeEnumeration = function(i, tag) { - if (typeof(i) !== 'number') - throw new TypeError('argument must be a Number'); - if (typeof(tag) !== 'number') - tag = ASN1.Enumeration; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - return this.writeInt(i, tag); -}; +var leven = __webpack_require__(632); +var path = __webpack_require__(0); -Writer.prototype.writeBoolean = function(b, tag) { - if (typeof(b) !== 'boolean') - throw new TypeError('argument must be a Boolean'); - if (typeof(tag) !== 'number') - tag = ASN1.Boolean; +var _require = __webpack_require__(656), + quoteForShell = _require.quoteForShell, + sh = _require.sh, + unquoted = _require.unquoted; - this._ensure(3); - this._buf[this._offset++] = tag; - this._buf[this._offset++] = 0x01; - this._buf[this._offset++] = b ? 0xff : 0x00; -}; +function setFlags(commander) { + commander.description('Runs a defined package script.'); +} +function hasWrapper(commander, args) { + return true; +} -Writer.prototype.writeString = function(s, tag) { - if (typeof(s) !== 'string') - throw new TypeError('argument must be a string (was: ' + typeof(s) + ')'); - if (typeof(tag) !== 'number') - tag = ASN1.OctetString; +/***/ }), +/* 404 */ +/***/ (function(module, exports, __webpack_require__) { - var len = Buffer.byteLength(s); - this.writeByte(tag); - this.writeLength(len); - if (len) { - this._ensure(len); - this._buf.write(s, this._offset); - this._offset += len; - } -}; +"use strict"; -Writer.prototype.writeBuffer = function(buf, tag) { - if (typeof(tag) !== 'number') - throw new TypeError('tag must be a number'); - if (!Buffer.isBuffer(buf)) - throw new TypeError('argument must be a buffer'); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.examples = exports.hasWrapper = exports.run = undefined; - this.writeByte(tag); - this.writeLength(buf.length); - this._ensure(buf.length); - buf.copy(this._buf, this._offset, 0, buf.length); - this._offset += buf.length; -}; +var _extends2; +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(25)); +} -Writer.prototype.writeStringArray = function(strings) { - if ((!strings instanceof Array)) - throw new TypeError('argument must be an Array[String]'); +var _asyncToGenerator2; - var self = this; - strings.forEach(function(s) { - self.writeString(s); - }); -}; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} -// This is really to solve DER cases, but whatever for now -Writer.prototype.writeOID = function(s, tag) { - if (typeof(s) !== 'string') - throw new TypeError('argument must be a string'); - if (typeof(tag) !== 'number') - tag = ASN1.OID; +var removeTeamUser = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter) { + reporter.step(2, 3, reporter.lang('teamRemovingUser')); + reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user`, { + method: 'DELETE', + body: { + user: parts.user + } + }))); + return true; + }); - if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) - throw new Error('argument is not a valid OID string'); + return function removeTeamUser(_x6, _x7, _x8) { + return _ref2.apply(this, arguments); + }; +}(); - function encodeOctet(bytes, octet) { - if (octet < 128) { - bytes.push(octet); - } else if (octet < 16384) { - bytes.push((octet >>> 7) | 0x80); - bytes.push(octet & 0x7F); - } else if (octet < 2097152) { - bytes.push((octet >>> 14) | 0x80); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); - } else if (octet < 268435456) { - bytes.push((octet >>> 21) | 0x80); - bytes.push(((octet >>> 14) | 0x80) & 0xFF); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); +var list = function () { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter) { + reporter.step(2, 3, reporter.lang('teamListing')); + var uriParams = '?format=cli'; + if (parts.team) { + reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user${uriParams}`))); } else { - bytes.push(((octet >>> 28) | 0x80) & 0xFF); - bytes.push(((octet >>> 21) | 0x80) & 0xFF); - bytes.push(((octet >>> 14) | 0x80) & 0xFF); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); + reporter.inspect((yield config.registries.npm.request(`org/${parts.scope}/team${uriParams}`))); } - } - - var tmp = s.split('.'); - var bytes = []; - bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); - tmp.slice(2).forEach(function(b) { - encodeOctet(bytes, parseInt(b, 10)); + return true; }); - var self = this; - this._ensure(2 + bytes.length); - this.writeByte(tag); - this.writeLength(bytes.length); - bytes.forEach(function(b) { - self.writeByte(b); - }); -}; + return function list(_x9, _x10, _x11) { + return _ref3.apply(this, arguments); + }; +}(); +exports.setFlags = setFlags; -Writer.prototype.writeLength = function(len) { - if (typeof(len) !== 'number') - throw new TypeError('argument must be a Number'); +var _buildSubCommands2; - this._ensure(4); +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(46)); +} - if (len <= 0x7f) { - this._buf[this._offset++] = len; - } else if (len <= 0xff) { - this._buf[this._offset++] = 0x81; - this._buf[this._offset++] = len; - } else if (len <= 0xffff) { - this._buf[this._offset++] = 0x82; - this._buf[this._offset++] = len >> 8; - this._buf[this._offset++] = len; - } else if (len <= 0xffffff) { - this._buf[this._offset++] = 0x83; - this._buf[this._offset++] = len >> 16; - this._buf[this._offset++] = len >> 8; - this._buf[this._offset++] = len; - } else { - throw new InvalidAsn1ERror('Length too long (> 4 bytes)'); - } -}; +var _login; -Writer.prototype.startSequence = function(tag) { - if (typeof(tag) !== 'number') - tag = ASN1.Sequence | ASN1.Constructor; +function _load_login() { + return _login = __webpack_require__(84); +} - this.writeByte(tag); - this._seq.push(this._offset); - this._ensure(3); - this._offset += 3; -}; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function explodeScopeTeam(arg, requireTeam, reporter) { + var _arg$split = arg.split(':'), + scope = _arg$split[0], + team = _arg$split[1], + parts = _arg$split.slice(2); -Writer.prototype.endSequence = function() { - var seq = this._seq.pop(); - var start = seq + 3; - var len = this._offset - start; + if (parts.length) { + return false; + } - if (len <= 0x7f) { - this._shift(start, len, -2); - this._buf[seq] = len; - } else if (len <= 0xff) { - this._shift(start, len, -1); - this._buf[seq] = 0x81; - this._buf[seq + 1] = len; - } else if (len <= 0xffff) { - this._buf[seq] = 0x82; - this._buf[seq + 1] = len >> 8; - this._buf[seq + 2] = len; - } else if (len <= 0xffffff) { - this._shift(start, len, 1); - this._buf[seq] = 0x83; - this._buf[seq + 1] = len >> 16; - this._buf[seq + 2] = len >> 8; - this._buf[seq + 3] = len; - } else { - throw new InvalidAsn1Error('Sequence too long'); + if (requireTeam && !team) { + return false; } -}; + return { + scope: scope || '', + team: team || '', + user: '' + }; +} -Writer.prototype._shift = function(start, len, shift) { - assert.ok(start !== undefined); - assert.ok(len !== undefined); - assert.ok(shift); +function warnDeprecation(reporter, deprecationWarning) { + var command = 'yarn team'; + reporter.warn(reporter.lang('deprecatedCommand', `${command} ${deprecationWarning.deprecatedCommand}`, `${command} ${deprecationWarning.currentComand}`)); +} - this._buf.copy(this._buf, start + shift, start, start + len); - this._offset += shift; -}; +function wrapRequired(callback, requireTeam, deprecationInfo) { + return function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (deprecationInfo) { + warnDeprecation(reporter, deprecationInfo); + } -Writer.prototype._ensure = function(len) { - assert.ok(len); + if (!args.length) { + return false; + } - if (this._size - this._offset < len) { - var sz = this._size * this._options.growthFactor; - if (sz - this._offset < len) - sz += len; + var parts = explodeScopeTeam(args[0], requireTeam, reporter); + if (!parts) { + return false; + } - var buf = new Buffer(sz); + reporter.step(1, 3, reporter.lang('loggingIn')); + var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter); - this._buf.copy(buf, 0, 0, this._offset); - this._buf = buf; - this._size = sz; - } -}; + var res = yield callback(parts, config, reporter, flags, args); + if (!res) { + return res; + } + reporter.step(3, 3, reporter.lang('revokingToken')); + yield revoke(); + return true; + }); + return function (_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; + }(); +} -///--- Exported API +function wrapRequiredTeam(callback) { + var requireTeam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + var subCommandDeprecated = arguments[2]; -module.exports = Writer; + return wrapRequired(function (parts, config, reporter, flags, args) { + if (args.length === 1) { + return callback(parts, config, reporter, flags, args); + } else { + return false; + } + }, requireTeam, subCommandDeprecated); +} +function wrapRequiredUser(callback, subCommandDeprecated) { + return wrapRequired(function (parts, config, reporter, flags, args) { + if (args.length === 2) { + return callback((0, (_extends2 || _load_extends()).default)({ + user: args[1] + }, parts), config, reporter, flags, args); + } else { + return false; + } + }, true, subCommandDeprecated); +} -/***/ }), -/* 365 */ -/***/ (function(module, exports, __webpack_require__) { +function setFlags(commander) { + commander.description('Maintain team memberships'); +} -module.exports = -{ - parallel : __webpack_require__(367), - serial : __webpack_require__(368), - serialOrdered : __webpack_require__(211) -}; +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('team', { + create: wrapRequiredTeam(function () { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) { + reporter.step(2, 3, reporter.lang('teamCreating')); + reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}`, { + method: 'PUT', + body: { + team: parts.team + } + }))); + return true; + }); + return function (_x12, _x13, _x14, _x15, _x16) { + return _ref4.apply(this, arguments); + }; + }()), -/***/ }), -/* 366 */ -/***/ (function(module, exports) { + destroy: wrapRequiredTeam(function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) { + reporter.step(2, 3, reporter.lang('teamRemoving')); + reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}`, { + method: 'DELETE' + }))); + return true; + }); -module.exports = defer; + return function (_x17, _x18, _x19, _x20, _x21) { + return _ref5.apply(this, arguments); + }; + }()), -/** - * Runs provided function on next iteration of the event loop - * - * @param {function} fn - function to run - */ -function defer(fn) -{ - var nextTick = typeof setImmediate == 'function' - ? setImmediate - : ( - typeof process == 'object' && typeof process.nextTick == 'function' - ? process.nextTick - : null - ); + add: wrapRequiredUser(function () { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) { + reporter.step(2, 3, reporter.lang('teamAddingUser')); + reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user`, { + method: 'PUT', + body: { + user: parts.user + } + }))); + return true; + }); - if (nextTick) - { - nextTick(fn); - } - else - { - setTimeout(fn, 0); - } -} + return function (_x22, _x23, _x24, _x25, _x26) { + return _ref6.apply(this, arguments); + }; + }()), + + rm: wrapRequiredUser(function (parts, config, reporter, flags, args) { + removeTeamUser(parts, config, reporter); + }, { + deprecatedCommand: 'rm', + currentComand: 'remove' + }), + + remove: wrapRequiredUser(function (parts, config, reporter, flags, args) { + removeTeamUser(parts, config, reporter); + }), + + ls: wrapRequiredTeam(function (parts, config, reporter, flags, args) { + list(parts, config, reporter); + }, false, { + deprecatedCommand: 'ls', + currentComand: 'list' + }), + + list: wrapRequiredTeam(function (parts, config, reporter, flags, args) { + list(parts, config, reporter); + }, false) +}, ['create ', 'destroy ', 'add ', 'remove ', 'list |']), + run = _buildSubCommands.run, + hasWrapper = _buildSubCommands.hasWrapper, + examples = _buildSubCommands.examples; +exports.run = run; +exports.hasWrapper = hasWrapper; +exports.examples = examples; /***/ }), -/* 367 */ +/* 405 */ /***/ (function(module, exports, __webpack_require__) { -var iterate = __webpack_require__(208) - , initState = __webpack_require__(209) - , terminator = __webpack_require__(210) - ; +"use strict"; -// Public API -module.exports = parallel; -/** - * Runs iterator over provided array elements in parallel - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function parallel(list, iterator, callback) -{ - var state = initState(list); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; - while (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, function(error, result) - { - if (error) - { - callback(error, result); - return; - } +var _getIterator2; - // looks like it's the last one - if (Object.keys(state.jobs).length === 0) - { - callback(null, state.results); - return; - } - }); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} - state.index++; - } +var _asyncToGenerator2; - return terminator.bind(state, callback); +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (args.length) { + for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; -/***/ }), -/* 368 */ -/***/ (function(module, exports, __webpack_require__) { + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } -var serialOrdered = __webpack_require__(211); + var name = _ref2; -// Public API -module.exports = serial; + var linkLoc = path.join(config.linkFolder, name); + if (yield (_fs || _load_fs()).exists(linkLoc)) { + yield (_fs || _load_fs()).unlink(path.join((yield (0, (_link || _load_link()).getRegistryFolder)(config, name)), name)); + reporter.success(reporter.lang('linkDisusing', name)); + reporter.info(reporter.lang('linkDisusingMessage', name)); + } else { + throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', name)); + } + } + } else { + // remove from registry + var manifest = yield config.readRootManifest(); + var _name = manifest.name; + if (!_name) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownPackageName')); + } -/** - * Runs iterator over provided array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serial(list, iterator, callback) -{ - return serialOrdered(list, iterator, null, callback); -} + var _linkLoc = path.join(config.linkFolder, _name); + if (yield (_fs || _load_fs()).exists(_linkLoc)) { + // If there is a `bin` defined in the package.json, + // link each bin to the global bin + if (manifest.bin) { + var globalBinFolder = yield (0, (_global || _load_global()).getBinFolder)(config, flags); + for (var binName in manifest.bin) { + var binDestLoc = path.join(globalBinFolder, binName); + if (yield (_fs || _load_fs()).exists(binDestLoc)) { + yield (_fs || _load_fs()).unlink(binDestLoc); + } + } + } + yield (_fs || _load_fs()).unlink(_linkLoc); -/***/ }), -/* 369 */ -/***/ (function(module, exports, __webpack_require__) { + reporter.success(reporter.lang('linkUnregistered', _name)); + reporter.info(reporter.lang('linkUnregisteredMessage', _name)); + } else { + throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', _name)); + } + } + }); + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); -/*! - * Copyright 2010 LearnBoost - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; -/** - * Module dependencies. - */ +var _errors; -var crypto = __webpack_require__(9) - , parse = __webpack_require__(14).parse - ; +function _load_errors() { + return _errors = __webpack_require__(5); +} -/** - * Valid keys. - */ +var _fs; -var keys = - [ 'acl' - , 'location' - , 'logging' - , 'notification' - , 'partNumber' - , 'policy' - , 'requestPayment' - , 'torrent' - , 'uploadId' - , 'uploads' - , 'versionId' - , 'versioning' - , 'versions' - , 'website' - ] +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(7)); +} -/** - * Return an "Authorization" header value with the given `options` - * in the form of "AWS :" - * - * @param {Object} options - * @return {String} - * @api private - */ +var _link; -function authorization (options) { - return 'AWS ' + options.key + ':' + sign(options) +function _load_link() { + return _link = __webpack_require__(226); } -module.exports = authorization -module.exports.authorization = authorization - -/** - * Simple HMAC-SHA1 Wrapper - * - * @param {Object} options - * @return {String} - * @api private - */ +var _global; -function hmacSha1 (options) { - return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +function _load_global() { + return _global = __webpack_require__(83); } -module.exports.hmacSha1 = hmacSha1 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -/** - * Create a base64 sha1 HMAC for `options`. - * - * @param {Object} options - * @return {String} - * @api private - */ +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function sign (options) { - options.message = stringToSign(options) - return hmacSha1(options) -} -module.exports.sign = sign +var path = __webpack_require__(0); -/** - * Create a base64 sha1 HMAC for `options`. - * - * Specifically to be used with S3 presigned URLs - * - * @param {Object} options - * @return {String} - * @api private - */ +function setFlags(commander) { + commander.description('Unlink a previously created symlink for a package.'); +} -function signQuery (options) { - options.message = queryStringToSign(options) - return hmacSha1(options) +function hasWrapper(commander, args) { + return true; } -module.exports.signQuery= signQuery -/** - * Return a string for sign() with the given `options`. - * - * Spec: - * - * \n - * \n - * \n - * \n - * [headers\n] - * - * - * @param {Object} options - * @return {String} - * @api private - */ +/***/ }), +/* 406 */ +/***/ (function(module, exports, __webpack_require__) { -function stringToSign (options) { - var headers = options.amazonHeaders || '' - if (headers) headers += '\n' - var r = - [ options.verb - , options.md5 - , options.contentType - , options.date ? options.date.toUTCString() : '' - , headers + options.resource - ] - return r.join('\n') -} -module.exports.queryStringToSign = stringToSign +"use strict"; -/** - * Return a string for sign() with the given `options`, but is meant exclusively - * for S3 presigned URLs - * - * Spec: - * - * \n - * - * - * @param {Object} options - * @return {String} - * @api private - */ -function queryStringToSign (options){ - return 'GET\n\n\n' + options.date + '\n' + options.resource -} -module.exports.queryStringToSign = queryStringToSign +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; -/** - * Perform the following: - * - * - ignore non-amazon headers - * - lowercase fields - * - sort lexicographically - * - trim whitespace between ":" - * - join with newline - * - * @param {Object} headers - * @return {String} - * @api private - */ +var _assign; -function canonicalizeHeaders (headers) { - var buf = [] - , fields = Object.keys(headers) - ; - for (var i = 0, len = fields.length; i < len; ++i) { - var field = fields[i] - , val = headers[field] - , field = field.toLowerCase() - ; - if (0 !== field.indexOf('x-amz')) continue - buf.push(field + ':' + val) - } - return buf.sort().join('\n') +function _load_assign() { + return _assign = _interopRequireDefault(__webpack_require__(17)); } -module.exports.canonicalizeHeaders = canonicalizeHeaders -/** - * Perform the following: - * - * - ignore non sub-resources - * - sort lexicographically - * - * @param {String} resource - * @return {String} - * @api private - */ +var _asyncToGenerator2; -function canonicalizeResource (resource) { - var url = parse(resource, true) - , path = url.pathname - , buf = [] - ; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} - Object.keys(url.query).forEach(function(key){ - if (!~keys.indexOf(key)) return - var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) - buf.push(key + val) - }) +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var versions = { yarn: (_yarnVersion || _load_yarnVersion()).version }; - return path + (buf.length ? '?' + buf.sort().join('&') : '') -} -module.exports.canonicalizeResource = canonicalizeResource + var pkg = yield config.maybeReadManifest(config.cwd); + if (pkg && pkg.name && pkg.version) { + versions[pkg.name] = pkg.version; + } + (0, (_assign || _load_assign()).default)(versions, process.versions); -/***/ }), -/* 370 */ -/***/ (function(module, exports, __webpack_require__) { + reporter.inspect(versions); + }); -var aws4 = exports, - url = __webpack_require__(14), - querystring = __webpack_require__(134), - crypto = __webpack_require__(9), - lru = __webpack_require__(371), - credentialsCache = lru(1000) + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); -// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; -function hmac(key, string, encoding) { - return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) +var _yarnVersion; + +function _load_yarnVersion() { + return _yarnVersion = __webpack_require__(81); } -function hash(string, encoding) { - return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function setFlags(commander) { + commander.description('Displays version information of currently installed Yarn, Node.js, and its dependencies.'); } -// This function assumes the string has already been percent encoded -function encodeRfc3986(urlEncodedString) { - return urlEncodedString.replace(/[!'()*]/g, function(c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) +function hasWrapper(commander, args) { + return true; } -// request: { path | body, [host], [method], [headers], [service], [region] } -// credentials: { accessKeyId, secretAccessKey, [sessionToken] } -function RequestSigner(request, credentials) { +/***/ }), +/* 407 */ +/***/ (function(module, exports, __webpack_require__) { - if (typeof request === 'string') request = url.parse(request) +"use strict"; - var headers = request.headers = (request.headers || {}), - hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) - this.request = request - this.credentials = credentials || this.defaultCredentials() +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.requireLockfile = undefined; - this.service = request.service || hostParts[0] || '' - this.region = request.region || hostParts[1] || 'us-east-1' +var _from; - // SES uses a different domain from the service name - if (this.service === 'email') this.service = 'ses' +function _load_from() { + return _from = _interopRequireDefault(__webpack_require__(92)); +} - if (!request.method && request.body) - request.method = 'POST' +var _getIterator2; - if (!headers.Host && !headers.host) { - headers.Host = request.hostname || request.host || this.createHost() +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} - // If a port is specified explicitly, use it as is - if (request.port) - headers.Host += ':' + request.port - } - if (!request.hostname && !request.host) - request.hostname = headers.Host || headers.host +var _keys; - this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); } -RequestSigner.prototype.matchHost = function(host) { - var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/) - var hostParts = (match || []).slice(1, 3) - - // ES's hostParts are sometimes the other way round, if the value that is expected - // to be region equals ‘es’ switch them back - // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com - if (hostParts[1] === 'es') - hostParts = hostParts.reverse() +var _promise; - return hostParts +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); } -// http://docs.aws.amazon.com/general/latest/gr/rande.html -RequestSigner.prototype.isSingleRegion = function() { - // Special case for S3 and SimpleDB in us-east-1 - if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true +var _set; - return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] - .indexOf(this.service) >= 0 +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); } -RequestSigner.prototype.createHost = function() { - var region = this.isSingleRegion() ? '' : - (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, - service = this.service === 'ses' ? 'email' : this.service - return service + region + '.amazonaws.com' +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -RequestSigner.prototype.prepareRequest = function() { - this.parsePath() +var cleanQuery = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, query) { + // if a location was passed then turn it into a hash query + if (path.isAbsolute(query) && (yield (_fs || _load_fs()).exists(query))) { + // absolute path + query = path.relative(config.cwd, query); + } - var request = this.request, headers = request.headers, query + // remove references to node_modules with hashes + query = query.replace(/([\\/]|^)node_modules[\\/]/g, '#'); - if (request.signQuery) { + // remove trailing hashes + query = query.replace(/^#+/g, ''); - this.parsedPath.query = query = this.parsedPath.query || {} + // remove trailing paths from each part of the query, skip second part of path for scoped packages + var queryParts = query.split('#'); + queryParts = queryParts.map(function (part) { + var parts = part.split(/[\\/]/g); - if (this.credentials.sessionToken) - query['X-Amz-Security-Token'] = this.credentials.sessionToken + if (part[0] === '@') { + parts = parts.slice(0, 2); + } else { + parts = parts.slice(0, 1); + } - if (this.service === 's3' && !query['X-Amz-Expires']) - query['X-Amz-Expires'] = 86400 + return parts.join('/'); + }); + query = queryParts.join('#'); - if (query['X-Amz-Date']) - this.datetime = query['X-Amz-Date'] - else - query['X-Amz-Date'] = this.getDateTime() + return query; + }); - query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' - query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() - query['X-Amz-SignedHeaders'] = this.signedHeaders() + return function cleanQuery(_x, _x2) { + return _ref.apply(this, arguments); + }; +}(); - } else { +var getPackageSize = function () { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (tuple) { + var loc = tuple[0]; - if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { - if (request.body && !headers['Content-Type'] && !headers['content-type']) - headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' - if (request.body && !headers['Content-Length'] && !headers['content-length']) - headers['Content-Length'] = Buffer.byteLength(request.body) + var files = yield (_fs || _load_fs()).walk(loc, null, new (_set || _load_set()).default([(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME])); - if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) - headers['X-Amz-Security-Token'] = this.credentials.sessionToken + var sizes = yield (_promise || _load_promise()).default.all(files.map(function (walkFile) { + return (_fs || _load_fs()).getFileSizeOnDisk(walkFile.absolute); + })); - if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) - headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') + return sum(sizes); + }); - if (headers['X-Amz-Date'] || headers['x-amz-date']) - this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] - else - headers['X-Amz-Date'] = this.getDateTime() + return function getPackageSize(_x3) { + return _ref2.apply(this, arguments); + }; +}(); + +var run = exports.run = function () { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (!args.length) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('missingWhyDependency')); + } + if (args.length > 1) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('tooManyArguments', 1)); } - delete headers.Authorization - delete headers.authorization - } -} + var query = yield cleanQuery(config, args[0]); -RequestSigner.prototype.sign = function() { - if (!this.parsedPath) this.prepareRequest() + reporter.step(1, 4, reporter.lang('whyStart', args[0]), emoji.get('thinking_face')); - if (this.request.signQuery) { - this.parsedPath.query['X-Amz-Signature'] = this.signature() - } else { - this.request.headers.Authorization = this.authHeader() - } + // init + reporter.step(2, 4, reporter.lang('whyInitGraph'), emoji.get('truck')); + var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); + var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - this.request.path = this.formatPath() + var _ref8 = yield install.fetchRequestFromCwd(), + depRequests = _ref8.requests, + patterns = _ref8.patterns, + workspaceLayout = _ref8.workspaceLayout; - return this.request -} + yield install.resolver.init(depRequests, { + isFlat: install.flags.flat, + isFrozen: install.flags.frozenLockfile, + workspaceLayout + }); + var hoisted = yield install.linker.getFlatHoistedTree(patterns); -RequestSigner.prototype.getDateTime = function() { - if (!this.datetime) { - var headers = this.request.headers, - date = new Date(headers.Date || headers.date || new Date) + // finding + reporter.step(3, 4, reporter.lang('whyFinding'), emoji.get('mag')); - this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + var matches = queryWhy(query, hoisted); - // Remove the trailing 'Z' on the timestamp string for CodeCommit git access - if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) - } - return this.datetime -} + if (matches.length <= 0) { + reporter.error(reporter.lang('whyUnknownMatch')); + return; + } -RequestSigner.prototype.getDate = function() { - return this.getDateTime().substr(0, 8) -} + var processMatch = function () { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (match) { + var matchInfo = match[1]; -RequestSigner.prototype.authHeader = function() { - return [ - 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), - 'SignedHeaders=' + this.signedHeaders(), - 'Signature=' + this.signature(), - ].join(', ') -} + var matchRef = matchInfo.pkg._reference; + invariant(matchRef, 'expected reference'); -RequestSigner.prototype.signature = function() { - var date = this.getDate(), - cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), - kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) - if (!kCredentials) { - kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) - kRegion = hmac(kDate, this.region) - kService = hmac(kRegion, this.service) - kCredentials = hmac(kService, 'aws4_request') - credentialsCache.set(cacheKey, kCredentials) - } - return hmac(kCredentials, this.stringToSign(), 'hex') -} + var distinctMatchPatterns = new (_set || _load_set()).default(matchRef.patterns); + var reasons = []; -RequestSigner.prototype.stringToSign = function() { - return [ - 'AWS4-HMAC-SHA256', - this.getDateTime(), - this.credentialString(), - hash(this.canonicalString(), 'hex'), - ].join('\n') -} + // reason: dependency of these modules + if (matchInfo.originalParentPath.length > 0) { + reasons.push({ + type: 'whyDependedOn', + typeSimple: 'whyDependedOnSimple', + value: toStandardPathString(matchInfo.originalParentPath) + }); + } -RequestSigner.prototype.canonicalString = function() { - if (!this.parsedPath) this.prepareRequest() + // reason: exists in manifest + var rootType = void 0; + for (var _iterator3 = distinctMatchPatterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref10; - var pathStr = this.parsedPath.path, - query = this.parsedPath.query, - headers = this.request.headers, - queryStr = '', - normalizePath = this.service !== 's3', - decodePath = this.service === 's3' || this.request.doNotEncodePath, - decodeSlashesInPath = this.service === 's3', - firstValOnly = this.service === 's3', - bodyHash + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref10 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref10 = _i3.value; + } - if (this.service === 's3' && this.request.signQuery) { - bodyHash = 'UNSIGNED-PAYLOAD' - } else if (this.isCodeCommitGit) { - bodyHash = '' - } else { - bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || - hash(this.request.body || '', 'hex') - } + var pattern = _ref10; - if (query) { - queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { - if (!key) return obj - obj[key] = !Array.isArray(query[key]) ? query[key] : - (firstValOnly ? query[key][0] : query[key].slice().sort()) - return obj - }, {}))) - } - if (pathStr !== '/') { - if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') - pathStr = pathStr.split('/').reduce(function(path, piece) { - if (normalizePath && piece === '..') { - path.pop() - } else if (!normalizePath || piece !== '.') { - if (decodePath) piece = querystring.unescape(piece) - path.push(encodeRfc3986(querystring.escape(piece))) - } - return path - }, []).join('/') - if (pathStr[0] !== '/') pathStr = '/' + pathStr - if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') - } + rootType = install.rootPatternsToOrigin[pattern]; + if (rootType) { + reasons.push({ + type: 'whySpecified', + typeSimple: 'whySpecifiedSimple', + value: rootType + }); + } + } - return [ - this.request.method || 'GET', - pathStr, - queryStr, - this.canonicalHeaders() + '\n', - this.signedHeaders(), - bodyHash, - ].join('\n') -} + // reason: this is hoisted from these modules + for (var _iterator4 = matchInfo.previousPaths, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { + var _ref11; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref11 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref11 = _i4.value; + } + + var _path = _ref11; + + reasons.push({ + type: 'whyHoistedFrom', + typeSimple: 'whyHoistedFromSimple', + value: toStandardPathString(_path) + }); + } + + // package sizes + var packageSize = 0; + var directSizes = []; + var transitiveSizes = []; + try { + packageSize = yield getPackageSize(match); + } catch (e) {} -RequestSigner.prototype.canonicalHeaders = function() { - var headers = this.request.headers - function trimAll(header) { - return header.toString().trim().replace(/\s+/g, ' ') - } - return Object.keys(headers) - .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) - .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) - .join('\n') -} + var dependencies = (0, (_from || _load_from()).default)(collect(hoisted, new (_set || _load_set()).default(), match)); + var transitiveDependencies = (0, (_from || _load_from()).default)(collect(hoisted, new (_set || _load_set()).default(), match, { recursive: true })); -RequestSigner.prototype.signedHeaders = function() { - return Object.keys(this.request.headers) - .map(function(key) { return key.toLowerCase() }) - .sort() - .join(';') -} + try { + directSizes = yield (_promise || _load_promise()).default.all(dependencies.map(getPackageSize)); + transitiveSizes = yield (_promise || _load_promise()).default.all(transitiveDependencies.map(getPackageSize)); + } catch (e) {} -RequestSigner.prototype.credentialString = function() { - return [ - this.getDate(), - this.region, - this.service, - 'aws4_request', - ].join('/') -} + var transitiveKeys = new (_set || _load_set()).default(transitiveDependencies.map(function (_ref12) { + var info = _ref12[1]; + return info.key; + })); + var sharedDependencies = getSharedDependencies(hoisted, transitiveKeys); -RequestSigner.prototype.defaultCredentials = function() { - var env = process.env - return { - accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, - secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, - sessionToken: env.AWS_SESSION_TOKEN, - } -} + // prepare output: populate reporter + reporter.info(reporter.lang('whyMatch', `${matchInfo.key}@${matchInfo.pkg.version}`)); + // + // reason: hoisted/nohoist + if (matchInfo.isNohoist) { + reasons.push({ + type: 'whyNotHoisted', + typeSimple: 'whyNotHoistedSimple', + value: matchInfo.nohoistList + }); + } else if (query === matchInfo.originalKey) { + reporter.info(reporter.lang('whyHoistedTo', matchInfo.key)); + } -RequestSigner.prototype.parsePath = function() { - var path = this.request.path || '/', - queryIx = path.indexOf('?'), - query = null + if (reasons.length === 1) { + reporter.info(reporter.lang(reasons[0].typeSimple, reasons[0].value)); + } else if (reasons.length > 1) { + reporter.info(reporter.lang('whyReasons')); + reporter.list('reasons', reasons.map(function (reason) { + return reporter.lang(reason.type, reason.value); + })); + } else { + reporter.error(reporter.lang('whyWhoKnows')); + } - if (queryIx >= 0) { - query = querystring.parse(path.slice(queryIx + 1)) - path = path.slice(0, queryIx) - } + if (packageSize) { + // stats: file size of this dependency without any dependencies + reporter.info(reporter.lang('whyDiskSizeWithout', bytes(packageSize))); - // S3 doesn't always encode characters > 127 correctly and - // all services don't encode characters > 255 correctly - // So if there are non-reserved chars (and it's not already all % encoded), just encode them all - if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { - path = path.split('/').map(function(piece) { - return querystring.escape(querystring.unescape(piece)) - }).join('/') - } + // stats: file size of this dependency including dependencies that aren't shared + reporter.info(reporter.lang('whyDiskSizeUnique', bytes(packageSize + sum(directSizes)))); - this.parsedPath = { - path: path, - query: query, - } -} + // stats: file size of this dependency including dependencies + reporter.info(reporter.lang('whyDiskSizeTransitive', bytes(packageSize + sum(transitiveSizes)))); -RequestSigner.prototype.formatPath = function() { - var path = this.parsedPath.path, - query = this.parsedPath.query + // stats: shared transitive dependencies + reporter.info(reporter.lang('whySharedDependencies', sharedDependencies.size)); + } + }); - if (!query) return path + return function processMatch(_x9) { + return _ref9.apply(this, arguments); + }; + }(); - // Services don't support empty query string keys - if (query[''] != null) delete query[''] + reporter.step(4, 4, reporter.lang('whyCalculating'), emoji.get('aerial_tramway')); + for (var _iterator5 = matches, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { + var _ref13; - return path + '?' + encodeRfc3986(querystring.stringify(query)) -} + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref13 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref13 = _i5.value; + } -aws4.RequestSigner = RequestSigner + var match = _ref13; -aws4.sign = function(request, credentials) { - return new RequestSigner(request, credentials).sign() -} + yield processMatch(match); + } + }); + return function run(_x5, _x6, _x7, _x8) { + return _ref7.apply(this, arguments); + }; +}(); -/***/ }), -/* 371 */ -/***/ (function(module, exports) { +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; +exports.queryWhy = queryWhy; -module.exports = function(size) { - return new LruCache(size) -} +var _install; -function LruCache(size) { - this.capacity = size | 0 - this.map = Object.create(null) - this.list = new DoublyLinkedList() +function _load_install() { + return _install = __webpack_require__(33); } -LruCache.prototype.get = function(key) { - var node = this.map[key] - if (node == null) return undefined - this.used(node) - return node.val -} +var _constants; -LruCache.prototype.set = function(key, val) { - var node = this.map[key] - if (node != null) { - node.val = val - } else { - if (!this.capacity) this.prune() - if (!this.capacity) return false - node = new DoublyLinkedNode(key, val) - this.map[key] = node - this.capacity-- - } - this.used(node) - return true +function _load_constants() { + return _constants = __webpack_require__(8); } -LruCache.prototype.used = function(node) { - this.list.moveToFront(node) +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(7)); } -LruCache.prototype.prune = function() { - var node = this.list.pop() - if (node != null) { - delete this.map[node.key] - this.capacity++ - } +var _lockfile; + +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(20)); } +var _errors; -function DoublyLinkedList() { - this.firstNode = null - this.lastNode = null +function _load_errors() { + return _errors = __webpack_require__(5); } -DoublyLinkedList.prototype.moveToFront = function(node) { - if (this.firstNode == node) return +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - this.remove(node) +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - if (this.firstNode == null) { - this.firstNode = node - this.lastNode = node - node.prev = null - node.next = null - } else { - node.prev = null - node.next = this.firstNode - node.next.prev = node - this.firstNode = node - } +var requireLockfile = exports.requireLockfile = true; + +var invariant = __webpack_require__(9); +var bytes = __webpack_require__(459); +var emoji = __webpack_require__(293); +var path = __webpack_require__(0); + +function sum(array) { + return array.length ? array.reduce(function (a, b) { + return a + b; + }, 0) : 0; } -DoublyLinkedList.prototype.pop = function() { - var lastNode = this.lastNode - if (lastNode != null) { - this.remove(lastNode) +function collect(hoistManifests, allDependencies, dependency) { + var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { recursive: false }, + recursive = _ref3.recursive; + + var depInfo = dependency[1]; + + var deps = depInfo.pkg.dependencies; + + if (!deps) { + return allDependencies; } - return lastNode -} -DoublyLinkedList.prototype.remove = function(node) { - if (this.firstNode == node) { - this.firstNode = node.next - } else if (node.prev != null) { - node.prev.next = node.next + var dependencyKeys = new (_set || _load_set()).default((0, (_keys || _load_keys()).default)(deps)); + var directDependencies = []; + + for (var _iterator = hoistManifests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref4; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } + + var dep = _ref4; + var info = dep[1]; + + + if (!allDependencies.has(dep) && dependencyKeys.has(info.key)) { + allDependencies.add(dep); + directDependencies.push(dep); + } } - if (this.lastNode == node) { - this.lastNode = node.prev - } else if (node.next != null) { - node.next.prev = node.prev + + if (recursive) { + directDependencies.forEach(function (dependency) { + return collect(hoistManifests, allDependencies, dependency, { recursive: true }); + }); } + + return allDependencies; } +function getSharedDependencies(hoistManifests, transitiveKeys) { + var sharedDependencies = new (_set || _load_set()).default(); + for (var _iterator2 = hoistManifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref6; -function DoublyLinkedNode(key, val) { - this.key = key - this.val = val - this.prev = null - this.next = null -} + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref6 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref6 = _i2.value; + } + var _ref5 = _ref6; + var info = _ref5[1]; -/***/ }), -/* 372 */ -/***/ (function(module, exports, __webpack_require__) { + if (!transitiveKeys.has(info.key) && info.pkg.dependencies) { + (0, (_keys || _load_keys()).default)(info.pkg.dependencies).forEach(function (dependency) { + if (transitiveKeys.has(dependency) && !sharedDependencies.has(dependency)) { + sharedDependencies.add(dependency); + } + }); + } + } + return sharedDependencies; +} -"use strict"; +function setFlags(commander) { + commander.description('Identifies why a package has been installed, detailing which other packages depend on it.'); +} +function hasWrapper(commander, args) { + return true; +} -Object.defineProperty(exports, "__esModule", { - value: true -}); +// to conform to the current standard '#' as package tree separator +function toStandardPathString(pathString) { + var str = pathString.replace(/\//g, '#'); + if (str[0] === '#') { + return str.slice(1); + } + return str; +} -exports.default = function (message) { - return { - useless: true, - run: function run() { - throw new (_errors || _load_errors()).MessageError(message); - }, +function queryWhy(pattern, hoisted) { + var nohoistPattern = `#${pattern}`; + var found = []; + for (var _iterator6 = hoisted, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { + var _ref15; - setFlags: () => {}, - hasWrapper: () => true - }; -}; + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref15 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref15 = _i6.value; + } -var _errors; + var _ref14 = _ref15; + var loc = _ref14[0]; + var info = _ref14[1]; -function _load_errors() { - return _errors = __webpack_require__(3); + if (info.key === pattern || info.previousPaths.indexOf(pattern) >= 0 || info.key.endsWith(nohoistPattern)) { + found.push([loc, info]); + } + } + return found; } /***/ }), -/* 373 */ +/* 408 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80253,100 +88385,98 @@ function _load_errors() { Object.defineProperty(exports, "__esModule", { value: true }); -exports.examples = exports.hasWrapper = exports.setFlags = exports.run = undefined; +exports.run = undefined; -var _promise; +var _asyncToGenerator2; -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -var _buildSubCommands2; +var run = exports.run = function () { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + var workspaceRootFolder = config.workspaceRootFolder; -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(47)); -} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (!workspaceRootFolder) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd)); + } -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('access', { - public: function _public() { - return (_promise || _load_promise()).default.reject(new Error('TODO')); - }, - restricted: function restricted() { - return (_promise || _load_promise()).default.reject(new Error('TODO')); - }, - grant: function grant() { - return (_promise || _load_promise()).default.reject(new Error('TODO')); - }, - revoke: function revoke() { - return (_promise || _load_promise()).default.reject(new Error('TODO')); - }, - lsPackages: function lsPackages() { - return (_promise || _load_promise()).default.reject(new Error('TODO')); - }, - lsCollaborators: function lsCollaborators() { - return (_promise || _load_promise()).default.reject(new Error('TODO')); - }, - edit: function edit() { - return (_promise || _load_promise()).default.reject(new Error('TODO')); - } -}, ['access public []', 'access restricted []', 'access grant []', 'access revoke []', 'access ls-packages [||]', 'access ls-collaborators [ []]', 'access edit []']); + if (args.length < 1) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceMissingWorkspace')); + } -const run = _buildSubCommands.run, - setFlags = _buildSubCommands.setFlags, - hasWrapper = _buildSubCommands.hasWrapper, - examples = _buildSubCommands.examples; -exports.run = run; -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; -exports.examples = examples; + if (args.length < 2) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceMissingCommand')); + } -/***/ }), -/* 374 */ -/***/ (function(module, exports, __webpack_require__) { + var manifest = yield config.findManifest(workspaceRootFolder, false); + invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property'); -"use strict"; + var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest); + var workspaceName = args[0]; + // rawArgs contains: [nodePath, yarnPath, 'workspace', workspaceName, ...] -Object.defineProperty(exports, "__esModule", { - value: true -}); + var _ref2 = flags.rawArgs || [], + rest = _ref2.slice(4); -var _promise; + if (!Object.prototype.hasOwnProperty.call(workspaces, workspaceName)) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceUnknownWorkspace', workspaceName)); + } -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(4)); -} + var workspace = workspaces[workspaceName]; + + try { + yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [(_constants || _load_constants()).YARN_BIN_PATH].concat(rest), { + stdio: 'inherit', + cwd: workspace.loc + }); + } catch (err) { + throw err; + } + }); + + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +}(); -exports.hasWrapper = hasWrapper; exports.setFlags = setFlags; -exports.run = run; +exports.hasWrapper = hasWrapper; -var _yarnResolver; +var _errors; -function _load_yarnResolver() { - return _yarnResolver = _interopRequireDefault(__webpack_require__(231)); +function _load_errors() { + return _errors = __webpack_require__(5); } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _child; -const path = __webpack_require__(1); +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(45)); +} -function hasWrapper(commander) { - return false; +var _constants; + +function _load_constants() { + return _constants = __webpack_require__(8); } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var invariant = __webpack_require__(9); + function setFlags(commander) {} -function run(config, reporter, flags, args) { - const binFolder = path.join(config.cwd, config.registries[(_yarnResolver || _load_yarnResolver()).default.registry].folder, '.bin'); - reporter.log(binFolder, { force: true }); - return (_promise || _load_promise()).default.resolve(); +function hasWrapper(commander, args) { + return true; } /***/ }), -/* 375 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80355,597 +88485,971 @@ function run(config, reporter, flags, args) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.examples = exports.run = undefined; +exports.examples = exports.setFlags = exports.run = exports.info = undefined; + +var _from; + +function _load_from() { + return _from = _interopRequireDefault(__webpack_require__(92)); +} + +var _set; + +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); +} + +var _getIterator2; -var _toConsumableArray2; +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} + +var _keys; + +function _load_keys() { + return _keys = _interopRequireDefault(__webpack_require__(14)); +} + +var _stringify; -function _load_toConsumableArray() { - return _toConsumableArray2 = _interopRequireDefault(__webpack_require__(32)); +function _load_stringify() { + return _stringify = _interopRequireDefault(__webpack_require__(32)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } -let _list = (() => { +var info = exports.info = function () { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - let readCacheMetadata = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let parentDir = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : config.cacheFolder; - let metadataFile = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_constants || _load_constants()).METADATA_FILENAME; + var workspaceRootFolder = config.workspaceRootFolder; - const folders = yield (_fs || _load_fs()).readdir(parentDir); - const packagesMetadata = []; - for (const folder of folders) { - if (folder[0] === '.') { - continue; - } + if (!workspaceRootFolder) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd)); + } - const loc = path.join(config.cacheFolder, parentDir.replace(config.cacheFolder, ''), folder); - // Check if this is a scoped package - if (!(yield (_fs || _load_fs()).exists(path.join(loc, metadataFile)))) { - // If so, recurrently read scoped packages metadata - packagesMetadata.push.apply(packagesMetadata, (0, (_toConsumableArray2 || _load_toConsumableArray()).default)((yield readCacheMetadata(loc)))); - } else { - var _ref3 = yield config.readPackageMetadata(loc); + var manifest = yield config.findManifest(workspaceRootFolder, false); + invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property'); - const registry = _ref3.registry, - manifest = _ref3.package, - remote = _ref3.remote; + var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest); - if (flags.pattern && !micromatch.contains(manifest.name, flags.pattern)) { - continue; + var publicData = {}; + + for (var _iterator = (0, (_keys || _load_keys()).default)(workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var workspaceName = _ref2; + var _workspaces$workspace = workspaces[workspaceName], + loc = _workspaces$workspace.loc, + _manifest = _workspaces$workspace.manifest; + + + var workspaceDependencies = new (_set || _load_set()).default(); + var mismatchedWorkspaceDependencies = new (_set || _load_set()).default(); + + for (var _iterator2 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var dependencyType = _ref3; + + if (dependencyType !== 'peerDependencies') { + for (var _iterator3 = (0, (_keys || _load_keys()).default)(_manifest[dependencyType] || {}), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + var dependencyName = _ref4; + + if (Object.prototype.hasOwnProperty.call(workspaces, dependencyName)) { + invariant(_manifest && _manifest[dependencyType], 'The request should exist'); + var requestedRange = _manifest[dependencyType][dependencyName]; + if (semver.satisfies(workspaces[dependencyName].manifest.version, requestedRange)) { + workspaceDependencies.add(dependencyName); + } else { + mismatchedWorkspaceDependencies.add(dependencyName); + } } - packagesMetadata.push([manifest.name, manifest.version, registry, remote && remote.resolved || '']); } } + } - return packagesMetadata; - }); - - return function readCacheMetadata() { - return _ref2.apply(this, arguments); + publicData[workspaceName] = { + location: path.relative(config.lockfileFolder, loc).replace(/\\/g, '/'), + workspaceDependencies: (0, (_from || _load_from()).default)(workspaceDependencies), + mismatchedWorkspaceDependencies: (0, (_from || _load_from()).default)(mismatchedWorkspaceDependencies) }; - })(); - - const body = yield readCacheMetadata(); + } - reporter.table(['Name', 'Version', 'Registry', 'Resolved'], body); + reporter.log((0, (_stringify || _load_stringify()).default)(publicData, null, 2), { force: true }); }); - return function _list(_x, _x2, _x3, _x4) { + return function info(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; -})(); +}(); exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; -var _buildSubCommands2; +var _errors; -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(47)); +function _load_errors() { + return _errors = __webpack_require__(5); } -var _fs; +var _buildSubCommands2; -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(5)); +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(46)); } var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const path = __webpack_require__(1); - -const micromatch = __webpack_require__(93); +var invariant = __webpack_require__(9); +var path = __webpack_require__(0); +var semver = __webpack_require__(21); -function hasWrapper(flags, args) { - return args[0] !== 'dir'; +function hasWrapper(commander, args) { + return true; } -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('cache', { - ls: (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - reporter.warn(`\`yarn cache ls\` is deprecated. Please use \`yarn cache list\`.`); - yield _list(config, reporter, flags, args); - }); +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('workspaces', { + info(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield info(config, reporter, flags, args); + })(); + } +}), + run = _buildSubCommands.run, + setFlags = _buildSubCommands.setFlags, + examples = _buildSubCommands.examples; - function ls(_x7, _x8, _x9, _x10) { - return _ref4.apply(this, arguments); - } +exports.run = run; +exports.setFlags = setFlags; +exports.examples = examples; - return ls; - })(), - list: (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - yield _list(config, reporter, flags, args); - }); +/***/ }), +/* 410 */ +/***/ (function(module, exports, __webpack_require__) { - function list(_x11, _x12, _x13, _x14) { - return _ref5.apply(this, arguments); - } +"use strict"; +/* WEBPACK VAR INJECTION */(function(module) { - return list; - })(), - dir: function dir(config, reporter) { - reporter.log(config.cacheFolder, { force: true }); - }, - clean: (() => { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - let getPackageCachefolders = (() => { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (packageName) { - let parentDir = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : config.cacheFolder; - let metadataFile = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (_constants || _load_constants()).METADATA_FILENAME; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.autoRun = undefined; - const folders = yield (_fs || _load_fs()).readdir(parentDir); - const packageFolders = []; +var _assign; - for (const folder of folders) { - if (folder[0] === '.') { - continue; - } +function _load_assign() { + return _assign = _interopRequireDefault(__webpack_require__(17)); +} - const loc = path.join(config.cacheFolder, parentDir.replace(config.cacheFolder, ''), folder); - // Check if this is a scoped package - if (!(yield (_fs || _load_fs()).exists(path.join(loc, metadataFile)))) { - // If so, recurrently read scoped packages metadata - packageFolders.push.apply(packageFolders, (0, (_toConsumableArray2 || _load_toConsumableArray()).default)((yield getPackageCachefolders(packageName, loc)))); - } else { - var _ref8 = yield config.readPackageMetadata(loc); +var _asyncToGenerator2; - const manifest = _ref8.package; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +} - if (packageName === manifest.name) { - packageFolders.push(loc); - } - } - } +var _getIterator2; - return packageFolders; - }); +function _load_getIterator() { + return _getIterator2 = _interopRequireDefault(__webpack_require__(3)); +} - return function getPackageCachefolders(_x21) { - return _ref7.apply(this, arguments); - }; - })(); +var _stringify; - if (config.cacheFolder) { - const activity = reporter.activity(); +function _load_stringify() { + return _stringify = _interopRequireDefault(__webpack_require__(32)); +} - if (args.length > 0) { - // Clear named package from cache - const folders = yield getPackageCachefolders(args[0]); +var _promise; - if (folders.length === 0) { - activity.end(); - reporter.warn(reporter.lang('couldntClearPackageFromCache', args[0])); - return; - } +function _load_promise() { + return _promise = _interopRequireDefault(__webpack_require__(6)); +} - for (const folder of folders) { - yield (_fs || _load_fs()).unlink(folder); - } - activity.end(); - reporter.success(reporter.lang('clearedPackageFromCache', args[0])); - } else { - // Clear all cache - yield (_fs || _load_fs()).unlink(config._cacheRootFolder); - yield (_fs || _load_fs()).mkdirp(config.cacheFolder); - activity.end(); - reporter.success(reporter.lang('clearedCache')); +var _set; + +function _load_set() { + return _set = _interopRequireDefault(__webpack_require__(15)); +} + +var start = function () { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var rc = (0, (_rc || _load_rc()).getRcConfigForCwd)(process.cwd()); + var yarnPath = rc['yarn-path']; + + if (yarnPath && !boolifyWithDefault(process.env.YARN_IGNORE_PATH, false)) { + var argv = process.argv.slice(2); + var opts = { stdio: 'inherit', env: (0, (_assign || _load_assign()).default)({}, process.env, { YARN_IGNORE_PATH: 1 }) }; + var exitCode = 0; + + try { + exitCode = yield (0, (_child || _load_child()).spawnp)(yarnPath, argv, opts); + } catch (firstError) { + try { + exitCode = yield (0, (_child || _load_child()).forkp)(yarnPath, argv, opts); + } catch (error) { + throw firstError; } } - }); - function clean(_x15, _x16, _x17, _x18) { - return _ref6.apply(this, arguments); + process.exitCode = exitCode; + } else { + // ignore all arguments after a -- + var doubleDashIndex = process.argv.findIndex(function (element) { + return element === '--'; + }); + var startArgs = process.argv.slice(0, 2); + var args = process.argv.slice(2, doubleDashIndex === -1 ? process.argv.length : doubleDashIndex); + var endArgs = doubleDashIndex === -1 ? [] : process.argv.slice(doubleDashIndex); + + main({ startArgs, args, endArgs }); } + }); - return clean; - })() -}); + return function start() { + return _ref5.apply(this, arguments); + }; +}(); -const run = _buildSubCommands.run, - _setFlags = _buildSubCommands.setFlags, - examples = _buildSubCommands.examples; -exports.run = run; -exports.examples = examples; -function setFlags(commander) { - _setFlags(commander); - commander.option('--pattern [pattern]', 'filter cached packages by pattern'); +// When this module is compiled via Webpack, its child +// count will be 0 since it is a single-file bundle. + + +exports.main = main; + +var _http; + +function _load_http() { + return _http = _interopRequireDefault(__webpack_require__(51)); } -/***/ }), -/* 376 */ -/***/ (function(module, exports, __webpack_require__) { +var _net; -"use strict"; +function _load_net() { + return _net = _interopRequireDefault(__webpack_require__(82)); +} +var _path; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.setFlags = exports.run = undefined; +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); +} -var _stringify; +var _commander; -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(34)); +function _load_commander() { + return _commander = _interopRequireDefault(__webpack_require__(204)); } -var _slicedToArray2; +var _fs; -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(17)); +function _load_fs() { + return _fs = _interopRequireDefault(__webpack_require__(10)); } -var _asyncToGenerator2; +var _invariant; -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); +function _load_invariant() { + return _invariant = _interopRequireDefault(__webpack_require__(9)); } -exports.hasWrapper = hasWrapper; +var _properLockfile; -var _buildSubCommands2; +function _load_properLockfile() { + return _properLockfile = _interopRequireDefault(__webpack_require__(335)); +} -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(47)); +var _loudRejection; + +function _load_loudRejection() { + return _loudRejection = _interopRequireDefault(__webpack_require__(334)); } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _death; -const CONFIG_KEYS = [ -// 'reporter', -'rootModuleFolders', 'registryFolders', 'linkedModules', -// 'registries', -'cache', 'cwd', 'looseSemver', 'commandName', 'preferOffline', 'modulesFolder', 'globalFolder', 'linkFolder', 'offline', 'binLinks', 'ignorePlatform', 'ignoreScripts', 'disablePrepublish', 'nonInteractive', 'workspaceRootFolder', 'lockfileFolder', 'networkConcurrency', 'childConcurrency', 'networkTimeout', 'workspacesEnabled', 'pruneOfflineMirror', 'enableMetaFolder', 'enableLockfileVersions', 'linkFileDependencies', 'cacheFolder', 'tempFolder', 'production']; -/* eslint object-shorthand: 0 */ +function _load_death() { + return _death = _interopRequireDefault(__webpack_require__(333)); +} -function hasWrapper(flags, args) { - return args[0] !== 'get'; +var _semver; + +function _load_semver() { + return _semver = _interopRequireDefault(__webpack_require__(21)); } -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('config', { - set: (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (args.length === 0 || args.length > 2) { - return false; - } +var _index; - var _args = (0, (_slicedToArray2 || _load_slicedToArray()).default)(args, 2); +function _load_index() { + return _index = __webpack_require__(144); +} - const key = _args[0]; - var _args$ = _args[1]; - const val = _args$ === undefined ? true : _args$; +var _index2; - const yarnConfig = config.registries.yarn; - yield yarnConfig.saveHomeConfig({ [key]: val }); - reporter.success(reporter.lang('configSet', key, val)); - return true; - }); +function _load_index2() { + return _index2 = __webpack_require__(40); +} - function set(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - } +var _index3; - return set; - })(), - get: function get(config, reporter, flags, args) { - if (args.length !== 1) { - return false; - } +function _load_index3() { + return _index3 = _interopRequireDefault(__webpack_require__(202)); +} - reporter.log(String(config.getOption(args[0])), { force: true }); - return true; - }, +var _constants; +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} - delete: (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (args.length !== 1) { - return false; - } +var _network; - const key = args[0]; - const yarnConfig = config.registries.yarn; - yield yarnConfig.saveHomeConfig({ [key]: undefined }); - reporter.success(reporter.lang('configDelete', key)); - return true; - }); +function _load_network() { + return _network = _interopRequireWildcard(__webpack_require__(203)); +} - function _delete(_x5, _x6, _x7, _x8) { - return _ref2.apply(this, arguments); - } +var _errors; - return _delete; - })(), +function _load_errors() { + return _errors = __webpack_require__(5); +} - list: function list(config, reporter, flags, args) { - if (args.length) { - return false; - } +var _config; - reporter.info(reporter.lang('configYarn')); - reporter.inspect(config.registries.yarn.config); +function _load_config() { + return _config = _interopRequireDefault(__webpack_require__(106)); +} - reporter.info(reporter.lang('configNpm')); - reporter.inspect(config.registries.npm.config); +var _rc; - return true; - }, - current: function current(config, reporter, flags, args) { - if (args.length) { - return false; - } +function _load_rc() { + return _rc = __webpack_require__(331); +} - reporter.log((0, (_stringify || _load_stringify()).default)(config, CONFIG_KEYS, 2), { force: true }); +var _child; - return true; - } -}); +function _load_child() { + return _child = __webpack_require__(45); +} -const run = _buildSubCommands.run, - setFlags = _buildSubCommands.setFlags, - examples = _buildSubCommands.examples; -exports.run = run; -exports.setFlags = setFlags; -exports.examples = examples; +var _yarnVersion; -/***/ }), -/* 377 */ -/***/ (function(module, exports, __webpack_require__) { +function _load_yarnVersion() { + return _yarnVersion = __webpack_require__(81); +} -"use strict"; +var _signalHandler; +function _load_signalHandler() { + return _signalHandler = _interopRequireDefault(__webpack_require__(332)); +} -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function findProjectRoot(base) { + var prev = null; + var dir = base; -var _toArray2; + do { + if ((_fs || _load_fs()).default.existsSync((_path || _load_path()).default.join(dir, (_constants || _load_constants()).NODE_PACKAGE_JSON))) { + return dir; + } + + prev = dir; + dir = (_path || _load_path()).default.dirname(dir); + } while (dir !== prev); -function _load_toArray() { - return _toArray2 = _interopRequireDefault(__webpack_require__(88)); + return base; } -var _asyncToGenerator2; +var boolify = function boolify(val) { + return val.toString().toLowerCase() !== 'false' && val !== '0'; +}; -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(0)); +function boolifyWithDefault(val, defaultResult) { + if (val === undefined || val === null || val === '') { + return defaultResult; + } else { + return boolify(val); + } } -let run = exports.run = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var _args = (0, (_toArray2 || _load_toArray()).default)(args); +function main(_ref) { + var startArgs = _ref.startArgs, + args = _ref.args, + endArgs = _ref.endArgs; - const builderName = _args[0], - rest = _args.slice(1); + (0, (_loudRejection || _load_loudRejection()).default)(); + (0, (_signalHandler || _load_signalHandler()).default)(); - if (!builderName) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName')); + // set global options + (_commander || _load_commander()).default.version((_yarnVersion || _load_yarnVersion()).version, '-v, --version'); + (_commander || _load_commander()).default.usage('[command] [flags]'); + (_commander || _load_commander()).default.option('--verbose', 'output verbose messages on internal operations'); + (_commander || _load_commander()).default.option('--offline', 'trigger an error if any required dependencies are not available in local cache'); + (_commander || _load_commander()).default.option('--prefer-offline', 'use network only if dependencies are not available in local cache'); + (_commander || _load_commander()).default.option('--strict-semver'); + (_commander || _load_commander()).default.option('--json', 'format Yarn log messages as lines of JSON (see jsonlines.org)'); + (_commander || _load_commander()).default.option('--ignore-scripts', "don't run lifecycle scripts"); + (_commander || _load_commander()).default.option('--har', 'save HAR output of network traffic'); + (_commander || _load_commander()).default.option('--ignore-platform', 'ignore platform checks'); + (_commander || _load_commander()).default.option('--ignore-engines', 'ignore engines check'); + (_commander || _load_commander()).default.option('--ignore-optional', 'ignore optional dependencies'); + (_commander || _load_commander()).default.option('--force', 'install and build packages even if they were built before, overwrite lockfile'); + (_commander || _load_commander()).default.option('--skip-integrity-check', 'run install without checking if node_modules is installed'); + (_commander || _load_commander()).default.option('--check-files', 'install will verify file tree of packages for consistency'); + (_commander || _load_commander()).default.option('--no-bin-links', "don't generate bin links when setting up packages"); + (_commander || _load_commander()).default.option('--flat', 'only allow one version of a package'); + (_commander || _load_commander()).default.option('--prod, --production [prod]', '', boolify); + (_commander || _load_commander()).default.option('--no-lockfile', "don't read or generate a lockfile"); + (_commander || _load_commander()).default.option('--pure-lockfile', "don't generate a lockfile"); + (_commander || _load_commander()).default.option('--frozen-lockfile', "don't generate a lockfile and fail if an update is needed"); + (_commander || _load_commander()).default.option('--update-checksums', 'update package checksums from current repository'); + (_commander || _load_commander()).default.option('--link-duplicates', 'create hardlinks to the repeated modules in node_modules'); + (_commander || _load_commander()).default.option('--link-folder ', 'specify a custom folder to store global links'); + (_commander || _load_commander()).default.option('--global-folder ', 'specify a custom folder to store global packages'); + (_commander || _load_commander()).default.option('--modules-folder ', 'rather than installing modules into the node_modules folder relative to the cwd, output them here'); + (_commander || _load_commander()).default.option('--preferred-cache-folder ', 'specify a custom folder to store the yarn cache if possible'); + (_commander || _load_commander()).default.option('--cache-folder ', 'specify a custom folder that must be used to store the yarn cache'); + (_commander || _load_commander()).default.option('--mutex [:specifier]', 'use a mutex to ensure only one yarn instance is executing'); + (_commander || _load_commander()).default.option('--emoji [bool]', 'enable emoji in output', boolify, process.platform === 'darwin'); + (_commander || _load_commander()).default.option('-s, --silent', 'skip Yarn console logs, other types of logs (script output) will be printed'); + (_commander || _load_commander()).default.option('--cwd ', 'working directory to use', process.cwd()); + (_commander || _load_commander()).default.option('--proxy ', ''); + (_commander || _load_commander()).default.option('--https-proxy ', ''); + (_commander || _load_commander()).default.option('--registry ', 'override configuration registry'); + (_commander || _load_commander()).default.option('--no-progress', 'disable progress bar'); + (_commander || _load_commander()).default.option('--network-concurrency ', 'maximum number of concurrent network requests', parseInt); + (_commander || _load_commander()).default.option('--network-timeout ', 'TCP timeout for network requests', parseInt); + (_commander || _load_commander()).default.option('--non-interactive', 'do not show interactive prompts'); + (_commander || _load_commander()).default.option('--scripts-prepend-node-path [bool]', 'prepend the node executable dir to the PATH in scripts', boolify); + (_commander || _load_commander()).default.option('--no-node-version-check', 'do not warn when using a potentially unsupported Node version'); + + // if -v is the first command, then always exit after returning the version + if (args[0] === '-v') { + console.log((_yarnVersion || _load_yarnVersion()).version.trim()); + process.exitCode = 0; + return; + } + + // get command name + var firstNonFlagIndex = args.findIndex(function (arg, idx, arr) { + var isOption = arg.startsWith('-'); + var prev = idx > 0 && arr[idx - 1]; + var prevOption = prev && prev.startsWith('-') && (_commander || _load_commander()).default.optionFor(prev); + var boundToPrevOption = prevOption && (prevOption.optional || prevOption.required); + + return !isOption && !boundToPrevOption; + }); + var preCommandArgs = void 0; + var commandName = ''; + if (firstNonFlagIndex > -1) { + preCommandArgs = args.slice(0, firstNonFlagIndex); + commandName = args[firstNonFlagIndex]; + args = args.slice(firstNonFlagIndex + 1); + } else { + preCommandArgs = args; + args = []; + } + + var isKnownCommand = Object.prototype.hasOwnProperty.call((_index3 || _load_index3()).default, commandName); + var isHelp = function isHelp(arg) { + return arg === '--help' || arg === '-h'; + }; + var helpInPre = preCommandArgs.findIndex(isHelp); + var helpInArgs = args.findIndex(isHelp); + var setHelpMode = function setHelpMode() { + if (isKnownCommand) { + args.unshift(commandName); } + commandName = 'help'; + isKnownCommand = true; + }; - const packageName = builderName.replace(/^(@[^\/]+\/)?/, '$1create-'); - const commandName = packageName.replace(/^@[^\/]+\//, ''); + if (helpInPre > -1) { + preCommandArgs.splice(helpInPre); + setHelpMode(); + } else if (isKnownCommand && helpInArgs === 0) { + args.splice(helpInArgs); + setHelpMode(); + } - yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', packageName]); + if (!commandName) { + commandName = 'install'; + isKnownCommand = true; + } - const binFolder = yield (0, (_global || _load_global()).getBinFolder)(config, {}); - const command = path.resolve(binFolder, path.basename(commandName)); + if (!isKnownCommand) { + // if command is not recognized, then set default to `run` + args.unshift(commandName); + commandName = 'run'; + } + var command = (_index3 || _load_index3()).default[commandName]; - yield (_child || _load_child()).spawn(command, rest, { stdio: `inherit`, shell: true }); + var warnAboutRunDashDash = false; + // we are using "yarn