diff --git a/CHANGELOG.md b/CHANGELOG.md index 70c182f..d1e8351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log This project adheres to [Semantic Versioning](http://semver.org/). All notable changes will be documented in this file. -## [Unreleased] +## [1.2.1] - 2019-05-21 ### Fixed - [#46](https://github.com/OldSneerJaw/couchster/issues/46): Broken error equality test in Node.js 12 @@ -41,7 +41,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). All notable c ## [0.1.0] - 2018-02-28 Adapted from [synctos](https://github.com/Kashoo/synctos) for use with CouchDB -[Unreleased]: https://github.com/OldSneerJaw/couchster/compare/v1.2.0...HEAD +[Unreleased]: https://github.com/OldSneerJaw/couchster/compare/v1.2.1...HEAD +[1.2.1]: https://github.com/OldSneerJaw/couchster/compare/v1.2.0...v1.2.1 [1.2.0]: https://github.com/OldSneerJaw/couchster/compare/v1.1.0...v1.2.0 [1.1.0]: https://github.com/OldSneerJaw/couchster/compare/v1.0.0...v1.1.0 [1.0.0]: https://github.com/OldSneerJaw/couchster/compare/v0.2.0...v1.0.0 diff --git a/lib/commander/VERSION b/lib/commander/VERSION index 3f8eb71..7329e21 100644 --- a/lib/commander/VERSION +++ b/lib/commander/VERSION @@ -1 +1 @@ -2.17.1 +2.20.0 diff --git a/lib/commander/index.js b/lib/commander/index.js index 8e29669..06173c1 100644 --- a/lib/commander/index.js +++ b/lib/commander/index.js @@ -527,14 +527,11 @@ Command.prototype.executeSubCommand = function(argv, args, unknown) { // In case of globally installed, get the base dir where executable // subcommand file should be located at - var baseDir, - link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f; + var baseDir; - // when symbolink is relative path - if (link !== f && link.charAt(0) !== '/') { - link = path.join(dirname(f), link); - } - baseDir = dirname(link); + var resolvedLink = fs.realpathSync(f); + + baseDir = dirname(resolvedLink); // prefer local `./` to bin in the $PATH var localBin = path.join(baseDir, bin); @@ -580,9 +577,9 @@ Command.prototype.executeSubCommand = function(argv, args, unknown) { proc.on('close', process.exit.bind(process)); proc.on('error', function(err) { if (err.code === 'ENOENT') { - console.error('%s(1) does not exist, try --help', bin); + console.error('error: %s(1) does not exist, try --help', bin); } else if (err.code === 'EACCES') { - console.error('%s(1) not executable. try chmod or run with root', bin); + console.error('error: %s(1) not executable. try chmod or run with root', bin); } process.exit(1); }); @@ -664,7 +661,7 @@ Command.prototype.parseArgs = function(args, unknown) { this.unknownOption(unknown[0]); } if (this.commands.length === 0 && - this._args.filter(function(a) { return a.required }).length === 0) { + this._args.filter(function(a) { return a.required; }).length === 0) { this.emit('command:*'); } } @@ -792,9 +789,7 @@ Command.prototype.opts = function() { */ Command.prototype.missingArgument = function(name) { - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); + console.error("error: missing required argument `%s'", name); process.exit(1); }; @@ -807,13 +802,11 @@ Command.prototype.missingArgument = function(name) { */ Command.prototype.optionMissingArgument = function(option, flag) { - console.error(); if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); + console.error("error: option `%s' argument missing, got `%s'", option.flags, flag); } else { - console.error(" error: option `%s' argument missing", option.flags); + console.error("error: option `%s' argument missing", option.flags); } - console.error(); process.exit(1); }; @@ -826,9 +819,7 @@ Command.prototype.optionMissingArgument = function(option, flag) { Command.prototype.unknownOption = function(flag) { if (this._allowUnknownOption) return; - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); + console.error("error: unknown option `%s'", flag); process.exit(1); }; @@ -840,9 +831,7 @@ Command.prototype.unknownOption = function(flag) { */ Command.prototype.variadicArgNotLast = function(name) { - console.error(); - console.error(" error: variadic arguments must be last `%s'", name); - console.error(); + console.error("error: variadic arguments must be last `%s'", name); process.exit(1); }; @@ -1053,7 +1042,7 @@ Command.prototype.optionHelp = function() { // Append the help information return this.options.map(function(option) { return pad(option.flags, width) + ' ' + option.description + - ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + option.defaultValue + ')' : ''); + ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + JSON.stringify(option.defaultValue) + ')' : ''); }).concat([pad('-h, --help', width) + ' ' + 'output usage information']) .join('\n'); }; @@ -1073,7 +1062,6 @@ Command.prototype.commandHelp = function() { return [ 'Commands:', - '', commands.map(function(cmd) { var desc = cmd[1] ? ' ' + cmd[1] : ''; return (desc ? pad(cmd[0], width) : cmd[0]) + desc; @@ -1124,7 +1112,6 @@ Command.prototype.helpInformation = function() { var options = [ 'Options:', - '', '' + this.optionHelp().replace(/^/gm, ' '), '' ]; diff --git a/lib/indent.js/VERSION b/lib/indent.js/VERSION index d15723f..42045ac 100644 --- a/lib/indent.js/VERSION +++ b/lib/indent.js/VERSION @@ -1 +1 @@ -0.3.2 +0.3.4 diff --git a/lib/indent.js/indent.js b/lib/indent.js/indent.js new file mode 100644 index 0000000..f2f7e80 --- /dev/null +++ b/lib/indent.js/indent.js @@ -0,0 +1,762 @@ +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { + define([], factory); + } else if (typeof exports === 'object') { + module.exports = factory(); + } else { + root.indent = factory(); + } +}(this, function() { +var indent = (function (root) { + var rulesCache = {}; + + function map(array, predicate) { + var i, results = []; + for (i=0; i/], + $ignoreRules: true, + $consumeEndMatch: true + }, + { + $languages: "html", + $name: "doctype", + $startPatterns: [/\<\!doctype html>/i], + $endPatterns: [NEW_LINE_REGEX], + $ignoreRules: true, + $consumeEndMatch: true + }, + { + $languages: "js html", + $name: "void-tags", + $startPatterns: [ + /\<(area|base|br|col|command|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)/i], + $endPatterns: [/>/], + $indent: true, + $consumeEndMatch: true + }, + { + $languages: "html", + $name: "mode switch js", + $startPatterns: [function (string) { + var start = /].*/i; + var end = /<\/script>/i; + var startMatch = start.exec(string); + var endMatch = end.exec(string); + + if (startMatch && (!endMatch || endMatch.index < startMatch.index)) { + return { + matchIndex: startMatch.index, + length: startMatch[0].length + }; + } + return null; + }], + $endPatterns: [/<\/script>/i], + $switchRules: "js", + $consumeEndMatch: true, + $indent: true, + $newScope: true + }, + { + $languages: "html", + $name: "mode switch css", + $startPatterns: [function (string) { + var start = /].*/i; + var end = /<\/style>/i; + var startMatch = start.exec(string); + var endMatch = end.exec(string); + + if (startMatch && (!endMatch || endMatch.index < startMatch.index)) { + return { + matchIndex: startMatch.index, + length: startMatch[0].length + }; + } + return null; + }], + $endPatterns: [/<\/style>/i], + $switchRules: "css", + $consumeEndMatch: true, + $indent: true, + $newScope: true + }, + { + $languages: "html", + $name: "html-tag", + $startPatterns: [//i], + $consumeEndMatch: true + }, + { + $languages: "js html", + $name: "tag", + $startPatterns: [function (string, rule, state) { + var re = /<([A-Za-z][A-Za-z0-9\-\.]*)/; + var match = string.match(re); + if (match) { + state.openingTag = match[1]; + return { + matchIndex: match.index, + length: match[0].length + } + } else { + return null; + } + }], + $endPatterns: [function (string, rule, state) { + var re = new RegExp("<\/" + state.openingTag + ">|\\s\/>", "i"); + var match = string.match(re); + if (match) { + return { + matchIndex: match.index, + length: match[0].length + } + } else { + return null; + } + }], + $indent: true, + $consumeEndMatch: true + }, + { + $languages: "js", + $name: "line-comment", + $startPatterns: [/\/\//], + $endPatterns: [NEW_LINE_REGEX], + $ignoreRules: true + }, + { + $languages: "js css", + $name: "block-comment", + $startPatterns: [/\/\*/], + $endPatterns: [/\*\//], + $ignoreRules: true, + $consumeEndMatch: true + }, + { + $languages: "js", + $name: "regex", + $startPatterns: [function (string, rule) { + var re = /[(,=:[!&|?{};][\s]*\/[^/]|^[\s]*\/[^/]/; + var startIndex = string.search(re); + if (startIndex != -1) { + startIndex = string.indexOf('/', startIndex); + var substr = string.substring(startIndex + 1); + var match = searchAny(substr, rule.$endPatterns, rule); + if (match.matchIndex != -1) { + substr = substr.substring(0, match.matchIndex); + try { + (new RegExp(substr)); + return { + matchIndex: startIndex, + length: 1 + }; + } + catch (e) { + return null; + } + } + } + return null; + }], + $endPatterns: [function (string) { + var fromIndex = 0; + var index = string.indexOf('/'); + while (index != -1) { + try { + (new RegExp(string.substring(0, index))); + break; + } + catch (e) { + index = string.indexOf('/', fromIndex); + fromIndex = index + 1; + } + } + return index === -1 ? null : { + matchIndex: index, + length: 1 + }; + }], + $ignoreRules: true, + $consumeEndMatch: true + }, + { + $languages: "js html", + $name: "quotes", + $excludeIf: HTML_TAG_RULES, + $startPatterns: [/"/], + $endPatterns: [/"/, NEW_LINE_REGEX], + $ignoreRules: true, + $consumeEndMatch: true + }, + { + $languages: "js html", + $name: "quotes", + $excludeIf: HTML_TAG_RULES, + $startPatterns: [/'/], + $endPatterns: [/'/, NEW_LINE_REGEX], + $ignoreRules: true, + $consumeEndMatch: true + }, + { + $languages: "js css", + $name: "string", + $startPatterns: [/(''|""|``)/], + $endPatterns: [/./, NEW_LINE_REGEX] + }, + { + $languages: "js css", + $name: "string", + $startPatterns: [/\"(?=[^"])/], + $endPatterns: [/[^\\]\"/, NEW_LINE_REGEX], + $ignoreRules: true, + $consumeEndMatch: true + }, + { + $languages: "js css", + $name: "string", + $startPatterns: [/\'(?=[^'])/], + $endPatterns: [/[^\\]\'/, NEW_LINE_REGEX], + $ignoreRules: true, + $consumeEndMatch: true + }, + { + $languages: "js css", + $name: "string", + $startPatterns: [/\`(?=[^`])/], + $endPatterns: [/[^\\]\`/], + $ignoreRules: true, + $consumeEndMatch: true + }, + { + $languages: "js", + $name: "if", + $startPatterns: [/^if\s*(?=\()/, /[\s]+if\s*(?=\()/], + $endPatterns: [/else[\s]+/, nonWhitespaceFollowByNewline, /[{;]/], + $indent: true + }, + { + $languages: "js", + $name: "for|while", + $startPatterns: [/^(for|while)\s*(?=\()/], + $endPatterns: [nonWhitespaceFollowByNewline, /[{;]/], + $indent: true + }, + { + $languages: "js", + $name: "else", + $startPatterns: [/else[\s]+/], + $endPatterns: [/if[^\w$]/, nonWhitespaceFollowByNewline, /[{;]/], + $indent: true + }, + { + $languages: "js css", + $name: "bracket", + $startPatterns: [/\(\s*(var|let|const)?\s*/], + $endPatterns: [/\)/], + $indent: true, + $consumeEndMatch: true, + $newScope: true + }, + { + $languages: "js", + $name: "dot-chain", + $startPatterns: [/^\.[A-Za-z$_]/], + $endPatterns: [/[\.;]/, NEW_LINE_REGEX], + $indent: true, + $matchBeginning: true, + $lineOffset: -1 + }, + { + $languages: "js", + $name: "dot-chain", + $startPatterns: [/\.\s*\r*\n/], + $endPatterns: [/[\.;})\]]/, /[^\s]\s*\r*\n/], + $indent: true + }, + { + $languages: "js css", + $name: "array", + $startPatterns: [/\[/], + $endPatterns: [/\]/], + $indent: true, + $consumeEndMatch: true, + $newScope: true + }, + { + $languages: "js css", + $name: "block", + $startPatterns: [/\{/], + $endPatterns: [/\}/], + $indent: true, + $consumeEndMatch: true, + $newScope: true + }, + { + $languages: "js", + $name: "var/let/const", + $startPatterns: [/(var|let|const)[\s]*\r*\n/], + $endPatterns: [nonWhitespaceFollowByNewline], + $indent: true, + $endPatternIndent: true + }, + { + $languages: "js", + $name: "var/let/const", + $startPatterns: [/(var|let|const)\s+(?=[\w$])/], + $endPatterns: [/[,;=]/, nonWhitespaceFollowByNewline], + $indent: true + }, + { + $languages: "js", + $name: "var/let/const", + $lastRule: ["var/let/const", "="], + $startPatterns: [/,[\s]*\r*\n/], + $endPatterns: [/[,;]/, nonWhitespaceFollowByNewline], + $indent: true, + callback: postIndentForCommaAfterEqual + }, + { + $languages: "js", + $name: "var/let/const", + $lastRule: ["var/let/const", "="], + $startPatterns: [/^,/], + $endPatterns: [/[,;]/, nonWhitespaceFollowByNewline], + $matchBeginning: true, + $indent: true, + $lineOffset: -1, + callback: postIndentForCommaAfterEqual + }, + { + $languages: "js", + $name: "equality", + $startPatterns: [/[=<>!]=(=)?/], + $endPatterns: [/./] + }, + { + $languages: "js", + $name: "=", + $excludeIf: HTML_TAG_RULES, + $startPatterns: [/=/], + $endPatterns: [/[,;\)\]}]/, NEW_LINE_REGEX] + }, + { + $languages: "js", + $name: "?:", + $startPatterns: [/\?/], + $endPatterns: [/[:;]/], + $endPatternIndent: true, + $indent: true + }, + { + $languages: "js", + $name: "case", + $startPatterns: [/^(case|default)[\s:]/], + $endPatterns: [/break[\s;\r\n]/, /^return[\s;\r\n]/, /^case[\s]+/, /^default[\s:]/, /}/], + $endPatternIndent: function (matchEnd) { + return matchEnd.endPatternIndex <= 1; + }, + $indent: true, + $newScope: true + }, + { + $languages: "js", + $name: "semicolon", + $startPatterns: [/;/], + $endPatterns: [/./] + } + ]; + + return { + css: function (code, options) { + return indent(code, filterRules('css', MASTER_RULES), options); + }, + js: function (code, options) { + return indent(code, filterRules('js', MASTER_RULES), options); + }, + ts: function (code, options) { + return indent(code, filterRules('js', MASTER_RULES), options); + }, + html: function (code, options) { + var rules = options && options.indentHtmlTag ? + filterRules('html', MASTER_RULES, 'html-tag') : filterRules('html', MASTER_RULES); + return indent(code, rules, options); + } + }; + + + function indent(code, baseRules, options) { + code = code || ''; + /** + * Algorithm assumptions + * + * indentDeltas - store the the deltas in tabString + * - can be manipulated directly to alter the tabString + * indentBuffer - used to keep tabs on the number of open indentations on each line + * dedentBuffer - each line in the buffer has an array storing open indent lines to be closed + * - an array of numbers is used to reference the opening line + * - a negative number is used to signify a soft dedent (see note about soft dedent) + * + * Each line can create at most 1 tabString. + * When a line is 'used up' for dedent, it cannot be used again, hence the indentBuffer. + */ + var tabString = options && options.tabString != null ? options.tabString : '\t'; + var lines = code.split(/[\r]?\n/gi); + var lineCount = lines.length; + var ignoreBuffer = intArray(lineCount); + var indentBuffer = intArray(lineCount); + var dedentBuffer = arrayOfArrays(lineCount); + var activeMatches = []; + var lastMatches= [null]; + var l = 0; + var pos = 0; + var matchEnd, matchStart; + var modeRules = null; + var line, lineToMatch, activeMatch; + + if (options) { + options.debug = { + buffers: { + ignore: ignoreBuffer, + indent: indentBuffer, + dedent: dedentBuffer, + active: activeMatches + } + }; + } + + while (l < lineCount) { + line = lines[l].trim(); + lineToMatch = cleanEscapedChars(line) + '\r\n'; + activeMatch = activeMatches[activeMatches.length-1]; + + matchStart = matchStartRule(lineToMatch, modeRules || baseRules, pos); + + if (activeMatches.length) { + matchEnd = matchEndRule(lineToMatch, activeMatch, pos, matchStart); + if (matchEnd.matchIndex === -1) { + if (activeMatch.rule.$ignoreRules) { + // last rule is still active, and it's telling us to ignore. + ignoreBuffer[l] = 1; + l++; pos = 0; + continue; + } + } + else if ( + activeMatch.rule.$ignoreRules || + matchStart.matchIndex === -1 || + matchEnd.matchIndex <= matchStart.matchIndex) { + removeCurrentRule(); + pos = matchEnd.cursor; + continue; // Repeat process for matching line start/end + } + } + + if (matchStart.matchIndex !== -1) { + implementRule(matchStart); + } + else { + // No new token match end, no new match start + l++; pos = 0; + } + } + + var + hardIndentCount, + dedentLines, dedentLine, dedents, + i, j, indents = 0, + hardIndents = copyIntArray(indentBuffer), + indentDeltas = intArray(lineCount), + newLines = []; + + for (i=0; i 0) { + hardIndents[dedentLine]--; + dedents += dedentLine !== i; + } + } + hardIndentCount = hardIndents[i]; + indentDeltas[i] = hardIndentCount > dedents ? 1 : + (hardIndentCount < dedents ? hardIndentCount - dedents : 0); + hardIndents[i] = hardIndentCount > 0 ? 1 : 0; + } + + for (i=0; i 0 ? repeatString(tabString, indents) : '') + lines[i].trim()); + } + } + + return newLines.join('\r\n'); + + + function implementRule(match) { + pos = match.cursor; + + var rule = match.rule; + var line = (l + 1) + (rule.$lineOffset || 0); + match.line = line; + activeMatches.push(match); + + if (rule.$indent) { + indentBuffer[line]++; + } + if (rule.$switchRules) { + modeRules = filterRules(rule.$switchRules, MASTER_RULES); + } + if (rule.$newScope) { + lastMatches.push(null); + } + if (rule.callback) { + rule.callback(match, indentBuffer, dedentBuffer); + } + } + + function removeCurrentRule() { + var match = activeMatches.pop(), + line = match.line, + rule = match.rule; + + if (rule.$indent) { + var endPatternIndent = typeof rule.$endPatternIndent === 'function' ? + rule.$endPatternIndent(matchEnd) : rule.$endPatternIndent; + var offset = !endPatternIndent && matchEnd.matchIndex === 0 ? 0 : 1; + if (dedentBuffer[l + offset]) dedentBuffer[l + offset].push(line); + } + if (rule.$switchRules) { + modeRules = null; + } + if (rule.$newScope) { + lastMatches.pop(); + } + lastMatches[lastMatches.length - 1] = match; + } + + function matchStartRule(string, rules, index) { + string = string.substring(index, string.length); + var result = null; + var minIndex = string.length; + var minMatch; + var match; + + var lastMatch = lastMatches[lastMatches.length - 1]; + var lastRuleInScope = lastMatch ? lastMatch.rule.$name : ''; + var activeRules = map(activeMatches, function (match) { + return match.rule.$name; + }).join('\n'); // Use \n as a special delimiter for rule names + + for (var rule, r = 0; r < rules.length; r++) { + rule = rules[r]; + if (rule.$excludeIf && some(rule.$excludeIf, function (excludeRule) { + return activeRules.indexOf(excludeRule) != -1; + })) { + } else if (!rule.$lastRule || + (lastRuleInScope && rule.$lastRule.indexOf(lastRuleInScope) !== -1) + ) { + match = searchAny(string, rule.$startPatterns, rule); + if (match.matchIndex != -1 && match.matchIndex < minIndex + && (!rule.$matchBeginning || index === 0)) { + minIndex = match.matchIndex; + minMatch = match; + result = rule; + } + } + } + return { + rule: result, + relativeIndex: result ? minIndex : -1, + matchIndex: result ? minIndex + index : -1, + cursor: result ? index + minMatch.cursor : -1, + state: minMatch ? minMatch.state : {}, + lastMatch: lastMatch + }; + } + + function matchEndRule(string, active, offset, matchStart) { + string = string.substr(offset, string.length); + var rule = active.rule; + var match = searchAny(string, rule.$endPatterns, rule, active.state, matchStart); + var cursor = rule.$consumeEndMatch ? match.cursor : match.matchIndex; + return { + endPatternIndex: match.endPatternIndex, + matchIndex: match.matchIndex === -1 ? -1 : match.matchIndex + offset, + cursor: cursor === -1 ? -1 : cursor + offset, + state: match.state + }; + } + } + + function arrayOfArrays(length) { + var array = new Array(length); + for (var i=0; i0&&(C[$]--,q+=$!==R);P=C[R],H[R]=P>q?1:P0?1:0}for(R=0;R0?s(p,M):"")+j[R].trim()));return L.join("\r\n")}function r(n){for(var e=new Array(n),t=0;t/],m:!0,l:!0},{a:"html",b:"doctype",i:[/\<\!doctype html>/i],k:[d],m:!0,l:!0},{a:"html",b:"void-tags",i:[/\<(area|base|br|col|command|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)/i],k:[/>/],d:!0,l:!0},{a:"html",b:"mode switch js",i:[function(n){var e=/].*/i,t=/<\/script>/i,r=e.exec(n),a=t.exec(n);return r&&(!a||a.index/i],e:"js",l:!0,d:!0,f:!0},{a:"html",b:"mode switch css",i:[function(n){var e=/].*/i,t=/<\/style>/i,r=e.exec(n),a=t.exec(n);return r&&(!a||a.index/i],e:"css",l:!0,d:!0,f:!0},{a:"html",b:"html-tag",i:[//i],l:!0},{a:"html",b:"tag",i:[function(n,e,t){var r=/<([A-Za-z0-9\-]+)/,a=n.match(r);return a?(t.openingTag=a[1],{matchIndex:a.index,length:a[0].length}):null}],k:[function(n,e,t){var r=new RegExp("","i"),a=n.match(r);return a?{matchIndex:a.index,length:a[0].length}:null}],d:!0,l:!0},{a:"js",b:"line-comment",i:[/\/\//],k:[d],m:!0},{a:"js css",b:"block-comment",i:[/\/\*/],k:[/\*\//],m:!0,l:!0},{a:"js",b:"regex",i:[function(n,e){var t=/[(,=:[!&|?{};][\s]*\/[^\/]|^[\s]*\/[^\/]/,r=n.search(t);if(r!=-1){r=n.indexOf("/",r);var a=n.substring(r+1),i=o(a,e.k,e);if(i.matchIndex!=-1){a=a.substring(0,i.matchIndex);try{return new RegExp(a),{matchIndex:r,length:1}}catch(s){return null}}}return null}],k:[function(n){for(var e=0,t=n.indexOf("/");t!=-1;)try{new RegExp(n.substring(0,t));break}catch(r){t=n.indexOf("/",e),e=t+1}return t===-1?null:{matchIndex:t,length:1}}],m:!0,l:!0},{a:"html",b:"quotes",i:[/"/],k:[/"/,d],m:!0,l:!0},{a:"html",b:"quotes",i:[/'/],k:[/'/,d],m:!0,l:!0},{a:"js css",b:"string",i:[/(''|""|``)/],k:[/./,d]},{a:"js css",b:"string",i:[/\"(?=[^"])/],k:[/[^\\]\"/,d],m:!0,l:!0},{a:"js css",b:"string",i:[/\'(?=[^'])/],k:[/[^\\]\'/,d],m:!0,l:!0},{a:"js css",b:"string",i:[/\`(?=[^`])/],k:[/[^\\]\`/],m:!0,l:!0},{a:"js",b:"if",i:[/^if\s*(?=\()/,/[\s]+if\s*(?=\()/],k:[/else[\s]+/,u,/[{;]/],d:!0},{a:"js",b:"for|while",i:[/^(for|while)\s*(?=\()/],k:[u,/[{;]/],d:!0},{a:"js",b:"else",i:[/else[\s]+/],k:[/if[^\w$]/,u,/[{;]/],d:!0},{a:"js css",b:"bracket",i:[/\(\s*(var|let|const)?\s*/],k:[/\)/],d:!0,l:!0,f:!0},{a:"js",b:"dot-chain",i:[/^\.[A-Za-z$_]/],k:[/[\.;]/,d],d:!0,j:!0,c:-1},{a:"js",b:"dot-chain",i:[/\.\s*\r*\n/],k:[/[\.;})\]]/,/[^\s]\s*\r*\n/],d:!0},{a:"js css",b:"array",i:[/\[/],k:[/\]/],d:!0,l:!0,f:!0},{a:"js css",b:"block",i:[/\{/],k:[/\}/],d:!0,l:!0,f:!0},{a:"js",b:"var/let/const",i:[/(var|let|const)[\s]*\r*\n/],k:[u],d:!0,g:!0},{a:"js",b:"var/let/const",i:[/(var|let|const)\s+(?=[\w$])/],k:[/[,;=]/,u],d:!0},{a:"js",b:"var/let/const",h:["var/let/const","="],i:[/,[\s]*\r*\n/],k:[/[,;]/,u],d:!0,callback:c},{a:"js",b:"var/let/const",h:["var/let/const","="],i:[/^,/],k:[/[,;]/,u],j:!0,d:!0,c:-1,callback:c},{a:"js",b:"equality",i:[/[=<>!]=(=)?/],k:[/./]},{a:"js",b:"=",i:[/=/],k:[/[,;\)\]}]/,d]},{a:"js",b:"?:",i:[/\?/],k:[/[:;]/],g:!0,d:!0},{a:"js",b:"case",i:[/^(case|default)[\s:]/],k:[/break[\s;\r\n]/,/^return[\s;\r\n]/,/^case[\s]+/,/^default[\s:]/,/}/],g:function(n){return n.endPatternIndex<=1},d:!0,f:!0},{a:"js",b:"semicolon",i:[/;/],k:[/./]}];return{css:function(n,r){return t(n,e("css",f),r)},js:function(n,r){return t(n,e("js",f),r)},ts:function(n,r){return t(n,e("js",f),r)},html:function(n,r){var a=r&&r.indentHtmlTag?e("html",f,"html-tag"):e("html",f);return t(n,a,r)}}}(this);return n}); \ No newline at end of file diff --git a/lib/joi/LICENSE b/lib/joi/LICENSE index d59259f..8baeab2 100644 --- a/lib/joi/LICENSE +++ b/lib/joi/LICENSE @@ -1,173 +1,66 @@ -=== -Joi -=== +========= +@hapi/joi +========= -Copyright (c) 2012-2017, Project contributors -Copyright (c) 2012-2014, Walmart +Copyright (c) 2012-2019, Sideway Inc, and project contributors +Copyright (c) 2012-2014, Walmart. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * 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. - * The names of any contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +* 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. +* The names of any contributors may not 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 HOLDERS AND 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 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 HOLDERS AND 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 OFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * * * -The complete list of contributors can be found at: https://github.com/hapijs/joi/graphs/contributors +========== +@hapi/hoek +========== +Copyright (c) 2011-2019, Sideway Inc, and project contributors +Copyright (c) 2011-2014, Walmart +Copyright (c) 2011, Yahoo Inc. -======== -punycode -======== +All rights reserved. -Copyright Mathias Bynens +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +* 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. +* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +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 HOLDERS AND 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 OFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +============= +@hapi/address +============= +Copyright (c) 2019, Project contributors +All rights reserved. -==== -Hoek -==== +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * 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. + * The names of any contributors may not 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 HOLDERS AND 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. -Copyright (c) 2011-2017, Project contributors -Copyright (c) 2011-2014, Walmart -Copyright (c) 2011, Yahoo 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: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * 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. - * The names of any contributors may not 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 HOLDERS AND 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. - - * * * - -The complete list of contributors can be found at: https://github.com/hapijs/hapi/graphs/contributors -Portions of this project were initially based on the Yahoo! Inc. Postmile project, -published at https://github.com/yahoo/postmile. - - - -======= -isemail -======= - -Copyright (c) 2014-2015, Eli Skeggs and Project contributors -Copyright (c) 2013-2014, GlobeSherpa -Copyright (c) 2008-2011, Dominic Sayers -All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * 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. - * The names of any contributors may not 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 HOLDERS AND 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. - - * * * - -The complete list of contributors can be found at: https://github.com/hapijs/isemail/graphs/contributors -Previously published under the 2-Clause-BSD license published here: https://github.com/hapijs/isemail/blob/v1.2.0/LICENSE - - - -==== -topo -==== - -Copyright (c) 2012-2016, Project contributors -Copyright (c) 2012-2014, Walmart +========== +@hapi/topo +========== + +Copyright (c) 2012-2019, Sideway Inc, and project contributors +Copyright (c) 2012-2014, Walmart. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * 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. - * The names of any contributors may not 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 HOLDERS AND 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. - - * * * - -The complete list of contributors can be found at: https://github.com/hapijs/topo/graphs/contributors +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +* 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. +* The names of any contributors may not 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 HOLDERS AND 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 OFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/joi/VERSION b/lib/joi/VERSION index fc9c00c..13577ce 100644 --- a/lib/joi/VERSION +++ b/lib/joi/VERSION @@ -1 +1 @@ -13.6.0 +15.0.3 diff --git a/lib/joi/joi.bundle.js b/lib/joi/joi.bundle.js index 6164b9d..52e4f3d 100644 --- a/lib/joi/joi.bundle.js +++ b/lib/joi/joi.bundle.js @@ -82,7 +82,7 @@ module.exports = /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 5); +/******/ return __webpack_require__(__webpack_require__.s = 6); /******/ }) /************************************************************************/ /******/ ([ @@ -97,9 +97,9 @@ module.exports = const Assert = __webpack_require__(13); const Crypto = __webpack_require__(14); const Path = __webpack_require__(15); -const Util = __webpack_require__(6); -const Escape = __webpack_require__(16); +const DeepEqual = __webpack_require__(16); +const Escape = __webpack_require__(17); // Declare internals @@ -107,9 +107,14 @@ const Escape = __webpack_require__(16); const internals = {}; +// Deep object or array comparison + +exports.deepEqual = DeepEqual; + + // Clone object or array -exports.clone = function (obj, seen) { +exports.clone = function (obj, options = {}, _seen = null) { if (typeof obj !== 'object' || obj === null) { @@ -117,7 +122,7 @@ exports.clone = function (obj, seen) { return obj; } - seen = seen || new Map(); + const seen = _seen || new Map(); const lookup = seen.get(obj); if (lookup) { @@ -126,8 +131,9 @@ exports.clone = function (obj, seen) { let newObj; let cloneDeep = false; + const isArray = Array.isArray(obj); - if (!Array.isArray(obj)) { + if (!isArray) { if (Buffer.isBuffer(obj)) { newObj = Buffer.from(obj); } @@ -137,15 +143,36 @@ exports.clone = function (obj, seen) { else if (obj instanceof RegExp) { newObj = new RegExp(obj); } + else if (obj instanceof Set) { + newObj = new Set(); + cloneDeep = true; + for (const val of obj) { + newObj.add(exports.clone(val)); + } + } + else if (obj instanceof Map) { + newObj = new Map(); + cloneDeep = true; + for (let [key, value] of obj) { + value = exports.clone(value); + newObj.set(key, value); + } + } else { - const proto = Object.getPrototypeOf(obj); - if (proto && - proto.isImmutable) { + if (options.prototype !== false) { // Defaults to true + const proto = Object.getPrototypeOf(obj); + if (proto && + proto.isImmutable) { - newObj = obj; + newObj = obj; + } + else { + newObj = Object.create(proto); + cloneDeep = true; + } } else { - newObj = Object.create(proto); + newObj = {}; cloneDeep = true; } } @@ -158,9 +185,14 @@ exports.clone = function (obj, seen) { seen.set(obj, newObj); if (cloneDeep) { - const keys = Object.getOwnPropertyNames(obj); + const keys = internals.keys(obj, options); for (let i = 0; i < keys.length; ++i) { const key = keys[i]; + + if (isArray && key === 'length') { + continue; + } + const descriptor = Object.getOwnPropertyDescriptor(obj, key); if (descriptor && (descriptor.get || @@ -169,20 +201,33 @@ exports.clone = function (obj, seen) { Object.defineProperty(newObj, key, descriptor); } else { - newObj[key] = exports.clone(obj[key], seen); + Object.defineProperty(newObj, key, { + enumerable: descriptor ? descriptor.enumerable : true, + writable: true, + configurable: true, + value: exports.clone(obj[key], options, seen) + }); } } + + if (isArray) { + newObj.length = obj.length; + } } return newObj; }; +internals.keys = function (obj, options = {}) { + + return options.symbols ? Reflect.ownKeys(obj) : Object.getOwnPropertyNames(obj); +}; + + // 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.merge = function (target, source, isNullOverride = true, isMergeArrays = true) { 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'); @@ -193,7 +238,7 @@ exports.merge = function (target, source, isNullOverride /* = true */, isMergeAr if (Array.isArray(source)) { exports.assert(Array.isArray(target), 'Cannot merge array onto an object'); - if (isMergeArrays === false) { // isMergeArrays defaults to true + if (!isMergeArrays) { target.length = 0; // Must not change target assignment } @@ -204,10 +249,12 @@ exports.merge = function (target, source, isNullOverride /* = true */, isMergeAr return target; } - const keys = Object.keys(source); + const keys = internals.keys(source); for (let i = 0; i < keys.length; ++i) { const key = keys[i]; - if (key === '__proto__') { + if (key === '__proto__' || + !Object.prototype.propertyIsEnumerable.call(source, key)) { + continue; } @@ -234,7 +281,7 @@ exports.merge = function (target, source, isNullOverride /* = true */, isMergeAr target[key] = value; } - else if (isNullOverride !== false) { // Defaults to true + else if (isNullOverride) { target[key] = value; } } @@ -246,7 +293,7 @@ exports.merge = function (target, source, isNullOverride /* = true */, isMergeAr // Apply options to a copy of the defaults -exports.applyToDefaults = function (defaults, options, isNullOverride) { +exports.applyToDefaults = function (defaults, options, isNullOverride = false) { 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'); @@ -261,13 +308,13 @@ exports.applyToDefaults = function (defaults, options, isNullOverride) { return copy; } - return exports.merge(copy, options, isNullOverride === true, false); + return exports.merge(copy, options, isNullOverride, false); }; // Clone an object except for the listed keys which are shallow copied -exports.cloneWithShallow = function (source, keys) { +exports.cloneWithShallow = function (source, keys, options) { if (!source || typeof source !== 'object') { @@ -276,20 +323,22 @@ exports.cloneWithShallow = function (source, keys) { } const storage = internals.store(source, keys); // Move shallow copy items to storage - const copy = exports.clone(source); // Deep copy the rest - internals.restore(copy, source, storage); // Shallow copy the stored items and restore + const copy = exports.clone(source, options); // Deep copy the rest + internals.restore(copy, source, storage); // Shallow copy the stored items and restore return copy; }; internals.store = function (source, keys) { - const storage = {}; + const storage = new Map(); for (let i = 0; i < keys.length; ++i) { const key = keys[i]; const value = exports.reach(source, key); - if (value !== undefined) { - storage[key] = value; + if (typeof value === 'object' || + typeof value === 'function') { + + storage.set(key, value); internals.reachSet(source, key, undefined); } } @@ -300,18 +349,16 @@ internals.store = function (source, keys) { internals.restore = function (copy, source, storage) { - const keys = Object.keys(storage); - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - internals.reachSet(copy, key, storage[key]); - internals.reachSet(source, key, storage[key]); + for (const [key, value] of storage) { + internals.reachSet(copy, key, value); + internals.reachSet(source, key, value); } }; internals.reachSet = function (obj, key, value) { - const path = key.split('.'); + const path = Array.isArray(key) ? key : key.split('.'); let ref = obj; for (let i = 0; i < path.length; ++i) { const segment = path[i]; @@ -342,206 +389,56 @@ exports.applyToDefaultsWithShallow = function (defaults, options, keys) { return copy; } - const 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 + const 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; }; -// Deep object or array comparison - -exports.deepEqual = function (obj, ref, options, seen) { - - 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 - } - - options = options || { prototype: true }; - - const type = typeof obj; - - if (type !== typeof ref) { - return false; - } - - if (type !== 'object' || - obj === null || - ref === null) { - - return obj !== obj && ref !== ref; // NaN - } - - seen = seen || []; - if (seen.indexOf(obj) !== -1) { - return true; // If previous comparison failed, it would have stopped execution - } - - seen.push(obj); - - if (Array.isArray(obj)) { - if (!Array.isArray(ref)) { - return false; - } - - if (!options.part && obj.length !== ref.length) { - return false; - } - - for (let i = 0; i < obj.length; ++i) { - if (options.part) { - let found = false; - for (let j = 0; j < ref.length; ++j) { - if (exports.deepEqual(obj[i], ref[j], options)) { - found = true; - break; - } - } - - return found; - } - - if (!exports.deepEqual(obj[i], ref[i], options)) { - return false; - } - } - - return true; - } - - if (Buffer.isBuffer(obj)) { - if (!Buffer.isBuffer(ref)) { - return false; - } - - if (obj.length !== ref.length) { - return false; - } - - for (let i = 0; i < obj.length; ++i) { - if (obj[i] !== ref[i]) { - return false; - } - } - - return true; - } - - if (obj instanceof Date) { - return (ref instanceof Date && obj.getTime() === ref.getTime()); - } - - if (obj instanceof RegExp) { - return (ref instanceof RegExp && obj.toString() === ref.toString()); - } - - if (options.prototype) { - if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) { - return false; - } - } +// Find the common unique items in two arrays - const keys = Object.getOwnPropertyNames(obj); +exports.intersect = function (array1, array2, justFirst = false) { - if (!options.part && keys.length !== Object.getOwnPropertyNames(ref).length) { - return false; - } + if (!array1 || + !array2) { - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - const 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 (justFirst ? null : []); } - return true; -}; - - -// Remove duplicate items from array - -exports.unique = (array, key) => { - - let result; - if (key) { - result = []; - const index = new Set(); - array.forEach((item) => { + const common = []; + const hash = (Array.isArray(array1) ? new Set(array1) : array1); + const found = new Set(); + for (const value of array2) { + if (internals.has(hash, value) && + !found.has(value)) { - const identifier = item[key]; - if (!index.has(identifier)) { - index.add(identifier); - result.push(item); + if (justFirst) { + return value; } - }); - } - else { - result = Array.from(new Set(array)); - } - - return result; -}; - - -// Convert array into object - -exports.mapToObject = function (array, key) { - if (!array) { - return null; - } - - const obj = {}; - for (let i = 0; i < array.length; ++i) { - if (key) { - if (array[i][key]) { - obj[array[i][key]] = true; - } - } - else { - obj[array[i]] = true; + common.push(value); + found.add(value); } } - return obj; + return (justFirst ? null : common); }; -// Find the common unique items in two arrays - -exports.intersect = function (array1, array2, justFirst) { - - if (!array1 || !array2) { - return []; - } - - const common = []; - const hash = (Array.isArray(array1) ? exports.mapToObject(array1) : array1); - const found = {}; - for (let i = 0; i < array2.length; ++i) { - if (hash[array2[i]] && !found[array2[i]]) { - if (justFirst) { - return array2[i]; - } +internals.has = function (ref, key) { - common.push(array2[i]); - found[array2[i]] = true; - } + if (typeof ref.has === 'function') { + return ref.has(key); } - return (justFirst ? null : common); + return ref[key] !== undefined; }; // Test if the reference contains the values -exports.contain = function (ref, values, options) { +exports.contain = function (ref, values, options = {}) { // options: { deep, once, only, part, symbols } /* string -> string(s) @@ -557,14 +454,13 @@ exports.contain = function (ref, values, options) { !Array.isArray(values)) { valuePairs = values; - values = Object.keys(values); + const symbols = Object.getOwnPropertySymbols(values).filter(Object.prototype.propertyIsEnumerable.bind(values)); + values = [...Object.keys(values), ...symbols]; } else { values = [].concat(values); } - options = options || {}; // deep, once, only, part - exports.assert(typeof ref === 'string' || typeof ref === 'object', 'Reference must be string or an object'); exports.assert(values.length, 'Values array cannot be empty'); @@ -573,12 +469,12 @@ exports.contain = function (ref, values, options) { if (options.deep) { compare = exports.deepEqual; - const hasOnly = options.hasOwnProperty('only'); - const hasPart = options.hasOwnProperty('part'); + const hasOnly = options.only !== undefined; + const hasPart = options.part !== undefined; compareFlags = { prototype: hasOnly ? options.only : hasPart ? !options.part : false, - part: hasOnly ? !options.only : hasPart ? options.part : true + part: hasOnly ? !options.only : hasPart ? options.part : false }; } else { @@ -610,10 +506,17 @@ exports.contain = function (ref, values, options) { misses = !!leftovers; } else if (Array.isArray(ref)) { + const onlyOnce = !!(options.only && options.once); + if (onlyOnce && ref.length !== values.length) { + return false; + } + for (let i = 0; i < ref.length; ++i) { let matched = false; for (let j = 0; j < values.length && matched === false; ++j) { - matched = compare(values[j], ref[i], compareFlags) && j; + if (!onlyOnce || matches[j] === 0) { + matched = compare(values[j], ref[i], compareFlags) && j; + } } if (matched !== false) { @@ -625,7 +528,7 @@ exports.contain = function (ref, values, options) { } } else { - const keys = Object.getOwnPropertyNames(ref); + const keys = internals.keys(ref, options); for (let i = 0; i < keys.length; ++i) { const key = keys[i]; const pos = values.indexOf(key); @@ -644,6 +547,12 @@ exports.contain = function (ref, values, options) { } } + if (options.only) { + if (misses || !options.once) { + return !misses; + } + } + let result = false; for (let i = 0; i < matches.length; ++i) { result = result || !!matches[i]; @@ -654,12 +563,6 @@ exports.contain = function (ref, values, options) { } } - if (options.only && - misses) { - - return false; - } - return result; }; @@ -689,7 +592,7 @@ exports.reach = function (obj, chain, options) { if (chain === false || chain === null || - typeof chain === 'undefined') { + chain === undefined) { return obj; } @@ -699,13 +602,21 @@ exports.reach = function (obj, chain, options) { options = { separator: options }; } - const path = chain.split(options.separator || '.'); + const isChainArray = Array.isArray(chain); + + exports.assert(!isChainArray || !options.separator, 'Separator option no valid for array-based chain'); + + const path = isChainArray ? chain : chain.split(options.separator || '.'); let ref = obj; for (let i = 0; i < path.length; ++i) { let key = path[i]; - if (key[0] === '-' && Array.isArray(ref)) { - key = key.slice(1, key.length); - key = ref.length - key; + + if (Array.isArray(ref)) { + const number = Number(key); + + if (Number.isInteger(number) && number < 0) { + key = ref.length + number; + } } if (!ref || @@ -735,79 +646,6 @@ exports.reachTemplate = function (obj, template, options) { }; -exports.formatStack = function (stack) { - - const trace = []; - for (let i = 0; i < stack.length; ++i) { - const item = stack[i]; - trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]); - } - - return trace; -}; - - -exports.formatTrace = function (trace) { - - const display = []; - - for (let i = 0; i < trace.length; ++i) { - const row = trace[i]; - display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')'); - } - - return display; -}; - - -exports.callStack = function (slice) { - - // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi - - const v8 = Error.prepareStackTrace; - Error.prepareStackTrace = function (_, stack) { - - return stack; - }; - - const capture = {}; - Error.captureStackTrace(capture, this); - const stack = capture.stack; - - Error.prepareStackTrace = v8; - - const trace = exports.formatStack(stack); - - return trace.slice(1 + slice); -}; - - -exports.displayStack = function (slice) { - - const trace = exports.callStack(slice === undefined ? 1 : slice + 1); - - return exports.formatTrace(trace); -}; - - -exports.abortThrow = false; - - -exports.abort = function (message, hideStack) { - - if ("production" === 'test' || exports.abortThrow === true) { - throw new Error(message || 'Unknown error'); - } - - let stack = ''; - if (!hideStack) { - stack = exports.displayStack(1).join('\n\t'); - } - console.log('ABORT: ' + message + '\n\t' + stack); - process.exit(1); -}; - - exports.assert = function (condition, ...args) { if (condition) { @@ -835,29 +673,29 @@ exports.assert = function (condition, ...args) { }; -exports.Bench = function () { - - this.ts = 0; - this.reset(); -}; - +exports.Bench = class { -exports.Bench.prototype.reset = function () { + constructor() { - this.ts = exports.Bench.now(); -}; + this.ts = 0; + this.reset(); + } + reset() { -exports.Bench.prototype.elapsed = function () { + this.ts = exports.Bench.now(); + } - return exports.Bench.now() - this.ts; -}; + elapsed() { + return exports.Bench.now() - this.ts; + } -exports.Bench.now = function () { + static now() { - const ts = process.hrtime(); - return (ts[0] * 1e3) + (ts[1] / 1e6); + const ts = process.hrtime(); + return (ts[0] * 1e3) + (ts[1] / 1e6); + } }; @@ -870,35 +708,6 @@ exports.escapeRegex = function (string) { }; -// Base64url (RFC 4648) encode - -exports.base64urlEncode = function (value, encoding) { - - exports.assert(typeof value === 'string' || Buffer.isBuffer(value), 'value must be string or buffer'); - const buf = (Buffer.isBuffer(value) ? value : Buffer.from(value, encoding || 'binary')); - return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); -}; - - -// Base64url (RFC 4648) decode - -exports.base64urlDecode = function (value, encoding) { - - if (typeof value !== 'string') { - - throw new Error('Value not a string'); - } - - if (!/^[\w\-]*$/.test(value)) { - - throw new Error('Invalid character'); - } - - const buf = Buffer.from(value, 'base64'); - return (encoding === 'buffer' ? buf : buf.toString(encoding || 'binary')); -}; - - // Escape attribute value for use in HTTP header exports.escapeHeaderAttribute = function (attribute) { @@ -917,12 +726,6 @@ exports.escapeHtml = function (string) { }; -exports.escapeJavaScript = function (string) { - - return Escape.escapeJavaScript(string); -}; - - exports.escapeJson = function (string) { return Escape.escapeJson(string); @@ -940,7 +743,7 @@ exports.once = function (method) { if (!once) { once = true; - method.apply(null, args); + method(...args); } }; @@ -949,59 +752,9 @@ exports.once = function (method) { }; -exports.isInteger = Number.isSafeInteger; - - exports.ignore = function () { }; -exports.inherits = Util.inherits; - - -exports.format = Util.format; - - -exports.transform = function (source, transform, options) { - - exports.assert(source === null || source === undefined || typeof source === 'object' || Array.isArray(source), 'Invalid source object: must be null, undefined, an object, or an array'); - const separator = (typeof options === 'object' && options !== null) ? (options.separator || '.') : '.'; - - if (Array.isArray(source)) { - const results = []; - for (let i = 0; i < source.length; ++i) { - results.push(exports.transform(source[i], transform, options)); - } - return results; - } - - const result = {}; - const keys = Object.keys(transform); - - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - const path = key.split(separator); - const sourcePath = transform[key]; - - exports.assert(typeof sourcePath === 'string', 'All mappings must be "." delineated strings'); - - let segment; - let res = result; - - 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; -}; - - exports.uniqueFilename = function (path, extension) { if (extension) { @@ -1028,12 +781,6 @@ exports.stringify = function (...args) { }; -exports.shallow = function (source) { - - return Object.assign({}, source); -}; - - exports.wait = function (timeout) { return new Promise((resolve) => setTimeout(resolve, timeout)); @@ -1053,17 +800,18 @@ exports.block = function () { "use strict"; -// Load modules - const Hoek = __webpack_require__(0); -const Settings = __webpack_require__(7); + +const Settings = __webpack_require__(18); const Ref = __webpack_require__(2); const Errors = __webpack_require__(4); -let Alternatives = null; // Delay-loaded to prevent circular dependencies -let Cast = null; +const State = __webpack_require__(5); +const Symbols = __webpack_require__(7); +let Alternatives = null; // Delay-loaded to prevent circular dependencies +let Cast = null; +let Schemas = null; -// Declare internals const internals = { Set: __webpack_require__(8) @@ -1078,7 +826,6 @@ internals.defaults = { stripUnknown: false, language: {}, presence: 'optional', - strip: false, noDefaults: false, escapeHtml: false @@ -1149,8 +896,10 @@ module.exports = internals.Any = class { checkOptions(options) { - const Schemas = __webpack_require__(18); + Schemas = Schemas || __webpack_require__(20); + const result = Schemas.options.validate(options); + if (result.error) { throw new Error(result.error.details[0].message); } @@ -1212,16 +961,30 @@ module.exports = internals.Any = class { obj._settings = obj._settings ? Settings.concat(obj._settings, schema._settings) : schema._settings; obj._valids.merge(schema._valids, schema._invalids); obj._invalids.merge(schema._invalids, schema._valids); - obj._tests = obj._tests.concat(schema._tests); - obj._refs = obj._refs.concat(schema._refs); - Hoek.merge(obj._flags, schema._flags); + obj._tests.push(...schema._tests); + obj._refs.push(...schema._refs); + if (obj._flags.empty && schema._flags.empty) { + obj._flags.empty = obj._flags.empty.concat(schema._flags.empty); + const flags = Object.assign({}, schema._flags); + delete flags.empty; + Hoek.merge(obj._flags, flags); + } + else if (schema._flags.empty) { + obj._flags.empty = schema._flags.empty; + const flags = Object.assign({}, schema._flags); + delete flags.empty; + Hoek.merge(obj._flags, flags); + } + else { + Hoek.merge(obj._flags, schema._flags); + } obj._description = schema._description || obj._description; obj._unit = schema._unit || obj._unit; - obj._notes = obj._notes.concat(schema._notes); - obj._tags = obj._tags.concat(schema._tags); - obj._examples = obj._examples.concat(schema._examples); - obj._meta = obj._meta.concat(schema._meta); + obj._notes.push(...schema._notes); + obj._tags.push(...schema._tags); + obj._examples.push(...schema._examples); + obj._meta.push(...schema._meta); const inners = Object.keys(schema._inner); const isObject = obj._type === 'object'; @@ -1271,6 +1034,14 @@ module.exports = internals.Any = class { return obj; } + _testUnique(name, arg, func, options) { + + const obj = this.clone(); + obj._tests = obj._tests.filter((test) => test.name !== name); + obj._tests.push({ func, name, arg, options }); + return obj; + } + options(options) { Hoek.assert(!options.context, 'Cannot override context'); @@ -1303,12 +1074,20 @@ module.exports = internals.Any = class { return obj; } - error(err) { + error(err, options = { self: false }) { Hoek.assert(err && (err instanceof Error || typeof err === 'function'), 'Must provide a valid Error object or a function'); + const unknownKeys = Object.keys(options).filter((k) => !['self'].includes(k)); + Hoek.assert(unknownKeys.length === 0, `Options ${unknownKeys} are unknown`); + const obj = this.clone(); obj._flags.error = err; + + if (options.self) { + obj._flags.selfError = true; + } + return obj; } @@ -1323,6 +1102,7 @@ module.exports = internals.Any = class { obj._invalids.remove(value); obj._valids.add(value, obj._refs); } + return obj; } @@ -1394,7 +1174,7 @@ module.exports = internals.Any = class { return obj; } - applyFunctionToChildren(children, fn, args, root) { + applyFunctionToChildren(children, fn, args = [], root) { children = [].concat(children); @@ -1409,7 +1189,7 @@ module.exports = internals.Any = class { throw new Error('unknown key(s) ' + extraChildren.join(', ')); } - return this[fn].apply(this, args); + return this[fn](...args); } default(value, description) { @@ -1443,6 +1223,7 @@ module.exports = internals.Any = class { else { obj._flags.empty = Cast.schema(this._currentJoi, schema); } + return obj; } @@ -1460,6 +1241,7 @@ module.exports = internals.Any = class { if (Object.prototype.hasOwnProperty.call(options, 'is')) { alternativeOptions.is = options.is; } + const obj = Alternatives.when(condition, alternativeOptions); obj._flags.presence = 'ignore'; obj._baseType = this; @@ -1503,13 +1285,40 @@ module.exports = internals.Any = class { return obj; } - example(...args) { + example(...examples) { + + Hoek.assert(examples.length > 0, 'Missing examples'); + + const processed = []; + for (let i = 0; i < examples.length; ++i) { + const example = [].concat(examples[i]); + Hoek.assert(example.length <= 2, `Bad example format at index ${i}`); + + const value = example[0]; + let options = example[1]; + if (options !== undefined) { + Hoek.assert(options && typeof options === 'object', `Options for example at index ${i} must be an object`); + const unknownOptions = Object.keys(options).filter((option) => !['parent', 'context'].includes(option)); + Hoek.assert(unknownOptions.length === 0, `Unknown example options ${unknownOptions} at index ${i}`); + } + else { + options = {}; + } + + const localState = new State('', [], options.parent || null); + const result = this._validate(value, localState, Settings.concat(internals.defaults, options.context ? { context: options.context } : null)); + Hoek.assert(!result.errors, `Bad example at index ${i}:`, result.errors && Errors.process(result.errors, value)); + + const ex = { value }; + if (Object.keys(options).length) { + ex.options = options; + } - Hoek.assert(args.length === 1, 'Missing example'); - const value = args[0]; + processed.push(ex); + } const obj = this.clone(); - obj._examples.push(value); + obj._examples = processed; return obj; } @@ -1537,77 +1346,32 @@ module.exports = internals.Any = class { // Setup state and settings - state = state || { key: '', path: [], parent: null, reference }; + state = state || new State('', [], null, reference); if (this._settings) { - options = Settings.concat(options, this._settings); - } - - let errors = []; - const finish = () => { - - let finalValue; - - if (value !== undefined) { - finalValue = this._flags.raw ? originalValue : value; - } - else if (options.noDefaults) { - finalValue = value; - } - else if (Ref.isRef(this._flags.default)) { - finalValue = this._flags.default(state.parent, options); - } - else if (typeof this._flags.default === 'function' && - !(this._flags.func && !this._flags.default.description)) { - - let args; - - if (state.parent !== null && - this._flags.default.length > 0) { - - args = [Hoek.clone(state.parent), options]; - } - - const defaultValue = internals._try(this._flags.default, args); - finalValue = defaultValue.value; - if (defaultValue.error) { - errors.push(this.createError('any.default', { error: defaultValue.error }, state, options)); - } + const isDefaultOptions = options === internals.defaults; + if (isDefaultOptions && this._settings[Symbols.settingsCache]) { + options = this._settings[Symbols.settingsCache]; } else { - finalValue = Hoek.clone(this._flags.default); - } - - if (errors.length && typeof this._flags.error === 'function') { - const change = this._flags.error.call(this, errors); - - if (typeof change === 'string') { - errors = [this.createOverrideError('override', { reason: errors }, state, options, change)]; - } - else { - errors = [].concat(change) - .map((err) => { - - return err instanceof Error ? - err : - this.createOverrideError(err.type || 'override', err.context, state, options, err.message, err.template); - }); + options = Settings.concat(this._language ? Settings.concat({ language: this._language }, options) : options, this._settings); + if (isDefaultOptions) { + this._settings[Symbols.settingsCache] = options; } } + } + else if (this._language) { + options = Settings.concat({ language: this._language }, options); + } - return { - value: this._flags.strip ? undefined : finalValue, - finalValue, - errors: errors.length ? errors : null - }; - }; + let errors = []; if (this._coerce) { - const coerced = this._coerce.call(this, value, state, options); + const coerced = this._coerce(value, state, options); if (coerced.errors) { value = coerced.value; errors = errors.concat(coerced.errors); - return finish(); // Coerced error always aborts early + return this._finalizeValue(value, originalValue, errors, state, options); // Coerced error always aborts early } value = coerced.value; @@ -1627,7 +1391,7 @@ module.exports = internals.Any = class { value = {}; } else { - return finish(); + return this._finalizeValue(value, originalValue, errors, state, options); } } } @@ -1635,40 +1399,44 @@ module.exports = internals.Any = class { value === undefined) { errors.push(this.createError('any.required', null, state, options)); - return finish(); + return this._finalizeValue(value, originalValue, errors, state, options); } else if (presence === 'forbidden') { if (value === undefined) { - return finish(); + return this._finalizeValue(value, originalValue, errors, state, options); } errors.push(this.createError('any.unknown', null, state, options)); - return finish(); + return this._finalizeValue(value, originalValue, errors, state, options); } // Check allowed and denied values using the original value - if (this._valids.has(value, state, options, this._flags.insensitive)) { - return finish(); + let match = this._valids.get(value, state, options, this._flags.insensitive); + if (match) { + if (options.convert) { + value = match.value; + } + + return this._finalizeValue(value, originalValue, errors, state, options); } if (this._invalids.has(value, state, options, this._flags.insensitive)) { errors.push(this.createError(value === '' ? 'any.empty' : 'any.invalid', { value, invalids: this._invalids.values({ stripUndefined: true }) }, state, options)); - if (options.abortEarly || - value === undefined) { // No reason to keep validating missing value + if (options.abortEarly) { - return finish(); + return this._finalizeValue(value, originalValue, errors, state, options); } } // Convert value and validate type if (this._base) { - const base = this._base.call(this, value, state, options); + const base = this._base(value, state, options); if (base.errors) { value = base.value; errors = errors.concat(base.errors); - return finish(); // Base error always aborts early + return this._finalizeValue(value, originalValue, errors, state, options); // Base error always aborts early } if (base.value !== value) { @@ -1676,14 +1444,16 @@ module.exports = internals.Any = class { // Check allowed and denied values using the converted value - if (this._valids.has(value, state, options, this._flags.insensitive)) { - return finish(); + match = this._valids.get(value, state, options, this._flags.insensitive); + if (match) { + value = match.value; + return this._finalizeValue(value, originalValue, errors, state, options); } if (this._invalids.has(value, state, options, this._flags.insensitive)) { errors.push(this.createError(value === '' ? 'any.empty' : 'any.invalid', { value, invalids: this._invalids.values({ stripUndefined: true }) }, state, options)); if (options.abortEarly) { - return finish(); + return this._finalizeValue(value, originalValue, errors, state, options); } } } @@ -1694,7 +1464,7 @@ module.exports = internals.Any = class { if (this._flags.allowOnly) { errors.push(this.createError('any.allowOnly', { value, valids: this._valids.values({ stripUndefined: true }) }, state, options)); if (options.abortEarly) { - return finish(); + return this._finalizeValue(value, originalValue, errors, state, options); } } @@ -1706,7 +1476,7 @@ module.exports = internals.Any = class { if (ret instanceof Errors.Err) { errors.push(ret); if (options.abortEarly) { - return finish(); + return this._finalizeValue(value, originalValue, errors, state, options); } } else { @@ -1714,7 +1484,71 @@ module.exports = internals.Any = class { } } - return finish(); + return this._finalizeValue(value, originalValue, errors, state, options); + } + + _finalizeValue(value, originalValue, errors, state, options) { + + let finalValue; + + if (value !== undefined) { + finalValue = this._flags.raw ? originalValue : value; + } + else if (options.noDefaults) { + finalValue = value; + } + else if (Ref.isRef(this._flags.default)) { + finalValue = this._flags.default(state.parent, options); + } + else if (typeof this._flags.default === 'function' && + !(this._flags.func && !this._flags.default.description)) { + + let args; + + if (state.parent !== null && + this._flags.default.length > 0) { + + args = [Hoek.clone(state.parent), options]; + } + + const defaultValue = internals._try(this._flags.default, args); + finalValue = defaultValue.value; + if (defaultValue.error) { + errors.push(this.createError('any.default', { error: defaultValue.error }, state, options)); + } + } + else { + finalValue = Hoek.clone(this._flags.default); + } + + if (errors.length && + typeof this._flags.error === 'function' && + ( + !this._flags.selfError || + errors.some((e) => state.path.length === e.path.length) + ) + ) { + const change = this._flags.error.call(this, errors); + + if (typeof change === 'string') { + errors = [this.createOverrideError('override', { reason: errors }, state, options, change)]; + } + else { + errors = [].concat(change) + .map((err) => { + + return err instanceof Error ? + err : + this.createOverrideError(err.type || 'override', err.context, state, options, err.message, err.template); + }); + } + } + + return { + value: this._flags.strip ? undefined : finalValue, + finalValue, + errors: errors.length ? errors : null + }; } _validateWithOptions(value, options, callback) { @@ -1923,13 +1757,13 @@ internals.Any.prototype.disallow = internals.Any.prototype.not = internals.Any.p internals.Any.prototype.exist = internals.Any.prototype.required; -internals._try = function (fn, args) { +internals._try = function (fn, args = []) { let err; let result; try { - result = fn.apply(null, args); + result = fn(...args); } catch (e) { err = e; @@ -1949,13 +1783,9 @@ internals._try = function (fn, args) { "use strict"; -// Load modules - const Hoek = __webpack_require__(0); -// Declare internals - const internals = {}; @@ -2009,15 +1839,10 @@ exports.push = function (array, ref) { "use strict"; -// Load modules - const Hoek = __webpack_require__(0); -const Ref = __webpack_require__(2); - -// Type modules are delay-loaded to prevent circular dependencies +const Ref = __webpack_require__(2); -// Declare internals const internals = {}; @@ -2080,18 +1905,16 @@ exports.ref = function (id) { "use strict"; -// Load modules - const Hoek = __webpack_require__(0); -const Language = __webpack_require__(17); +const Language = __webpack_require__(19); -// Declare internals const internals = { annotations: Symbol('joi-annotations') }; + internals.stringify = function (value, wrapArrays) { const type = typeof value; @@ -2125,6 +1948,7 @@ internals.stringify = function (value, wrapArrays) { return JSON.stringify(value); }; + exports.Err = class { constructor(type, context, state, options, flags, message, template) { @@ -2182,10 +2006,11 @@ exports.Err = class { if (wrapArrays) { return childrenString.slice(1, -1); } + return childrenString; } - const hasKey = /\{\{\!?label\}\}/.test(format); + const hasKey = /{{!?label}}/.test(format); const skipKey = format.length > 2 && format[0] === '!' && format[1] === '!'; if (skipKey) { @@ -2202,12 +2027,16 @@ exports.Err = class { } } - return format.replace(/\{\{(\!?)([^}]+)\}\}/g, ($0, isSecure, name) => { + const message = format.replace(/{{(!?)([^}]+)}}/g, ($0, isSecure, name) => { const value = Hoek.reach(this.context, name); const normalized = internals.stringify(value, wrapArrays); return (isSecure && this.options.escapeHtml ? Hoek.escapeHtml(normalized) : normalized); }); + + this.toString = () => message; // Persist result of last toString call, it won't change + + return message; } }; @@ -2221,7 +2050,7 @@ exports.create = function (type, context, state, options, flags, message, templa exports.process = function (errors, object) { - if (!errors || !errors.length) { + if (!errors) { return null; } @@ -2230,7 +2059,7 @@ exports.process = function (errors, object) { let message = ''; const details = []; - const processErrors = function (localErrors, parent) { + const processErrors = function (localErrors, parent, overrideMessage) { for (let i = 0; i < localErrors.length; ++i) { const item = localErrors[i]; @@ -2240,7 +2069,9 @@ exports.process = function (errors, object) { } if (item.flags.error && typeof item.flags.error !== 'function') { - return item.flags.error; + if (!item.flags.selfError || !item.context.reason) { + return item.flags.error; + } } let itemMessage; @@ -2251,15 +2082,15 @@ exports.process = function (errors, object) { // Do not push intermediate errors, we're only interested in leafs - if (item.context.reason && item.context.reason.length) { - const override = processErrors(item.context.reason, item.path); + if (item.context.reason) { + const override = processErrors(item.context.reason, item.path, item.type === 'override' ? item.message : null); if (override) { return override; } } else { details.push({ - message: itemMessage || item.toString(), + message: overrideMessage || itemMessage || item.toString(), path: item.path, type: item.type, context: item.context @@ -2284,11 +2115,13 @@ exports.process = function (errors, object) { // Inspired by json-stringify-safe + internals.safeStringify = function (obj, spaces) { return JSON.stringify(obj, internals.serializer(), spaces); }; + internals.serializer = function () { const keys = []; @@ -2335,6 +2168,7 @@ internals.serializer = function () { if (annotations.errors[i]) { annotated.push(`_$idx$_${annotations.errors[i].sort().join(', ')}_$end$_`); } + annotated.push(value[i]); } @@ -2418,10 +2252,10 @@ internals.annotate = function (stripColorCodes) { } const replacers = { - key: /_\$key\$_([, \d]+)_\$end\$_\"/g, - missing: /\"_\$miss\$_([^\|]+)\|(\d+)_\$end\$_\"\: \"__missing__\"/g, - arrayIndex: /\s*\"_\$idx\$_([, \d]+)_\$end\$_\",?\n(.*)/g, - specials: /"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)\]"/g + key: /_\$key\$_([, \d]+)_\$end\$_"/g, + missing: /"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g, + arrayIndex: /\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g, + specials: /"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g }; let message = internals.safeStringify(obj, 2) @@ -2450,31 +2284,50 @@ internals.annotate = function (stripColorCodes) { "use strict"; -// Load modules +const internals = {}; + + +module.exports = class { + constructor(key, path, parent, reference) { + + this.key = key; + this.path = path; + this.parent = parent; + this.reference = reference; + } +}; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + const Hoek = __webpack_require__(0); + const Any = __webpack_require__(1); const Cast = __webpack_require__(3); const Errors = __webpack_require__(4); -const Lazy = __webpack_require__(19); +const Lazy = __webpack_require__(21); const Ref = __webpack_require__(2); -const Settings = __webpack_require__(7); -// Declare internals - const internals = { alternatives: __webpack_require__(9), - array: __webpack_require__(20), - boolean: __webpack_require__(21), - binary: __webpack_require__(22), + array: __webpack_require__(22), + boolean: __webpack_require__(23), + binary: __webpack_require__(24), date: __webpack_require__(10), - func: __webpack_require__(23), - number: __webpack_require__(25), + func: __webpack_require__(25), + number: __webpack_require__(27), object: __webpack_require__(11), - string: __webpack_require__(26) + string: __webpack_require__(28), + symbol: __webpack_require__(36) }; + internals.callWithDefaults = function (schema, args) { Hoek.assert(this, 'Must be invoked on a Joi instance.'); @@ -2488,6 +2341,7 @@ internals.callWithDefaults = function (schema, args) { return schema._init(...args); }; + internals.root = function () { const any = new Any(); @@ -2495,6 +2349,7 @@ internals.root = function () { const root = any.clone(); Any.prototype._currentJoi = root; root._currentJoi = root; + root._binds = new Set(['any', 'alternatives', 'alt', 'array', 'bool', 'boolean', 'binary', 'date', 'func', 'number', 'object', 'string', 'symbol', 'validate', 'describe', 'compile', 'assert', 'attempt', 'lazy', 'defaults', 'extend', 'allow', 'valid', 'only', 'equal', 'invalid', 'disallow', 'not', 'required', 'exist', 'optional', 'forbidden', 'strip', 'when', 'empty', 'default']); root.any = function (...args) { @@ -2562,6 +2417,13 @@ internals.root = function () { return internals.callWithDefaults.call(this, internals.string, args); }; + root.symbol = function (...args) { + + Hoek.assert(args.length === 0, 'Joi.symbol() does not allow arguments.'); + + return internals.callWithDefaults.call(this, internals.symbol, args); + }; + root.ref = function (...args) { return Ref.create(...args); @@ -2583,14 +2445,14 @@ internals.root = function () { } const options = count === 2 ? args[1] : undefined; - const schema = root.compile(args[0]); + const schema = this.compile(args[0]); return schema._validateWithOptions(value, options, callback); }; root.describe = function (...args) { - const schema = args.length ? root.compile(args[0]) : any; + const schema = args.length ? this.compile(args[0]) : any; return schema.describe(); }; @@ -2603,24 +2465,26 @@ internals.root = function () { if (err.hasOwnProperty('path')) { err.message = err.message + '(' + err.path + ')'; } + throw err; } }; root.assert = function (value, schema, message) { - root.attempt(value, schema, message); + this.attempt(value, schema, message); }; root.attempt = function (value, schema, message) { - const result = root.validate(value, schema); + const result = this.validate(value, schema); const error = result.error; if (error) { if (!message) { if (typeof error.annotate === 'function') { error.message = error.annotate(); } + throw error; } @@ -2628,6 +2492,7 @@ internals.root = function () { if (typeof error.annotate === 'function') { error.message = `${message} ${error.annotate()}`; } + throw error; } @@ -2667,9 +2532,9 @@ internals.root = function () { return reach(schema, schemaPath); }; - root.lazy = function (fn) { + root.lazy = function (...args) { - return Lazy.set(fn); + return internals.callWithDefaults.call(this, Lazy, args); }; root.defaults = function (fn) { @@ -2698,6 +2563,18 @@ internals.root = function () { return joi; }; + root.bind = function () { + + const joi = Object.create(this); + + joi._binds.forEach((bind) => { + + joi[bind] = joi[bind].bind(joi); + }); + + return joi; + }; + root.extend = function (...args) { const extensions = Hoek.flatten(args); @@ -2707,6 +2584,8 @@ internals.root = function () { const joi = Object.create(this.any()); Object.assign(joi, this); + joi._currentJoi = joi; + joi._binds = new Set(joi._binds); for (let i = 0; i < extensions.length; ++i) { let extension = extensions[i]; @@ -2729,18 +2608,18 @@ internals.root = function () { } this._type = extension.name; - - if (extension.language) { - this._settings = Settings.concat(this._settings, { - language: { - [extension.name]: extension.language - } - }); - } } }; + if (extension.language) { + const lang = { + [extension.name]: extension.language + }; + type.prototype._language = Hoek.applyToDefaults(type.prototype._language || (base._settings && base._settings.language) || {}, lang); + } + + if (extension.coerce) { type.prototype._coerce = function (value, state, options) { @@ -2762,6 +2641,7 @@ internals.root = function () { return { value: ret }; }; } + if (extension.pre) { type.prototype._base = function (value, state, options) { @@ -2813,7 +2693,7 @@ internals.root = function () { } let schema; - if (rule.validate) { + if (rule.validate && !rule.setup) { const validate = function (value, state, options) { return rule.validate.call(this, arg, value, state, options); @@ -2834,6 +2714,18 @@ internals.root = function () { Hoek.assert(newSchema instanceof Any, `Setup of extension Joi.${this._type}().${rule.name}() must return undefined or a Joi object`); schema = newSchema; } + + if (rule.validate) { + const validate = function (value, state, options) { + + return rule.validate.call(this, arg, value, state, options); + }; + + schema = schema._test(rule.name, arg, validate, { + description: rule.description, + hasRef + }); + } } return schema; @@ -2854,6 +2746,8 @@ internals.root = function () { return internals.callWithDefaults.call(this, instance, extArgs); }; + + joi._binds.add(extension.name); } return joi; @@ -2880,7 +2774,7 @@ internals.root = function () { root.extensionsSchema = internals.array.items([internals.object, internals.func.arity(1)]).strict(); - root.version = __webpack_require__(32).version; + root.version = __webpack_require__(38).version; return root; }; @@ -2889,12 +2783,6 @@ internals.root = function () { module.exports = internals.root(); -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -module.exports = require("util"); - /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { @@ -2902,38 +2790,11 @@ module.exports = require("util"); "use strict"; -// Load modules - -const Hoek = __webpack_require__(0); - - -// Declare internals - const internals = {}; -exports.concat = function (target, source) { - - if (!source) { - return target; - } - - const obj = Object.assign({}, target); - - const sKeys = Object.keys(source); - for (let i = 0; i < sKeys.length; ++i) { - const key = sKeys[i]; - if (key !== 'language' || - !obj.hasOwnProperty(key)) { - - obj[key] = source[key]; - } - else { - obj[key] = Hoek.applyToDefaults(obj[key], source[key]); - } - } - - return obj; +module.exports = { + settingsCache: Symbol('settingsCache') }; @@ -2961,6 +2822,7 @@ internals.extendedCheckForValue = function (value, insensitive) { return item instanceof Date && value.getTime() === item.getTime(); }; } + if (Buffer.isBuffer(value)) { return (item) => { @@ -3028,13 +2890,18 @@ module.exports = class InternalSet { has(value, state, options, insensitive) { + return !!this.get(value, state, options, insensitive); + } + + get(value, state, options, insensitive) { + if (!this._set.size) { return false; } const hasValue = this._set.has(value); if (hasValue) { - return hasValue; + return { value }; } const extendedCheck = internals.extendedCheckForValue(value, insensitive); @@ -3042,9 +2909,10 @@ module.exports = class InternalSet { if (state && this._hasRef) { for (let item of this._set) { if (Ref.isRef(item)) { - item = item(state.reference || state.parent, options); - if (value === item || (Array.isArray(item) && item.includes(value))) { - return true; + item = [].concat(item(state.reference || state.parent, options)); + const found = item.indexOf(value); + if (found >= 0) { + return { value: item[found] }; } } } @@ -3074,15 +2942,21 @@ module.exports = class InternalSet { item = item(state.reference || state.parent, options); if (Array.isArray(item)) { - if (item.find(isReallyEqual)) { - return true; + const found = item.findIndex(isReallyEqual); + if (found >= 0) { + return { + value: item[found] + }; } + continue; } } if (isReallyEqual(item)) { - return true; + return { + value: item + }; } } @@ -3129,16 +3003,13 @@ module.exports = class InternalSet { "use strict"; -// Load modules - const Hoek = __webpack_require__(0); + const Any = __webpack_require__(1); const Cast = __webpack_require__(3); const Ref = __webpack_require__(2); -// Declare internals - const internals = {}; @@ -3159,7 +3030,7 @@ internals.Alternatives = class extends Any { _base(value, state, options) { - let errors = []; + const errors = []; const il = this._inner.matches.length; const baseType = this._baseType; @@ -3191,7 +3062,7 @@ internals.Alternatives = class extends Any { return result; } - errors = errors.concat(result.errors); + errors.push(...result.errors); } if (errors.length) { @@ -3211,8 +3082,9 @@ internals.Alternatives = class extends Any { for (let i = 0; i < schemas.length; ++i) { const cast = Cast.schema(this._currentJoi, schemas[i]); if (cast._refs.length) { - obj._refs = obj._refs.concat(cast._refs); + obj._refs.push(...cast._refs); } + obj._inner.matches.push({ schema: cast }); } @@ -3231,6 +3103,7 @@ internals.Alternatives = class extends Any { else { Hoek.assert(options.hasOwnProperty('is'), 'Missing "is" directive'); } + Hoek.assert(options.then !== undefined || options.otherwise !== undefined, 'options must have at least one of "then" or "otherwise"'); const obj = this.clone(); @@ -3261,15 +3134,15 @@ internals.Alternatives = class extends Any { if (!schemaCondition) { Ref.push(obj._refs, item.ref); - obj._refs = obj._refs.concat(item.is._refs); + obj._refs.push(...item.is._refs); } - if (item.then && item.then._refs) { - obj._refs = obj._refs.concat(item.then._refs); + if (item.then && item.then._refs.length) { + obj._refs.push(...item.then._refs); } - if (item.otherwise && item.otherwise._refs) { - obj._refs = obj._refs.concat(item.otherwise._refs); + if (item.otherwise && item.otherwise._refs.length) { + obj._refs.push(...item.otherwise._refs); } obj._inner.matches.push(item); @@ -3277,6 +3150,29 @@ internals.Alternatives = class extends Any { return obj; } + label(name) { + + const obj = super.label(name); + obj._inner.matches = obj._inner.matches.map((match) => { + + if (match.schema) { + return { schema: match.schema.label(name) }; + } + + match = Object.assign({}, match); + if (match.then) { + match.then = match.then.label(name); + } + + if (match.otherwise) { + match.otherwise = match.otherwise.label(name); + } + + return match; + }); + return obj; + } + describe() { const description = super.describe(); @@ -3329,15 +3225,12 @@ module.exports = new internals.Alternatives(); "use strict"; -// Load modules +const Hoek = __webpack_require__(0); const Any = __webpack_require__(1); const Ref = __webpack_require__(2); -const Hoek = __webpack_require__(0); -// Declare internals - const internals = {}; internals.isoDate = /^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/; @@ -3370,7 +3263,7 @@ internals.Date = class extends Any { result.errors = null; } else if (!options.convert) { - result.errors = this.createError('date.strict', null, state, options); + result.errors = this.createError('date.strict', { value }, state, options); } else { let type; @@ -3384,7 +3277,7 @@ internals.Date = class extends Any { type = 'base'; } - result.errors = this.createError(`date.${type}`, null, state, options); + result.errors = this.createError(`date.${type}`, { value }, state, options); } return result; @@ -3399,17 +3292,19 @@ internals.Date = class extends Any { if (typeof value === 'string' || (typeof value === 'number' && !isNaN(value) && isFinite(value))) { - if (typeof value === 'string' && + const isIsoDate = format && internals.isIsoDate(format); + if (!isIsoDate && + typeof value === 'string' && /^[+-]?\d+(\.\d+)?$/.test(value)) { value = parseFloat(value); } let date; - if (format && internals.isIsoDate(format)) { - date = format.test(value) ? new Date(value) : internals.invalidDate; + if (isIsoDate) { + date = format.test(value) ? new Date(value.toString()) : internals.invalidDate; } - else if (timestamp && multiplier) { + else if (timestamp) { date = /^\s*$/.test(value) ? internals.invalidDate : new Date(value * multiplier); } else { @@ -3477,10 +3372,11 @@ internals.compare = function (type, compare) { compareTo = Date.now(); } else if (isRef) { - compareTo = internals.Date.toDate(date(state.reference || state.parent, options)); + const refValue = date(state.reference || state.parent, options); + compareTo = internals.Date.toDate(refValue); if (!compareTo) { - return this.createError('date.ref', { ref: date.key }, state, options); + return this.createError('date.ref', { ref: date, value: refValue }, state, options); } compareTo = compareTo.getTime(); @@ -3493,7 +3389,7 @@ internals.compare = function (type, compare) { return value; } - return this.createError('date.' + type, { limit: new Date(compareTo) }, state, options); + return this.createError('date.' + type, { limit: new Date(compareTo), value }, state, options); }); }; }; @@ -3515,17 +3411,15 @@ module.exports = new internals.Date(); "use strict"; -// Load modules - const Hoek = __webpack_require__(0); -const Topo = __webpack_require__(24); +const Topo = __webpack_require__(26); + const Any = __webpack_require__(1); const Errors = __webpack_require__(4); const Cast = __webpack_require__(3); +const State = __webpack_require__(5); -// Declare internals - const internals = {}; @@ -3561,7 +3455,14 @@ internals.Object = class extends Any { if (typeof value === 'string' && options.convert) { - value = internals.safeParse(value); + if (value.length > 1 && + (value[0] === '{' || /^\s*\{/.test(value))) { + + try { + value = JSON.parse(value); + } + catch (e) { } + } } const type = this._flags.func ? 'function' : 'object'; @@ -3569,7 +3470,7 @@ internals.Object = class extends Any { typeof value !== type || Array.isArray(value)) { - errors.push(this.createError(type + '.base', null, state, options)); + errors.push(this.createError(type + '.base', { value }, state, options)); return finish(); } @@ -3723,7 +3624,7 @@ internals.Object = class extends Any { unprocessed.delete(key); - const localState = { key, path: state.path.concat(key), parent: target, reference: state.reference }; + const localState = new State(key, [...state.path, key], target, state.reference); const result = child.schema._validate(item, localState, options); if (result.errors) { errors.push(this.createError('object.child', { key, child: child.schema._getLabel(key), reason: result.errors }, localState, options)); @@ -3753,12 +3654,7 @@ internals.Object = class extends Any { if (unprocessed.size && this._inner.patterns.length) { for (const key of unprocessed) { - const localState = { - key, - path: state.path.concat(key), - parent: target, - reference: state.reference - }; + const localState = new State(key, [...state.path, key], target, state.reference); const item = target[key]; for (let i = 0; i < this._inner.patterns.length; ++i) { @@ -3766,7 +3662,7 @@ internals.Object = class extends Any { if (pattern.regex ? pattern.regex.test(key) : - !pattern.schema.validate(key).error) { + !pattern.schema._validate(key, state, { ...options, abortEarly:true }).errors) { unprocessed.delete(key); @@ -3812,9 +3708,9 @@ internals.Object = class extends Any { if ((this._flags.allowUnknown !== undefined ? !this._flags.allowUnknown : !options.allowUnknown)) { for (const unprocessedKey of unprocessed) { - errors.push(this.createError('object.allowUnknown', { child: unprocessedKey }, { + errors.push(this.createError('object.allowUnknown', { child: unprocessedKey, value: target[unprocessedKey] }, { key: unprocessedKey, - path: state.path.concat(unprocessedKey) + path: [...state.path, unprocessedKey] }, options, {})); } } @@ -3824,7 +3720,10 @@ internals.Object = class extends Any { for (let i = 0; i < this._inner.dependencies.length; ++i) { const dep = this._inner.dependencies[i]; - const err = internals[dep.type].call(this, dep.key !== null && target[dep.key], dep.peers, target, { key: dep.key, path: dep.key === null ? state.path : state.path.concat(dep.key) }, options); + const hasKey = dep.key !== null; + const splitKey = hasKey && dep.key.split('.'); + const localState = hasKey ? new State(splitKey[splitKey.length - 1], [...state.path, ...splitKey]) : new State(null, state.path); + const err = internals[dep.type].call(this, dep.key, hasKey && Hoek.reach(target, dep.key, { functions: true }), dep.peers, target, localState, options); if (err instanceof Errors.Err) { errors.push(err); if (options.abortEarly) { @@ -3881,6 +3780,7 @@ internals.Object = class extends Any { else { castErr.path = key; } + throw castErr; } } @@ -3922,7 +3822,7 @@ internals.Object = class extends Any { return value; } - return this.createError('object.length', { limit }, state, options); + return this.createError('object.length', { limit, value }, state, options); }); } @@ -3936,7 +3836,7 @@ internals.Object = class extends Any { return value; } - return this.createError('object.min', { limit }, state, options); + return this.createError('object.min', { limit, value }, state, options); }); } @@ -3950,7 +3850,7 @@ internals.Object = class extends Any { return value; } - return this.createError('object.max', { limit }, state, options); + return this.createError('object.max', { limit, value }, state, options); }); } @@ -3961,7 +3861,7 @@ internals.Object = class extends Any { Hoek.assert(schema !== undefined, 'Invalid rule'); if (isRegExp) { - pattern = new RegExp(pattern.source, pattern.ignoreCase ? 'i' : undefined); // Future version should break this and forbid unsupported regex flags + Hoek.assert(!pattern.flags.includes('g') && !pattern.flags.includes('y'), 'pattern should not use global or sticky mode'); } try { @@ -3969,7 +3869,7 @@ internals.Object = class extends Any { } catch (castErr) { if (castErr.hasOwnProperty('path')) { - castErr.message = castErr.message + '(' + castErr.path + ')'; + castErr.message = `${castErr.message}(${castErr.path})`; } throw castErr; @@ -3982,6 +3882,7 @@ internals.Object = class extends Any { else { obj._inner.patterns.push({ schema: pattern, rule: schema }); } + return obj; } @@ -4017,6 +3918,11 @@ internals.Object = class extends Any { return this._dependency('xor', null, peers); } + oxor(...peers) { + + return this._dependency('oxor', null, peers); + } + or(...peers) { peers = Hoek.flatten(peers); @@ -4075,7 +3981,7 @@ internals.Object = class extends Any { return obj; } - applyFunctionToChildren(children, fn, args, root) { + applyFunctionToChildren(children, fn, args = [], root) { children = [].concat(children); Hoek.assert(children.length > 0, 'expected at least one children'); @@ -4084,7 +3990,7 @@ internals.Object = class extends Any { let obj; if ('' in groupedChildren) { - obj = this[fn].apply(this, args); + obj = this[fn](...args); delete groupedChildren['']; } else { @@ -4188,13 +4094,14 @@ internals.Object = class extends Any { ref = Cast.ref(ref); Hoek.assert(ref.isContext || ref.depth > 1, 'Cannot use assertions for root level references - use direct key rules instead'); message = message || 'pass the assertion test'; + Hoek.assert(typeof message === 'string', 'Message must be a string'); try { schema = Cast.schema(this._currentJoi, schema); } catch (castErr) { if (castErr.hasOwnProperty('path')) { - castErr.message = castErr.message + '(' + castErr.path + ')'; + castErr.message = `${castErr.message}(${castErr.path})`; } throw castErr; @@ -4210,9 +4117,7 @@ internals.Object = class extends Any { return value; } - const localState = Hoek.merge({}, state); - localState.key = key; - localState.path = ref.path; + const localState = new State(key, ref.path, state.parent, state.reference); return this.createError('object.assert', { ref: path, message }, localState, options); }); } @@ -4231,21 +4136,11 @@ internals.Object = class extends Any { return value; } - return this.createError('object.type', { type: typeData.name }, state, options); + return this.createError('object.type', { type: typeData.name, value }, state, options); }); } }; -internals.safeParse = function (value) { - - try { - return JSON.parse(value); - } - catch (parseErr) {} - - return value; -}; - internals.renameDefaults = { alias: false, // Keep old value in place @@ -4282,8 +4177,8 @@ internals.keysToLabels = function (schema, keys) { const findLabel = function (key) { - const matchingChild = children.find((child) => child.key === key); - return matchingChild ? matchingChild.schema._getLabel(key) : key; + const matchingChild = schema._currentJoi.reach(schema, key); + return matchingChild ? matchingChild._getLabel(key) : key; }; if (Array.isArray(keys)) { @@ -4294,68 +4189,64 @@ internals.keysToLabels = function (schema, keys) { }; -internals.with = function (value, peers, parent, state, options) { +internals.with = function (key, value, peers, parent, state, options) { if (value === undefined) { - return value; + return; } for (let i = 0; i < peers.length; ++i) { + const peer = peers[i]; - if (!Object.prototype.hasOwnProperty.call(parent, peer) || - parent[peer] === undefined) { + const keysExist = Hoek.reach(parent, peer, { functions: true }); + if (keysExist === undefined) { return this.createError('object.with', { - main: state.key, - mainWithLabel: internals.keysToLabels(this, state.key), + main: key, + mainWithLabel: internals.keysToLabels(this, key), peer, peerWithLabel: internals.keysToLabels(this, peer) }, state, options); } } - - return value; }; -internals.without = function (value, peers, parent, state, options) { +internals.without = function (key, value, peers, parent, state, options) { if (value === undefined) { - return value; + return; } for (let i = 0; i < peers.length; ++i) { const peer = peers[i]; - if (Object.prototype.hasOwnProperty.call(parent, peer) && - parent[peer] !== undefined) { + const keysExist = Hoek.reach(parent, peer, { functions: true }); + if (keysExist !== undefined) { return this.createError('object.without', { - main: state.key, - mainWithLabel: internals.keysToLabels(this, state.key), + main: key, + mainWithLabel: internals.keysToLabels(this, key), peer, peerWithLabel: internals.keysToLabels(this, peer) }, state, options); } } - - return value; }; -internals.xor = function (value, peers, parent, state, options) { +internals.xor = function (key, value, peers, parent, state, options) { const present = []; for (let i = 0; i < peers.length; ++i) { const peer = peers[i]; - if (Object.prototype.hasOwnProperty.call(parent, peer) && - parent[peer] !== undefined) { - + const keysExist = Hoek.reach(parent, peer, { functions: true }); + if (keysExist !== undefined) { present.push(peer); } } if (present.length === 1) { - return value; + return; } const context = { peers, peersWithLabels: internals.keysToLabels(this, peers) }; @@ -4364,17 +4255,45 @@ internals.xor = function (value, peers, parent, state, options) { return this.createError('object.missing', context, state, options); } + context.present = present; + context.presentWithLabels = internals.keysToLabels(this, present); + return this.createError('object.xor', context, state, options); }; -internals.or = function (value, peers, parent, state, options) { +internals.oxor = function (key, value, peers, parent, state, options) { + const present = []; for (let i = 0; i < peers.length; ++i) { const peer = peers[i]; - if (Object.prototype.hasOwnProperty.call(parent, peer) && - parent[peer] !== undefined) { - return value; + const keysExist = Hoek.reach(parent, peer, { functions: true }); + if (keysExist !== undefined) { + present.push(peer); + } + } + + if (!present.length || + present.length === 1) { + + return; + } + + const context = { peers, peersWithLabels: internals.keysToLabels(this, peers) }; + context.present = present; + context.presentWithLabels = internals.keysToLabels(this, present); + + return this.createError('object.oxor', context, state, options); +}; + + +internals.or = function (key, value, peers, parent, state, options) { + + for (let i = 0; i < peers.length; ++i) { + const peer = peers[i]; + const keysExist = Hoek.reach(parent, peer, { functions: true }); + if (keysExist !== undefined) { + return; } } @@ -4385,15 +4304,15 @@ internals.or = function (value, peers, parent, state, options) { }; -internals.and = function (value, peers, parent, state, options) { +internals.and = function (key, value, peers, parent, state, options) { const missing = []; const present = []; const count = peers.length; for (let i = 0; i < count; ++i) { const peer = peers[i]; - if (!Object.prototype.hasOwnProperty.call(parent, peer) || - parent[peer] === undefined) { + const keysExist = Hoek.reach(parent, peer, { functions: true }); + if (keysExist === undefined) { missing.push(peer); } @@ -4416,20 +4335,20 @@ internals.and = function (value, peers, parent, state, options) { }; -internals.nand = function (value, peers, parent, state, options) { +internals.nand = function (key, value, peers, parent, state, options) { const present = []; for (let i = 0; i < peers.length; ++i) { const peer = peers[i]; - if (Object.prototype.hasOwnProperty.call(parent, peer) && - parent[peer] !== undefined) { + const keysExist = Hoek.reach(parent, peer, { functions: true }); + if (keysExist !== undefined) { present.push(peer); } } - const values = Hoek.clone(peers); - const main = values.splice(0, 1)[0]; + const main = peers[0]; + const values = peers.slice(1); const allPresent = (present.length === peers.length); return allPresent ? this.createError('object.nand', { main, @@ -4450,11 +4369,6 @@ module.exports = new internals.Object(); "use strict"; -// Load modules - - -// Delcare internals - const internals = { rfc3986: {} }; @@ -4694,35 +4608,340 @@ module.exports = require("path"); "use strict"; +// Load modules + + // Declare internals -const internals = {}; +const internals = { + arrayType: Symbol('array'), + bufferType: Symbol('buffer'), + dateType: Symbol('date'), + errorType: Symbol('error'), + genericType: Symbol('generic'), + mapType: Symbol('map'), + promiseType: Symbol('promise'), + regexType: Symbol('regex'), + setType: Symbol('set'), + weakMapType: Symbol('weak-map'), + weakSetType: Symbol('weak-set'), + mismatched: Symbol('mismatched') +}; -exports.escapeJavaScript = function (input) { +internals.typeMap = { + '[object Array]': internals.arrayType, + '[object Date]': internals.dateType, + '[object Error]': internals.errorType, + '[object Map]': internals.mapType, + '[object Promise]': internals.promiseType, + '[object RegExp]': internals.regexType, + '[object Set]': internals.setType, + '[object WeakMap]': internals.weakMapType, + '[object WeakSet]': internals.weakSetType +}; - if (!input) { - return ''; + +module.exports = function (obj, ref, options) { + + options = { prototype: true, ...options }; + + return !!internals.isDeepEqual(obj, ref, options, []); +}; + + +internals.isDeepEqual = function (obj, ref, options, seen) { + + 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; } - let escaped = ''; + const type = typeof obj; - for (let i = 0; i < input.length; ++i) { + if (type !== typeof ref) { + return false; + } - const charCode = input.charCodeAt(i); + if (type !== 'object' || + obj === null || + ref === null) { - if (internals.isSafe(charCode)) { - escaped += input[i]; + return obj !== obj && ref !== ref; // NaN + } + + const instanceType = internals.getSharedType(obj, ref, !!options.prototype); + switch (instanceType) { + case internals.bufferType: + return Buffer.prototype.equals.call(obj, ref); + case internals.promiseType: + return obj === ref; + case internals.regexType: + return obj.toString() === ref.toString(); + case internals.mismatched: + return false; + } + + for (let i = seen.length - 1; i >= 0; --i) { + if (seen[i].isSame(obj, ref)) { + return true; // If previous comparison failed, it would have stopped execution + } + } + + seen.push(new internals.SeenEntry(obj, ref)); + + try { + return !!internals.isDeepEqualObj(instanceType, obj, ref, options, seen); + } + finally { + seen.pop(); + } +}; + + +internals.getInternalType = function (obj) { + + const { typeMap, bufferType, genericType } = internals; + + if (obj instanceof Buffer) { + return bufferType; + } + + const objName = Object.prototype.toString.call(obj); + return typeMap[objName] || genericType; +}; + + +internals.getSharedType = function (obj, ref, checkPrototype) { + + if (checkPrototype) { + if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) { + return internals.mismatched; + } + + return internals.getInternalType(obj); + } + + const type = internals.getInternalType(obj); + if (type !== internals.getInternalType(ref)) { + return internals.mismatched; + } + + return type; +}; + + +internals.valueOf = function (obj) { + + const objValueOf = obj.valueOf; + if (objValueOf === undefined) { + return obj; + } + + try { + return objValueOf.call(obj); + } + catch (err) { + return err; + } +}; + + +internals.hasOwnEnumerableProperty = function (obj, key) { + + return Object.prototype.propertyIsEnumerable.call(obj, key); +}; + + +internals.isSetSimpleEqual = function (obj, ref) { + + for (const entry of obj) { + if (!ref.has(entry)) { + return false; + } + } + + return true; +}; + + +internals.isDeepEqualObj = function (instanceType, obj, ref, options, seen) { + + const { isDeepEqual, valueOf, hasOwnEnumerableProperty } = internals; + const { keys, getOwnPropertySymbols } = Object; + + if (instanceType === internals.arrayType) { + if (options.part) { + // Check if any index match any other index + + for (let i = 0; i < obj.length; ++i) { + const objValue = obj[i]; + for (let j = 0; j < ref.length; ++j) { + if (isDeepEqual(objValue, ref[j], options, seen)) { + return true; + } + } + } } else { - escaped += internals.escapeJavaScriptChar(charCode); + if (obj.length !== ref.length) { + return false; + } + + for (let i = 0; i < obj.length; ++i) { + if (!isDeepEqual(obj[i], ref[i], options, seen)) { + return false; + } + } + + return true; } } + else if (instanceType === internals.setType) { + if (obj.size !== ref.size) { + return false; + } - return escaped; + if (!internals.isSetSimpleEqual(obj, ref)) { + + // Check for deep equality + + const ref2 = new Set(ref); + for (const objEntry of obj) { + if (ref2.delete(objEntry)) { + continue; + } + + let found = false; + for (const refEntry of ref2) { + if (isDeepEqual(objEntry, refEntry, options, seen)) { + ref2.delete(refEntry); + found = true; + break; + } + } + + if (!found) { + return false; + } + } + } + } + else if (instanceType === internals.mapType) { + if (obj.size !== ref.size) { + return false; + } + + for (const [key, value] of obj) { + if (value === undefined && !ref.has(key)) { + return false; + } + + if (!isDeepEqual(value, ref.get(key), options, seen)) { + return false; + } + } + } + else if (instanceType === internals.errorType) { + // Always check name and message + + if (obj.name !== ref.name || obj.message !== ref.message) { + return false; + } + } + + // Check .valueOf() + + const valueOfObj = valueOf(obj); + const valueOfRef = valueOf(ref); + if (!(obj === valueOfObj && ref === valueOfRef) && + !isDeepEqual(valueOfObj, valueOfRef, options, seen)) { + return false; + } + + // Check properties + + const objKeys = keys(obj); + if (!options.part && + objKeys.length !== keys(ref).length) { + + return false; + } + + for (let i = 0; i < objKeys.length; ++i) { + const key = objKeys[i]; + + if (!hasOwnEnumerableProperty(ref, key)) { + return false; + } + + if (!isDeepEqual(obj[key], ref[key], options, seen)) { + return false; + } + } + + // Check symbols + + if (options.symbols) { + const objSymbols = getOwnPropertySymbols(obj); + const refSymbols = new Set(getOwnPropertySymbols(ref)); + + for (let i = 0; i < objSymbols.length; ++i) { + const key = objSymbols[i]; + + if (hasOwnEnumerableProperty(obj, key)) { + if (!hasOwnEnumerableProperty(ref, key)) { + return false; + } + + if (!isDeepEqual(obj[key], ref[key], options, seen)) { + return false; + } + } + else if (hasOwnEnumerableProperty(ref, key)) { + return false; + } + + refSymbols.delete(key); + } + + for (const key of refSymbols) { + if (hasOwnEnumerableProperty(ref, key)) { + return false; + } + } + } + + return true; +}; + + +internals.SeenEntry = class { + + constructor(obj, ref) { + + this.obj = obj; + this.ref = ref; + } + + isSame(obj, ref) { + + return this.obj === obj && this.ref === ref; + } }; +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Declare internals + +const internals = {}; + + exports.escapeHtml = function (input) { if (!input) { @@ -4767,31 +4986,24 @@ exports.escapeJson = function (input) { if (charCode === lessThan) { return '\\u003c'; } - else if (charCode === greaterThan) { + + if (charCode === greaterThan) { return '\\u003e'; } - else if (charCode === andSymbol) { + + if (charCode === andSymbol) { return '\\u0026'; } - else if (charCode === lineSeperator) { + + if (charCode === lineSeperator) { return '\\u2028'; } + return '\\u2029'; }); }; -internals.escapeJavaScriptChar = function (charCode) { - - if (charCode >= 256) { - return '\\u' + internals.padLeft('' + charCode, 4); - } - - const hexValue = Buffer.from(String.fromCharCode(charCode), 'ascii').toString('hex'); - return '\\x' + internals.padLeft(hexValue, 2); -}; - - internals.escapeHtmlChar = function (charCode) { const namedEscape = internals.namedHtml[charCode]; @@ -4804,17 +5016,7 @@ internals.escapeHtmlChar = function (charCode) { } const hexValue = Buffer.from(String.fromCharCode(charCode), 'ascii').toString('hex'); - return '&#x' + internals.padLeft(hexValue, 2) + ';'; -}; - - -internals.padLeft = function (str, len) { - - while (str.length < len) { - str = '0' + str; - } - - return str; + return `&#x${hexValue};`; }; @@ -4863,28 +5065,62 @@ internals.safeCharCodes = (function () { /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Load modules +const Hoek = __webpack_require__(0); +const Symbols = __webpack_require__(7); -// Declare internals const internals = {}; -exports.errors = { - root: 'value', - key: '"{{!label}}" ', - messages: { - wrapArrays: true - }, - any: { - unknown: 'is not allowed', +exports.concat = function (target, source) { + + if (!source) { + return target; + } + + const obj = Object.assign({}, target); + + const language = source.language; + + Object.assign(obj, source); + + if (language && target && target.language) { + obj.language = Hoek.applyToDefaults(target.language, language); + } + + if (obj[Symbols.settingsCache]) { + delete obj[Symbols.settingsCache]; + } + + return obj; +}; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +const internals = {}; + + +exports.errors = { + root: 'value', + key: '"{{!label}}" ', + messages: { + wrapArrays: true + }, + any: { + unknown: 'is not allowed', invalid: 'contains an invalid value', empty: 'is not allowed to be empty', required: 'is required', @@ -4906,6 +5142,8 @@ exports.errors = { includesRequiredBoth: 'does not contain {{knownMisses}} and {{unknownMisses}} other required value(s)', excludes: 'at position {{pos}} contains an excluded value', excludesSingle: 'single value of "{{!label}}" contains an excluded value', + hasKnown: 'does not contain at least one required match for type "{{!patternLabel}}"', + hasUnknown: 'does not contain at least one required match', min: 'must contain at least {{limit}} items', max: 'must contain less than or equal to {{limit}} items', length: 'must contain {{limit}} items', @@ -4926,7 +5164,6 @@ exports.errors = { }, date: { base: 'must be a number of milliseconds or valid date string', - format: 'must be a string with one of the following formats {{format}}', strict: 'must be a valid date', min: 'must be larger than or equal to "{{limit}}"', max: 'must be less than or equal to "{{limit}}"', @@ -4962,7 +5199,7 @@ exports.errors = { without: '!!"{{mainWithLabel}}" conflict with forbidden peer "{{peerWithLabel}}"', missing: 'must contain at least one of {{peersWithLabels}}', xor: 'contains a conflict between exclusive peers {{peersWithLabels}}', - or: 'must contain at least one of {{peersWithLabels}}', + oxor: 'contains a conflict between optional exclusive peers {{peersWithLabels}}', and: 'contains {{presentWithLabels}} without its required peers {{missingWithLabels}}', nand: '!!"{{mainWithLabel}}" must not exist simultaneously with {{peersWithLabels}}', assert: '!!"{{ref}}" validation failed because "{{ref}}" failed to {{message}}', @@ -4979,11 +5216,11 @@ exports.errors = { }, number: { base: 'must be a number', + unsafe: 'must be a safe number', min: 'must be larger than or equal to {{limit}}', max: 'must be less than or equal to {{limit}}', less: 'must be less than {{limit}}', greater: 'must be greater than {{limit}}', - float: 'must be a float or double', integer: 'must be an integer', negative: 'must be a negative number', positive: 'must be a positive number', @@ -5026,26 +5263,27 @@ exports.errors = { ref: 'references "{{ref}}" which is not a number', ip: 'must be a valid ip address with a {{cidr}} CIDR', ipVersion: 'must be a valid ip address of one of the following versions {{version}} with a {{cidr}} CIDR' + }, + symbol: { + base: 'must be a symbol', + map: 'must be one of {{map}}' } }; /***/ }), -/* 18 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Load modules - -const Joi = __webpack_require__(5); - +const Joi = __webpack_require__(6); -// Declare internals const internals = {}; + exports.options = Joi.object({ abortEarly: Joi.boolean(), convert: Joi.boolean(), @@ -5054,28 +5292,23 @@ exports.options = Joi.object({ stripUnknown: [Joi.boolean(), Joi.object({ arrays: Joi.boolean(), objects: Joi.boolean() }).or('arrays', 'objects')], language: Joi.object(), presence: Joi.string().only('required', 'optional', 'forbidden', 'ignore'), - raw: Joi.boolean(), context: Joi.object(), - strip: Joi.boolean(), noDefaults: Joi.boolean(), escapeHtml: Joi.boolean() }).strict(); /***/ }), -/* 19 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Load modules - -const Any = __webpack_require__(1); const Hoek = __webpack_require__(0); +const Any = __webpack_require__(1); -// Declare internals const internals = {}; @@ -5086,34 +5319,63 @@ internals.Lazy = class extends Any { super(); this._type = 'lazy'; + this._flags.once = true; + this._cache = null; } - _base(value, state, options) { + _init(fn, options) { - const result = { value }; - const lazy = this._flags.lazy; + return this.set(fn, options); + } - if (!lazy) { - result.errors = this.createError('lazy.base', null, state, options); - return result; + _base(value, state, options) { + + let schema; + if (this._cache) { + schema = this._cache; } + else { + const result = { value }; + const lazy = this._flags.lazy; - const schema = lazy(); + if (!lazy) { + result.errors = this.createError('lazy.base', null, state, options); + return result; + } - if (!(schema instanceof Any)) { - result.errors = this.createError('lazy.schema', null, state, options); - return result; + schema = lazy(); + + if (!(schema instanceof Any)) { + result.errors = this.createError('lazy.schema', { schema }, state, options); + return result; + } + + if (this._flags.once) { + this._cache = schema; + } } return schema._validate(value, state, options); } - set(fn) { + set(fn, options) { Hoek.assert(typeof fn === 'function', 'You must provide a function as first argument'); + Hoek.assert(options === undefined || (options && typeof options === 'object' && !Array.isArray(options)), `Options must be an object`); + + if (options) { + const unknownOptions = Object.keys(options).filter((key) => !['once'].includes(key)); + Hoek.assert(unknownOptions.length === 0, `Options contain unknown keys: ${unknownOptions}`); + Hoek.assert(options.once === undefined || typeof options.once === 'boolean', 'Option "once" must be a boolean'); + } const obj = this.clone(); obj._flags.lazy = fn; + + if (options && options.once !== obj._flags.once) { + obj._flags.once = options.once; + } + return obj; } @@ -5123,22 +5385,20 @@ module.exports = new internals.Lazy(); /***/ }), -/* 20 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Load modules +const Hoek = __webpack_require__(0); const Any = __webpack_require__(1); const Cast = __webpack_require__(3); const Ref = __webpack_require__(2); -const Hoek = __webpack_require__(0); +const State = __webpack_require__(5); -// Declare internals - const internals = {}; @@ -5176,7 +5436,14 @@ internals.Array = class extends Any { if (typeof value === 'string' && options.convert) { - internals.safeParse(value, result); + if (value.length > 1 && + (value[0] === '[' || /^\s*\[/.test(value))) { + + try { + result.value = JSON.parse(value); + } + catch (e) { } + } } let isArray = Array.isArray(result.value); @@ -5202,7 +5469,7 @@ internals.Array = class extends Any { result.value = result.value.slice(0); } - result.errors = this._checkItems.call(this, result.value, wasArray, state, options); + result.errors = this._checkItems(result.value, wasArray, state, options); if (result.errors && wasArray && options.convert && this._flags.single) { @@ -5210,7 +5477,7 @@ internals.Array = class extends Any { const previousErrors = result.errors; result.value = [result.value]; - result.errors = this._checkItems.call(this, result.value, wasArray, state, options); + result.errors = this._checkItems(result.value, wasArray, state, options); if (result.errors) { @@ -5231,7 +5498,7 @@ internals.Array = class extends Any { const requireds = this._inner.requireds.slice(); const ordereds = this._inner.ordereds.slice(); - const inclusions = this._inner.inclusions.concat(requireds); + const inclusions = [...this._inner.inclusions, ...requireds]; let il = items.length; for (let i = 0; i < il; ++i) { @@ -5239,8 +5506,8 @@ internals.Array = class extends Any { const item = items[i]; let isValid = false; const key = wasArray ? i : state.key; - const path = wasArray ? state.path.concat(i) : state.path; - const localState = { key, path, parent: state.parent, reference: state.reference }; + const path = wasArray ? [...state.path, i] : state.path; + const localState = new State(key, path, state.parent, state.reference); let res; // Sparse @@ -5310,6 +5577,7 @@ internals.Array = class extends Any { return errors; } } + continue; } else if (!this._inner.items.length) { @@ -5317,6 +5585,7 @@ internals.Array = class extends Any { if (options.abortEarly) { return errors; } + continue; } } @@ -5352,9 +5621,7 @@ internals.Array = class extends Any { // Inclusions - const stripUnknown = options.stripUnknown - ? (options.stripUnknown === true ? true : !!options.stripUnknown.arrays) - : false; + const stripUnknown = options.stripUnknown && !!options.stripUnknown.arrays || false; jl = inclusions.length; for (let j = 0; j < jl; ++j) { @@ -5381,6 +5648,7 @@ internals.Array = class extends Any { else { items[i] = res.value; } + isValid = true; break; } @@ -5428,11 +5696,11 @@ internals.Array = class extends Any { } if (requireds.length) { - this._fillMissedErrors.call(this, errors, requireds, state, options); + this._fillMissedErrors(errors, requireds, state, options); } if (ordereds.length) { - this._fillOrderedErrors.call(this, errors, ordereds, state, options); + this._fillOrderedErrors(errors, ordereds, state, options); } return errors.length ? errors : null; @@ -5458,6 +5726,15 @@ internals.Array = class extends Any { } } + if (description.rules) { + for (let i = 0; i < description.rules.length; ++i) { + const rule = description.rules[i]; + if (rule.name === 'has') { + rule.arg = rule.arg.describe(); + } + } + } + return description; } @@ -5477,7 +5754,8 @@ internals.Array = class extends Any { else { castErr.path = index; } - castErr.message = castErr.message + '(' + castErr.path + ')'; + + castErr.message = `${castErr.message}(${castErr.path})`; throw castErr; } @@ -5513,9 +5791,11 @@ internals.Array = class extends Any { else { castErr.path = index; } - castErr.message = castErr.message + '(' + castErr.path + ')'; + + castErr.message = `${castErr.message}(${castErr.path})`; throw castErr; } + obj._inner.ordereds.push(type); }); @@ -5528,14 +5808,14 @@ internals.Array = class extends Any { Hoek.assert((Number.isSafeInteger(limit) && limit >= 0) || isRef, 'limit must be a positive integer or reference'); - return this._test('min', limit, function (value, state, options) { + return this._testUnique('min', limit, function (value, state, options) { let compareTo; if (isRef) { compareTo = limit(state.reference || state.parent, options); if (!(Number.isSafeInteger(compareTo) && compareTo >= 0)) { - return this.createError('array.ref', { ref: limit.key }, state, options); + return this.createError('array.ref', { ref: limit, value: compareTo }, state, options); } } else { @@ -5556,7 +5836,7 @@ internals.Array = class extends Any { Hoek.assert((Number.isSafeInteger(limit) && limit >= 0) || isRef, 'limit must be a positive integer or reference'); - return this._test('max', limit, function (value, state, options) { + return this._testUnique('max', limit, function (value, state, options) { let compareTo; if (isRef) { @@ -5584,7 +5864,7 @@ internals.Array = class extends Any { Hoek.assert((Number.isSafeInteger(limit) && limit >= 0) || isRef, 'limit must be a positive integer or reference'); - return this._test('length', limit, function (value, state, options) { + return this._testUnique('length', limit, function (value, state, options) { let compareTo; if (isRef) { @@ -5606,6 +5886,40 @@ internals.Array = class extends Any { }); } + has(schema) { + + try { + schema = Cast.schema(this._currentJoi, schema); + } + catch (castErr) { + if (castErr.hasOwnProperty('path')) { + castErr.message = `${castErr.message}(${castErr.path})`; + } + + throw castErr; + } + + return this._test('has', schema, function (value, state, options) { + + const isValid = value.some((item, idx) => { + + const localState = new State(idx, [...state.path, idx], state.key, state.reference); + return !schema._validate(item, localState, options).errors; + }); + + if (isValid) { + return value; + } + + const patternLabel = schema._getLabel(); + if (patternLabel) { + return this.createError('array.hasKnown', { patternLabel }, state, options); + } + + return this.createError('array.hasUnknown', null, state, options); + }); + } + unique(comparator, configs) { Hoek.assert(comparator === undefined || @@ -5654,13 +5968,7 @@ internals.Array = class extends Any { let current; while (!(current = entries.next()).done) { if (compare(current.value[0], item)) { - const localState = { - key: state.key, - path: state.path.concat(i), - parent: state.parent, - reference: state.reference - }; - + const localState = new State(state.key, [...state.path, i], state.parent, state.reference); const context = { pos: i, value: value[i], @@ -5680,12 +5988,7 @@ internals.Array = class extends Any { } else { if ((!ignoreUndefined || item !== undefined) && records[item] !== undefined) { - const localState = { - key: state.key, - path: state.path.concat(i), - parent: state.parent, - reference: state.reference - }; + const localState = new State(state.key, [...state.path, i], state.parent, state.reference); const context = { pos: i, @@ -5776,42 +6079,27 @@ internals.Array = class extends Any { } if (requiredOrdereds.length) { - this._fillMissedErrors.call(this, errors, requiredOrdereds, state, options); + this._fillMissedErrors(errors, requiredOrdereds, state, options); } } }; -internals.safeParse = function (value, result) { - - try { - const converted = JSON.parse(value); - if (Array.isArray(converted)) { - result.value = converted; - } - } - catch (e) { } -}; - - module.exports = new internals.Array(); /***/ }), -/* 21 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Load modules - -const Any = __webpack_require__(1); const Hoek = __webpack_require__(0); +const Any = __webpack_require__(1); -// Declare internals const internals = { Set: __webpack_require__(8) @@ -5847,7 +6135,7 @@ internals.Boolean = class extends Any { : (this._inner.falsySet.has(value, null, null, this._flags.insensitive) ? false : value)); } - result.errors = (typeof result.value === 'boolean') ? null : this.createError('boolean.base', null, state, options); + result.errors = (typeof result.value === 'boolean') ? null : this.createError('boolean.base', { value }, state, options); return result; } @@ -5861,6 +6149,7 @@ internals.Boolean = class extends Any { Hoek.assert(value !== undefined, 'Cannot call truthy with undefined'); obj._inner.truthySet.add(value); } + return obj; } @@ -5874,6 +6163,7 @@ internals.Boolean = class extends Any { Hoek.assert(value !== undefined, 'Cannot call falsy with undefined'); obj._inner.falsySet.add(value); } + return obj; } @@ -5893,8 +6183,8 @@ internals.Boolean = class extends Any { describe() { const description = super.describe(); - description.truthy = [true].concat(this._inner.truthySet.values()); - description.falsy = [false].concat(this._inner.falsySet.values()); + description.truthy = [true, ...this._inner.truthySet.values()]; + description.falsy = [false, ...this._inner.falsySet.values()]; return description; } }; @@ -5904,19 +6194,16 @@ module.exports = new internals.Boolean(); /***/ }), -/* 22 */ +/* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Load modules - -const Any = __webpack_require__(1); const Hoek = __webpack_require__(0); +const Any = __webpack_require__(1); -// Declare internals const internals = {}; @@ -5941,8 +6228,7 @@ internals.Binary = class extends Any { try { result.value = Buffer.from(value, this._flags.encoding); } - catch (e) { - } + catch (e) { } } result.errors = Buffer.isBuffer(result.value) ? null : this.createError('binary.base', null, state, options); @@ -6011,21 +6297,18 @@ module.exports = new internals.Binary(); /***/ }), -/* 23 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Load modules - const Hoek = __webpack_require__(0); + const ObjectType = __webpack_require__(11); const Ref = __webpack_require__(2); -// Declare internals - const internals = {}; @@ -6087,7 +6370,7 @@ internals.Func = class extends ObjectType.constructor { return value; } - return this.createError('function.ref', null, state, options); + return this.createError('function.ref', { value }, state, options); }); } @@ -6099,7 +6382,7 @@ internals.Func = class extends ObjectType.constructor { return value; } - return this.createError('function.class', null, state, options); + return this.createError('function.class', { value }, state, options); }); } }; @@ -6108,7 +6391,7 @@ module.exports = new internals.Func(); /***/ }), -/* 24 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6124,242 +6407,260 @@ const Hoek = __webpack_require__(0); const internals = {}; -exports = module.exports = internals.Topo = function () { - - this._items = []; - this.nodes = []; -}; +module.exports = class Topo { + constructor() { -internals.Topo.prototype.add = function (nodes, options) { + this._items = []; + this.nodes = []; + } - options = options || {}; + add(nodes, options) { - // Validate rules + options = options || {}; - const before = [].concat(options.before || []); - const after = [].concat(options.after || []); - const group = options.group || '?'; - const sort = options.sort || 0; // Used for merging only + // Validate rules - Hoek.assert(before.indexOf(group) === -1, 'Item cannot come before itself:', group); - Hoek.assert(before.indexOf('?') === -1, 'Item cannot come before unassociated items'); - Hoek.assert(after.indexOf(group) === -1, 'Item cannot come after itself:', group); - Hoek.assert(after.indexOf('?') === -1, 'Item cannot come after unassociated items'); + const before = [].concat(options.before || []); + const after = [].concat(options.after || []); + const group = options.group || '?'; + const sort = options.sort || 0; // Used for merging only - ([].concat(nodes)).forEach((node, i) => { + Hoek.assert(!before.includes(group), `Item cannot come before itself: ${group}`); + Hoek.assert(!before.includes('?'), 'Item cannot come before unassociated items'); + Hoek.assert(!after.includes(group), `Item cannot come after itself: ${group}`); + Hoek.assert(!after.includes('?'), 'Item cannot come after unassociated items'); - const item = { - seq: this._items.length, - sort, - before, - after, - group, - node - }; + ([].concat(nodes)).forEach((node, i) => { - this._items.push(item); - }); + const item = { + seq: this._items.length, + sort, + before, + after, + group, + node + }; - // Insert event + this._items.push(item); + }); - const error = this._sort(); - Hoek.assert(!error, 'item', (group !== '?' ? 'added into group ' + group : ''), 'created a dependencies error'); + // Insert event - return this.nodes; -}; + const error = this._sort(); + Hoek.assert(!error, 'item', (group !== '?' ? `added into group ${group}` : ''), 'created a dependencies error'); + return this.nodes; + } -internals.Topo.prototype.merge = function (others) { + merge(others) { - others = [].concat(others); - for (let i = 0; i < others.length; ++i) { - const other = others[i]; - if (other) { - for (let j = 0; j < other._items.length; ++j) { - const item = Hoek.shallow(other._items[j]); - this._items.push(item); + others = [].concat(others); + for (let i = 0; i < others.length; ++i) { + const other = others[i]; + if (other) { + for (let j = 0; j < other._items.length; ++j) { + const item = Object.assign({}, other._items[j]); // Shallow cloned + this._items.push(item); + } } } - } - - // Sort items - - this._items.sort(internals.mergeSort); - for (let i = 0; i < this._items.length; ++i) { - this._items[i].seq = i; - } - const error = this._sort(); - Hoek.assert(!error, 'merge created a dependencies error'); + // Sort items - return this.nodes; -}; - - -internals.mergeSort = function (a, b) { + this._items.sort(internals.mergeSort); + for (let i = 0; i < this._items.length; ++i) { + this._items[i].seq = i; + } - return a.sort === b.sort ? 0 : (a.sort < b.sort ? -1 : 1); -}; + const error = this._sort(); + Hoek.assert(!error, 'merge created a dependencies error'); + return this.nodes; + } -internals.Topo.prototype._sort = function () { + _sort() { - // Construct graph + // Construct graph - const graph = {}; - const graphAfters = Object.create(null); // A prototype can bungle lookups w/ false positives - const groups = Object.create(null); + const graph = {}; + const graphAfters = Object.create(null); // A prototype can bungle lookups w/ false positives + const groups = Object.create(null); - for (let i = 0; i < this._items.length; ++i) { - const item = this._items[i]; - const seq = item.seq; // Unique across all items - const group = item.group; + for (let i = 0; i < this._items.length; ++i) { + const item = this._items[i]; + const seq = item.seq; // Unique across all items + const group = item.group; - // Determine Groups + // Determine Groups - groups[group] = groups[group] || []; - groups[group].push(seq); + groups[group] = groups[group] || []; + groups[group].push(seq); - // Build intermediary graph using 'before' + // Build intermediary graph using 'before' - graph[seq] = item.before; + graph[seq] = item.before; - // Build second intermediary graph with 'after' + // Build second intermediary graph with 'after' - const after = item.after; - for (let j = 0; j < after.length; ++j) { - graphAfters[after[j]] = (graphAfters[after[j]] || []).concat(seq); + const after = item.after; + for (let j = 0; j < after.length; ++j) { + graphAfters[after[j]] = (graphAfters[after[j]] || []).concat(seq); + } } - } - // Expand intermediary graph + // Expand intermediary graph - let graphNodes = Object.keys(graph); - for (let i = 0; i < graphNodes.length; ++i) { - const node = graphNodes[i]; - const expandedGroups = []; + let graphNodes = Object.keys(graph); + for (let i = 0; i < graphNodes.length; ++i) { + const node = graphNodes[i]; + const expandedGroups = []; - const graphNodeItems = Object.keys(graph[node]); - for (let j = 0; j < graphNodeItems.length; ++j) { - const group = graph[node][graphNodeItems[j]]; - groups[group] = groups[group] || []; + const graphNodeItems = Object.keys(graph[node]); + for (let j = 0; j < graphNodeItems.length; ++j) { + const group = graph[node][graphNodeItems[j]]; + groups[group] = groups[group] || []; - for (let k = 0; k < groups[group].length; ++k) { - expandedGroups.push(groups[group][k]); + for (let k = 0; k < groups[group].length; ++k) { + expandedGroups.push(groups[group][k]); + } } + + graph[node] = expandedGroups; } - graph[node] = expandedGroups; - } - // Merge intermediary graph using graphAfters into final graph + // Merge intermediary graph using graphAfters into final graph - const afterNodes = Object.keys(graphAfters); - for (let i = 0; i < afterNodes.length; ++i) { - const group = afterNodes[i]; + const afterNodes = Object.keys(graphAfters); + for (let i = 0; i < afterNodes.length; ++i) { + const group = afterNodes[i]; - if (groups[group]) { - for (let j = 0; j < groups[group].length; ++j) { - const node = groups[group][j]; - graph[node] = graph[node].concat(graphAfters[group]); + if (groups[group]) { + for (let j = 0; j < groups[group].length; ++j) { + const node = groups[group][j]; + graph[node] = graph[node].concat(graphAfters[group]); + } } } - } - // Compile ancestors + // Compile ancestors - let children; - const ancestors = {}; - graphNodes = Object.keys(graph); - for (let i = 0; i < graphNodes.length; ++i) { - const node = graphNodes[i]; - children = graph[node]; + let children; + const ancestors = {}; + graphNodes = Object.keys(graph); + for (let i = 0; i < graphNodes.length; ++i) { + const node = graphNodes[i]; + children = graph[node]; - for (let j = 0; j < children.length; ++j) { - ancestors[children[j]] = (ancestors[children[j]] || []).concat(node); + for (let j = 0; j < children.length; ++j) { + ancestors[children[j]] = (ancestors[children[j]] || []).concat(node); + } } - } - // Topo sort + // Topo sort - const visited = {}; - const sorted = []; + const visited = {}; + const sorted = []; - for (let i = 0; i < this._items.length; ++i) { // Really looping thru item.seq values out of order - let next = i; + for (let i = 0; i < this._items.length; ++i) { // Really looping thru item.seq values out of order + let next = i; - if (ancestors[i]) { - next = null; - for (let j = 0; j < this._items.length; ++j) { // As above, these are item.seq values - if (visited[j] === true) { - continue; - } + if (ancestors[i]) { + next = null; + for (let j = 0; j < this._items.length; ++j) { // As above, these are item.seq values + if (visited[j] === true) { + continue; + } - if (!ancestors[j]) { - ancestors[j] = []; - } + if (!ancestors[j]) { + ancestors[j] = []; + } + + const shouldSeeCount = ancestors[j].length; + let seenCount = 0; + for (let k = 0; k < shouldSeeCount; ++k) { + if (visited[ancestors[j][k]]) { + ++seenCount; + } + } - const shouldSeeCount = ancestors[j].length; - let seenCount = 0; - for (let k = 0; k < shouldSeeCount; ++k) { - if (visited[ancestors[j][k]]) { - ++seenCount; + if (seenCount === shouldSeeCount) { + next = j; + break; } } + } - if (seenCount === shouldSeeCount) { - next = j; - break; - } + if (next !== null) { + visited[next] = true; + sorted.push(next); } } - if (next !== null) { - visited[next] = true; - sorted.push(next); + if (sorted.length !== this._items.length) { + return new Error('Invalid dependencies'); } - } - if (sorted.length !== this._items.length) { - return new Error('Invalid dependencies'); - } + const seqIndex = {}; + for (let i = 0; i < this._items.length; ++i) { + const item = this._items[i]; + seqIndex[item.seq] = item; + } - const seqIndex = {}; - for (let i = 0; i < this._items.length; ++i) { - const item = this._items[i]; - seqIndex[item.seq] = item; - } + const sortedNodes = []; + this._items = sorted.map((value) => { - const sortedNodes = []; - this._items = sorted.map((value) => { + const sortedItem = seqIndex[value]; + sortedNodes.push(sortedItem.node); + return sortedItem; + }); - const sortedItem = seqIndex[value]; - sortedNodes.push(sortedItem.node); - return sortedItem; - }); + this.nodes = sortedNodes; + } +}; - this.nodes = sortedNodes; +internals.mergeSort = (a, b) => { + + return a.sort === b.sort ? 0 : (a.sort < b.sort ? -1 : 1); }; /***/ }), -/* 25 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Load modules +const Hoek = __webpack_require__(0); const Any = __webpack_require__(1); const Ref = __webpack_require__(2); -const Hoek = __webpack_require__(0); - -// Declare internals const internals = { - precisionRx: /(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/ + precisionRx: /(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/, + normalizeExponent(str) { + + return str + .replace(/\.?0+e/, 'e') + .replace(/e\+/, 'e') + .replace(/^\+/, '') + .replace(/^(-?)0+([1-9])/, '$1$2'); + }, + normalizeDecimal(str) { + + str = str + .replace(/^\+/, '') + .replace(/\.0+$/, '') + .replace(/^(-?)0+([1-9])/, '$1$2'); + + if (str.includes('.') && str.endsWith('0')) { + str = str.replace(/0+$/, ''); + } + + return str; + } }; @@ -6369,6 +6670,7 @@ internals.Number = class extends Any { super(); this._type = 'number'; + this._flags.unsafe = false; this._invalids.add(Infinity); this._invalids.add(-Infinity); } @@ -6383,8 +6685,27 @@ internals.Number = class extends Any { if (typeof value === 'string' && options.convert) { - const number = parseFloat(value); - result.value = (isNaN(number) || !isFinite(value)) ? NaN : number; + const matches = value.match(/^\s*[+-]?\d+(?:\.\d+)?(?:e([+-]?\d+))?\s*$/i); + if (matches) { + + value = value.trim(); + result.value = parseFloat(value); + + if (!this._flags.unsafe) { + if (value.includes('e')) { + if (internals.normalizeExponent(`${result.value / Math.pow(10, matches[1])}e${matches[1]}`) !== internals.normalizeExponent(value)) { + result.errors = this.createError('number.unsafe', { value }, state, options); + return result; + } + } + else { + if (result.value.toString() !== internals.normalizeDecimal(value)) { + result.errors = this.createError('number.unsafe', { value }, state, options); + return result; + } + } + } + } } const isNumber = typeof result.value === 'number' && !isNaN(result.value); @@ -6396,7 +6717,16 @@ internals.Number = class extends Any { result.value = Math.round(result.value * precision) / precision; } - result.errors = isNumber ? null : this.createError('number.base', { value }, state, options); + if (isNumber) { + if (!this._flags.unsafe && + (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER)) { + result.errors = this.createError('number.unsafe', { value }, state, options); + } + } + else { + result.errors = this.createError('number.base', { value }, state, options); + } + return result; } @@ -6429,10 +6759,23 @@ internals.Number = class extends Any { return this._test('integer', undefined, function (value, state, options) { - return Number.isSafeInteger(value) ? value : this.createError('number.integer', { value }, state, options); + return Math.trunc(value) - value === 0 ? value : this.createError('number.integer', { value }, state, options); }); } + unsafe(enabled = true) { + + Hoek.assert(typeof enabled === 'boolean', 'enabled must be a boolean'); + + if (this._flags.unsafe === enabled) { + return this; + } + + const obj = this.clone(); + obj._flags.unsafe = enabled; + return obj; + } + negative() { return this._test('negative', undefined, function (value, state, options) { @@ -6535,24 +6878,24 @@ module.exports = new internals.Number(); /***/ }), -/* 26 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Load modules +const Net = __webpack_require__(29); -const Net = __webpack_require__(27); +const Address = __webpack_require__(30); const Hoek = __webpack_require__(0); -let Isemail; // Loaded on demand + const Any = __webpack_require__(1); const Ref = __webpack_require__(2); const JoiDate = __webpack_require__(10); -const Uri = __webpack_require__(28); -const Ip = __webpack_require__(29); -// Declare internals +const Uri = __webpack_require__(34); +const Ip = __webpack_require__(35); + const internals = { uriRegex: Uri.createUriRegex(), @@ -6571,6 +6914,7 @@ const internals = { normalizationForms: ['NFC', 'NFD', 'NFKC', 'NFKD'] }; + internals.String = class extends Any { constructor() { @@ -6659,10 +7003,9 @@ internals.String = class extends Any { regex(pattern, patternOptions) { Hoek.assert(pattern instanceof RegExp, 'pattern must be a RegExp'); + Hoek.assert(!pattern.flags.includes('g') && !pattern.flags.includes('y'), 'pattern should not use global or sticky mode'); - const patternObject = { - pattern: new RegExp(pattern.source, pattern.ignoreCase ? 'i' : undefined) // Future version should break this and forbid unsupported regex flags - }; + const patternObject = { pattern }; if (typeof patternOptions === 'string') { patternObject.name = patternOptions; @@ -6713,41 +7056,62 @@ internals.String = class extends Any { }); } - email(isEmailOptions) { + email(validationOptions) { - if (isEmailOptions) { - Hoek.assert(typeof isEmailOptions === 'object', 'email options must be an object'); - Hoek.assert(typeof isEmailOptions.checkDNS === 'undefined', 'checkDNS option is not supported'); - Hoek.assert(typeof isEmailOptions.tldWhitelist === 'undefined' || - typeof isEmailOptions.tldWhitelist === 'object', 'tldWhitelist must be an array or object'); - Hoek.assert( - typeof isEmailOptions.minDomainAtoms === 'undefined' || - Number.isSafeInteger(isEmailOptions.minDomainAtoms) && - isEmailOptions.minDomainAtoms > 0, - 'minDomainAtoms must be a positive integer' - ); - Hoek.assert( - typeof isEmailOptions.errorLevel === 'undefined' || - typeof isEmailOptions.errorLevel === 'boolean' || - ( - Number.isSafeInteger(isEmailOptions.errorLevel) && - isEmailOptions.errorLevel >= 0 - ), - 'errorLevel must be a non-negative integer or boolean' - ); - } + if (validationOptions) { + Hoek.assert(typeof validationOptions === 'object', 'email options must be an object'); - return this._test('email', isEmailOptions, function (value, state, options) { + // Migration validation for unsupported options - Isemail = Isemail || __webpack_require__(30); + Hoek.assert(validationOptions.checkDNS === undefined, 'checkDNS option is not supported'); + Hoek.assert(validationOptions.errorLevel === undefined, 'errorLevel option is not supported'); + Hoek.assert(validationOptions.minDomainAtoms === undefined, 'minDomainAtoms option is not supported, use minDomainSegments instead'); + Hoek.assert(validationOptions.tldBlacklist === undefined, 'tldBlacklist option is not supported, use tlds.deny instead'); + Hoek.assert(validationOptions.tldWhitelist === undefined, 'tldWhitelist option is not supported, use tlds.allow instead'); - try { - const result = Isemail.validate(value, isEmailOptions); - if (result === true || result === 0) { - return value; - } + // Validate options + + if (validationOptions.tlds && + typeof validationOptions.tlds === 'object') { + + Hoek.assert(validationOptions.tlds.allow === undefined || + validationOptions.tlds.allow === false || + validationOptions.tlds.allow === true || + Array.isArray(validationOptions.tlds.allow) || + validationOptions.tlds.allow instanceof Set, 'tlds.allow must be an array, Set, or boolean'); + + Hoek.assert(validationOptions.tlds.deny === undefined || + Array.isArray(validationOptions.tlds.deny) || + validationOptions.tlds.deny instanceof Set, 'tlds.deny must be an array or Set'); + + const normalizeTable = (table) => { + + if (table === undefined || + typeof table === 'boolean' || + table instanceof Set) { + + return table; + } + + return new Set(table); + }; + + validationOptions = Object.assign({}, validationOptions); // Shallow cloned + validationOptions.tlds = { + allow: normalizeTable(validationOptions.tlds.allow), + deny: normalizeTable(validationOptions.tlds.deny) + }; + } + + Hoek.assert(validationOptions.minDomainSegments === undefined || + Number.isSafeInteger(validationOptions.minDomainSegments) && validationOptions.minDomainSegments > 0, 'minDomainSegments must be a positive integer'); + } + + return this._test('email', validationOptions, function (value, state, options) { + + if (Address.email.isValid(value, validationOptions)) { + return value; } - catch (e) { } return this.createError('string.email', { value }, state, options); }); @@ -6793,7 +7157,7 @@ internals.String = class extends Any { } // Make sure we have a set of versions - versions = Hoek.unique(versions); + versions = Array.from(new Set(versions)); regex = Ip.createIpRegex(versions, ipOptions.cidr); } @@ -6967,6 +7331,7 @@ internals.String = class extends Any { if (byteAligned && value.length % 2 !== 0) { return this.createError('string.hexAlign', { value }, state, options); } + return value; } @@ -6995,9 +7360,9 @@ internals.String = class extends Any { // Set validation based on preference. const regex = paddingRequired ? // Padding is required. - /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/ + /^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/ // Padding is optional. - : /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/; + : /^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/; return this._test('base64', regex, function (value, state, options) { @@ -7011,14 +7376,14 @@ internals.String = class extends Any { dataUri(dataUriOptions = {}) { - const regex = /^data:[\w\/\+]+;((charset=[\w-]+|base64),)?(.*)$/; + const regex = /^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/; // Determine if padding is required. const paddingRequired = dataUriOptions.paddingRequired === false ? dataUriOptions.paddingRequired : dataUriOptions.paddingRequired || true; - const base64regex = paddingRequired ? + const base64regex = paddingRequired ? /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/ : /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/; @@ -7199,7 +7564,7 @@ internals.compare = function (type, compare) { compareTo = limit(state.reference || state.parent, options); if (!Number.isSafeInteger(compareTo)) { - return this.createError('string.ref', { ref: limit.key }, state, options); + return this.createError('string.ref', { ref: limit, value: compareTo }, state, options); } } else { @@ -7244,1572 +7609,2115 @@ module.exports = new internals.String(); /***/ }), -/* 27 */ +/* 29 */ /***/ (function(module, exports) { module.exports = require("net"); /***/ }), -/* 28 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Load Modules +const Punycode = __webpack_require__(31); -const RFC3986 = __webpack_require__(12); +const Abnf = __webpack_require__(32); +const Tlds = __webpack_require__(33); -// Declare internals - const internals = { - Uri: { - createUriRegex: function (optionalScheme, allowRelative, relativeOnly, allowQuerySquareBrackets) { - - let scheme = RFC3986.scheme; - let prefix; - - if (relativeOnly) { - prefix = '(?:' + RFC3986.relativeRef + ')'; - } - else { - // If we were passed a scheme, use it instead of the generic one - if (optionalScheme) { - - // Have to put this in a non-capturing group to handle the OR statements - scheme = '(?:' + optionalScheme + ')'; - } - - const withScheme = '(?:' + scheme + ':' + RFC3986.hierPart + ')'; - - prefix = allowRelative ? '(?:' + withScheme + '|' + RFC3986.relativeRef + ')' : withScheme; - } - - /** - * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] - * - * OR - * - * relative-ref = relative-part [ "?" query ] [ "#" fragment ] - */ - return new RegExp('^' + prefix + '(?:\\?' + (allowQuerySquareBrackets ? RFC3986.queryWithSquareBrackets : RFC3986.query) + ')?' + '(?:#' + RFC3986.fragment + ')?$'); - } - } + nonAsciiRx: /[^\x00-\x7f]/, + minDomainSegments: 2, + defaultTlds: { allow: Tlds, deny: null } }; -module.exports = internals.Uri; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { +module.exports = { + email: { + analyze: function (email, options) { -"use strict"; + return internals.email(email, options); + }, + isValid: function (email, options) { + return !internals.email(email, options); + } + }, + domain: { + analyze: function (domain, options = {}) { -// Load modules + internals.options(domain, options); -const RFC3986 = __webpack_require__(12); + if (!domain) { + return internals.error('Domain must be a non-empty string'); + } + if (domain.length > 256) { + return internals.error('Domain too long'); + } -// Declare internals + const ascii = !internals.nonAsciiRx.test(domain); + if (!ascii) { + if (options.allowUnicode === false) { // Defaults to true + return internals.error('Domain contains forbidden Unicode characters'); + } -const internals = { - Ip: { - cidrs: { - ipv4: { - required: '\\/(?:' + RFC3986.ipv4Cidr + ')', - optional: '(?:\\/(?:' + RFC3986.ipv4Cidr + '))?', - forbidden: '' - }, - ipv6: { - required: '\\/' + RFC3986.ipv6Cidr, - optional: '(?:\\/' + RFC3986.ipv6Cidr + ')?', - forbidden: '' - }, - ipvfuture: { - required: '\\/' + RFC3986.ipv6Cidr, - optional: '(?:\\/' + RFC3986.ipv6Cidr + ')?', - forbidden: '' + const normalized = domain.normalize('NFC'); + domain = Punycode.toASCII(normalized); } - }, - versions: { - ipv4: RFC3986.IPv4address, - ipv6: RFC3986.IPv6address, - ipvfuture: RFC3986.IPvFuture - } - } -}; - -internals.Ip.createIpRegex = function (versions, cidr) { + return internals.domain(domain, options); + }, + isValid: function (domain, options) { - let regex; - for (let i = 0; i < versions.length; ++i) { - const version = versions[i]; - if (!regex) { - regex = '^(?:' + internals.Ip.versions[version] + internals.Ip.cidrs[version][cidr]; - } - else { - regex += '|' + internals.Ip.versions[version] + internals.Ip.cidrs[version][cidr]; + return !module.exports.domain.analyze(domain, options); } } - - return new RegExp(regex + ')$'); }; -module.exports = internals.Ip; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// Load modules - -const Punycode = __webpack_require__(31); -const Util = __webpack_require__(6); - -// Declare internals -const internals = { - hasOwn: Object.prototype.hasOwnProperty, - indexOf: Array.prototype.indexOf, - defaultThreshold: 16, - maxIPv6Groups: 8, - - categories: { - valid: 1, - dnsWarn: 7, - rfc5321: 15, - cfws: 31, - deprecated: 63, - rfc5322: 127, - error: 255 - }, +internals.email = function (email, options = {}) { - diagnoses: { - - // Address is valid - - valid: 0, - - // Address is valid for SMTP but has unusual elements - - rfc5321TLD: 9, - rfc5321TLDNumeric: 10, - rfc5321QuotedString: 11, - rfc5321AddressLiteral: 12, - - // Address is valid for message, but must be modified for envelope - - cfwsComment: 17, - cfwsFWS: 18, - - // Address contains non-ASCII when the allowUnicode option is false - // Has to be > internals.defaultThreshold so that it's rejected - // without an explicit errorLevel: - undesiredNonAscii: 25, - - // Address contains deprecated elements, but may still be valid in some contexts - - deprecatedLocalPart: 33, - deprecatedFWS: 34, - deprecatedQTEXT: 35, - deprecatedQP: 36, - deprecatedComment: 37, - deprecatedCTEXT: 38, - deprecatedIPv6: 39, - deprecatedCFWSNearAt: 49, - - // Address is only valid according to broad definition in RFC 5322, but is otherwise invalid - - rfc5322Domain: 65, - rfc5322TooLong: 66, - rfc5322LocalTooLong: 67, - rfc5322DomainTooLong: 68, - rfc5322LabelTooLong: 69, - rfc5322DomainLiteral: 70, - rfc5322DomainLiteralOBSDText: 71, - rfc5322IPv6GroupCount: 72, - rfc5322IPv62x2xColon: 73, - rfc5322IPv6BadCharacter: 74, - rfc5322IPv6MaxGroups: 75, - rfc5322IPv6ColonStart: 76, - rfc5322IPv6ColonEnd: 77, - - // Address is invalid for any purpose - - errExpectingDTEXT: 129, - errNoLocalPart: 130, - errNoDomain: 131, - errConsecutiveDots: 132, - errATEXTAfterCFWS: 133, - errATEXTAfterQS: 134, - errATEXTAfterDomainLiteral: 135, - errExpectingQPair: 136, - errExpectingATEXT: 137, - errExpectingQTEXT: 138, - errExpectingCTEXT: 139, - errBackslashEnd: 140, - errDotStart: 141, - errDotEnd: 142, - errDomainHyphenStart: 143, - errDomainHyphenEnd: 144, - errUnclosedQuotedString: 145, - errUnclosedComment: 146, - errUnclosedDomainLiteral: 147, - errFWSCRLFx2: 148, - errFWSCRLFEnd: 149, - errCRNoLF: 150, - errUnknownTLD: 160, - errDomainTooShort: 161 - }, + internals.options(email, options); - components: { - localpart: 0, - domain: 1, - literal: 2, - contextComment: 3, - contextFWS: 4, - contextQuotedString: 5, - contextQuotedPair: 6 + if (!email) { + return internals.error('Address must be a non-empty string'); } -}; - -internals.specials = function () { + // Unicode - const specials = '()<>[]:;@\\,."'; // US-ASCII visible characters not valid for atext (http://tools.ietf.org/html/rfc5322#section-3.2.3) - const lookup = new Array(0x100); - lookup.fill(false); + const ascii = !internals.nonAsciiRx.test(email); + if (!ascii) { + if (options.allowUnicode === false) { // Defaults to true + return internals.error('Address contains forbidden Unicode characters'); + } - for (let i = 0; i < specials.length; ++i) { - lookup[specials.codePointAt(i)] = true; + const normalized = email.normalize('NFC'); + email = Punycode.toASCII(normalized); } - return function (code) { - - return lookup[code]; - }; -}(); - -internals.c0Controls = function () { - - const lookup = new Array(0x100); - lookup.fill(false); + // Basic structure - // add C0 control characters - - for (let i = 0; i < 33; ++i) { - lookup[i] = true; + const parts = email.split('@'); + if (parts.length !== 2) { + return internals.error(parts.length > 2 ? 'Address cannot contain more than one @ character' : 'Address must contain one @ character'); } - return function (code) { - - return lookup[code]; - }; -}(); - -internals.c1Controls = function () { + const local = parts[0]; + const domain = parts[1]; - const lookup = new Array(0x100); - lookup.fill(false); - - // add C1 control characters - - for (let i = 127; i < 160; ++i) { - lookup[i] = true; + if (!local) { + return internals.error('Address local part cannot be empty'); } - return function (code) { - - return lookup[code]; - }; -}(); - -internals.regex = { - ipV4: /\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, - ipV6: /^[a-fA-F\d]{0,4}$/ -}; + if (!domain) { + return internals.error('Domain cannot be empty'); + } -internals.normalizeSupportsNul = '\0'.normalize('NFC') === '\0'; + if (email.length > 254) { // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.3 + return internals.error('Address too long'); + } + if (Buffer.byteLength(local, 'utf-8') > 64) { // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.1 + return internals.error('Address local part too long'); + } -// $lab:coverage:off$ -internals.nulNormalize = function (email) { + // Validate parts - return email.split('\0').map((part) => part.normalize('NFC')).join('\0'); + return internals.local(local, ascii) || internals.domain(domain, options); }; -// $lab:coverage:on$ - - -internals.normalize = function (email) { - // $lab:coverage:off$ - if (!internals.normalizeSupportsNul && email.indexOf('\0') >= 0) { - return internals.nulNormalize(email); - } - // $lab:coverage:on$ - - return email.normalize('NFC'); -}; +internals.options = function (value, options) { -internals.checkIpV6 = function (items) { + // Options validation - return items.every((value) => internals.regex.ipV6.test(value)); -}; + if (options.tlds && + options.tlds !== true) { + if (typeof options.tlds !== 'object') { + throw new Error('Invalid options: tlds must be a boolean or an object'); + } -// Node 10 introduced isSet and isMap, which are useful for cross-context type -// checking. -// $lab:coverage:off$ -internals._isSet = (value) => value instanceof Set; -internals._isMap = (value) => value instanceof Map; -internals.isSet = Util.types && Util.types.isSet || internals._isSet; -internals.isMap = Util.types && Util.types.isMap || internals._isMap; -// $lab:coverage:on$ + if (options.tlds.allow !== undefined && + options.tlds.allow !== true && + options.tlds.allow instanceof Set === false) { + throw new Error('Invalid options: tlds.allow must be a Set object or true'); + } -/** - * Normalize the given lookup "table" to an iterator. Outputs items in arrays - * and sets, keys from maps (regardless of the corresponding value), and own - * enumerable keys from all other objects (intended to be plain objects). - * - * @param {*} table The table to convert. - * @returns {Iterable<*>} The converted table. - */ -internals.normalizeTable = function (table) { + if (options.tlds.deny) { + if (options.tlds.deny instanceof Set === false) { + throw new Error('Invalid options: tlds.deny must be a Set object'); + } - if (internals.isSet(table) || Array.isArray(table)) { - return table; + if (options.tlds.allow instanceof Set) { + throw new Error('Invalid options: cannot specify both tlds.allow and tlds.deny lists'); + } + } } - if (internals.isMap(table)) { - return table.keys(); - } + // Input validation - return Object.keys(table); + if (typeof value !== 'string') { + throw new Error('Invalid input: value must be a string'); + } }; -/** - * Convert the given domain atom to its canonical form using Nameprep and string - * lowercasing. Domain atoms that are all-ASCII will not undergo any changes via - * Nameprep, and domain atoms that have already been canonicalized will not be - * altered. - * - * @param {string} atom The atom to canonicalize. - * @returns {string} The canonicalized atom. - */ -internals.canonicalizeAtom = function (atom) { - - return Punycode.toASCII(atom).toLowerCase(); -}; +internals.local = function (local, ascii) { + const segments = local.split('.'); + for (const segment of segments) { + if (!segment.length) { + return internals.error('Address local part contains empty dot-separated segment'); + } -/** - * Check whether any of the values in the given iterable, when passed through - * the iteratee function, are equal to the given value. - * - * @param {Iterable<*>} iterable The iterable to check. - * @param {function(*): *} iteratee The iteratee that receives each item from - * the iterable. - * @param {*} value The reference value. - * @returns {boolean} Whether the given value matches any of the items in the - * iterable per the iteratee. - */ -internals.includesMapped = function (iterable, iteratee, value) { - - for (const item of iterable) { - if (value === iteratee(item)) { - return true; + if (ascii) { + if (!Abnf.atextRx.test(segment)) { + return internals.error('Address local part contains invalid character'); + } + } + else { + for (const char of segment) { + const binary = Buffer.from(char).toString('binary'); + if (!Abnf.atomRx.test(binary)) { + return internals.error('Address local part contains invalid character'); + } + } } } - return false; }; -/** - * Check whether the given top-level domain atom is valid based on the - * configured blacklist/whitelist. - * - * @param {string} tldAtom The atom to check. - * @param {Object} options - * {*} tldBlacklist The set of domains to consider invalid. - * {*} tldWhitelist The set of domains to consider valid. - * @returns {boolean} Whether the given domain atom is valid per the blacklist/ - * whitelist. - */ -internals.validDomain = function (tldAtom, options) { - - // Nameprep handles case-sensitive unicode stuff, but doesn't touch - // uppercase ASCII characters. - const canonicalTldAtom = internals.canonicalizeAtom(tldAtom); - - if (options.tldBlacklist) { - return !internals.includesMapped( - internals.normalizeTable(options.tldBlacklist), - internals.canonicalizeAtom, canonicalTldAtom); - } - - return internals.includesMapped( - internals.normalizeTable(options.tldWhitelist), - internals.canonicalizeAtom, canonicalTldAtom); -}; +internals.tldSegmentRx = /^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/; -/** - * Check that an email address conforms to RFCs 5321, 5322, 6530 and others - * - * We distinguish clearly between a Mailbox as defined by RFC 5321 and an - * addr-spec as defined by RFC 5322. Depending on the context, either can be - * regarded as a valid email address. The RFC 5321 Mailbox specification is - * more restrictive (comments, white space and obsolete forms are not allowed). - * - * @param {string} email The email address to check. See README for specifics. - * @param {Object} options The (optional) options: - * {*} errorLevel Determines the boundary between valid and invalid - * addresses. - * {*} tldBlacklist The set of domains to consider invalid. - * {*} tldWhitelist The set of domains to consider valid. - * {*} allowUnicode Whether to allow non-ASCII characters, defaults to true. - * {*} minDomainAtoms The minimum number of domain atoms which must be present - * for the address to be valid. - * @param {function(number|boolean)} callback The (optional) callback handler. - * @return {*} - */ - -exports.validate = internals.validate = function (email, options, callback) { +internals.domainSegmentRx = /^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/; - options = options || {}; - email = internals.normalize(email); - // The callback function is deprecated. - // $lab:coverage:off$ - if (typeof options === 'function') { - callback = options; - options = {}; - } +internals.domain = function (domain, options) { - if (typeof callback !== 'function') { - callback = null; - } - // $lab:coverage:on$ + // https://tools.ietf.org/html/rfc1035 section 2.3.1 - let diagnose; - let threshold; + const minDomainSegments = (options.minDomainSegments || internals.minDomainSegments); - if (typeof options.errorLevel === 'number') { - diagnose = true; - threshold = options.errorLevel; - } - else { - diagnose = !!options.errorLevel; - threshold = internals.diagnoses.valid; + const segments = domain.split('.'); + if (segments.length < minDomainSegments) { + return internals.error('Domain lacks the minimum required number of segments'); } - if (options.tldWhitelist) { - if (typeof options.tldWhitelist === 'string') { - options.tldWhitelist = [options.tldWhitelist]; - } - else if (typeof options.tldWhitelist !== 'object') { - throw new TypeError('expected array or object tldWhitelist'); - } - } + const tlds = internals.tlds(options); + if (tlds) { + const tld = segments[segments.length - 1].toLowerCase(); + if (tlds.deny && tlds.deny.has(tld) || + tlds.allow && !tlds.allow.has(tld)) { - if (options.tldBlacklist) { - if (typeof options.tldBlacklist === 'string') { - options.tldBlacklist = [options.tldBlacklist]; - } - else if (typeof options.tldBlacklist !== 'object') { - throw new TypeError('expected array or object tldBlacklist'); + return internals.error('Domain uses forbidden TLD'); } } - if (options.minDomainAtoms && (options.minDomainAtoms !== ((+options.minDomainAtoms) | 0) || options.minDomainAtoms < 0)) { - throw new TypeError('expected positive integer minDomainAtoms'); - } + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; - let maxResult = internals.diagnoses.valid; - const updateResult = (value) => { + if (!segment.length) { + return internals.error('Domain contains empty dot-separated segment'); + } - if (value > maxResult) { - maxResult = value; + if (segment.length > 63) { + return internals.error('Domain contains dot-separated segment that is too long'); } - }; - const allowUnicode = options.allowUnicode === undefined || !!options.allowUnicode; - if (!allowUnicode && /[^\x00-\x7f]/.test(email)) { - updateResult(internals.diagnoses.undesiredNonAscii); + if (i < segments.length - 1) { + if (!internals.domainSegmentRx.test(segment)) { + return internals.error('Domain contains invalid character'); + } + } + else { + if (!internals.tldSegmentRx.test(segment)) { + return internals.error('Domain contains invalid tld character'); + } + } } +}; - const context = { - now: internals.components.localpart, - prev: internals.components.localpart, - stack: [internals.components.localpart] - }; - let prevToken = ''; +internals.tlds = function (options) { - const parseData = { - local: '', - domain: '' - }; - const atomData = { - locals: [''], - domains: [''] - }; + if (options.tlds === false) { // Defaults to true + return null; + } - let elementCount = 0; - let elementLength = 0; - let crlfCount = 0; - let charCode; + if (!options.tlds || + options.tlds === true) { - let hyphenFlag = false; - let assertEnd = false; - - const emailLength = email.length; - - let token; // Token is used outside the loop, must declare similarly - for (let i = 0; i < emailLength; i += token.length) { - // Utilize codepoints to account for Unicode surrogate pairs - token = String.fromCodePoint(email.codePointAt(i)); - - switch (context.now) { - // Local-part - case internals.components.localpart: - // http://tools.ietf.org/html/rfc5322#section-3.4.1 - // local-part = dot-atom / quoted-string / obs-local-part - // - // dot-atom = [CFWS] dot-atom-text [CFWS] - // - // dot-atom-text = 1*atext *("." 1*atext) - // - // quoted-string = [CFWS] - // DQUOTE *([FWS] qcontent) [FWS] DQUOTE - // [CFWS] - // - // obs-local-part = word *("." word) - // - // word = atom / quoted-string - // - // atom = [CFWS] 1*atext [CFWS] - switch (token) { - // Comment - case '(': - if (elementLength === 0) { - // Comments are OK at the beginning of an element - updateResult(elementCount === 0 ? internals.diagnoses.cfwsComment : internals.diagnoses.deprecatedComment); - } - else { - updateResult(internals.diagnoses.cfwsComment); - // Cannot start a comment in an element, should be end - assertEnd = true; - } + return internals.defaultTlds; + } - context.stack.push(context.now); - context.now = internals.components.contextComment; - break; + return { + allow: options.tlds.allow === true ? null : options.tlds.allow || Tlds, + deny: options.tlds.deny || null + }; +}; - // Next dot-atom element - case '.': - if (elementLength === 0) { - // Another dot, already? - updateResult(elementCount === 0 ? internals.diagnoses.errDotStart : internals.diagnoses.errConsecutiveDots); - } - else { - // The entire local-part can be a quoted string for RFC 5321; if one atom is quoted it's an RFC 5322 obsolete form - if (assertEnd) { - updateResult(internals.diagnoses.deprecatedLocalPart); - } - // CFWS & quoted strings are OK again now we're at the beginning of an element (although they are obsolete forms) - assertEnd = false; - elementLength = 0; - ++elementCount; - parseData.local += token; - atomData.locals[elementCount] = ''; - } +internals.error = function (reason) { - break; + return { error: reason }; +}; - // Quoted string - case '"': - if (elementLength === 0) { - // The entire local-part can be a quoted string for RFC 5321; if one atom is quoted it's an RFC 5322 obsolete form - updateResult(elementCount === 0 ? internals.diagnoses.rfc5321QuotedString : internals.diagnoses.deprecatedLocalPart); - parseData.local += token; - atomData.locals[elementCount] += token; - elementLength += Buffer.byteLength(token, 'utf8'); +/***/ }), +/* 31 */ +/***/ (function(module, exports) { - // Quoted string must be the entire element - assertEnd = true; - context.stack.push(context.now); - context.now = internals.components.contextQuotedString; - } - else { - updateResult(internals.diagnoses.errExpectingATEXT); - } +module.exports = require("punycode"); - break; +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { - // Folding white space - case '\r': - if (emailLength === ++i || email[i] !== '\n') { - // Fatal error - updateResult(internals.diagnoses.errCRNoLF); - break; - } +"use strict"; - // Fallthrough - case ' ': - case '\t': - if (elementLength === 0) { - updateResult(elementCount === 0 ? internals.diagnoses.cfwsFWS : internals.diagnoses.deprecatedFWS); - } - else { - // We can't start FWS in the middle of an element, better be end - assertEnd = true; - } +const internals = {}; - context.stack.push(context.now); - context.now = internals.components.contextFWS; - prevToken = token; - break; - case '@': - // At this point we should have a valid local-part - // $lab:coverage:off$ - if (context.stack.length !== 1) { - throw new Error('unexpected item on context stack'); - } - // $lab:coverage:on$ +/* + From RFC 5321: - if (parseData.local.length === 0) { - // Fatal error - updateResult(internals.diagnoses.errNoLocalPart); - } - else if (elementLength === 0) { - // Fatal error - updateResult(internals.diagnoses.errDotEnd); - } - // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.1 the maximum total length of a user name or other local-part is 64 - // octets - else if (Buffer.byteLength(parseData.local, 'utf8') > 64) { - updateResult(internals.diagnoses.rfc5322LocalTooLong); - } - // http://tools.ietf.org/html/rfc5322#section-3.4.1 comments and folding white space SHOULD NOT be used around "@" in the - // addr-spec - // - // http://tools.ietf.org/html/rfc2119 - // 4. SHOULD NOT this phrase, or the phrase "NOT RECOMMENDED" mean that there may exist valid reasons in particular - // circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood - // and the case carefully weighed before implementing any behavior described with this label. - else if (context.prev === internals.components.contextComment || context.prev === internals.components.contextFWS) { - updateResult(internals.diagnoses.deprecatedCFWSNearAt); - } + Mailbox = Local-part "@" ( Domain / address-literal ) - // Clear everything down for the domain parsing - context.now = internals.components.domain; - context.stack[0] = internals.components.domain; - elementCount = 0; - elementLength = 0; - assertEnd = false; // CFWS can only appear at the end of the element - break; + Local-part = Dot-string / Quoted-string + Dot-string = Atom *("." Atom) + Atom = 1*atext + atext = ALPHA / DIGIT / "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~" - // ATEXT - default: - // http://tools.ietf.org/html/rfc5322#section-3.2.3 - // atext = ALPHA / DIGIT / ; Printable US-ASCII - // "!" / "#" / ; characters not including - // "$" / "%" / ; specials. Used for atoms. - // "&" / "'" / - // "*" / "+" / - // "-" / "/" / - // "=" / "?" / - // "^" / "_" / - // "`" / "{" / - // "|" / "}" / - // "~" - if (assertEnd) { - // We have encountered atext where it is no longer valid - switch (context.prev) { - case internals.components.contextComment: - case internals.components.contextFWS: - updateResult(internals.diagnoses.errATEXTAfterCFWS); - break; - - case internals.components.contextQuotedString: - updateResult(internals.diagnoses.errATEXTAfterQS); - break; - - // $lab:coverage:off$ - default: - throw new Error('more atext found where none is allowed, but unrecognized prev context: ' + context.prev); - // $lab:coverage:on$ - } - } - else { - context.prev = context.now; - charCode = token.codePointAt(0); + Domain = sub-domain *("." sub-domain) + sub-domain = Let-dig [Ldh-str] + Let-dig = ALPHA / DIGIT + Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig - // Especially if charCode == 10 - if (internals.specials(charCode) || internals.c0Controls(charCode) || internals.c1Controls(charCode)) { + ALPHA = %x41-5A / %x61-7A ; a-z, A-Z + DIGIT = %x30-39 ; 0-9 - // Fatal error - updateResult(internals.diagnoses.errExpectingATEXT); - } + From RFC 6531: - parseData.local += token; - atomData.locals[elementCount] += token; - elementLength += Buffer.byteLength(token, 'utf8'); - } - } + sub-domain =/ U-label + atext =/ UTF8-non-ascii - break; + UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4 - case internals.components.domain: - // http://tools.ietf.org/html/rfc5322#section-3.4.1 - // domain = dot-atom / domain-literal / obs-domain - // - // dot-atom = [CFWS] dot-atom-text [CFWS] - // - // dot-atom-text = 1*atext *("." 1*atext) - // - // domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS] - // - // dtext = %d33-90 / ; Printable US-ASCII - // %d94-126 / ; characters not including - // obs-dtext ; "[", "]", or "\" - // - // obs-domain = atom *("." atom) - // - // atom = [CFWS] 1*atext [CFWS] - - // http://tools.ietf.org/html/rfc5321#section-4.1.2 - // Mailbox = Local-part "@" ( Domain / address-literal ) - // - // Domain = sub-domain *("." sub-domain) - // - // address-literal = "[" ( IPv4-address-literal / - // IPv6-address-literal / - // General-address-literal ) "]" - // ; See Section 4.1.3 - - // http://tools.ietf.org/html/rfc5322#section-3.4.1 - // Note: A liberal syntax for the domain portion of addr-spec is - // given here. However, the domain portion contains addressing - // information specified by and used in other protocols (e.g., - // [RFC1034], [RFC1035], [RFC1123], [RFC5321]). It is therefore - // incumbent upon implementations to conform to the syntax of - // addresses for the context in which they are used. - // - // is_email() author's note: it's not clear how to interpret this in - // he context of a general email address validator. The conclusion I - // have reached is this: "addressing information" must comply with - // RFC 5321 (and in turn RFC 1035), anything that is "semantically - // invisible" must comply only with RFC 5322. - switch (token) { - // Comment - case '(': - if (elementLength === 0) { - // Comments at the start of the domain are deprecated in the text, comments at the start of a subdomain are obs-domain - // http://tools.ietf.org/html/rfc5322#section-3.4.1 - updateResult(elementCount === 0 ? internals.diagnoses.deprecatedCFWSNearAt : internals.diagnoses.deprecatedComment); - } - else { - // We can't start a comment mid-element, better be at the end - assertEnd = true; - updateResult(internals.diagnoses.cfwsComment); - } + UTF8-2 = %xC2-DF UTF8-tail + UTF8-3 = %xE0 %xA0-BF UTF8-tail / + %xE1-EC 2( UTF8-tail ) / + %xED %x80-9F UTF8-tail / + %xEE-EF 2( UTF8-tail ) + UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / + %xF1-F3 3( UTF8-tail ) / + %xF4 %x80-8F 2( UTF8-tail ) - context.stack.push(context.now); - context.now = internals.components.contextComment; - break; + UTF8-tail = %x80-BF - // Next dot-atom element - case '.': - const punycodeLength = Punycode.encode(atomData.domains[elementCount]).length; - if (elementLength === 0) { - // Another dot, already? Fatal error. - updateResult(elementCount === 0 ? internals.diagnoses.errDotStart : internals.diagnoses.errConsecutiveDots); - } - else if (hyphenFlag) { - // Previous subdomain ended in a hyphen. Fatal error. - updateResult(internals.diagnoses.errDomainHyphenEnd); - } - else if (punycodeLength > 63) { - // RFC 5890 specifies that domain labels that are encoded using the Punycode algorithm - // must adhere to the <= 63 octet requirement. - // This includes string prefixes from the Punycode algorithm. - // - // https://tools.ietf.org/html/rfc5890#section-2.3.2.1 - // labels 63 octets or less - - updateResult(internals.diagnoses.rfc5322LabelTooLong); - } + Note: The following are not supported: - // CFWS is OK again now we're at the beginning of an element (although - // it may be obsolete CFWS) - assertEnd = false; - elementLength = 0; - ++elementCount; - atomData.domains[elementCount] = ''; - parseData.domain += token; + RFC 5321: address-literal, Quoted-string + RFC 5322: obs-*, CFWS +*/ - break; - // Domain literal - case '[': - if (parseData.domain.length === 0) { - // Domain literal must be the only component - assertEnd = true; - elementLength += Buffer.byteLength(token, 'utf8'); - context.stack.push(context.now); - context.now = internals.components.literal; - parseData.domain += token; - atomData.domains[elementCount] += token; - parseData.literal = ''; - } - else { - // Fatal error - updateResult(internals.diagnoses.errExpectingATEXT); - } +internals.atext = '[\\w!#\\$%&\'\\*\\+\\-/=\\?\\^`\\{\\|\\}~]'; // _ included in \w - break; - // Folding white space - case '\r': - if (emailLength === ++i || email[i] !== '\n') { - // Fatal error - updateResult(internals.diagnoses.errCRNoLF); - break; - } +exports.atextRx = new RegExp(`^${internals.atext}+$`); - // Fallthrough - case ' ': - case '\t': - if (elementLength === 0) { - updateResult(elementCount === 0 ? internals.diagnoses.deprecatedCFWSNearAt : internals.diagnoses.deprecatedFWS); - } - else { - // We can't start FWS in the middle of an element, so this better be the end - updateResult(internals.diagnoses.cfwsFWS); - assertEnd = true; - } +exports.atomRx = new RegExp([ - context.stack.push(context.now); - context.now = internals.components.contextFWS; - prevToken = token; - break; + internals.atext, - // This must be ATEXT - default: - // RFC 5322 allows any atext... - // http://tools.ietf.org/html/rfc5322#section-3.2.3 - // atext = ALPHA / DIGIT / ; Printable US-ASCII - // "!" / "#" / ; characters not including - // "$" / "%" / ; specials. Used for atoms. - // "&" / "'" / - // "*" / "+" / - // "-" / "/" / - // "=" / "?" / - // "^" / "_" / - // "`" / "{" / - // "|" / "}" / - // "~" - - // But RFC 5321 only allows letter-digit-hyphen to comply with DNS rules - // (RFCs 1034 & 1123) - // http://tools.ietf.org/html/rfc5321#section-4.1.2 - // sub-domain = Let-dig [Ldh-str] - // - // Let-dig = ALPHA / DIGIT - // - // Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig - // - if (assertEnd) { - // We have encountered ATEXT where it is no longer valid - switch (context.prev) { - case internals.components.contextComment: - case internals.components.contextFWS: - updateResult(internals.diagnoses.errATEXTAfterCFWS); - break; - - case internals.components.literal: - updateResult(internals.diagnoses.errATEXTAfterDomainLiteral); - break; - - // $lab:coverage:off$ - default: - throw new Error('more atext found where none is allowed, but unrecognized prev context: ' + context.prev); - // $lab:coverage:on$ - } - } + // %xC2-DF UTF8-tail + '(?:[\\xc2-\\xdf][\\x80-\\xbf])', - charCode = token.codePointAt(0); - // Assume this token isn't a hyphen unless we discover it is - hyphenFlag = false; + // %xE0 %xA0-BF UTF8-tail %xE1-EC 2( UTF8-tail ) %xED %x80-9F UTF8-tail %xEE-EF 2( UTF8-tail ) + '(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})', - if (internals.specials(charCode) || internals.c0Controls(charCode) || internals.c1Controls(charCode)) { - // Fatal error - updateResult(internals.diagnoses.errExpectingATEXT); - } - else if (token === '-') { - if (elementLength === 0) { - // Hyphens cannot be at the beginning of a subdomain, fatal error - updateResult(internals.diagnoses.errDomainHyphenStart); - } + // %xF0 %x90-BF 2( UTF8-tail ) %xF1-F3 3( UTF8-tail ) %xF4 %x80-8F 2( UTF8-tail ) + '(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})' - hyphenFlag = true; - } - // Check if it's a neither a number nor a latin/unicode letter - else if (charCode < 48 || (charCode > 122 && charCode < 192) || (charCode > 57 && charCode < 65) || (charCode > 90 && charCode < 97)) { - // This is not an RFC 5321 subdomain, but still OK by RFC 5322 - updateResult(internals.diagnoses.rfc5322Domain); - } +].join('|')); - parseData.domain += token; - atomData.domains[elementCount] += token; - elementLength += Buffer.byteLength(token, 'utf8'); - } - break; +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { - // Domain literal - case internals.components.literal: - // http://tools.ietf.org/html/rfc5322#section-3.4.1 - // domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS] - // - // dtext = %d33-90 / ; Printable US-ASCII - // %d94-126 / ; characters not including - // obs-dtext ; "[", "]", or "\" - // - // obs-dtext = obs-NO-WS-CTL / quoted-pair - switch (token) { - // End of domain literal - case ']': - if (maxResult < internals.categories.deprecated) { - // Could be a valid RFC 5321 address literal, so let's check - - // http://tools.ietf.org/html/rfc5321#section-4.1.2 - // address-literal = "[" ( IPv4-address-literal / - // IPv6-address-literal / - // General-address-literal ) "]" - // ; See Section 4.1.3 - // - // http://tools.ietf.org/html/rfc5321#section-4.1.3 - // IPv4-address-literal = Snum 3("." Snum) - // - // IPv6-address-literal = "IPv6:" IPv6-addr - // - // General-address-literal = Standardized-tag ":" 1*dcontent - // - // Standardized-tag = Ldh-str - // ; Standardized-tag MUST be specified in a - // ; Standards-Track RFC and registered with IANA - // - // dcontent = %d33-90 / ; Printable US-ASCII - // %d94-126 ; excl. "[", "\", "]" - // - // Snum = 1*3DIGIT - // ; representing a decimal integer - // ; value in the range 0 through 255 - // - // IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp - // - // IPv6-hex = 1*4HEXDIG - // - // IPv6-full = IPv6-hex 7(":" IPv6-hex) - // - // IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::" - // [IPv6-hex *5(":" IPv6-hex)] - // ; The "::" represents at least 2 16-bit groups of - // ; zeros. No more than 6 groups in addition to the - // ; "::" may be present. - // - // IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal - // - // IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::" - // [IPv6-hex *3(":" IPv6-hex) ":"] - // IPv4-address-literal - // ; The "::" represents at least 2 16-bit groups of - // ; zeros. No more than 4 groups in addition to the - // ; "::" and IPv4-address-literal may be present. - - let index = -1; - let addressLiteral = parseData.literal; - const matchesIP = internals.regex.ipV4.exec(addressLiteral); - - // Maybe extract IPv4 part from the end of the address-literal - if (matchesIP) { - index = matchesIP.index; - if (index !== 0) { - // Convert IPv4 part to IPv6 format for futher testing - addressLiteral = addressLiteral.slice(0, index) + '0:0'; - } - } +"use strict"; - if (index === 0) { - // Nothing there except a valid IPv4 address, so... - updateResult(internals.diagnoses.rfc5321AddressLiteral); - } - else if (addressLiteral.slice(0, 5).toLowerCase() !== 'ipv6:') { - updateResult(internals.diagnoses.rfc5322DomainLiteral); - } - else { - const match = addressLiteral.slice(5); - let maxGroups = internals.maxIPv6Groups; - const groups = match.split(':'); - index = match.indexOf('::'); - - if (!~index) { - // Need exactly the right number of groups - if (groups.length !== maxGroups) { - updateResult(internals.diagnoses.rfc5322IPv6GroupCount); - } - } - else if (index !== match.lastIndexOf('::')) { - updateResult(internals.diagnoses.rfc5322IPv62x2xColon); - } - else { - if (index === 0 || index === match.length - 2) { - // RFC 4291 allows :: at the start or end of an address with 7 other groups in addition - ++maxGroups; - } - - if (groups.length > maxGroups) { - updateResult(internals.diagnoses.rfc5322IPv6MaxGroups); - } - else if (groups.length === maxGroups) { - // Eliding a single "::" - updateResult(internals.diagnoses.deprecatedIPv6); - } - } - // IPv6 testing strategy - if (match[0] === ':' && match[1] !== ':') { - updateResult(internals.diagnoses.rfc5322IPv6ColonStart); - } - else if (match[match.length - 1] === ':' && match[match.length - 2] !== ':') { - updateResult(internals.diagnoses.rfc5322IPv6ColonEnd); - } - else if (internals.checkIpV6(groups)) { - updateResult(internals.diagnoses.rfc5321AddressLiteral); - } - else { - updateResult(internals.diagnoses.rfc5322IPv6BadCharacter); - } - } - } - else { - updateResult(internals.diagnoses.rfc5322DomainLiteral); - } +const internals = {}; - parseData.domain += token; - atomData.domains[elementCount] += token; - elementLength += Buffer.byteLength(token, 'utf8'); - context.prev = context.now; - context.now = context.stack.pop(); - break; - case '\\': - updateResult(internals.diagnoses.rfc5322DomainLiteralOBSDText); - context.stack.push(context.now); - context.now = internals.components.contextQuotedPair; - break; +// http://data.iana.org/TLD/tlds-alpha-by-domain.txt +// # Version 2019032300, Last Updated Sat Mar 23 07:07:02 2019 UTC + + +internals.tlds = [ + 'AAA', + 'AARP', + 'ABARTH', + 'ABB', + 'ABBOTT', + 'ABBVIE', + 'ABC', + 'ABLE', + 'ABOGADO', + 'ABUDHABI', + 'AC', + 'ACADEMY', + 'ACCENTURE', + 'ACCOUNTANT', + 'ACCOUNTANTS', + 'ACO', + 'ACTOR', + 'AD', + 'ADAC', + 'ADS', + 'ADULT', + 'AE', + 'AEG', + 'AERO', + 'AETNA', + 'AF', + 'AFAMILYCOMPANY', + 'AFL', + 'AFRICA', + 'AG', + 'AGAKHAN', + 'AGENCY', + 'AI', + 'AIG', + 'AIGO', + 'AIRBUS', + 'AIRFORCE', + 'AIRTEL', + 'AKDN', + 'AL', + 'ALFAROMEO', + 'ALIBABA', + 'ALIPAY', + 'ALLFINANZ', + 'ALLSTATE', + 'ALLY', + 'ALSACE', + 'ALSTOM', + 'AM', + 'AMERICANEXPRESS', + 'AMERICANFAMILY', + 'AMEX', + 'AMFAM', + 'AMICA', + 'AMSTERDAM', + 'ANALYTICS', + 'ANDROID', + 'ANQUAN', + 'ANZ', + 'AO', + 'AOL', + 'APARTMENTS', + 'APP', + 'APPLE', + 'AQ', + 'AQUARELLE', + 'AR', + 'ARAB', + 'ARAMCO', + 'ARCHI', + 'ARMY', + 'ARPA', + 'ART', + 'ARTE', + 'AS', + 'ASDA', + 'ASIA', + 'ASSOCIATES', + 'AT', + 'ATHLETA', + 'ATTORNEY', + 'AU', + 'AUCTION', + 'AUDI', + 'AUDIBLE', + 'AUDIO', + 'AUSPOST', + 'AUTHOR', + 'AUTO', + 'AUTOS', + 'AVIANCA', + 'AW', + 'AWS', + 'AX', + 'AXA', + 'AZ', + 'AZURE', + 'BA', + 'BABY', + 'BAIDU', + 'BANAMEX', + 'BANANAREPUBLIC', + 'BAND', + 'BANK', + 'BAR', + 'BARCELONA', + 'BARCLAYCARD', + 'BARCLAYS', + 'BAREFOOT', + 'BARGAINS', + 'BASEBALL', + 'BASKETBALL', + 'BAUHAUS', + 'BAYERN', + 'BB', + 'BBC', + 'BBT', + 'BBVA', + 'BCG', + 'BCN', + 'BD', + 'BE', + 'BEATS', + 'BEAUTY', + 'BEER', + 'BENTLEY', + 'BERLIN', + 'BEST', + 'BESTBUY', + 'BET', + 'BF', + 'BG', + 'BH', + 'BHARTI', + 'BI', + 'BIBLE', + 'BID', + 'BIKE', + 'BING', + 'BINGO', + 'BIO', + 'BIZ', + 'BJ', + 'BLACK', + 'BLACKFRIDAY', + 'BLOCKBUSTER', + 'BLOG', + 'BLOOMBERG', + 'BLUE', + 'BM', + 'BMS', + 'BMW', + 'BN', + 'BNL', + 'BNPPARIBAS', + 'BO', + 'BOATS', + 'BOEHRINGER', + 'BOFA', + 'BOM', + 'BOND', + 'BOO', + 'BOOK', + 'BOOKING', + 'BOSCH', + 'BOSTIK', + 'BOSTON', + 'BOT', + 'BOUTIQUE', + 'BOX', + 'BR', + 'BRADESCO', + 'BRIDGESTONE', + 'BROADWAY', + 'BROKER', + 'BROTHER', + 'BRUSSELS', + 'BS', + 'BT', + 'BUDAPEST', + 'BUGATTI', + 'BUILD', + 'BUILDERS', + 'BUSINESS', + 'BUY', + 'BUZZ', + 'BV', + 'BW', + 'BY', + 'BZ', + 'BZH', + 'CA', + 'CAB', + 'CAFE', + 'CAL', + 'CALL', + 'CALVINKLEIN', + 'CAM', + 'CAMERA', + 'CAMP', + 'CANCERRESEARCH', + 'CANON', + 'CAPETOWN', + 'CAPITAL', + 'CAPITALONE', + 'CAR', + 'CARAVAN', + 'CARDS', + 'CARE', + 'CAREER', + 'CAREERS', + 'CARS', + 'CARTIER', + 'CASA', + 'CASE', + 'CASEIH', + 'CASH', + 'CASINO', + 'CAT', + 'CATERING', + 'CATHOLIC', + 'CBA', + 'CBN', + 'CBRE', + 'CBS', + 'CC', + 'CD', + 'CEB', + 'CENTER', + 'CEO', + 'CERN', + 'CF', + 'CFA', + 'CFD', + 'CG', + 'CH', + 'CHANEL', + 'CHANNEL', + 'CHARITY', + 'CHASE', + 'CHAT', + 'CHEAP', + 'CHINTAI', + 'CHRISTMAS', + 'CHROME', + 'CHRYSLER', + 'CHURCH', + 'CI', + 'CIPRIANI', + 'CIRCLE', + 'CISCO', + 'CITADEL', + 'CITI', + 'CITIC', + 'CITY', + 'CITYEATS', + 'CK', + 'CL', + 'CLAIMS', + 'CLEANING', + 'CLICK', + 'CLINIC', + 'CLINIQUE', + 'CLOTHING', + 'CLOUD', + 'CLUB', + 'CLUBMED', + 'CM', + 'CN', + 'CO', + 'COACH', + 'CODES', + 'COFFEE', + 'COLLEGE', + 'COLOGNE', + 'COM', + 'COMCAST', + 'COMMBANK', + 'COMMUNITY', + 'COMPANY', + 'COMPARE', + 'COMPUTER', + 'COMSEC', + 'CONDOS', + 'CONSTRUCTION', + 'CONSULTING', + 'CONTACT', + 'CONTRACTORS', + 'COOKING', + 'COOKINGCHANNEL', + 'COOL', + 'COOP', + 'CORSICA', + 'COUNTRY', + 'COUPON', + 'COUPONS', + 'COURSES', + 'CR', + 'CREDIT', + 'CREDITCARD', + 'CREDITUNION', + 'CRICKET', + 'CROWN', + 'CRS', + 'CRUISE', + 'CRUISES', + 'CSC', + 'CU', + 'CUISINELLA', + 'CV', + 'CW', + 'CX', + 'CY', + 'CYMRU', + 'CYOU', + 'CZ', + 'DABUR', + 'DAD', + 'DANCE', + 'DATA', + 'DATE', + 'DATING', + 'DATSUN', + 'DAY', + 'DCLK', + 'DDS', + 'DE', + 'DEAL', + 'DEALER', + 'DEALS', + 'DEGREE', + 'DELIVERY', + 'DELL', + 'DELOITTE', + 'DELTA', + 'DEMOCRAT', + 'DENTAL', + 'DENTIST', + 'DESI', + 'DESIGN', + 'DEV', + 'DHL', + 'DIAMONDS', + 'DIET', + 'DIGITAL', + 'DIRECT', + 'DIRECTORY', + 'DISCOUNT', + 'DISCOVER', + 'DISH', + 'DIY', + 'DJ', + 'DK', + 'DM', + 'DNP', + 'DO', + 'DOCS', + 'DOCTOR', + 'DODGE', + 'DOG', + 'DOHA', + 'DOMAINS', + 'DOT', + 'DOWNLOAD', + 'DRIVE', + 'DTV', + 'DUBAI', + 'DUCK', + 'DUNLOP', + 'DUNS', + 'DUPONT', + 'DURBAN', + 'DVAG', + 'DVR', + 'DZ', + 'EARTH', + 'EAT', + 'EC', + 'ECO', + 'EDEKA', + 'EDU', + 'EDUCATION', + 'EE', + 'EG', + 'EMAIL', + 'EMERCK', + 'ENERGY', + 'ENGINEER', + 'ENGINEERING', + 'ENTERPRISES', + 'EPSON', + 'EQUIPMENT', + 'ER', + 'ERICSSON', + 'ERNI', + 'ES', + 'ESQ', + 'ESTATE', + 'ESURANCE', + 'ET', + 'ETISALAT', + 'EU', + 'EUROVISION', + 'EUS', + 'EVENTS', + 'EVERBANK', + 'EXCHANGE', + 'EXPERT', + 'EXPOSED', + 'EXPRESS', + 'EXTRASPACE', + 'FAGE', + 'FAIL', + 'FAIRWINDS', + 'FAITH', + 'FAMILY', + 'FAN', + 'FANS', + 'FARM', + 'FARMERS', + 'FASHION', + 'FAST', + 'FEDEX', + 'FEEDBACK', + 'FERRARI', + 'FERRERO', + 'FI', + 'FIAT', + 'FIDELITY', + 'FIDO', + 'FILM', + 'FINAL', + 'FINANCE', + 'FINANCIAL', + 'FIRE', + 'FIRESTONE', + 'FIRMDALE', + 'FISH', + 'FISHING', + 'FIT', + 'FITNESS', + 'FJ', + 'FK', + 'FLICKR', + 'FLIGHTS', + 'FLIR', + 'FLORIST', + 'FLOWERS', + 'FLY', + 'FM', + 'FO', + 'FOO', + 'FOOD', + 'FOODNETWORK', + 'FOOTBALL', + 'FORD', + 'FOREX', + 'FORSALE', + 'FORUM', + 'FOUNDATION', + 'FOX', + 'FR', + 'FREE', + 'FRESENIUS', + 'FRL', + 'FROGANS', + 'FRONTDOOR', + 'FRONTIER', + 'FTR', + 'FUJITSU', + 'FUJIXEROX', + 'FUN', + 'FUND', + 'FURNITURE', + 'FUTBOL', + 'FYI', + 'GA', + 'GAL', + 'GALLERY', + 'GALLO', + 'GALLUP', + 'GAME', + 'GAMES', + 'GAP', + 'GARDEN', + 'GB', + 'GBIZ', + 'GD', + 'GDN', + 'GE', + 'GEA', + 'GENT', + 'GENTING', + 'GEORGE', + 'GF', + 'GG', + 'GGEE', + 'GH', + 'GI', + 'GIFT', + 'GIFTS', + 'GIVES', + 'GIVING', + 'GL', + 'GLADE', + 'GLASS', + 'GLE', + 'GLOBAL', + 'GLOBO', + 'GM', + 'GMAIL', + 'GMBH', + 'GMO', + 'GMX', + 'GN', + 'GODADDY', + 'GOLD', + 'GOLDPOINT', + 'GOLF', + 'GOO', + 'GOODYEAR', + 'GOOG', + 'GOOGLE', + 'GOP', + 'GOT', + 'GOV', + 'GP', + 'GQ', + 'GR', + 'GRAINGER', + 'GRAPHICS', + 'GRATIS', + 'GREEN', + 'GRIPE', + 'GROCERY', + 'GROUP', + 'GS', + 'GT', + 'GU', + 'GUARDIAN', + 'GUCCI', + 'GUGE', + 'GUIDE', + 'GUITARS', + 'GURU', + 'GW', + 'GY', + 'HAIR', + 'HAMBURG', + 'HANGOUT', + 'HAUS', + 'HBO', + 'HDFC', + 'HDFCBANK', + 'HEALTH', + 'HEALTHCARE', + 'HELP', + 'HELSINKI', + 'HERE', + 'HERMES', + 'HGTV', + 'HIPHOP', + 'HISAMITSU', + 'HITACHI', + 'HIV', + 'HK', + 'HKT', + 'HM', + 'HN', + 'HOCKEY', + 'HOLDINGS', + 'HOLIDAY', + 'HOMEDEPOT', + 'HOMEGOODS', + 'HOMES', + 'HOMESENSE', + 'HONDA', + 'HONEYWELL', + 'HORSE', + 'HOSPITAL', + 'HOST', + 'HOSTING', + 'HOT', + 'HOTELES', + 'HOTELS', + 'HOTMAIL', + 'HOUSE', + 'HOW', + 'HR', + 'HSBC', + 'HT', + 'HU', + 'HUGHES', + 'HYATT', + 'HYUNDAI', + 'IBM', + 'ICBC', + 'ICE', + 'ICU', + 'ID', + 'IE', + 'IEEE', + 'IFM', + 'IKANO', + 'IL', + 'IM', + 'IMAMAT', + 'IMDB', + 'IMMO', + 'IMMOBILIEN', + 'IN', + 'INC', + 'INDUSTRIES', + 'INFINITI', + 'INFO', + 'ING', + 'INK', + 'INSTITUTE', + 'INSURANCE', + 'INSURE', + 'INT', + 'INTEL', + 'INTERNATIONAL', + 'INTUIT', + 'INVESTMENTS', + 'IO', + 'IPIRANGA', + 'IQ', + 'IR', + 'IRISH', + 'IS', + 'ISELECT', + 'ISMAILI', + 'IST', + 'ISTANBUL', + 'IT', + 'ITAU', + 'ITV', + 'IVECO', + 'JAGUAR', + 'JAVA', + 'JCB', + 'JCP', + 'JE', + 'JEEP', + 'JETZT', + 'JEWELRY', + 'JIO', + 'JLL', + 'JM', + 'JMP', + 'JNJ', + 'JO', + 'JOBS', + 'JOBURG', + 'JOT', + 'JOY', + 'JP', + 'JPMORGAN', + 'JPRS', + 'JUEGOS', + 'JUNIPER', + 'KAUFEN', + 'KDDI', + 'KE', + 'KERRYHOTELS', + 'KERRYLOGISTICS', + 'KERRYPROPERTIES', + 'KFH', + 'KG', + 'KH', + 'KI', + 'KIA', + 'KIM', + 'KINDER', + 'KINDLE', + 'KITCHEN', + 'KIWI', + 'KM', + 'KN', + 'KOELN', + 'KOMATSU', + 'KOSHER', + 'KP', + 'KPMG', + 'KPN', + 'KR', + 'KRD', + 'KRED', + 'KUOKGROUP', + 'KW', + 'KY', + 'KYOTO', + 'KZ', + 'LA', + 'LACAIXA', + 'LADBROKES', + 'LAMBORGHINI', + 'LAMER', + 'LANCASTER', + 'LANCIA', + 'LANCOME', + 'LAND', + 'LANDROVER', + 'LANXESS', + 'LASALLE', + 'LAT', + 'LATINO', + 'LATROBE', + 'LAW', + 'LAWYER', + 'LB', + 'LC', + 'LDS', + 'LEASE', + 'LECLERC', + 'LEFRAK', + 'LEGAL', + 'LEGO', + 'LEXUS', + 'LGBT', + 'LI', + 'LIAISON', + 'LIDL', + 'LIFE', + 'LIFEINSURANCE', + 'LIFESTYLE', + 'LIGHTING', + 'LIKE', + 'LILLY', + 'LIMITED', + 'LIMO', + 'LINCOLN', + 'LINDE', + 'LINK', + 'LIPSY', + 'LIVE', + 'LIVING', + 'LIXIL', + 'LK', + 'LLC', + 'LOAN', + 'LOANS', + 'LOCKER', + 'LOCUS', + 'LOFT', + 'LOL', + 'LONDON', + 'LOTTE', + 'LOTTO', + 'LOVE', + 'LPL', + 'LPLFINANCIAL', + 'LR', + 'LS', + 'LT', + 'LTD', + 'LTDA', + 'LU', + 'LUNDBECK', + 'LUPIN', + 'LUXE', + 'LUXURY', + 'LV', + 'LY', + 'MA', + 'MACYS', + 'MADRID', + 'MAIF', + 'MAISON', + 'MAKEUP', + 'MAN', + 'MANAGEMENT', + 'MANGO', + 'MAP', + 'MARKET', + 'MARKETING', + 'MARKETS', + 'MARRIOTT', + 'MARSHALLS', + 'MASERATI', + 'MATTEL', + 'MBA', + 'MC', + 'MCKINSEY', + 'MD', + 'ME', + 'MED', + 'MEDIA', + 'MEET', + 'MELBOURNE', + 'MEME', + 'MEMORIAL', + 'MEN', + 'MENU', + 'MERCKMSD', + 'METLIFE', + 'MG', + 'MH', + 'MIAMI', + 'MICROSOFT', + 'MIL', + 'MINI', + 'MINT', + 'MIT', + 'MITSUBISHI', + 'MK', + 'ML', + 'MLB', + 'MLS', + 'MM', + 'MMA', + 'MN', + 'MO', + 'MOBI', + 'MOBILE', + 'MOBILY', + 'MODA', + 'MOE', + 'MOI', + 'MOM', + 'MONASH', + 'MONEY', + 'MONSTER', + 'MOPAR', + 'MORMON', + 'MORTGAGE', + 'MOSCOW', + 'MOTO', + 'MOTORCYCLES', + 'MOV', + 'MOVIE', + 'MOVISTAR', + 'MP', + 'MQ', + 'MR', + 'MS', + 'MSD', + 'MT', + 'MTN', + 'MTR', + 'MU', + 'MUSEUM', + 'MUTUAL', + 'MV', + 'MW', + 'MX', + 'MY', + 'MZ', + 'NA', + 'NAB', + 'NADEX', + 'NAGOYA', + 'NAME', + 'NATIONWIDE', + 'NATURA', + 'NAVY', + 'NBA', + 'NC', + 'NE', + 'NEC', + 'NET', + 'NETBANK', + 'NETFLIX', + 'NETWORK', + 'NEUSTAR', + 'NEW', + 'NEWHOLLAND', + 'NEWS', + 'NEXT', + 'NEXTDIRECT', + 'NEXUS', + 'NF', + 'NFL', + 'NG', + 'NGO', + 'NHK', + 'NI', + 'NICO', + 'NIKE', + 'NIKON', + 'NINJA', + 'NISSAN', + 'NISSAY', + 'NL', + 'NO', + 'NOKIA', + 'NORTHWESTERNMUTUAL', + 'NORTON', + 'NOW', + 'NOWRUZ', + 'NOWTV', + 'NP', + 'NR', + 'NRA', + 'NRW', + 'NTT', + 'NU', + 'NYC', + 'NZ', + 'OBI', + 'OBSERVER', + 'OFF', + 'OFFICE', + 'OKINAWA', + 'OLAYAN', + 'OLAYANGROUP', + 'OLDNAVY', + 'OLLO', + 'OM', + 'OMEGA', + 'ONE', + 'ONG', + 'ONL', + 'ONLINE', + 'ONYOURSIDE', + 'OOO', + 'OPEN', + 'ORACLE', + 'ORANGE', + 'ORG', + 'ORGANIC', + 'ORIGINS', + 'OSAKA', + 'OTSUKA', + 'OTT', + 'OVH', + 'PA', + 'PAGE', + 'PANASONIC', + 'PARIS', + 'PARS', + 'PARTNERS', + 'PARTS', + 'PARTY', + 'PASSAGENS', + 'PAY', + 'PCCW', + 'PE', + 'PET', + 'PF', + 'PFIZER', + 'PG', + 'PH', + 'PHARMACY', + 'PHD', + 'PHILIPS', + 'PHONE', + 'PHOTO', + 'PHOTOGRAPHY', + 'PHOTOS', + 'PHYSIO', + 'PIAGET', + 'PICS', + 'PICTET', + 'PICTURES', + 'PID', + 'PIN', + 'PING', + 'PINK', + 'PIONEER', + 'PIZZA', + 'PK', + 'PL', + 'PLACE', + 'PLAY', + 'PLAYSTATION', + 'PLUMBING', + 'PLUS', + 'PM', + 'PN', + 'PNC', + 'POHL', + 'POKER', + 'POLITIE', + 'PORN', + 'POST', + 'PR', + 'PRAMERICA', + 'PRAXI', + 'PRESS', + 'PRIME', + 'PRO', + 'PROD', + 'PRODUCTIONS', + 'PROF', + 'PROGRESSIVE', + 'PROMO', + 'PROPERTIES', + 'PROPERTY', + 'PROTECTION', + 'PRU', + 'PRUDENTIAL', + 'PS', + 'PT', + 'PUB', + 'PW', + 'PWC', + 'PY', + 'QA', + 'QPON', + 'QUEBEC', + 'QUEST', + 'QVC', + 'RACING', + 'RADIO', + 'RAID', + 'RE', + 'READ', + 'REALESTATE', + 'REALTOR', + 'REALTY', + 'RECIPES', + 'RED', + 'REDSTONE', + 'REDUMBRELLA', + 'REHAB', + 'REISE', + 'REISEN', + 'REIT', + 'RELIANCE', + 'REN', + 'RENT', + 'RENTALS', + 'REPAIR', + 'REPORT', + 'REPUBLICAN', + 'REST', + 'RESTAURANT', + 'REVIEW', + 'REVIEWS', + 'REXROTH', + 'RICH', + 'RICHARDLI', + 'RICOH', + 'RIGHTATHOME', + 'RIL', + 'RIO', + 'RIP', + 'RMIT', + 'RO', + 'ROCHER', + 'ROCKS', + 'RODEO', + 'ROGERS', + 'ROOM', + 'RS', + 'RSVP', + 'RU', + 'RUGBY', + 'RUHR', + 'RUN', + 'RW', + 'RWE', + 'RYUKYU', + 'SA', + 'SAARLAND', + 'SAFE', + 'SAFETY', + 'SAKURA', + 'SALE', + 'SALON', + 'SAMSCLUB', + 'SAMSUNG', + 'SANDVIK', + 'SANDVIKCOROMANT', + 'SANOFI', + 'SAP', + 'SARL', + 'SAS', + 'SAVE', + 'SAXO', + 'SB', + 'SBI', + 'SBS', + 'SC', + 'SCA', + 'SCB', + 'SCHAEFFLER', + 'SCHMIDT', + 'SCHOLARSHIPS', + 'SCHOOL', + 'SCHULE', + 'SCHWARZ', + 'SCIENCE', + 'SCJOHNSON', + 'SCOR', + 'SCOT', + 'SD', + 'SE', + 'SEARCH', + 'SEAT', + 'SECURE', + 'SECURITY', + 'SEEK', + 'SELECT', + 'SENER', + 'SERVICES', + 'SES', + 'SEVEN', + 'SEW', + 'SEX', + 'SEXY', + 'SFR', + 'SG', + 'SH', + 'SHANGRILA', + 'SHARP', + 'SHAW', + 'SHELL', + 'SHIA', + 'SHIKSHA', + 'SHOES', + 'SHOP', + 'SHOPPING', + 'SHOUJI', + 'SHOW', + 'SHOWTIME', + 'SHRIRAM', + 'SI', + 'SILK', + 'SINA', + 'SINGLES', + 'SITE', + 'SJ', + 'SK', + 'SKI', + 'SKIN', + 'SKY', + 'SKYPE', + 'SL', + 'SLING', + 'SM', + 'SMART', + 'SMILE', + 'SN', + 'SNCF', + 'SO', + 'SOCCER', + 'SOCIAL', + 'SOFTBANK', + 'SOFTWARE', + 'SOHU', + 'SOLAR', + 'SOLUTIONS', + 'SONG', + 'SONY', + 'SOY', + 'SPACE', + 'SPORT', + 'SPOT', + 'SPREADBETTING', + 'SR', + 'SRL', + 'SRT', + 'SS', + 'ST', + 'STADA', + 'STAPLES', + 'STAR', + 'STARHUB', + 'STATEBANK', + 'STATEFARM', + 'STC', + 'STCGROUP', + 'STOCKHOLM', + 'STORAGE', + 'STORE', + 'STREAM', + 'STUDIO', + 'STUDY', + 'STYLE', + 'SU', + 'SUCKS', + 'SUPPLIES', + 'SUPPLY', + 'SUPPORT', + 'SURF', + 'SURGERY', + 'SUZUKI', + 'SV', + 'SWATCH', + 'SWIFTCOVER', + 'SWISS', + 'SX', + 'SY', + 'SYDNEY', + 'SYMANTEC', + 'SYSTEMS', + 'SZ', + 'TAB', + 'TAIPEI', + 'TALK', + 'TAOBAO', + 'TARGET', + 'TATAMOTORS', + 'TATAR', + 'TATTOO', + 'TAX', + 'TAXI', + 'TC', + 'TCI', + 'TD', + 'TDK', + 'TEAM', + 'TECH', + 'TECHNOLOGY', + 'TEL', + 'TELEFONICA', + 'TEMASEK', + 'TENNIS', + 'TEVA', + 'TF', + 'TG', + 'TH', + 'THD', + 'THEATER', + 'THEATRE', + 'TIAA', + 'TICKETS', + 'TIENDA', + 'TIFFANY', + 'TIPS', + 'TIRES', + 'TIROL', + 'TJ', + 'TJMAXX', + 'TJX', + 'TK', + 'TKMAXX', + 'TL', + 'TM', + 'TMALL', + 'TN', + 'TO', + 'TODAY', + 'TOKYO', + 'TOOLS', + 'TOP', + 'TORAY', + 'TOSHIBA', + 'TOTAL', + 'TOURS', + 'TOWN', + 'TOYOTA', + 'TOYS', + 'TR', + 'TRADE', + 'TRADING', + 'TRAINING', + 'TRAVEL', + 'TRAVELCHANNEL', + 'TRAVELERS', + 'TRAVELERSINSURANCE', + 'TRUST', + 'TRV', + 'TT', + 'TUBE', + 'TUI', + 'TUNES', + 'TUSHU', + 'TV', + 'TVS', + 'TW', + 'TZ', + 'UA', + 'UBANK', + 'UBS', + 'UCONNECT', + 'UG', + 'UK', + 'UNICOM', + 'UNIVERSITY', + 'UNO', + 'UOL', + 'UPS', + 'US', + 'UY', + 'UZ', + 'VA', + 'VACATIONS', + 'VANA', + 'VANGUARD', + 'VC', + 'VE', + 'VEGAS', + 'VENTURES', + 'VERISIGN', + 'VERSICHERUNG', + 'VET', + 'VG', + 'VI', + 'VIAJES', + 'VIDEO', + 'VIG', + 'VIKING', + 'VILLAS', + 'VIN', + 'VIP', + 'VIRGIN', + 'VISA', + 'VISION', + 'VISTAPRINT', + 'VIVA', + 'VIVO', + 'VLAANDEREN', + 'VN', + 'VODKA', + 'VOLKSWAGEN', + 'VOLVO', + 'VOTE', + 'VOTING', + 'VOTO', + 'VOYAGE', + 'VU', + 'VUELOS', + 'WALES', + 'WALMART', + 'WALTER', + 'WANG', + 'WANGGOU', + 'WARMAN', + 'WATCH', + 'WATCHES', + 'WEATHER', + 'WEATHERCHANNEL', + 'WEBCAM', + 'WEBER', + 'WEBSITE', + 'WED', + 'WEDDING', + 'WEIBO', + 'WEIR', + 'WF', + 'WHOSWHO', + 'WIEN', + 'WIKI', + 'WILLIAMHILL', + 'WIN', + 'WINDOWS', + 'WINE', + 'WINNERS', + 'WME', + 'WOLTERSKLUWER', + 'WOODSIDE', + 'WORK', + 'WORKS', + 'WORLD', + 'WOW', + 'WS', + 'WTC', + 'WTF', + 'XBOX', + 'XEROX', + 'XFINITY', + 'XIHUAN', + 'XIN', + 'XN--11B4C3D', + 'XN--1CK2E1B', + 'XN--1QQW23A', + 'XN--2SCRJ9C', + 'XN--30RR7Y', + 'XN--3BST00M', + 'XN--3DS443G', + 'XN--3E0B707E', + 'XN--3HCRJ9C', + 'XN--3OQ18VL8PN36A', + 'XN--3PXU8K', + 'XN--42C2D9A', + 'XN--45BR5CYL', + 'XN--45BRJ9C', + 'XN--45Q11C', + 'XN--4GBRIM', + 'XN--54B7FTA0CC', + 'XN--55QW42G', + 'XN--55QX5D', + 'XN--5SU34J936BGSG', + 'XN--5TZM5G', + 'XN--6FRZ82G', + 'XN--6QQ986B3XL', + 'XN--80ADXHKS', + 'XN--80AO21A', + 'XN--80AQECDR1A', + 'XN--80ASEHDB', + 'XN--80ASWG', + 'XN--8Y0A063A', + 'XN--90A3AC', + 'XN--90AE', + 'XN--90AIS', + 'XN--9DBQ2A', + 'XN--9ET52U', + 'XN--9KRT00A', + 'XN--B4W605FERD', + 'XN--BCK1B9A5DRE4C', + 'XN--C1AVG', + 'XN--C2BR7G', + 'XN--CCK2B3B', + 'XN--CG4BKI', + 'XN--CLCHC0EA0B2G2A9GCD', + 'XN--CZR694B', + 'XN--CZRS0T', + 'XN--CZRU2D', + 'XN--D1ACJ3B', + 'XN--D1ALF', + 'XN--E1A4C', + 'XN--ECKVDTC9D', + 'XN--EFVY88H', + 'XN--ESTV75G', + 'XN--FCT429K', + 'XN--FHBEI', + 'XN--FIQ228C5HS', + 'XN--FIQ64B', + 'XN--FIQS8S', + 'XN--FIQZ9S', + 'XN--FJQ720A', + 'XN--FLW351E', + 'XN--FPCRJ9C3D', + 'XN--FZC2C9E2C', + 'XN--FZYS8D69UVGM', + 'XN--G2XX48C', + 'XN--GCKR3F0F', + 'XN--GECRJ9C', + 'XN--GK3AT1E', + 'XN--H2BREG3EVE', + 'XN--H2BRJ9C', + 'XN--H2BRJ9C8C', + 'XN--HXT814E', + 'XN--I1B6B1A6A2E', + 'XN--IMR513N', + 'XN--IO0A7I', + 'XN--J1AEF', + 'XN--J1AMH', + 'XN--J6W193G', + 'XN--JLQ61U9W7B', + 'XN--JVR189M', + 'XN--KCRX77D1X4A', + 'XN--KPRW13D', + 'XN--KPRY57D', + 'XN--KPU716F', + 'XN--KPUT3I', + 'XN--L1ACC', + 'XN--LGBBAT1AD8J', + 'XN--MGB9AWBF', + 'XN--MGBA3A3EJT', + 'XN--MGBA3A4F16A', + 'XN--MGBA7C0BBN0A', + 'XN--MGBAAKC7DVF', + 'XN--MGBAAM7A8H', + 'XN--MGBAB2BD', + 'XN--MGBAH1A3HJKRD', + 'XN--MGBAI9AZGQP6J', + 'XN--MGBAYH7GPA', + 'XN--MGBB9FBPOB', + 'XN--MGBBH1A', + 'XN--MGBBH1A71E', + 'XN--MGBC0A9AZCG', + 'XN--MGBCA7DZDO', + 'XN--MGBERP4A5D4AR', + 'XN--MGBGU82A', + 'XN--MGBI4ECEXP', + 'XN--MGBPL2FH', + 'XN--MGBT3DHD', + 'XN--MGBTX2B', + 'XN--MGBX4CD0AB', + 'XN--MIX891F', + 'XN--MK1BU44C', + 'XN--MXTQ1M', + 'XN--NGBC5AZD', + 'XN--NGBE9E0A', + 'XN--NGBRX', + 'XN--NODE', + 'XN--NQV7F', + 'XN--NQV7FS00EMA', + 'XN--NYQY26A', + 'XN--O3CW4H', + 'XN--OGBPF8FL', + 'XN--OTU796D', + 'XN--P1ACF', + 'XN--P1AI', + 'XN--PBT977C', + 'XN--PGBS0DH', + 'XN--PSSY2U', + 'XN--Q9JYB4C', + 'XN--QCKA1PMC', + 'XN--QXAM', + 'XN--RHQV96G', + 'XN--ROVU88B', + 'XN--RVC1E0AM3E', + 'XN--S9BRJ9C', + 'XN--SES554G', + 'XN--T60B56A', + 'XN--TCKWE', + 'XN--TIQ49XQYJ', + 'XN--UNUP4Y', + 'XN--VERMGENSBERATER-CTB', + 'XN--VERMGENSBERATUNG-PWB', + 'XN--VHQUV', + 'XN--VUQ861B', + 'XN--W4R85EL8FHU5DNRA', + 'XN--W4RS40L', + 'XN--WGBH1C', + 'XN--WGBL6A', + 'XN--XHQ521B', + 'XN--XKC2AL3HYE2A', + 'XN--XKC2DL3A5EE0H', + 'XN--Y9A3AQ', + 'XN--YFRO4I67O', + 'XN--YGBI2AMMX', + 'XN--ZFR164B', + 'XXX', + 'XYZ', + 'YACHTS', + 'YAHOO', + 'YAMAXUN', + 'YANDEX', + 'YE', + 'YODOBASHI', + 'YOGA', + 'YOKOHAMA', + 'YOU', + 'YOUTUBE', + 'YT', + 'YUN', + 'ZA', + 'ZAPPOS', + 'ZARA', + 'ZERO', + 'ZIP', + 'ZM', + 'ZONE', + 'ZUERICH', + 'ZW' +]; + + +// Keep as upper-case to make updating from source easier + +module.exports = new Set(internals.tlds.map((tld) => tld.toLowerCase())); - // Folding white space - case '\r': - if (emailLength === ++i || email[i] !== '\n') { - updateResult(internals.diagnoses.errCRNoLF); - break; - } - // Fallthrough +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { - case ' ': - case '\t': - updateResult(internals.diagnoses.cfwsFWS); +"use strict"; - context.stack.push(context.now); - context.now = internals.components.contextFWS; - prevToken = token; - break; - // DTEXT - default: - // http://tools.ietf.org/html/rfc5322#section-3.4.1 - // dtext = %d33-90 / ; Printable US-ASCII - // %d94-126 / ; characters not including - // obs-dtext ; "[", "]", or "\" - // - // obs-dtext = obs-NO-WS-CTL / quoted-pair - // - // obs-NO-WS-CTL = %d1-8 / ; US-ASCII control - // %d11 / ; characters that do not - // %d12 / ; include the carriage - // %d14-31 / ; return, line feed, and - // %d127 ; white space characters - charCode = token.codePointAt(0); - - // '\r', '\n', ' ', and '\t' have already been parsed above - if ((charCode !== 127 && internals.c1Controls(charCode)) || charCode === 0 || token === '[') { - // Fatal error - updateResult(internals.diagnoses.errExpectingDTEXT); - break; - } - else if (internals.c0Controls(charCode) || charCode === 127) { - updateResult(internals.diagnoses.rfc5322DomainLiteralOBSDText); - } +const RFC3986 = __webpack_require__(12); - parseData.literal += token; - parseData.domain += token; - atomData.domains[elementCount] += token; - elementLength += Buffer.byteLength(token, 'utf8'); - } - break; +const internals = { + Uri: { + createUriRegex: function (optionalScheme, allowRelative, relativeOnly, allowQuerySquareBrackets) { - // Quoted string - case internals.components.contextQuotedString: - // http://tools.ietf.org/html/rfc5322#section-3.2.4 - // quoted-string = [CFWS] - // DQUOTE *([FWS] qcontent) [FWS] DQUOTE - // [CFWS] - // - // qcontent = qtext / quoted-pair - switch (token) { - // Quoted pair - case '\\': - context.stack.push(context.now); - context.now = internals.components.contextQuotedPair; - break; + let scheme = RFC3986.scheme; + let prefix; - // Folding white space. Spaces are allowed as regular characters inside a quoted string - it's only FWS if we include '\t' or '\r\n' - case '\r': - if (emailLength === ++i || email[i] !== '\n') { - // Fatal error - updateResult(internals.diagnoses.errCRNoLF); - break; - } + if (relativeOnly) { + prefix = '(?:' + RFC3986.relativeRef + ')'; + } + else { + // If we were passed a scheme, use it instead of the generic one + if (optionalScheme) { - // Fallthrough + // Have to put this in a non-capturing group to handle the OR statements + scheme = '(?:' + optionalScheme + ')'; + } - case '\t': - // http://tools.ietf.org/html/rfc5322#section-3.2.2 - // Runs of FWS, comment, or CFWS that occur between lexical tokens in - // a structured header field are semantically interpreted as a single - // space character. + const withScheme = '(?:' + scheme + ':' + RFC3986.hierPart + ')'; - // http://tools.ietf.org/html/rfc5322#section-3.2.4 - // the CRLF in any FWS/CFWS that appears within the quoted-string [is] - // semantically "invisible" and therefore not part of the - // quoted-string + prefix = allowRelative ? '(?:' + withScheme + '|' + RFC3986.relativeRef + ')' : withScheme; + } - parseData.local += ' '; - atomData.locals[elementCount] += ' '; - elementLength += Buffer.byteLength(token, 'utf8'); + /** + * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] + * + * OR + * + * relative-ref = relative-part [ "?" query ] [ "#" fragment ] + */ + return new RegExp('^' + prefix + '(?:\\?' + (allowQuerySquareBrackets ? RFC3986.queryWithSquareBrackets : RFC3986.query) + ')?' + '(?:#' + RFC3986.fragment + ')?$'); + } + } +}; - updateResult(internals.diagnoses.cfwsFWS); - context.stack.push(context.now); - context.now = internals.components.contextFWS; - prevToken = token; - break; +module.exports = internals.Uri; - // End of quoted string - case '"': - parseData.local += token; - atomData.locals[elementCount] += token; - elementLength += Buffer.byteLength(token, 'utf8'); - context.prev = context.now; - context.now = context.stack.pop(); - break; - // QTEXT - default: - // http://tools.ietf.org/html/rfc5322#section-3.2.4 - // qtext = %d33 / ; Printable US-ASCII - // %d35-91 / ; characters not including - // %d93-126 / ; "\" or the quote character - // obs-qtext - // - // obs-qtext = obs-NO-WS-CTL - // - // obs-NO-WS-CTL = %d1-8 / ; US-ASCII control - // %d11 / ; characters that do not - // %d12 / ; include the carriage - // %d14-31 / ; return, line feed, and - // %d127 ; white space characters - charCode = token.codePointAt(0); - - if ((charCode !== 127 && internals.c1Controls(charCode)) || charCode === 0 || charCode === 10) { - updateResult(internals.diagnoses.errExpectingQTEXT); - } - else if (internals.c0Controls(charCode) || charCode === 127) { - updateResult(internals.diagnoses.deprecatedQTEXT); - } +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { - parseData.local += token; - atomData.locals[elementCount] += token; - elementLength += Buffer.byteLength(token, 'utf8'); - } +"use strict"; - // http://tools.ietf.org/html/rfc5322#section-3.4.1 - // If the string can be represented as a dot-atom (that is, it contains - // no characters other than atext characters or "." surrounded by atext - // characters), then the dot-atom form SHOULD be used and the quoted- - // string form SHOULD NOT be used. - break; - // Quoted pair - case internals.components.contextQuotedPair: - // http://tools.ietf.org/html/rfc5322#section-3.2.1 - // quoted-pair = ("\" (VCHAR / WSP)) / obs-qp - // - // VCHAR = %d33-126 ; visible (printing) characters - // WSP = SP / HTAB ; white space - // - // obs-qp = "\" (%d0 / obs-NO-WS-CTL / LF / CR) - // - // obs-NO-WS-CTL = %d1-8 / ; US-ASCII control - // %d11 / ; characters that do not - // %d12 / ; include the carriage - // %d14-31 / ; return, line feed, and - // %d127 ; white space characters - // - // i.e. obs-qp = "\" (%d0-8, %d10-31 / %d127) - charCode = token.codePointAt(0); - - if (charCode !== 127 && internals.c1Controls(charCode)) { - // Fatal error - updateResult(internals.diagnoses.errExpectingQPair); - } - else if ((charCode < 31 && charCode !== 9) || charCode === 127) { - // ' ' and '\t' are allowed - updateResult(internals.diagnoses.deprecatedQP); - } +const RFC3986 = __webpack_require__(12); - // At this point we know where this qpair occurred so we could check to see if the character actually needed to be quoted at all. - // http://tools.ietf.org/html/rfc5321#section-4.1.2 - // the sending system SHOULD transmit the form that uses the minimum quoting possible. - context.prev = context.now; - // End of qpair - context.now = context.stack.pop(); - const escapeToken = '\\' + token; +const internals = { + Ip: { + cidrs: { + ipv4: { + required: '\\/(?:' + RFC3986.ipv4Cidr + ')', + optional: '(?:\\/(?:' + RFC3986.ipv4Cidr + '))?', + forbidden: '' + }, + ipv6: { + required: '\\/' + RFC3986.ipv6Cidr, + optional: '(?:\\/' + RFC3986.ipv6Cidr + ')?', + forbidden: '' + }, + ipvfuture: { + required: '\\/' + RFC3986.ipv6Cidr, + optional: '(?:\\/' + RFC3986.ipv6Cidr + ')?', + forbidden: '' + } + }, + versions: { + ipv4: RFC3986.IPv4address, + ipv6: RFC3986.IPv6address, + ipvfuture: RFC3986.IPvFuture + } + } +}; - switch (context.now) { - case internals.components.contextComment: - break; - case internals.components.contextQuotedString: - parseData.local += escapeToken; - atomData.locals[elementCount] += escapeToken; +internals.Ip.createIpRegex = function (versions, cidr) { - // The maximum sizes specified by RFC 5321 are octet counts, so we must include the backslash - elementLength += 2; - break; + let regex; + for (let i = 0; i < versions.length; ++i) { + const version = versions[i]; + if (!regex) { + regex = '^(?:' + internals.Ip.versions[version] + internals.Ip.cidrs[version][cidr]; + } + else { + regex += '|' + internals.Ip.versions[version] + internals.Ip.cidrs[version][cidr]; + } + } - case internals.components.literal: - parseData.domain += escapeToken; - atomData.domains[elementCount] += escapeToken; + return new RegExp(regex + ')$'); +}; - // The maximum sizes specified by RFC 5321 are octet counts, so we must include the backslash - elementLength += 2; - break; +module.exports = internals.Ip; - // $lab:coverage:off$ - default: - throw new Error('quoted pair logic invoked in an invalid context: ' + context.now); - // $lab:coverage:on$ - } - break; - // Comment - case internals.components.contextComment: - // http://tools.ietf.org/html/rfc5322#section-3.2.2 - // comment = "(" *([FWS] ccontent) [FWS] ")" - // - // ccontent = ctext / quoted-pair / comment - switch (token) { - // Nested comment - case '(': - // Nested comments are ok - context.stack.push(context.now); - context.now = internals.components.contextComment; - break; +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { - // End of comment - case ')': - context.prev = context.now; - context.now = context.stack.pop(); - break; +"use strict"; - // Quoted pair - case '\\': - context.stack.push(context.now); - context.now = internals.components.contextQuotedPair; - break; - // Folding white space - case '\r': - if (emailLength === ++i || email[i] !== '\n') { - // Fatal error - updateResult(internals.diagnoses.errCRNoLF); - break; - } +const Util = __webpack_require__(37); - // Fallthrough +const Hoek = __webpack_require__(0); - case ' ': - case '\t': - updateResult(internals.diagnoses.cfwsFWS); +const Any = __webpack_require__(1); - context.stack.push(context.now); - context.now = internals.components.contextFWS; - prevToken = token; - break; - // CTEXT - default: - // http://tools.ietf.org/html/rfc5322#section-3.2.3 - // ctext = %d33-39 / ; Printable US-ASCII - // %d42-91 / ; characters not including - // %d93-126 / ; "(", ")", or "\" - // obs-ctext - // - // obs-ctext = obs-NO-WS-CTL - // - // obs-NO-WS-CTL = %d1-8 / ; US-ASCII control - // %d11 / ; characters that do not - // %d12 / ; include the carriage - // %d14-31 / ; return, line feed, and - // %d127 ; white space characters - charCode = token.codePointAt(0); - - if (charCode === 0 || charCode === 10 || (charCode !== 127 && internals.c1Controls(charCode))) { - // Fatal error - updateResult(internals.diagnoses.errExpectingCTEXT); - break; - } - else if (internals.c0Controls(charCode) || charCode === 127) { - updateResult(internals.diagnoses.deprecatedCTEXT); - } - } +const internals = {}; - break; - // Folding white space - case internals.components.contextFWS: - // http://tools.ietf.org/html/rfc5322#section-3.2.2 - // FWS = ([*WSP CRLF] 1*WSP) / obs-FWS - // ; Folding white space - - // But note the erratum: - // http://www.rfc-editor.org/errata_search.php?rfc=5322&eid=1908: - // In the obsolete syntax, any amount of folding white space MAY be - // inserted where the obs-FWS rule is allowed. This creates the - // possibility of having two consecutive "folds" in a line, and - // therefore the possibility that a line which makes up a folded header - // field could be composed entirely of white space. - // - // obs-FWS = 1*([CRLF] WSP) - - if (prevToken === '\r') { - if (token === '\r') { - // Fatal error - updateResult(internals.diagnoses.errFWSCRLFx2); - break; - } +internals.Map = class extends Map { - if (++crlfCount > 1) { - // Multiple folds => obsolete FWS - updateResult(internals.diagnoses.deprecatedFWS); - } - else { - crlfCount = 1; - } - } + slice() { - switch (token) { - case '\r': - if (emailLength === ++i || email[i] !== '\n') { - // Fatal error - updateResult(internals.diagnoses.errCRNoLF); - } + return new internals.Map(this); + } - break; + toString() { - case ' ': - case '\t': - break; + return Util.inspect(this); + } +}; - default: - if (prevToken === '\r') { - // Fatal error - updateResult(internals.diagnoses.errFWSCRLFEnd); - } - crlfCount = 0; +internals.Symbol = class extends Any { - // End of FWS - context.prev = context.now; - context.now = context.stack.pop(); + constructor() { - // Look at this token again in the parent context - --i; - } + super(); + this._type = 'symbol'; + this._inner.map = new internals.Map(); + } - prevToken = token; - break; + _base(value, state, options) { - // Unexpected context - // $lab:coverage:off$ - default: - throw new Error('unknown context: ' + context.now); - // $lab:coverage:on$ - } // Primary state machine + if (options.convert) { + const lookup = this._inner.map.get(value); + if (lookup) { + value = lookup; + } - if (maxResult > internals.categories.rfc5322) { - // Fatal error, no point continuing - break; + if (this._flags.allowOnly) { + return { + value, + errors: (typeof value === 'symbol') ? null : this.createError('symbol.map', { value, map: this._inner.map }, state, options) + }; + } } - } // Token loop - // Check for errors - if (maxResult < internals.categories.rfc5322) { - const punycodeLength = Punycode.encode(parseData.domain).length; - // Fatal errors - if (context.now === internals.components.contextQuotedString) { - updateResult(internals.diagnoses.errUnclosedQuotedString); - } - else if (context.now === internals.components.contextQuotedPair) { - updateResult(internals.diagnoses.errBackslashEnd); - } - else if (context.now === internals.components.contextComment) { - updateResult(internals.diagnoses.errUnclosedComment); - } - else if (context.now === internals.components.literal) { - updateResult(internals.diagnoses.errUnclosedDomainLiteral); - } - else if (token === '\r') { - updateResult(internals.diagnoses.errFWSCRLFEnd); - } - else if (parseData.domain.length === 0) { - updateResult(internals.diagnoses.errNoDomain); - } - else if (elementLength === 0) { - updateResult(internals.diagnoses.errDotEnd); - } - else if (hyphenFlag) { - updateResult(internals.diagnoses.errDomainHyphenEnd); - } + return { + value, + errors: (typeof value === 'symbol') ? null : this.createError('symbol.base', { value }, state, options) + }; + } - // Other errors - else if (punycodeLength > 255) { - // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.2 - // The maximum total length of a domain name or number is 255 octets. - updateResult(internals.diagnoses.rfc5322DomainTooLong); - } - else if (Buffer.byteLength(parseData.local, 'utf8') + punycodeLength + /* '@' */ 1 > 254) { - // http://tools.ietf.org/html/rfc5321#section-4.1.2 - // Forward-path = Path - // - // Path = "<" [ A-d-l ":" ] Mailbox ">" - // - // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.3 - // The maximum total length of a reverse-path or forward-path is 256 octets (including the punctuation and element separators). - // - // Thus, even without (obsolete) routing information, the Mailbox can only be 254 characters long. This is confirmed by this verified - // erratum to RFC 3696: - // - // http://www.rfc-editor.org/errata_search.php?rfc=3696&eid=1690 - // However, there is a restriction in RFC 2821 on the length of an address in MAIL and RCPT commands of 254 characters. Since - // addresses that do not fit in those fields are not normally useful, the upper limit on address lengths should normally be considered - // to be 254. - updateResult(internals.diagnoses.rfc5322TooLong); - } - else if (elementLength > 63) { - // http://tools.ietf.org/html/rfc1035#section-2.3.4 - // labels 63 octets or less - updateResult(internals.diagnoses.rfc5322LabelTooLong); - } - else if (options.minDomainAtoms && atomData.domains.length < options.minDomainAtoms) { - updateResult(internals.diagnoses.errDomainTooShort); - } - else if (options.tldWhitelist || options.tldBlacklist) { - const tldAtom = atomData.domains[elementCount]; + map(iterable) { - if (!internals.validDomain(tldAtom, options)) { - updateResult(internals.diagnoses.errUnknownTLD); - } + if (iterable && !iterable[Symbol.iterator] && typeof iterable === 'object') { + iterable = Object.entries(iterable); } - } // Check for errors - // Finish - if (maxResult < internals.categories.dnsWarn) { - // Per RFC 5321, domain atoms are limited to letter-digit-hyphen, so we only need to check code <= 57 to check for a digit - const code = atomData.domains[elementCount].codePointAt(0); + Hoek.assert(iterable && iterable[Symbol.iterator], 'Iterable must be an iterable or object'); + const obj = this.clone(); + + const symbols = []; + for (const entry of iterable) { + Hoek.assert(entry && entry[Symbol.iterator], 'Entry must be an iterable'); + const [key, value] = entry; - if (code <= 57) { - updateResult(internals.diagnoses.rfc5321TLDNumeric); + Hoek.assert(typeof key !== 'object' && typeof key !== 'function' && typeof key !== 'symbol', 'Key must not be an object, function, or Symbol'); + Hoek.assert(typeof value === 'symbol', 'Value must be a Symbol'); + obj._inner.map.set(key, value); + symbols.push(value); } - } - if (maxResult < threshold) { - maxResult = internals.diagnoses.valid; + return obj.valid(...symbols); } - const finishResult = diagnose ? maxResult : maxResult < internals.defaultThreshold; + describe() { - // $lab:coverage:off$ - if (callback) { - callback(finishResult); + const description = super.describe(); + description.map = new Map(this._inner.map); + return description; } - // $lab:coverage:on$ - - return finishResult; }; -exports.diagnoses = internals.validate.diagnoses = (function () { - - const diag = {}; - const keys = Object.keys(internals.diagnoses); - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - diag[key] = internals.diagnoses[key]; - } - - return diag; -})(); - - -exports.normalize = internals.normalize; +module.exports = new internals.Symbol(); /***/ }), -/* 31 */ +/* 37 */ /***/ (function(module, exports) { -module.exports = require("punycode"); +module.exports = require("util"); /***/ }), -/* 32 */ +/* 38 */ /***/ (function(module) { -module.exports = {"name":"joi","description":"Object schema validation","version":"13.6.0","homepage":"https://github.com/hapijs/joi","repository":"git://github.com/hapijs/joi","main":"lib/index.js","keywords":["hapi","schema","validation"],"engines":{"node":">=8.9.0"},"dependencies":{"hoek":"5.x.x","isemail":"3.x.x","topo":"3.x.x"},"devDependencies":{"code":"5.x.x","hapitoc":"1.x.x","lab":"15.x.x","webpack":"^4.16.5","webpack-cli":"^3.1.0"},"scripts":{"build":"webpack","test":"lab -t 100 -a code -L","test-debug":"lab -a code","test-cov-html":"lab -r html -o coverage.html -a code","toc":"hapitoc","version":"npm run toc && git add API.md README.md"},"license":"BSD-3-Clause"}; +module.exports = {"name":"@hapi/joi","description":"Object schema validation","version":"15.0.3","homepage":"https://github.com/hapijs/joi","repository":"git://github.com/hapijs/joi","main":"lib/index.js","keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"6.x.x","@hapi/address":"2.x.x","@hapi/topo":"3.x.x"},"devDependencies":{"@hapi/code":"5.x.x","@hapi/lab":"18.x.x","hapitoc":"1.x.x","webpack":"^4.31.0","webpack-cli":"^3.3.2"},"scripts":{"build":"webpack","test":"lab -t 100 -a @hapi/code -L","test-cov-html":"lab -r html -o coverage.html -a @hapi/code","toc":"hapitoc && node docs/check-errors-list.js","version":"npm run toc && git add API.md README.md"},"license":"BSD-3-Clause"}; /***/ }) -/******/ ]); +/******/ ]); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0a770e9..1012514 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "couchster", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -135,19 +135,6 @@ } } }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "dev": true, - "optional": true, - "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - } - }, "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", @@ -193,164 +180,18 @@ "sprintf-js": "~1.0.2" } }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, - "optional": true - }, "assertion-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz", - "integrity": "sha1-E8pRXYYgbaC6xm6DTdOX2HWBCUw=", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "async": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", - "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true, - "optional": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true, - "optional": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "dev": true, - "optional": true - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, "brace-expansion": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", @@ -361,65 +202,12 @@ "concat-map": "0.0.1" } }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true, - "optional": true - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, "caching-transform": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", @@ -449,25 +237,18 @@ "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", "dev": true }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true, - "optional": true - }, "chai": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz", - "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", "dev": true, "requires": { - "assertion-error": "^1.0.1", - "check-error": "^1.0.1", - "deep-eql": "^3.0.0", + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", "get-func-name": "^2.0.0", - "pathval": "^1.0.0", - "type-detect": "^4.0.0" + "pathval": "^1.1.0", + "type-detect": "^4.0.5" } }, "chalk": { @@ -487,29 +268,6 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, "cli": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", @@ -531,29 +289,12 @@ "wrap-ansi": "^2.0.0" } }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true, - "optional": true - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -569,23 +310,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "colors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", - "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", - "dev": true, - "optional": true - }, - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "dev": true, - "optional": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, "commander": { "version": "2.20.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", @@ -599,66 +323,12 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "optional": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "console-browserify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", @@ -677,12 +347,6 @@ "safe-buffer": "~5.1.1" } }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -715,23 +379,6 @@ "which": "^1.2.9" } }, - "cycle": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", - "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", - "dev": true, - "optional": true - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", @@ -761,12 +408,6 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -794,60 +435,6 @@ "object-keys": "^1.0.12" } }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true, - "optional": true - }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -855,33 +442,27 @@ "dev": true }, "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", "dev": true, "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" + "domelementtype": "^1.3.0", + "entities": "^1.1.1" }, "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - }, "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", "dev": true } } }, "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", "dev": true }, "domhandler": { @@ -903,17 +484,6 @@ "domelementtype": "1" } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "optional": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -975,13 +545,6 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, - "es6-promise": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", - "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", - "dev": true, - "optional": true - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1021,301 +584,43 @@ "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", "dev": true }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", "dev": true, "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" } }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "homedir-polyfill": "^1.0.1" + "locate-path": "^3.0.0" } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", "dev": true, - "optional": true + "requires": { + "is-buffer": "~2.0.3" + } }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "foreground-child": { + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", "dev": true, "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extract-zip": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", - "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", - "dev": true, - "optional": true, - "requires": { - "concat-stream": "1.6.2", - "debug": "2.6.9", - "mkdirp": "0.5.1", - "yauzl": "2.4.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true, - "optional": true - }, - "eyes": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", - "dev": true, - "optional": true - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "dev": true, - "optional": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true, - "optional": true - }, - "fd-slicer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", - "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", - "dev": true, - "optional": true, - "requires": { - "pend": "~1.2.0" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "flat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", - "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", - "dev": true, - "requires": { - "is-buffer": "~2.0.3" - }, - "dependencies": { - "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", - "dev": true - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "foreground-child": { - "version": "1.5.6", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", - "dev": true, - "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" + "cross-spawn": "^4", + "signal-exit": "^3.0.0" }, "dependencies": { "cross-spawn": { @@ -1330,46 +635,6 @@ } } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "dev": true, - "optional": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "1.0.6", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs-extra": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", - "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1383,9 +648,9 @@ "dev": true }, "get-caller-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-func-name": { @@ -1403,26 +668,10 @@ "pump": "^3.0.0" } }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1433,30 +682,6 @@ "path-is-absolute": "^1.0.0" } }, - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -1495,24 +720,6 @@ } } }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true, - "optional": true - }, - "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", - "dev": true, - "optional": true, - "requires": { - "ajv": "^5.3.0", - "har-schema": "^2.0.0" - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1534,64 +741,12 @@ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hasha": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", - "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", - "dev": true, - "optional": true, - "requires": { - "is-stream": "^1.0.1", - "pinkie-promise": "^2.0.0" - } - }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "homedir-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", - "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, "hosted-git-info": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", @@ -1611,18 +766,6 @@ "readable-stream": "1.1" } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -1645,38 +788,12 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -1684,9 +801,9 @@ "dev": true }, "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", + "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", "dev": true }, "is-callable": { @@ -1695,106 +812,17 @@ "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", "dev": true }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true }, "is-regex": { "version": "1.0.4", @@ -1820,19 +848,6 @@ "has-symbols": "^1.0.0" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true, - "optional": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -1845,19 +860,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true, - "optional": true - }, "istanbul-lib-coverage": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", @@ -1955,22 +957,15 @@ "dev": true }, "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true - }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -1978,22 +973,19 @@ "dev": true }, "jshint": { - "version": "2.9.6", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.6.tgz", - "integrity": "sha512-KO9SIAKTlJQOM4lE64GQUtGBRpTOuvbrRrSZw3AhUxMNG266nX9hK2cKA4SBhXOj0irJGyNyGSLT62HGOVDEOA==", + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.2.tgz", + "integrity": "sha512-e7KZgCSXMJxznE/4WULzybCMNXNAd/bf5TSrvVEq78Q/K8ZwFpmBqQeDtNiHc3l49nV4E/+YeHU/JZjSUIrLAA==", "dev": true, "requires": { "cli": "~1.0.0", "console-browserify": "1.1.x", "exit": "0.1.x", "htmlparser2": "3.8.x", - "lodash": "~4.17.10", + "lodash": "~4.17.11", "minimatch": "~3.0.2", - "phantom": "~4.0.1", - "phantomjs-prebuilt": "~2.1.7", "shelljs": "0.3.x", - "strip-json-comments": "1.0.x", - "unicode-5.2.0": "^0.7.5" + "strip-json-comments": "1.0.x" } }, "json-parse-better-errors": { @@ -2002,73 +994,6 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true, - "optional": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true, - "optional": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true, - "optional": true - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "kew": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", - "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", - "dev": true, - "optional": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", @@ -2166,21 +1091,6 @@ "p-defer": "^1.0.0" } }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, "mem": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", @@ -2209,44 +1119,6 @@ } } }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", - "dev": true, - "optional": true - }, - "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", - "dev": true, - "optional": true, - "requires": { - "mime-db": "~1.36.0" - } - }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -2268,27 +1140,6 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -2299,9 +1150,9 @@ } }, "mocha": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.0.tgz", - "integrity": "sha512-A7g9k3yr8oJaXn2IItFnfgjyxFc/LTe6Wwv7FczP+e8G74o9xYNSbMYmCf1ouldRojLrFcOb+z75P6Ak0GX6ug==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.4.tgz", + "integrity": "sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -2309,23 +1160,23 @@ "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "findup-sync": "2.0.0", + "find-up": "3.0.0", "glob": "7.1.3", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.12.0", + "js-yaml": "3.13.1", "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", "ms": "2.1.1", - "node-environment-flags": "1.0.4", + "node-environment-flags": "1.0.5", "object.assign": "4.1.0", "strip-json-comments": "2.0.1", "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "12.0.5", - "yargs-parser": "11.1.1", + "yargs": "13.2.2", + "yargs-parser": "13.0.0", "yargs-unparser": "1.5.0" }, "dependencies": { @@ -2352,12 +1203,6 @@ "path-is-absolute": "^1.0.0" } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -2376,40 +1221,29 @@ } }, "mock-require": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mock-require/-/mock-require-3.0.2.tgz", - "integrity": "sha512-aD/Y1ZFHqw5pHg3HVQ50dLbfaAAcytS6sqLuhP51Dk3TSPdFb2VkSAa3mjrHifLIlGAtwQHJHINafAyqAne7vA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/mock-require/-/mock-require-3.0.3.tgz", + "integrity": "sha512-lLzfLHcyc10MKQnNUCv7dMcoY/2Qxd6wJfbqCcVk3LDb8An4hF6ohk5AztrvgKhJCqj36uyzi/p5se+tvyD+Wg==", "dev": true, "requires": { "get-caller-file": "^1.0.2", "normalize-path": "^2.1.1" + }, + "dependencies": { + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + } } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, "neo-async": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", @@ -2429,12 +1263,21 @@ "dev": true }, "node-environment-flags": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.4.tgz", - "integrity": "sha512-M9rwCnWVLW7PX+NUWe3ejEdiLYinRpsEre9hMkU/6NS4h+EEulYaDH1gCEZ2gyXsmw+RXYDaV2JkkTNcsPDJ0Q==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", + "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", "dev": true, "requires": { - "object.getownpropertydescriptors": "^2.0.3" + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } }, "normalize-package-data": { @@ -2599,59 +1442,12 @@ } } }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true, - "optional": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "object-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, "object.assign": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", @@ -2674,15 +1470,6 @@ "es-abstract": "^1.5.1" } }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -2800,18 +1587,6 @@ "json-parse-better-errors": "^1.0.1" } }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -2859,73 +1634,12 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "dev": true, - "optional": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true, - "optional": true - }, - "phantom": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/phantom/-/phantom-4.0.12.tgz", - "integrity": "sha512-Tz82XhtPmwCk1FFPmecy7yRGZG2btpzY2KI9fcoPT7zT9det0CcMyfBFPp1S8DqzsnQnm8ZYEfdy528mwVtksA==", - "dev": true, - "optional": true, - "requires": { - "phantomjs-prebuilt": "^2.1.16", - "split": "^1.0.1", - "winston": "^2.4.0" - } - }, - "phantomjs-prebuilt": { - "version": "2.1.16", - "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", - "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", - "dev": true, - "optional": true, - "requires": { - "es6-promise": "^4.0.3", - "extract-zip": "^1.6.5", - "fs-extra": "^1.0.0", - "hasha": "^2.2.0", - "kew": "^0.7.0", - "progress": "^1.1.8", - "request": "^2.81.0", - "request-progress": "^2.0.1", - "which": "^1.2.10" - } - }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true, - "optional": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "optional": true, - "requires": { - "pinkie": "^2.0.0" - } - }, "pkg-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", @@ -2935,39 +1649,12 @@ "find-up": "^3.0.0" } }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true, - "optional": true - }, - "progress": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", - "dev": true, - "optional": true - }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, - "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", - "dev": true, - "optional": true - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -2978,20 +1665,6 @@ "once": "^1.3.1" } }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true, - "optional": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true, - "optional": true - }, "read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", @@ -3025,16 +1698,6 @@ "string_decoder": "~0.10.x" } }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -3050,57 +1713,6 @@ "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "optional": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "request-progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", - "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", - "dev": true, - "optional": true, - "requires": { - "throttleit": "^1.0.0" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3108,9 +1720,9 @@ "dev": true }, "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "resolve": { @@ -3122,34 +1734,12 @@ "path-parse": "^1.0.6" } }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - } - }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -3181,22 +1771,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, - "optional": true - }, "semver": { "version": "5.5.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", @@ -3204,33 +1778,10 @@ "dev": true }, "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true }, "shebang-command": { "version": "1.2.0", @@ -3259,147 +1810,12 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "dev": true, - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, "spawn-wrap": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz", @@ -3446,77 +1862,12 @@ "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", "dev": true }, - "split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "dev": true, - "optional": true, - "requires": { - "through": "2" - } - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", - "dev": true, - "optional": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", - "dev": true, - "optional": true - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -3603,115 +1954,24 @@ } } }, - "throttleit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", - "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", - "dev": true, - "optional": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true, - "optional": true - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "optional": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true - }, "type-detect": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.5.tgz", - "integrity": "sha512-N9IvkQslUGYGC24RkJk1ba99foK6TkwC2FHAEBlQFBP0RxQZS8ZpJuAZcwiY/w9ZJHFQb1aOXBI60OdxhTrwEQ==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true, - "optional": true - }, "uglify-js": { "version": "3.5.11", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.11.tgz", @@ -3732,112 +1992,6 @@ } } }, - "unicode-5.2.0": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/unicode-5.2.0/-/unicode-5.2.0-0.7.5.tgz", - "integrity": "sha512-KVGLW1Bri30x00yv4HNM8kBxoqFXr0Sbo55735nvrlsx4PYBZol3UtoWgO492fSwmsetzPEZzy73rbU8OGXJcA==", - "dev": true - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "optional": true - }, "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", @@ -3854,18 +2008,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -3890,21 +2032,6 @@ "string-width": "^1.0.2 || 2" } }, - "winston": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.4.tgz", - "integrity": "sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q==", - "dev": true, - "optional": true, - "requires": { - "async": "~1.0.0", - "colors": "1.0.x", - "cycle": "1.0.x", - "eyes": "0.1.x", - "isstream": "0.1.x", - "stack-trace": "0.0.x" - } - }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -3988,29 +2115,56 @@ "dev": true }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", + "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", "dev": true, "requires": { "cliui": "^4.0.0", - "decamelize": "^1.2.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^13.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -4028,23 +2182,49 @@ "yargs": "^12.0.5" }, "dependencies": { - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } - }, - "yauzl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", - "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", - "dev": true, - "optional": true, - "requires": { - "fd-slicer": "~1.0.1" - } } } } diff --git a/package.json b/package.json index b578095..213d7a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "couchster", - "version": "1.2.0", + "version": "1.2.1", "description": "A tool to build comprehensive validation functions for Apache CouchDB", "keywords": [ "apache", @@ -13,11 +13,11 @@ "main": "src/index.js", "dependencies": {}, "devDependencies": { - "chai": "^4.1.2", - "jshint": "^2.9.6", + "chai": "^4.2.0", + "jshint": "^2.10.2", "lodash": "^4.17.11", - "mocha": "^6.0.0", - "mock-require": "^3.0.2", + "mocha": "^6.1.4", + "mock-require": "^3.0.3", "nyc": "^14.1.1" }, "scripts": { diff --git a/src/loading/validation-function-loader.js b/src/loading/validation-function-loader.js index e234e0d..3374b6d 100644 --- a/src/loading/validation-function-loader.js +++ b/src/loading/validation-function-loader.js @@ -9,7 +9,7 @@ exports.load = loadFromFile; const fs = require('fs'); const path = require('path'); -const indent = require('../../lib/indent.js/indent.min'); +const indent = require('../../lib/indent.js/indent'); const docDefinitionsLoader = require('./document-definitions-loader'); const fileFragmentLoader = require('./file-fragment-loader'); diff --git a/src/loading/validation-function-loader.spec.js b/src/loading/validation-function-loader.spec.js index ab0604d..4b56ebc 100644 --- a/src/loading/validation-function-loader.spec.js +++ b/src/loading/validation-function-loader.spec.js @@ -16,7 +16,7 @@ describe('Validation function loader', () => { mockRequire('fs', fsMock); indentMock = { js: simpleMock.stub() }; - mockRequire('../../lib/indent.js/indent.min.js', indentMock); + mockRequire('../../lib/indent.js/indent.js', indentMock); fileFragmentLoaderMock = { load: simpleMock.stub() }; mockRequire('./file-fragment-loader.js', fileFragmentLoaderMock);