diff --git a/.babelrc b/.babelrc new file mode 100755 index 0000000..ddb0449 --- /dev/null +++ b/.babelrc @@ -0,0 +1,22 @@ +{ + "presets": [ + ["@babel/env", { + "targets": { + "browsers": ["last 2 versions"], + "node": "8" + } + }], + "@babel/preset-stage-3", + "@babel/typescript" + ], + "plugins": [ + ], + "env": { + "test": { + "plugins": [ "istanbul" ] + } + }, + "ignore": [ + "src/lib/vendor/**/*.*" + ] +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7544e0c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# see editorconfig.org + +root = true + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 2 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..2ab436e --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +lib/**/* +src/lib/vendor/**/* diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..0fd01a5 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,36 @@ +// http://eslint.org/docs/user-guide/configuring + +module.exports = { + root: true, + parser: 'babel-eslint', + parserOptions: { + sourceType: 'module', + }, + env: { + browser: true, + }, + extends: ['airbnb-base', 'prettier'], + plugins: ['import', 'prettier'], + rules: { + 'import/extensions': [ + 'error', + 'always', + // hide known extensions that are resolved by webpack + { + js: 'never', + ts: 'never', + }, + ], + // prettier compatibility + 'max-len': ['error', 100], + 'prettier/prettier': [ + 'error', + { singleQuote: true, trailingComma: 'all', printWidth: 100, tabWidth: 2 }, + ], + // only for use with getter-setters + 'no-underscore-dangle': 0, + // to correctly work on windows with some tools that create windows line-endings + // this will be correct by git when committed + 'linebreak-style': 0 + }, +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1601d5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +## copy to .npmignore +.DS_Store +.idea +npm-debug.log* +yarn-debug.log* +yarn-error.log* +node_modules/ +.npm +.eslintcache +/coverage/ +/.nyc_output/ +/tmp/ + +## only ignore in git +/lib +/index.js diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..98d0a4f --- /dev/null +++ b/.npmignore @@ -0,0 +1,32 @@ +## copy from .gitignore +.DS_Store +.idea +npm-debug.log* +yarn-debug.log* +yarn-error.log* +node_modules/ +.npm +.eslintcache +/coverage/ +/.nyc_output/ +/tmp/ + +# .npmignore +.babelrc +.editorconfig +.eslintignore +.eslintrc.js +.gitignore +.nvmrc +.nycrc +.prettierignore +.prettierrc +.travis.yml +AUTHORS.md +CONTRIBUTING.md +tsconfig.json +tslint.json +/docs +/example +/src +/test diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +8 diff --git a/.nycrc b/.nycrc new file mode 100644 index 0000000..241e9bb --- /dev/null +++ b/.nycrc @@ -0,0 +1,28 @@ +{ + "sourceMap": false, + "instrument": false, + "check-coverage": true, + "per-file": true, + "lines": 100, + "statements": 100, + "functions": 50, + "branches": 100, + "include": [ + "src/**/*.{js,ts}" + ], + "exclude": [ + "test/**/*.spec.{js,ts}", + "src/lib/vendor/**/*.*" + ], + "reporter": [ + "lcov", + "text-summary" + ], + "extension": [ + ".js", + ".ts" + ], + "cache": true, + "all": true, + "report-dir": "./coverage" +} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..98ede4e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +# for potential vendor files in src +lib/**/* +src/lib/vendor/**/* diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..3b91465 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,14 @@ +{ + "printWidth": 100, + "tabWidth": 2, + "singleQuote": true, + "trailingComma": "all", + "overrides": [ + { + "files": "*.json", + "options": { + "printWidth": 999999 + } + } + ] +} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..420ad12 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +language: node_js + +node_js: + - 'stable' + - '8' + +sudo: false + +script: + - npm run build + - npm run validate + +after_script: + - node_modules/.bin/coveralls < coverage/lcov.info + +before_deploy: + - npm run build:dist && node ./script/package-dist.js + +deploy: + - provider: npm + email: 'thanarie@gmail.com' + api_key: + secure: '' + on: + tags: true + node: '8' + skip_cleanup: true diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000..b8ba94c --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1 @@ +* [Arjan van Wijk](https://github.com/thanarie) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..dbefd6c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# Contributing + +## Adding docs + +Documentation is important, so any additions or improvements are welcomed! + +## Adding features + +Wanting to add a feature? Awesome! + +If you're not sure the feature will be accepted, you can first open an issue to +see what others think. + +Otherwise, just open a PR and describe what the feature is for; what problem it +solves, why it should be added. + +You should also provide tests for the new feature, so we know it's working and +to show of the usage. + +At last, please update the docs, describing how this new feature can be used. + +## Fixing bugs + +You found a bug? How embarrassing! + +If you don't know how to fix it yourself, you can open an issue describing the +bug; how to reproduce, desired behavior, actual behavior. + +Otherwise, you can open a PR. Please add a test first to show the incorrect +behavior, and then add the fix so the test passes. + +## Code style + +Please keep the code style consistent, defined by .editorconfig and the linters +in place. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..54ec35c --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2017 Tha Narie. + +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: + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1454aa0 --- /dev/null +++ b/README.md @@ -0,0 +1,224 @@ +[![Travis](https://img.shields.io/travis/thanarie/html-extract-data.svg?maxAge=2592000)](https://travis-ci.org/thanarie/html-extract-data) +[![npm](https://img.shields.io/npm/v/html-extract-data.svg?maxAge=2592000)](https://www.npmjs.com/package/html-extract-data) +[![npm](https://img.shields.io/npm/dm/html-extract-data.svg?maxAge=2592000)](https://www.npmjs.com/package/html-extract-data) + +# html-extract-data + +Extract data from the DOM using a JSON config + + +## Installation + +```sh +yarn add html-extract-data +``` + +```sh +npm i -S html-extract-data +``` + +## Usage + +### Basic +```ts +import extractFromHTML from 'html-extract-data'; + +extractFromHTML( + html, // a HTML DOM element + { + query: '.grid-item', + data: { + title: 'h2', + description: { query: 'p', html: true }, + } + }, +); + +// Output: +{ + title: 'title', + description: 'description bold' +} +``` + +### Advanced +```ts +import extractFromHTML from 'html-extract-data'; + +const data = extractFromHTML( + // a HTML DOM element + html, + { + // query element within the html + query: '.grid-item', + + // if list, it will use querySelectorAll and return an array + list: true, + + // extract dat (mostly attributes) from the element itself + self: { + + // grab the `data-category` attribute and put it in the `category` field + 'category': 'data-category', + + // convert the value to a number + 'id': { attr: 'data-id', convert: 'number' }, + } + + // extract extra data from child elements + data: { + + // get the text value from the `h2` element + title: 'h2', + + // get the html value from the `p` element + description: { query: 'p', html: true }, + + // get the text value from the `.tag` elements, and return as an array + tags: { query: '.tags > .tag', list: true }, + + // option to convert your extracted value, provide a user function + price: { query: '.price', convert: parseFloat } + + // or use any of the built-in converts (number, float, boolean, date) + date: { query: '.date', convert: 'date' } + + // when passed a function, you can do your own logic, + // extract and process any information you want, and return a value + // the extract function passed is bould to the parent element + // the parent element itself is also passed + image: (extract, element) => ({ + + // in here you can call and pass the same information as above + alt: extract({ query: '.js-image', attr: 'alt' }), + + // or use the shorthand syntax + src: extract('.js-image', { attr: 'src' }), + }), + + // alternative option for the above + image2: (extract) => + + // if we just want to exract info from a single element + // we can just pass a data object with shorthand extracts (see below) + extract('.js-image', { + data: { src: 'src', alt: 'alt' } + }), + // use the shorthand syntax to extra information from a single element + link: { + // specify the query to that element + query: 'a', + data: { + + // when passed a string, it will extract the attribute + href: 'href', + + // when passed as object, it will do the same as normal + target: { attr: 'target', convert: 'number' }, + + // when passed true, it will grab the text content + text: true, + + // this will extract the HTML content + value: { html: true }, + }, + }, + }, + }, + + // pass an additional object that will be merged in each extracted item + { + // normal property + visible: false, + + // allows deep merging (this prepends a default value to the array) + tags: ['select a value'] + } +); +``` + +Will output: +``` +[{ + category: 'js', + id: 1, + title: 'title', + description: 'description bold', + tags: ['select a value', 'a', 'b', 'c'], + price: 123.45, + date: Date(2018-20-08 ... ) + image: { + src: 'foo.jpg', + alt: 'foobar', + }, + image2: { + src: "foo.jpg", + alt: "foobar", + }, + link: { + href: 'http://www.google.com', + target: '_blank', + text: 'google', + value: 'google' + }, + visible: false +}] +``` + +### Production + +This library uses joi to validate the input config structure, but it's quite large. +That's why they are added within `process.env.NODE_ENV !== 'production'` checks, which means +that your build process can strip it out. + +## Documentation + +View the [unit tests](./test) to see all the possible ways this module can be used. + + +## Building + +In order to build html-extract-data, ensure that you have [Git](http://git-scm.com/downloads) +and [Node.js](http://nodejs.org/) installed. + +Clone a copy of the repo: +```sh +git clone https://github.com/thanarie/html-extract-data.git +``` + +Change to the html-extract-data directory: +```sh +cd html-extract-data +``` + +Install dev dependencies: +```sh +yarn +``` + +Use one of the following main scripts: +```sh +yarn build # build this project +yarn test # run the unit tests incl coverage +yarn test:dev # run the unit tests in watch mode +yarn lint # run tslint on this project +``` + +## Contribute + +View [CONTRIBUTING.md](./CONTRIBUTING.md) + + +## Changelog + +View [CHANGELOG.md](./CHANGELOG.md) + + +## Authors + +View [AUTHORS.md](./AUTHORS.md) + + +## LICENSE + +[MIT](./LICENSE) © Tha Narie diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..2994816 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,4 @@ +export { extractFromHTML as default } from './lib/extract-from-html'; +export { extractFromHTML } from './lib/extract-from-html'; +export { extractData } from './lib/extract-data'; +export { extractFromElement } from './lib/extract-from-element'; diff --git a/package.json b/package.json new file mode 100755 index 0000000..4838a45 --- /dev/null +++ b/package.json @@ -0,0 +1,96 @@ +{ + "name": "html-extract-data", + "version": "1.0.0", + "main": "./index.js", + "types": "./index.d.ts", + "scripts": { + "prepublishOnly": "npm-run-all -s validate build", + "validate": "npm-run-all -p lint test", + "dev": "npm-run-all -p dev:*", + "dev:babel": "babel ./src -x \".ts\" --out-dir ./ --watch", + "dev:ts": "tsc --noEmit --allowJs --watch", + "build": "npm-run-all -s clean build:*", + "build:babel": "babel ./src -x \".ts\" -x \".js\" --out-dir ./ --copy-files", + "build:ts": "tsc --declaration --outDir tmp --declarationDir ./", + "test": "cross-env NODE_ENV=test nyc mocha \"./test/**/*.spec.{ts,js}\"", + "test:dev": "mocha -w --watch-extensions ts,js \"./test/**/*.spec.{ts,js}\"", + "clean": "npm-run-all clean:*", + "clean:test": "shx rm -rf coverage .nyc_output", + "clean:npm": "shx rm -rf lib tmp index.js", + "lint": "npm-run-all lint:*", + "lint:js": "eslint src --ext .js --cache", + "lint:ts": "tslint src/**/*.ts -c tslint.json -p tsconfig.json -t verbose", + "prettify": "prettier --write \"src/**/*.{js,ts,json}\"", + "precommit": "lint-staged" + }, + "lint-staged": { + "gitDir": "./", + "linters": { + "src/**/*.{js,ts,json}": [ + "prettier --write", + "git add" + ], + "src/**/*.js": [ + "npm run lint:js" + ], + "src/**/*.ts": [ + "npm run lint:ts" + ] + } + }, + "author": "Arjan van Wijk (https://github.com/thanarie)", + "homepage": "https://www.thanarie.nl/", + "license": "MIT", + "keywords": [ + "html", + "extract" + ], + "bugs": { + "url": "https://github.com/thanarie/html-extract-data/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/thanarie/html-extract-data.git" + }, + "devDependencies": { + "@babel/cli": "^7.0.0-beta.35", + "@babel/core": "^7.0.0-beta.35", + "@babel/preset-env": "^7.0.0-beta.35", + "@babel/preset-stage-3": "^7.0.0-beta.35", + "@babel/preset-typescript": "^7.0.0-beta.35", + "@babel/register": "^7.0.0-beta.35", + "@types/mocha": "^2.2.44", + "babel-eslint": "^8.0.3", + "babel-plugin-istanbul": "^4.1.5", + "chai": "^4.1.2", + "cross-env": "^5.1.1", + "eslint": "^4.13.1", + "eslint-config-airbnb-base": "^12.1.0", + "eslint-config-prettier": "^2.9.0", + "eslint-friendly-formatter": "^3.0.0", + "eslint-plugin-import": "^2.8.0", + "eslint-plugin-prettier": "^2.4.0", + "husky": "^0.14.3", + "jsdom": "^11.5.1", + "jsdom-global": "^3.0.2", + "lint-staged": "^6.0.0", + "mocha": "^4.0.1", + "npm-run-all": "^4.1.2", + "nyc": "^11.3.0", + "prettier": "^1.9.2", + "shx": "^0.2.2", + "ts-node": "^4.0.2", + "tslint": "^5.8.0", + "tslint-config-airbnb": "^5.4.2", + "tslint-config-prettier": "^1.6.0", + "typescript": "^2.6.2" + }, + "dependencies": { + "@types/joi": "^13.0.3", + "@types/lodash": "^4.14.91", + "detect-node": "^2.0.3", + "joi": "^13.0.2", + "joi-browser": "^13.0.1", + "lodash": "^4.17.4" + } +} diff --git a/src/index.js b/src/index.js new file mode 100755 index 0000000..5190824 --- /dev/null +++ b/src/index.js @@ -0,0 +1,9 @@ +/* eslint-disable */ +const extractFromHTML = require('./lib/extract-from-html').extractFromHTML; +const extractData = require('./lib/extract-data').extractFromHTML; +const extractFromElement = require('./lib/extract-from-element').extractFromHTML; + +module.exports = extractFromHTML; +module.exports.extractFromHTML = extractFromHTML; +module.exports.extractData = extractData; +module.exports.extractFromElement = extractFromElement; diff --git a/src/lib/extract-data.ts b/src/lib/extract-data.ts new file mode 100755 index 0000000..8eea8c5 --- /dev/null +++ b/src/lib/extract-data.ts @@ -0,0 +1,50 @@ +import { extractFromElement, getSchemaKeys } from './extract-from-element'; +import { validateSchema } from './validation'; + +export function extractData(parent, infoOrQuery, config = {}) { + if (!parent) { + throw new Error("Missing first parameter 'parent'"); + } + if (!infoOrQuery) { + throw new Error("Missing second parameter 'config'"); + } + + let mergedConfig; + if (typeof infoOrQuery === 'string') { + mergedConfig = { + ...config, + query: infoOrQuery, + }; + } else { + mergedConfig = infoOrQuery; + } + + const validatedConfig = validateSchema(mergedConfig, dataSchema); + + const { query, list, ...finalConfig } = validatedConfig; + + if (!list) { + return extractFromElement(parent.querySelector(query), finalConfig); + } + + return Array.from(parent.querySelectorAll(query)).map(child => + extractFromElement(child, finalConfig), + ); +} + +const dataSchema = (() => { + const isProd = process.env.NODE_ENV === 'production'; + /* istanbul ignore if */ + if (isProd) return {}; + + const Joi = require('./vendor/joi-browser'); + return Joi.object().keys({ + ...getSchemaKeys(), + query: Joi.string().required(), + list: Joi.bool(), + }); +})(); + +export function getSchema(): any { + return dataSchema; +} diff --git a/src/lib/extract-from-element.ts b/src/lib/extract-from-element.ts new file mode 100755 index 0000000..e899a4a --- /dev/null +++ b/src/lib/extract-from-element.ts @@ -0,0 +1,101 @@ +import { validateSchema } from './validation'; + +export function extractFromElement(element, config) { + // no element found, return null value + if (!element) { + return null; + } + + const validatedConfig = validateSchema(config, elementScheme); + + let value; + // extract multiple properties from the same element + if (validatedConfig.data) { + value = extractDataFromElement(element, validatedConfig.data); + } else if (validatedConfig.attr) { + // extract attribute + value = element.getAttribute(validatedConfig.attr); + } else { + // extract text or html value + value = element[validatedConfig.html ? 'innerHTML' : 'textContent']; + } + + // convert value before returning + if (validatedConfig.convert) { + value = convertValue(value, validatedConfig.convert); + } + return value; +} + +function extractDataFromElement(element, data) { + return Object.keys(data).reduce((acc, key) => { + const dataConfig = data[key]; + const isAttr = typeof dataConfig === 'string'; + const isText = dataConfig === true; + acc[key] = extractFromElement( + element, + isAttr ? { attr: dataConfig } : isText ? {} : dataConfig, + ); + return acc; + }, {}); +} + +function convertValue(value, to) { + if (typeof to === 'function') { + // usr func + return to(value); + } + // built-in + switch (to) { + case 'number': + return parseInt(value, 10); + case 'float': + return parseFloat(value); + case 'boolean': + return value === 'true'; + case 'date': + return new Date(value); + } +} + +const baseKeys = (() => { + const isProd = process.env.NODE_ENV === 'production'; + /* istanbul ignore if */ + if (isProd) return {}; + + const Joi = require('./vendor/joi-browser'); + return { + attr: Joi.string(), + convert: [Joi.func().arity(1), Joi.string().regex(/^(number|float|boolean|date)$/)], + html: Joi.bool(), + }; +})(); + +const elementScheme = (() => { + const isProd = process.env.NODE_ENV === 'production'; + /* istanbul ignore if */ + if (isProd) return {}; + + const Joi = require('./vendor/joi-browser'); + return Joi.object().keys(getSchemaKeys()); +})(); + +export function getDataSchema() { + const isProd = process.env.NODE_ENV === 'production'; + /* istanbul ignore if */ + if (isProd) return {}; + + const Joi = require('./vendor/joi-browser'); + return Joi.object().pattern(/.*/, [Joi.string(), Joi.bool(), Joi.object().keys(baseKeys)]); +} + +export function getSchemaKeys(): any { + const isProd = process.env.NODE_ENV === 'production'; + /* istanbul ignore if */ + if (isProd) return {}; + + return { + ...baseKeys, + data: getDataSchema(), + }; +} diff --git a/src/lib/extract-from-html.ts b/src/lib/extract-from-html.ts new file mode 100755 index 0000000..13b6a0a --- /dev/null +++ b/src/lib/extract-from-html.ts @@ -0,0 +1,83 @@ +import mergeWith from 'lodash/mergeWith'; +import { extractData, getSchema } from './extract-data'; +import { extractFromElement, getDataSchema } from './extract-from-element'; +import { validateSchema } from './validation'; + +export function extractFromHTML(container: HTMLElement, config: any, additionalData: any = {}) { + if (!container) { + throw new Error("Missing first parameter 'container'"); + } + if (!config) { + throw new Error("Missing second parameter 'config'"); + } + + const validatedConfig = validateSchema(config, schema); + + if (validatedConfig.list) { + const elements = Array.from(container.querySelectorAll(validatedConfig.query)); + return elements.map((element: HTMLElement) => + getData(element, validatedConfig, additionalData), + ); + } + + return getData( + validatedConfig.query ? container.querySelector(validatedConfig.query) : container, + validatedConfig, + additionalData, + ); +} + +function getData(element, config, additionalData) { + const extractedData = Object.keys(config.data).reduce((obj, key) => { + const dataConfig = config.data[key]; + let extracted; + if (typeof dataConfig === 'function') { + extracted = dataConfig( + // @ts-ignore: TS doesn't understand passing destructure args yet + (...args) => extractData(element, ...args), + element, + ); + } else { + extracted = extractData(element, dataConfig); + } + obj[key] = extracted; + return obj; + }, {}); + + let selfData; + if (config.self) { + selfData = extractFromElement(element, { + data: config.self, + }); + } + + return mergeWith({}, additionalData, selfData, extractedData, (objValue, srcValue) => { + if (Array.isArray(objValue)) { + return objValue.concat(srcValue); + } + }); +} + +const schema = (() => { + const isProd = process.env.NODE_ENV === 'production'; + /* istanbul ignore if */ + if (isProd) return {}; + + const Joi = require('./vendor/joi-browser'); + return Joi.object() + .keys({ + query: Joi.string(), + data: Joi.object() + .pattern(/.*/, [ + Joi.string(), + Joi.func() + .minArity(1) + .maxArity(2), + getSchema(), + ]) + .required(), + list: Joi.bool(), + self: getDataSchema(), + }) + .with('list', 'query'); +})(); diff --git a/src/lib/validation.ts b/src/lib/validation.ts new file mode 100755 index 0000000..09bfebb --- /dev/null +++ b/src/lib/validation.ts @@ -0,0 +1,24 @@ +import isNode from 'detect-node'; + +export function validateSchema(config, schema) { + /* istanbul ignore if */ + if (process.env.NODE_ENV === 'production') { + return config; + } + + const Joi = require('./vendor/joi-browser'); + const { error, value: validatedConfig } = Joi.validate(config, schema); + + if (error) { + const stack = error.stack + .split(/\n/g) + .slice(5) + .join('\n'); + const explanation = `\n ${error.annotate(!isNode).replace(/\n/g, '\n ')}`; + const message = `${error.message}\n\nExplanation:\n${explanation}\n\nStack trace:\n${stack}`; + + throw new TypeError(message); + } + + return validatedConfig; +} diff --git a/src/lib/vendor/joi-browser.js b/src/lib/vendor/joi-browser.js new file mode 100644 index 0000000..1773061 --- /dev/null +++ b/src/lib/vendor/joi-browser.js @@ -0,0 +1,13426 @@ +const isProd = process.env.NODE_ENV === 'production'; +if (!isProd) { + (function webpackUniversalModuleDefinition(root, factory) { + if (typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if (typeof define === 'function' && define.amd) + define("Joi", [], factory); + else if (typeof exports === 'object') + exports["Joi"] = factory(); + else + root["Joi"] = factory(); + })(this, function () { + return /******/ (function (modules) { // webpackBootstrap + /******/ // The module cache + /******/ + var installedModules = {}; + /******/ + /******/ // The require function + /******/ + function __webpack_require__(moduleId) { + /******/ + /******/ // Check if module is in cache + /******/ + if (installedModules[moduleId]) { + /******/ + return installedModules[moduleId].exports; + /******/ + } + /******/ // Create a new module (and put it into the cache) + /******/ + var module = installedModules[moduleId] = { + /******/ i: moduleId, + /******/ l: false, + /******/ exports: {} + /******/ + }; + /******/ + /******/ // Execute the module function + /******/ + modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + /******/ + /******/ // Flag the module as loaded + /******/ + module.l = true; + /******/ + /******/ // Return the exports of the module + /******/ + return module.exports; + /******/ + } + + /******/ + /******/ + /******/ // expose the modules object (__webpack_modules__) + /******/ + __webpack_require__.m = modules; + /******/ + /******/ // expose the module cache + /******/ + __webpack_require__.c = installedModules; + /******/ + /******/ // identity function for calling harmony imports with the correct context + /******/ + __webpack_require__.i = function (value) { + return value; + }; + /******/ + /******/ // define getter function for harmony exports + /******/ + __webpack_require__.d = function (exports, name, getter) { + /******/ + if (!__webpack_require__.o(exports, name)) { + /******/ + Object.defineProperty(exports, name, { + /******/ configurable: false, + /******/ enumerable: true, + /******/ get: getter + /******/ + }); + /******/ + } + /******/ + }; + /******/ + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ + __webpack_require__.n = function (module) { + /******/ + var getter = module && module.__esModule ? + /******/ function getDefault() { + return module['default']; + } : + /******/ function getModuleExports() { + return module; + }; + /******/ + __webpack_require__.d(getter, 'a', getter); + /******/ + return getter; + /******/ + }; + /******/ + /******/ // Object.prototype.hasOwnProperty.call + /******/ + __webpack_require__.o = function (object, property) { + return Object.prototype.hasOwnProperty.call(object, property); + }; + /******/ + /******/ // __webpack_public_path__ + /******/ + __webpack_require__.p = ""; + /******/ + /******/ // Load entry module and return exports + /******/ + return __webpack_require__(__webpack_require__.s = 29); + /******/ + }) + /************************************************************************/ + /******/([ + /* 0 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + /* WEBPACK VAR INJECTION */ + (function (Buffer, process) { + +// Load modules + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? + function (obj) { + return typeof obj; + } : + function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? + "symbol" : + typeof obj; + }; + + var Crypto = __webpack_require__(14); + var Path = __webpack_require__(34); + var Util = __webpack_require__(38); + var Escape = __webpack_require__(15); + +// Declare internals + + var internals = {}; + +// Clone object or array + + exports.clone = function (obj, seen) { + + if ((typeof obj === 'undefined' ? + 'undefined' : + _typeof(obj)) !== 'object' || obj === null) { + + return obj; + } + + seen = seen || new Map(); + + var lookup = seen.get(obj); + if (lookup) { + return lookup; + } + + var newObj = void 0; + var cloneDeep = false; + + if (!Array.isArray(obj)) { + if (Buffer.isBuffer(obj)) { + newObj = new Buffer(obj); + } else if (obj instanceof Date) { + newObj = new Date(obj.getTime()); + } else if (obj instanceof RegExp) { + newObj = new RegExp(obj); + } else { + var proto = Object.getPrototypeOf(obj); + if (proto && proto.isImmutable) { + + newObj = obj; + } else { + newObj = Object.create(proto); + cloneDeep = true; + } + } + } else { + newObj = []; + cloneDeep = true; + } + + seen.set(obj, newObj); + + if (cloneDeep) { + var keys = Object.getOwnPropertyNames(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var descriptor = Object.getOwnPropertyDescriptor(obj, key); + if (descriptor && (descriptor.get || descriptor.set)) { + + Object.defineProperty(newObj, key, descriptor); + } else { + newObj[key] = exports.clone(obj[key], seen); + } + } + } + + return newObj; + }; + +// Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied + + /*eslint-disable */ + exports.merge = function ( + target, + source, + isNullOverride + /* = true */, + isMergeArrays + /* = true */ + ) { + /*eslint-enable */ + + exports.assert( + target && (typeof target === 'undefined' ? + 'undefined' : + _typeof(target)) === 'object', 'Invalid target value: must be an object'); + exports.assert( + source === null || source === undefined || (typeof source === 'undefined' ? + 'undefined' : + _typeof(source)) === 'object', + 'Invalid source value: must be null, undefined, or an object' + ); + + if (!source) { + return target; + } + + if (Array.isArray(source)) { + exports.assert(Array.isArray(target), 'Cannot merge array onto an object'); + if (isMergeArrays === false) { + // isMergeArrays defaults to true + target.length = 0; // Must not change target assignment + } + + for (var i = 0; i < source.length; ++i) { + target.push(exports.clone(source[i])); + } + + return target; + } + + var keys = Object.keys(source); + for (var _i = 0; _i < keys.length; ++_i) { + var key = keys[_i]; + var value = source[key]; + if (value && (typeof value === 'undefined' ? + 'undefined' : + _typeof(value)) === 'object') { + + if (!target[key] || _typeof(target[key]) !== 'object' || Array.isArray(target[key]) !== Array.isArray( + value) || value instanceof Date || Buffer.isBuffer(value) || value instanceof RegExp) { + + target[key] = exports.clone(value); + } else { + exports.merge(target[key], value, isNullOverride, isMergeArrays); + } + } else { + if (value !== null && value !== undefined) { + // Explicit to preserve empty strings + + target[key] = value; + } else if (isNullOverride !== false) { + // Defaults to true + target[key] = value; + } + } + } + + return target; + }; + +// Apply options to a copy of the defaults + + exports.applyToDefaults = function (defaults, options, isNullOverride) { + + exports.assert( + defaults && (typeof defaults === 'undefined' ? + 'undefined' : + _typeof(defaults)) === 'object', + 'Invalid defaults value: must be an object' + ); + exports.assert( + !options || options === true || (typeof options === 'undefined' ? + 'undefined' : + _typeof(options)) === 'object', + 'Invalid options value: must be true, falsy or an object' + ); + + if (!options) { + // If no options, return null + return null; + } + + var copy = exports.clone(defaults); + + if (options === true) { + // If options is set to true, use defaults + return copy; + } + + return exports.merge(copy, options, isNullOverride === true, false); + }; + +// Clone an object except for the listed keys which are shallow copied + + exports.cloneWithShallow = function (source, keys) { + + if (!source || (typeof source === 'undefined' ? + 'undefined' : + _typeof(source)) !== 'object') { + + return source; + } + + var storage = internals.store(source, keys); // Move shallow copy items to storage + var copy = exports.clone(source); // Deep copy the rest + internals.restore(copy, source, storage); // Shallow copy the stored items and restore + return copy; + }; + + internals.store = function (source, keys) { + + var storage = {}; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = exports.reach(source, key); + if (value !== undefined) { + storage[key] = value; + internals.reachSet(source, key, undefined); + } + } + + return storage; + }; + + internals.restore = function (copy, source, storage) { + + var keys = Object.keys(storage); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + internals.reachSet(copy, key, storage[key]); + internals.reachSet(source, key, storage[key]); + } + }; + + internals.reachSet = function (obj, key, value) { + + var path = key.split('.'); + var ref = obj; + for (var i = 0; i < path.length; ++i) { + var segment = path[i]; + if (i + 1 === path.length) { + ref[segment] = value; + } + + ref = ref[segment]; + } + }; + +// Apply options to defaults except for the listed keys which are shallow copied from option without merging + + exports.applyToDefaultsWithShallow = function (defaults, options, keys) { + + exports.assert( + defaults && (typeof defaults === 'undefined' ? + 'undefined' : + _typeof(defaults)) === 'object', + 'Invalid defaults value: must be an object' + ); + exports.assert( + !options || options === true || (typeof options === 'undefined' ? + 'undefined' : + _typeof(options)) === 'object', + 'Invalid options value: must be true, falsy or an object' + ); + exports.assert(keys && Array.isArray(keys), 'Invalid keys'); + + if (!options) { + // If no options, return null + return null; + } + + var copy = exports.cloneWithShallow(defaults, keys); + + if (options === true) { + // If options is set to true, use defaults + return copy; + } + + var storage = internals.store(options, keys); // Move shallow copy items to storage + exports.merge(copy, options, false, false); // Deep copy the rest + internals.restore(copy, options, storage); // Shallow copy the stored items and restore + return copy; + }; + +// Deep object or array comparison + + exports.deepEqual = function (obj, ref, options, seen) { + + options = options || { prototype: true }; + + var type = typeof obj === 'undefined' ? 'undefined' : _typeof(obj); + + if (type !== (typeof ref === 'undefined' ? 'undefined' : _typeof(ref))) { + return false; + } + + if (type !== 'object' || obj === null || ref === null) { + + 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 + } + + 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 (var i = 0; i < obj.length; ++i) { + if (options.part) { + var found = false; + for (var 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 (var _i2 = 0; _i2 < obj.length; ++_i2) { + if (obj[_i2] !== ref[_i2]) { + 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; + } + } + + var keys = Object.getOwnPropertyNames(obj); + + if (!options.part && keys.length !== Object.getOwnPropertyNames(ref).length) { + return false; + } + + for (var _i3 = 0; _i3 < keys.length; ++_i3) { + var key = keys[_i3]; + var descriptor = Object.getOwnPropertyDescriptor(obj, key); + if (descriptor.get) { + if (!exports.deepEqual( + descriptor, + Object.getOwnPropertyDescriptor(ref, key), + options, + seen + )) { + return false; + } + } else if (!exports.deepEqual(obj[key], ref[key], options, seen)) { + return false; + } + } + + return true; + }; + +// Remove duplicate items from array + + exports.unique = function (array, key) { + + var result = void 0; + if (key) { + result = []; + var index = new Set(); + array.forEach(function (item) { + + var identifier = item[key]; + if (!index.has(identifier)) { + index.add(identifier); + result.push(item); + } + }); + } else { + result = Array.from(new Set(array)); + } + + return result; + }; + +// Convert array into object + + exports.mapToObject = function (array, key) { + + if (!array) { + return null; + } + + var obj = {}; + for (var i = 0; i < array.length; ++i) { + if (key) { + if (array[i][key]) { + obj[array[i][key]] = true; + } + } else { + obj[array[i]] = true; + } + } + + return obj; + }; + +// Find the common unique items in two arrays + + exports.intersect = function (array1, array2, justFirst) { + + if (!array1 || !array2) { + return []; + } + + var common = []; + var hash = Array.isArray(array1) ? exports.mapToObject(array1) : array1; + var found = {}; + for (var i = 0; i < array2.length; ++i) { + if (hash[array2[i]] && !found[array2[i]]) { + if (justFirst) { + return array2[i]; + } + + common.push(array2[i]); + found[array2[i]] = true; + } + } + + return justFirst ? null : common; + }; + +// Test if the reference contains the values + + exports.contain = function (ref, values, options) { + + /* + string -> string(s) + array -> item(s) + object -> key(s) + object -> object (key:value) + */ + + var valuePairs = null; + if ((typeof ref === 'undefined' ? + 'undefined' : + _typeof(ref)) === 'object' && (typeof values === 'undefined' ? + 'undefined' : + _typeof(values)) === 'object' && !Array.isArray(ref) && !Array.isArray( + values)) { + + valuePairs = values; + values = Object.keys(values); + } else { + values = [].concat(values); + } + + options = options || {}; // deep, once, only, part + + exports.assert( + typeof ref === 'string' || (typeof ref === 'undefined' ? + 'undefined' : + _typeof(ref)) === 'object', + 'Reference must be string or an object' + ); + exports.assert(values.length, 'Values array cannot be empty'); + + var compare = void 0; + var compareFlags = void 0; + if (options.deep) { + compare = exports.deepEqual; + + var hasOnly = options.hasOwnProperty('only'); + var hasPart = options.hasOwnProperty('part'); + + compareFlags = { + prototype: hasOnly ? options.only : hasPart ? !options.part : false, + part: hasOnly ? !options.only : hasPart ? options.part : true + }; + } else { + compare = function compare(a, b) { + return a === b; + }; + } + + var misses = false; + var matches = new Array(values.length); + for (var i = 0; i < matches.length; ++i) { + matches[i] = 0; + } + + if (typeof ref === 'string') { + var pattern = '('; + for (var _i4 = 0; _i4 < values.length; ++_i4) { + var value = values[_i4]; + exports.assert( + typeof value === 'string', 'Cannot compare string reference to non-string value'); + pattern += (_i4 ? '|' : '') + exports.escapeRegex(value); + } + + var regex = new RegExp(pattern + ')', 'g'); + var leftovers = ref.replace(regex, function ($0, $1) { + + var index = values.indexOf($1); + ++matches[index]; + return ''; // Remove from string + }); + + misses = !!leftovers; + } else if (Array.isArray(ref)) { + for (var _i5 = 0; _i5 < ref.length; ++_i5) { + var matched = false; + for (var j = 0; j < values.length && matched === false; ++j) { + matched = compare(values[j], ref[_i5], compareFlags) && j; + } + + if (matched !== false) { + ++matches[matched]; + } else { + misses = true; + } + } + } else { + var keys = Object.getOwnPropertyNames(ref); + for (var _i6 = 0; _i6 < keys.length; ++_i6) { + var key = keys[_i6]; + var pos = values.indexOf(key); + if (pos !== -1) { + if (valuePairs && !compare(valuePairs[key], ref[key], compareFlags)) { + + return false; + } + + ++matches[pos]; + } else { + misses = true; + } + } + } + + var result = false; + for (var _i7 = 0; _i7 < matches.length; ++_i7) { + result = result || !!matches[_i7]; + if (options.once && matches[_i7] > 1 || !options.part && !matches[_i7]) { + + return false; + } + } + + if (options.only && misses) { + + return false; + } + + return result; + }; + +// Flatten array + + exports.flatten = function (array, target) { + + var result = target || []; + + for (var i = 0; i < array.length; ++i) { + if (Array.isArray(array[i])) { + exports.flatten(array[i], result); + } else { + result.push(array[i]); + } + } + + return result; + }; + +// Convert an object key chain string ('a.b.c') to reference (object[a][b][c]) + + exports.reach = function (obj, chain, options) { + + if (chain === false || chain === null || typeof chain === 'undefined') { + + return obj; + } + + options = options || {}; + if (typeof options === 'string') { + options = { separator: options }; + } + + var path = chain.split(options.separator || '.'); + var ref = obj; + for (var i = 0; i < path.length; ++i) { + var key = path[i]; + if (key[0] === '-' && Array.isArray(ref)) { + key = key.slice(1, key.length); + key = ref.length - key; + } + + if (!ref || !(((typeof ref === 'undefined' ? + 'undefined' : + _typeof(ref)) === 'object' || typeof ref === 'function') && key in ref) || (typeof ref === 'undefined' ? + 'undefined' : + _typeof( + ref)) !== 'object' && options.functions === false) { + // Only object and function can have properties + + exports.assert( + !options.strict || i + 1 === path.length, 'Missing segment', + key, + 'in reach path ', + chain + ); + exports.assert( + (typeof ref === 'undefined' ? + 'undefined' : + _typeof(ref)) === 'object' || options.functions === true || typeof ref !== 'function', + 'Invalid segment', + key, + 'in reach path ', + chain + ); + ref = options.default; + break; + } + + ref = ref[key]; + } + + return ref; + }; + + exports.reachTemplate = function (obj, template, options) { + + return template.replace(/{([^}]+)}/g, function ($0, chain) { + + var value = exports.reach(obj, chain, options); + return value === undefined || value === null ? '' : value; + }); + }; + + exports.formatStack = function (stack) { + + var trace = []; + for (var i = 0; i < stack.length; ++i) { + var item = stack[i]; + trace.push([item.getFileName(), + item.getLineNumber(), + item.getColumnNumber(), + item.getFunctionName(), + item.isConstructor()]); + } + + return trace; + }; + + exports.formatTrace = function (trace) { + + var display = []; + + for (var i = 0; i < trace.length; ++i) { + var 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 + + var v8 = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { + + return stack; + }; + + var capture = {}; + Error.captureStackTrace(capture, this); + var stack = capture.stack; + + Error.prepareStackTrace = v8; + + var trace = exports.formatStack(stack); + + return trace.slice(1 + slice); + }; + + exports.displayStack = function (slice) { + + var trace = exports.callStack(slice === undefined ? 1 : slice + 1); + + return exports.formatTrace(trace); + }; + + exports.abortThrow = false; + + exports.abort = function (message, hideStack) { + + if (process.env.NODE_ENV === 'test' || exports.abortThrow === true) { + throw new Error(message || 'Unknown error'); + } + + var stack = ''; + if (!hideStack) { + stack = exports.displayStack(1).join('\n\t'); + } + console.log('ABORT: ' + message + '\n\t' + stack); + process.exit(1); + }; + + exports.assert = function (condition) { + + if (condition) { + return; + } + + for (var _len = arguments.length, args = Array(_len > 1 ? + _len - 1 : + 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + if (args.length === 1 && args[0] instanceof Error) { + throw args[0]; + } + + var msgs = args.filter(function (arg) { + return arg !== ''; + }).map(function (arg) { + + return typeof arg === 'string' ? + arg : + arg instanceof Error ? + arg.message : + exports.stringify(arg); + }); + + throw new Error(msgs.join(' ') || 'Unknown error'); + }; + + exports.Bench = function () { + + this.ts = 0; + this.reset(); + }; + + exports.Bench.prototype.reset = function () { + + this.ts = exports.Bench.now(); + }; + + exports.Bench.prototype.elapsed = function () { + + return exports.Bench.now() - this.ts; + }; + + exports.Bench.now = function () { + + var ts = process.hrtime(); + return ts[0] * 1e3 + ts[1] / 1e6; + }; + +// Escape string for Regex construction + + exports.escapeRegex = function (string) { + + // Escape ^$.*+-?=!:|\/()[]{}, + return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&'); + }; + +// Base64url (RFC 4648) encode + + exports.base64urlEncode = function (value, encoding) { + + exports.assert( + typeof value === 'string' || Buffer.isBuffer(value), 'value must be string or buffer'); + var buf = Buffer.isBuffer(value) ? value : new Buffer(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'); + } + + var buf = new Buffer(value, 'base64'); + return encoding === 'buffer' ? buf : buf.toString(encoding || 'binary'); + }; + +// Escape attribute value for use in HTTP header + + exports.escapeHeaderAttribute = function (attribute) { + + // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, " + + exports.assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test( + attribute), 'Bad attribute value (' + attribute + ')'); + + return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash + }; + + exports.escapeHtml = function (string) { + + return Escape.escapeHtml(string); + }; + + exports.escapeJavaScript = function (string) { + + return Escape.escapeJavaScript(string); + }; + + exports.escapeJson = function (string) { + + return Escape.escapeJson(string); + }; + + exports.once = function (method) { + + if (method._hoekOnce) { + return method; + } + + var once = false; + var wrapped = function wrapped() { + + if (!once) { + once = true; + + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + method.apply(null, args); + } + }; + + wrapped._hoekOnce = true; + return wrapped; + }; + + 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 === 'undefined' ? + 'undefined' : + _typeof(source)) === 'object' || Array.isArray( + source), 'Invalid source object: must be null, undefined, an object, or an array'); + var separator = (typeof options === 'undefined' ? + 'undefined' : + _typeof(options)) === 'object' && options !== null ? + options.separator || '.' : + '.'; + + if (Array.isArray(source)) { + var results = []; + for (var i = 0; i < source.length; ++i) { + results.push(exports.transform(source[i], transform, options)); + } + return results; + } + + var result = {}; + var keys = Object.keys(transform); + + for (var _i8 = 0; _i8 < keys.length; ++_i8) { + var key = keys[_i8]; + var path = key.split(separator); + var sourcePath = transform[key]; + + exports.assert( + typeof sourcePath === 'string', 'All mappings must be "." delineated strings'); + + var segment = void 0; + var 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) { + extension = extension[0] !== '.' ? '.' + extension : extension; + } else { + extension = ''; + } + + path = Path.resolve(path); + var name = [Date.now(), process.pid, + Crypto.randomBytes(8).toString('hex')].join('-') + extension; + return Path.join(path, name); + }; + + exports.stringify = function () { + + try { + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + return JSON.stringify.apply(null, args); + } + catch (err) { + return '[Cannot display object: ' + err.message + ']'; + } + }; + + exports.shallow = function (source) { + + var target = {}; + var keys = Object.keys(source); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + target[key] = source[key]; + } + + return target; + }; + + exports.wait = function (timeout) { + + return new Promise(function (resolve) { + return setTimeout(resolve, timeout); + }); + }; + + exports.block = function () { + + return new Promise(exports.ignore); + }; + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(3).Buffer, __webpack_require__(5))) + + /***/ + }), + /* 1 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var Hoek = __webpack_require__(0); + +// Declare internals + + var internals = {}; + + exports.create = function (key, options) { + + Hoek.assert(typeof key === 'string', 'Invalid reference key:', key); + + var settings = Hoek.clone(options); // options can be reused and modified + + var ref = function ref(value, validationOptions) { + + return Hoek.reach(ref.isContext ? validationOptions.context : value, ref.key, settings); + }; + + ref.isContext = key[0] === (settings && settings.contextPrefix || '$'); + ref.key = ref.isContext ? key.slice(1) : key; + ref.path = ref.key.split(settings && settings.separator || '.'); + ref.depth = ref.path.length; + ref.root = ref.path[0]; + ref.isJoi = true; + + ref.toString = function () { + + return (ref.isContext ? 'context:' : 'ref:') + ref.key; + }; + + return ref; + }; + + exports.isRef = function (ref) { + + return typeof ref === 'function' && ref.isJoi; + }; + + exports.push = function (array, ref) { + + if (exports.isRef(ref) && !ref.isContext) { + + array.push(ref.root); + } + }; + + /***/ + }), + /* 2 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? + function (obj) { + return typeof obj; + } : + function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? + "symbol" : + typeof obj; + }; + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var Hoek = __webpack_require__(0); + var Ref = __webpack_require__(1); + var Errors = __webpack_require__(6); + var Alternatives = null; // Delay-loaded to prevent circular dependencies + var Cast = null; + +// Declare internals + + var internals = { + Set: __webpack_require__(9) + }; + + internals.defaults = { + abortEarly: true, + convert: true, + allowUnknown: false, + skipFunctions: false, + stripUnknown: false, + language: {}, + presence: 'optional', + strip: false, + noDefaults: false, + escapeHtml: false + + // context: null + }; + + module.exports = internals.Any = function () { + function _class() { + _classCallCheck(this, _class); + + Cast = Cast || __webpack_require__(4); + + this.isJoi = true; + this._type = 'any'; + this._settings = null; + this._valids = new internals.Set(); + this._invalids = new internals.Set(); + this._tests = []; + this._refs = []; + this._flags = { + /* + presence: 'optional', // optional, required, forbidden, ignore + allowOnly: false, + allowUnknown: undefined, + default: undefined, + forbidden: false, + encoding: undefined, + insensitive: false, + trim: false, + normalize: undefined, // NFC, NFD, NFKC, NFKD + case: undefined, // upper, lower + empty: undefined, + func: false, + raw: false + */ + }; + + this._description = null; + this._unit = null; + this._notes = []; + this._tags = []; + this._examples = []; + this._meta = []; + + this._inner = {}; // Hash of arrays of immutable objects + } + + _class.prototype.createError = function createError(type, context, state, options) { + var flags = arguments.length > 4 && arguments[4] !== undefined ? + arguments[4] : + this._flags; + + + return Errors.create(type, context, state, options, flags); + }; + + _class.prototype.createOverrideError = function createOverrideError( + type, + context, + state, + options, + message, + template + ) { + + return Errors.create(type, context, state, options, this._flags, message, template); + }; + + _class.prototype.checkOptions = function checkOptions(options) { + + var Schemas = __webpack_require__(18); + var result = Schemas.options.validate(options); + if (result.error) { + throw new Error(result.error.details[0].message); + } + }; + + _class.prototype.clone = function clone() { + + var obj = Object.create(Object.getPrototypeOf(this)); + + obj.isJoi = true; + obj._currentJoi = this._currentJoi; + obj._type = this._type; + obj._settings = internals.concatSettings(this._settings); + obj._baseType = this._baseType; + obj._valids = Hoek.clone(this._valids); + obj._invalids = Hoek.clone(this._invalids); + obj._tests = this._tests.slice(); + obj._refs = this._refs.slice(); + obj._flags = Hoek.clone(this._flags); + + obj._description = this._description; + obj._unit = this._unit; + obj._notes = this._notes.slice(); + obj._tags = this._tags.slice(); + obj._examples = this._examples.slice(); + obj._meta = this._meta.slice(); + + obj._inner = {}; + var inners = Object.keys(this._inner); + for (var i = 0; i < inners.length; ++i) { + var key = inners[i]; + obj._inner[key] = this._inner[key] ? this._inner[key].slice() : null; + } + + return obj; + }; + + _class.prototype.concat = function concat(schema) { + + Hoek.assert(schema instanceof internals.Any, 'Invalid schema object'); + Hoek.assert( + this._type === 'any' || schema._type === 'any' || schema._type === this._type, + 'Cannot merge type', + this._type, + 'with another type:', + schema._type + ); + + var obj = this.clone(); + + if (this._type === 'any' && schema._type !== 'any') { + + // Reset values as if we were "this" + var tmpObj = schema.clone(); + var keysToRestore = ['_settings', + '_valids', + '_invalids', + '_tests', + '_refs', + '_flags', + '_description', + '_unit', + '_notes', + '_tags', + '_examples', + '_meta', + '_inner']; + + for (var i = 0; i < keysToRestore.length; ++i) { + tmpObj[keysToRestore[i]] = obj[keysToRestore[i]]; + } + + obj = tmpObj; + } + + obj._settings = obj._settings ? + internals.concatSettings(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._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); + + var inners = Object.keys(schema._inner); + var isObject = obj._type === 'object'; + for (var _i = 0; _i < inners.length; ++_i) { + var key = inners[_i]; + var source = schema._inner[key]; + if (source) { + var target = obj._inner[key]; + if (target) { + if (isObject && key === 'children') { + var keys = {}; + + for (var j = 0; j < target.length; ++j) { + keys[target[j].key] = j; + } + + for (var _j = 0; _j < source.length; ++_j) { + var sourceKey = source[_j].key; + if (keys[sourceKey] >= 0) { + target[keys[sourceKey]] = { + key: sourceKey, + schema: target[keys[sourceKey]].schema.concat(source[_j].schema) + }; + } else { + target.push(source[_j]); + } + } + } else { + obj._inner[key] = obj._inner[key].concat(source); + } + } else { + obj._inner[key] = source.slice(); + } + } + } + + return obj; + }; + + _class.prototype._test = function _test(name, arg, func, options) { + + var obj = this.clone(); + obj._tests.push({ func: func, name: name, arg: arg, options: options }); + return obj; + }; + + _class.prototype.options = function options(_options) { + + Hoek.assert(!_options.context, 'Cannot override context'); + this.checkOptions(_options); + + var obj = this.clone(); + obj._settings = internals.concatSettings(obj._settings, _options); + return obj; + }; + + _class.prototype.strict = function strict(isStrict) { + + var obj = this.clone(); + obj._settings = obj._settings || {}; + obj._settings.convert = isStrict === undefined ? false : !isStrict; + return obj; + }; + + _class.prototype.raw = function raw(isRaw) { + + var value = isRaw === undefined ? true : isRaw; + + if (this._flags.raw === value) { + return this; + } + + var obj = this.clone(); + obj._flags.raw = value; + return obj; + }; + + _class.prototype.error = function error(err) { + + Hoek.assert( + err && (err instanceof Error || typeof err === 'function'), + 'Must provide a valid Error object or a function' + ); + + var obj = this.clone(); + obj._flags.error = err; + return obj; + }; + + _class.prototype.allow = function allow() { + for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) { + values[_key] = arguments[_key]; + } + + var obj = this.clone(); + values = Hoek.flatten(values); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + + Hoek.assert(value !== undefined, 'Cannot call allow/valid/invalid with undefined'); + obj._invalids.remove(value); + obj._valids.add(value, obj._refs); + } + return obj; + }; + + _class.prototype.valid = function valid() { + + var obj = this.allow.apply(this, arguments); + obj._flags.allowOnly = true; + return obj; + }; + + _class.prototype.invalid = function invalid() { + for (var _len2 = arguments.length, values = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + values[_key2] = arguments[_key2]; + } + + var obj = this.clone(); + values = Hoek.flatten(values); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + + Hoek.assert(value !== undefined, 'Cannot call allow/valid/invalid with undefined'); + obj._valids.remove(value); + obj._invalids.add(value, obj._refs); + } + + return obj; + }; + + _class.prototype.required = function required() { + + if (this._flags.presence === 'required') { + return this; + } + + var obj = this.clone(); + obj._flags.presence = 'required'; + return obj; + }; + + _class.prototype.optional = function optional() { + + if (this._flags.presence === 'optional') { + return this; + } + + var obj = this.clone(); + obj._flags.presence = 'optional'; + return obj; + }; + + _class.prototype.forbidden = function forbidden() { + + if (this._flags.presence === 'forbidden') { + return this; + } + + var obj = this.clone(); + obj._flags.presence = 'forbidden'; + return obj; + }; + + _class.prototype.strip = function strip() { + + if (this._flags.strip) { + return this; + } + + var obj = this.clone(); + obj._flags.strip = true; + return obj; + }; + + _class.prototype.applyFunctionToChildren = function applyFunctionToChildren( + children, + fn, + args, + root + ) { + + children = [].concat(children); + + if (children.length !== 1 || children[0] !== '') { + root = root ? root + '.' : ''; + + var extraChildren = (children[0] === '' ? + children.slice(1) : + children).map(function (child) { + + return root + child; + }); + + throw new Error('unknown key(s) ' + extraChildren.join(', ')); + } + + return this[fn].apply(this, args); + }; + + _class.prototype.default = function _default(value, description) { + + if (typeof value === 'function' && !Ref.isRef(value)) { + + if (!value.description && description) { + + value.description = description; + } + + if (!this._flags.func) { + Hoek.assert( + typeof value.description === 'string' && value.description.length > 0, + 'description must be provided when default value is a function' + ); + } + } + + var obj = this.clone(); + obj._flags.default = value; + Ref.push(obj._refs, value); + return obj; + }; + + _class.prototype.empty = function empty(schema) { + + var obj = this.clone(); + if (schema === undefined) { + delete obj._flags.empty; + } else { + obj._flags.empty = Cast.schema(this._currentJoi, schema); + } + return obj; + }; + + _class.prototype.when = function when(condition, options) { + + Hoek.assert(options && (typeof options === 'undefined' ? + 'undefined' : + _typeof(options)) === 'object', 'Invalid options'); + Hoek.assert( + options.then !== undefined || options.otherwise !== undefined, + 'options must have at least one of "then" or "otherwise"' + ); + + var then = options.hasOwnProperty('then') ? + this.concat(Cast.schema(this._currentJoi, options.then)) : + undefined; + var otherwise = options.hasOwnProperty('otherwise') ? + this.concat(Cast.schema(this._currentJoi, options.otherwise)) : + undefined; + + Alternatives = Alternatives || __webpack_require__(10); + + var alternativeOptions = { then: then, otherwise: otherwise }; + if (Object.prototype.hasOwnProperty.call(options, 'is')) { + alternativeOptions.is = options.is; + } + var obj = Alternatives.when(condition, alternativeOptions); + obj._flags.presence = 'ignore'; + obj._baseType = this; + + return obj; + }; + + _class.prototype.description = function description(desc) { + + Hoek.assert(desc && typeof desc === 'string', 'Description must be a non-empty string'); + + var obj = this.clone(); + obj._description = desc; + return obj; + }; + + _class.prototype.notes = function notes(_notes) { + + Hoek.assert( + _notes && (typeof _notes === 'string' || Array.isArray(_notes)), + 'Notes must be a non-empty string or array' + ); + + var obj = this.clone(); + obj._notes = obj._notes.concat(_notes); + return obj; + }; + + _class.prototype.tags = function tags(_tags) { + + Hoek.assert( + _tags && (typeof _tags === 'string' || Array.isArray(_tags)), + 'Tags must be a non-empty string or array' + ); + + var obj = this.clone(); + obj._tags = obj._tags.concat(_tags); + return obj; + }; + + _class.prototype.meta = function meta(_meta) { + + Hoek.assert(_meta !== undefined, 'Meta cannot be undefined'); + + var obj = this.clone(); + obj._meta = obj._meta.concat(_meta); + return obj; + }; + + _class.prototype.example = function example() { + + Hoek.assert(arguments.length === 1, 'Missing example'); + var value = arguments.length <= 0 ? undefined : arguments[0]; + var result = this._validate(value, null, internals.defaults); + Hoek.assert( + !result.errors, + 'Bad example:', result.errors && Errors.process(result.errors, value) + ); + + var obj = this.clone(); + obj._examples.push(value); + return obj; + }; + + _class.prototype.unit = function unit(name) { + + Hoek.assert(name && typeof name === 'string', 'Unit name must be a non-empty string'); + + var obj = this.clone(); + obj._unit = name; + return obj; + }; + + _class.prototype._prepareEmptyValue = function _prepareEmptyValue(value) { + + if (typeof value === 'string' && this._flags.trim) { + return value.trim(); + } + + return value; + }; + + _class.prototype._validate = function _validate(value, state, options, reference) { + var _this = this; + + var originalValue = value; + + // Setup state and settings + + state = state || { key: '', path: [], parent: null, reference: reference }; + + if (this._settings) { + options = internals.concatSettings(options, this._settings); + } + + var errors = []; + var finish = function finish() { + + var finalValue = void 0; + + 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)) { + + var args = void 0; + + if (state.parent !== null && _this._flags.default.length > 0) { + + args = [Hoek.clone(state.parent), options]; + } + + var 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') { + var 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(function (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: finalValue, + errors: errors.length ? errors : null + }; + }; + + if (this._coerce) { + var coerced = this._coerce.call(this, value, state, options); + if (coerced.errors) { + value = coerced.value; + errors = errors.concat(coerced.errors); + return finish(); // Coerced error always aborts early + } + + value = coerced.value; + } + + if (this._flags.empty && !this._flags.empty._validate( + this._prepareEmptyValue(value), + null, + internals.defaults + ).errors) { + value = undefined; + } + + // Check presence requirements + + var presence = this._flags.presence || options.presence; + if (presence === 'optional') { + if (value === undefined) { + var isDeepDefault = this._flags.hasOwnProperty('default') && this._flags.default === undefined; + if (isDeepDefault && this._type === 'object') { + value = {}; + } else { + return finish(); + } + } + } else if (presence === 'required' && value === undefined) { + + errors.push(this.createError('any.required', null, state, options)); + return finish(); + } else if (presence === 'forbidden') { + if (value === undefined) { + return finish(); + } + + errors.push(this.createError('any.unknown', null, state, options)); + return finish(); + } + + // Check allowed and denied values using the original value + + if (this._valids.has(value, state, options, this._flags.insensitive)) { + return finish(); + } + + if (this._invalids.has(value, state, options, this._flags.insensitive)) { + errors.push(this.createError( + value === '' ? 'any.empty' : 'any.invalid', + null, + state, + options + )); + if (options.abortEarly || value === undefined) { + // No reason to keep validating missing value + + return finish(); + } + } + + // Convert value and validate type + + if (this._base) { + var base = this._base.call(this, value, state, options); + if (base.errors) { + value = base.value; + errors = errors.concat(base.errors); + return finish(); // Base error always aborts early + } + + if (base.value !== value) { + value = base.value; + + // Check allowed and denied values using the converted value + + if (this._valids.has(value, state, options, this._flags.insensitive)) { + return finish(); + } + + if (this._invalids.has(value, state, options, this._flags.insensitive)) { + errors.push(this.createError( + value === '' ? 'any.empty' : 'any.invalid', + null, + state, + options + )); + if (options.abortEarly) { + return finish(); + } + } + } + } + + // Required values did not match + + if (this._flags.allowOnly) { + errors.push(this.createError( + 'any.allowOnly', + { valids: this._valids.values({ stripUndefined: true }) }, + state, + options + )); + if (options.abortEarly) { + return finish(); + } + } + + // Helper.validate tests + + for (var i = 0; i < this._tests.length; ++i) { + var test = this._tests[i]; + var ret = test.func.call(this, value, state, options); + if (ret instanceof Errors.Err) { + errors.push(ret); + if (options.abortEarly) { + return finish(); + } + } else { + value = ret; + } + } + + return finish(); + }; + + _class.prototype._validateWithOptions = function _validateWithOptions( + value, + options, + callback + ) { + + if (options) { + this.checkOptions(options); + } + + var settings = internals.concatSettings(internals.defaults, options); + var result = this._validate(value, null, settings); + var errors = Errors.process(result.errors, value); + + if (callback) { + return callback(errors, result.value); + } + + return { + error: errors, + value: result.value, + then: function then(resolve, reject) { + + if (errors) { + return Promise.reject(errors).catch(reject); + } + + return Promise.resolve(result.value).then(resolve); + }, + catch: function _catch(reject) { + + if (errors) { + return Promise.reject(errors).catch(reject); + } + + return Promise.resolve(result.value); + } + }; + }; + + _class.prototype.validate = function validate(value, options, callback) { + + if (typeof options === 'function') { + return this._validateWithOptions(value, null, options); + } + + return this._validateWithOptions(value, options, callback); + }; + + _class.prototype.describe = function describe() { + var _this2 = this; + + var description = { + type: this._type + }; + + var flags = Object.keys(this._flags); + if (flags.length) { + if (['empty', 'default', 'lazy', 'label'].some(function (flag) { + return _this2._flags.hasOwnProperty(flag); + })) { + description.flags = {}; + for (var i = 0; i < flags.length; ++i) { + var flag = flags[i]; + if (flag === 'empty') { + description.flags[flag] = this._flags[flag].describe(); + } else if (flag === 'default') { + if (Ref.isRef(this._flags[flag])) { + description.flags[flag] = this._flags[flag].toString(); + } else if (typeof this._flags[flag] === 'function') { + description.flags[flag] = { + description: this._flags[flag].description, + function: this._flags[flag] + }; + } else { + description.flags[flag] = this._flags[flag]; + } + } else if (flag === 'lazy' || flag === 'label') { + // We don't want it in the description + } else { + description.flags[flag] = this._flags[flag]; + } + } + } else { + description.flags = this._flags; + } + } + + if (this._settings) { + description.options = Hoek.clone(this._settings); + } + + if (this._baseType) { + description.base = this._baseType.describe(); + } + + if (this._description) { + description.description = this._description; + } + + if (this._notes.length) { + description.notes = this._notes; + } + + if (this._tags.length) { + description.tags = this._tags; + } + + if (this._meta.length) { + description.meta = this._meta; + } + + if (this._examples.length) { + description.examples = this._examples; + } + + if (this._unit) { + description.unit = this._unit; + } + + var valids = this._valids.values(); + if (valids.length) { + description.valids = valids.map(function (v) { + + return Ref.isRef(v) ? v.toString() : v; + }); + } + + var invalids = this._invalids.values(); + if (invalids.length) { + description.invalids = invalids.map(function (v) { + + return Ref.isRef(v) ? v.toString() : v; + }); + } + + description.rules = []; + + for (var _i2 = 0; _i2 < this._tests.length; ++_i2) { + var validator = this._tests[_i2]; + var item = { name: validator.name }; + + if (validator.arg !== void 0) { + item.arg = Ref.isRef(validator.arg) ? validator.arg.toString() : validator.arg; + } + + var options = validator.options; + if (options) { + if (options.hasRef) { + item.arg = {}; + var keys = Object.keys(validator.arg); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var value = validator.arg[key]; + item.arg[key] = Ref.isRef(value) ? value.toString() : value; + } + } + + if (typeof options.description === 'string') { + item.description = options.description; + } else if (typeof options.description === 'function') { + item.description = options.description(item.arg); + } + } + + description.rules.push(item); + } + + if (!description.rules.length) { + delete description.rules; + } + + var label = this._getLabel(); + if (label) { + description.label = label; + } + + return description; + }; + + _class.prototype.label = function label(name) { + + Hoek.assert(name && typeof name === 'string', 'Label name must be a non-empty string'); + + var obj = this.clone(); + obj._flags.label = name; + return obj; + }; + + _class.prototype._getLabel = function _getLabel(def) { + + return this._flags.label || def; + }; + + _createClass(_class, [{ + key: 'schemaType', + get: function get() { + + return this._type; + } + }]); + + return _class; + }(); + + internals.Any.prototype.isImmutable = true; // Prevents Hoek from deep cloning schema objects + +// Aliases + + internals.Any.prototype.only = internals.Any.prototype.equal = internals.Any.prototype.valid; + internals.Any.prototype.disallow = internals.Any.prototype.not = internals.Any.prototype.invalid; + internals.Any.prototype.exist = internals.Any.prototype.required; + + internals._try = function (fn, args) { + + var err = void 0; + var result = void 0; + + try { + result = fn.apply(null, args); + } + catch (e) { + err = e; + } + + return { + value: result, + error: err + }; + }; + + internals.concatSettings = function (target, source) { + + // Used to avoid cloning context + + if (!target && !source) { + + return null; + } + + var obj = _extends({}, target); + + if (source) { + var sKeys = Object.keys(source); + for (var i = 0; i < sKeys.length; ++i) { + var key = sKeys[i]; + if (key !== 'language' || !obj.hasOwnProperty(key)) { + + obj[key] = source[key]; + } else { + obj[key] = Hoek.applyToDefaults(obj[key], source[key]); + } + } + } + + return obj; + }; + + /***/ + }), + /* 3 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + /* WEBPACK VAR INJECTION */ + (function (global) {/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + /* eslint-disable no-proto */ + + + var base64 = __webpack_require__(30) + var ieee754 = __webpack_require__(31) + var isArray = __webpack_require__(32) + + exports.Buffer = Buffer + exports.SlowBuffer = SlowBuffer + exports.INSPECT_MAX_BYTES = 50 + + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ + Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() + + /* + * Export kMaxLength after typed array support is determined. + */ + exports.kMaxLength = kMaxLength() + + function typedArraySupport() { + try { + var arr = new Uint8Array(1) + arr.__proto__ = { + __proto__: Uint8Array.prototype, foo: function () { + return 42 + } + } + return arr.foo() === 42 && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } + catch (e) { + return false + } + } + + function kMaxLength() { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff + } + + function createBuffer(that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer(length) + } + that.length = length + } + + return that + } + + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + function Buffer(arg, encodingOrOffset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } + + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) + } + return allocUnsafe(this, arg) + } + return from(this, arg, encodingOrOffset, length) + } + + Buffer.poolSize = 8192 // not used by this implementation + +// TODO: Legacy, not needed anymore. Remove in next major version. + Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr + } + + function from(that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } + + return fromObject(that, value) + } + + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + Buffer.from = function (value, encodingOrOffset, length) { + return from(null, value, encodingOrOffset, length) + } + + if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true + }) + } + } + + function assertSize(size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } + } + + function alloc(that, size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) + } + + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) + } + + function allocUnsafe(that, size) { + assertSize(size) + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + that[i] = 0 + } + } + return that + } + + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + Buffer.allocUnsafe = function (size) { + return allocUnsafe(null, size) + } + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) + } + + function fromString(that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + var length = byteLength(string, encoding) | 0 + that = createBuffer(that, length) + + var actual = that.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + that = that.slice(0, actual) + } + + return that + } + + function fromArrayLike(that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + that = createBuffer(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that + } + + function fromArrayBuffer(that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer + + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } + + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array) + } else if (length === undefined) { + array = new Uint8Array(array, byteOffset) + } else { + array = new Uint8Array(array, byteOffset, length) + } + + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = array + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that = fromArrayLike(that, array) + } + return that + } + + function fromObject(that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) + + if (that.length === 0) { + return that + } + + obj.copy(that, 0, 0, len) + return that + } + + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } + + if (obj.type === 'Buffer' && isArray(obj.data)) { + return fromArrayLike(that, obj.data) + } + } + + throw new TypeError( + 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') + } + + function checked(length) { + // Note: cannot use `length < kMaxLength()` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 + } + + function SlowBuffer(length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) + } + + Buffer.isBuffer = function isBuffer(b) { + return !!(b != null && b._isBuffer) + } + + Buffer.compare = function compare(a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 + } + + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } + } + + Buffer.concat = function concat(list, length) { + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer + } + + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } + + var len = string.length + if (len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (; ;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + case undefined: + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } + } + + Buffer.byteLength = byteLength + + function slowToString(encoding, start, end) { + var loweredCase = false + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length + } + + if (end <= 0) { + return '' + } + + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } + } + +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. + Buffer.prototype._isBuffer = true + + function swap(b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i + } + + Buffer.prototype.swap16 = function swap16() { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this + } + + Buffer.prototype.swap32 = function swap32() { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this + } + + Buffer.prototype.swap64 = function swap64() { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this + } + + Buffer.prototype.toString = function toString() { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) + } + + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 + } + + Buffer.prototype.inspect = function inspect() { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '' + } + + Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 + } + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (isNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (Buffer.TYPED_ARRAY_SUPPORT && + typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') + } + + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } + + function read(buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } + } + + return -1 + } + + Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 + } + + Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) + } + + Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) + } + + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) return i + buf[offset + i] = parsed + } + return i + } + + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) + } + + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) + } + + function latin1Write(buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) + } + + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) + } + + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) + } + + Buffer.prototype.write = function write(string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (; ;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } + } + + Buffer.prototype.toJSON = function toJSON() { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } + } + + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } + } + + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) + } + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety + var MAX_ARGUMENTS_LENGTH = 0x1000 + + function decodeCodePointsArray(codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res + } + + function asciiSlice(buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret + } + + function latin1Slice(buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret + } + + function hexSlice(buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) + } + return out + } + + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res + } + + Buffer.prototype.slice = function slice(start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = this.subarray(start, end) + newBuf.__proto__ = Buffer.prototype + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; ++i) { + newBuf[i] = this[i + start] + } + } + + return newBuf + } + + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + function checkOffset(offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') + } + + Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val + } + + Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val + } + + Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] + } + + Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) + } + + Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] + } + + Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) + } + + Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) + } + + Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val + } + + Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val + } + + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) + } + + Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val + } + + Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val + } + + Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) + } + + Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) + } + + Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) + } + + Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) + } + + Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) + } + + Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) + } + + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError( + '"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') + } + + Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength + } + + Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength + } + + Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 + } + + function objectWriteUInt16(buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } + } + + Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 + } + + Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 + } + + function objectWriteUInt32(buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } + } + + Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 + } + + Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 + } + + Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength + } + + Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength + } + + Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 + } + + Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 + } + + Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 + } + + Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 + } + + Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 + } + + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') + } + + function writeFloat(buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 + } + + Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) + } + + Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) + } + + function writeDouble(buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) + } + + Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) + } + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + Buffer.prototype.copy = function copy(target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + var i + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; ++i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ) + } + + return len + } + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) + Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if (code < 256) { + val = code + } + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + } else if (typeof val === 'number') { + val = val & 255 + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : utf8ToBytes(new Buffer(val, encoding).toString()) + var len = bytes.length + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this + } + +// HELPER FUNCTIONS +// ================ + + var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g + + function base64clean(str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str + } + + function stringtrim(str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') + } + + function toHex(n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) + } + + function utf8ToBytes(string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes + } + + function asciiToBytes(str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray + } + + function utf16leToBytes(str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray + } + + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)) + } + + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i + } + + function isnan(val) { + return val !== val // eslint-disable-line no-self-compare + } + + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(7))) + + /***/ + }), + /* 4 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? + function (obj) { + return typeof obj; + } : + function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? + "symbol" : + typeof obj; + }; + + var Hoek = __webpack_require__(0); + var Ref = __webpack_require__(1); + +// Type modules are delay-loaded to prevent circular dependencies + + +// Declare internals + + var internals = {}; + + exports.schema = function (Joi, config) { + + if (config !== undefined && config !== null && (typeof config === 'undefined' ? + 'undefined' : + _typeof(config)) === 'object') { + + if (config.isJoi) { + return config; + } + + if (Array.isArray(config)) { + return Joi.alternatives().try(config); + } + + if (config instanceof RegExp) { + return Joi.string().regex(config); + } + + if (config instanceof Date) { + return Joi.date().valid(config); + } + + return Joi.object().keys(config); + } + + if (typeof config === 'string') { + return Joi.string().valid(config); + } + + if (typeof config === 'number') { + return Joi.number().valid(config); + } + + if (typeof config === 'boolean') { + return Joi.boolean().valid(config); + } + + if (Ref.isRef(config)) { + return Joi.valid(config); + } + + Hoek.assert(config === null, 'Invalid schema content:', config); + + return Joi.valid(null); + }; + + exports.ref = function (id) { + + return Ref.isRef(id) ? id : Ref.create(id); + }; + + /***/ + }), + /* 5 */ + /***/ (function (module, exports) { + +// shim for using process in browser + var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + + var cachedSetTimeout; + var cachedClearTimeout; + + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } + catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } + catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + }()) + + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } + catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } + catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + + } + + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } + catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } + catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + } + + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + +// v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() { + } + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + + process.listeners = function (name) { + return [] + } + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + process.cwd = function () { + return '/' + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + + + /***/ + }), + /* 6 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? + function (obj) { + return typeof obj; + } : + function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? + "symbol" : + typeof obj; + }; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var Hoek = __webpack_require__(0); + var Language = __webpack_require__(17); + +// Declare internals + + var internals = { + annotations: Symbol('joi-annotations') + }; + + internals.stringify = function (value, wrapArrays) { + + var type = typeof value === 'undefined' ? 'undefined' : _typeof(value); + + if (value === null) { + return 'null'; + } + + if (type === 'string') { + return value; + } + + if (value instanceof exports.Err || type === 'function' || type === 'symbol') { + return value.toString(); + } + + if (type === 'object') { + if (Array.isArray(value)) { + var partial = ''; + + for (var i = 0; i < value.length; ++i) { + partial = partial + (partial.length ? ', ' : '') + internals.stringify( + value[i], + wrapArrays + ); + } + + return wrapArrays ? '[' + partial + ']' : partial; + } + + return value.toString(); + } + + return JSON.stringify(value); + }; + + exports.Err = function () { + function _class(type, context, state, options, flags, message, template) { + _classCallCheck(this, _class); + + this.isJoi = true; + this.type = type; + this.context = context || {}; + this.context.key = state.path[state.path.length - 1]; + this.context.label = state.key; + this.path = state.path; + this.options = options; + this.flags = flags; + this.message = message; + this.template = template; + + var localized = this.options.language; + + if (this.flags.label) { + this.context.label = this.flags.label; + } else if (localized && ( // language can be null for arrays exclusion check + this.context.label === '' || this.context.label === null)) { + this.context.label = localized.root || Language.errors.root; + } + } + + _class.prototype.toString = function toString() { + var _this = this; + + if (this.message) { + return this.message; + } + + var format = void 0; + + if (this.template) { + format = this.template; + } + + var localized = this.options.language; + + format = format || Hoek.reach(localized, this.type) || Hoek.reach( + Language.errors, + this.type + ); + + if (format === undefined) { + return 'Error code "' + this.type + '" is not defined, your custom type is missing the correct language definition'; + } + + var wrapArrays = Hoek.reach(localized, 'messages.wrapArrays'); + if (typeof wrapArrays !== 'boolean') { + wrapArrays = Language.errors.messages.wrapArrays; + } + + if (format === null) { + var childrenString = internals.stringify(this.context.reason, wrapArrays); + if (wrapArrays) { + return childrenString.slice(1, -1); + } + return childrenString; + } + + var hasKey = /\{\{\!?label\}\}/.test(format); + var skipKey = format.length > 2 && format[0] === '!' && format[1] === '!'; + + if (skipKey) { + format = format.slice(2); + } + + if (!hasKey && !skipKey) { + var localizedKey = Hoek.reach(localized, 'key'); + if (typeof localizedKey === 'string') { + format = localizedKey + format; + } else { + format = Hoek.reach(Language.errors, 'key') + format; + } + } + + return format.replace(/\{\{(\!?)([^}]+)\}\}/g, function ($0, isSecure, name) { + + var value = Hoek.reach(_this.context, name); + var normalized = internals.stringify(value, wrapArrays); + return isSecure && _this.options.escapeHtml ? + Hoek.escapeHtml(normalized) : + normalized; + }); + }; + + return _class; + }(); + + exports.create = function (type, context, state, options, flags, message, template) { + + return new exports.Err(type, context, state, options, flags, message, template); + }; + + exports.process = function (errors, object) { + + if (!errors || !errors.length) { + return null; + } + + // Construct error + + var message = ''; + var details = []; + + var processErrors = function processErrors(localErrors, parent) { + + for (var i = 0; i < localErrors.length; ++i) { + var item = localErrors[i]; + + if (item instanceof Error) { + return item; + } + + if (item.flags.error && typeof item.flags.error !== 'function') { + return item.flags.error; + } + + var itemMessage = void 0; + if (parent === undefined) { + itemMessage = item.toString(); + message = message + (message ? '. ' : '') + itemMessage; + } + + // Do not push intermediate errors, we're only interested in leafs + + if (item.context.reason && item.context.reason.length) { + var _override = processErrors(item.context.reason, item.path); + if (_override) { + return _override; + } + } else { + details.push({ + message: itemMessage || item.toString(), + path: item.path, + type: item.type, + context: item.context + }); + } + } + }; + + var override = processErrors(errors); + if (override) { + return override; + } + + var error = new Error(message); + error.isJoi = true; + error.name = 'ValidationError'; + error.details = details; + error._object = object; + error.annotate = internals.annotate; + return error; + }; + +// Inspired by json-stringify-safe + internals.safeStringify = function (obj, spaces) { + + return JSON.stringify(obj, internals.serializer(), spaces); + }; + + internals.serializer = function () { + + var keys = []; + var stack = []; + + var cycleReplacer = function cycleReplacer(key, value) { + + if (stack[0] === value) { + return '[Circular ~]'; + } + + return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']'; + }; + + return function (key, value) { + + if (stack.length > 0) { + var thisPos = stack.indexOf(this); + if (~thisPos) { + stack.length = thisPos + 1; + keys.length = thisPos + 1; + keys[thisPos] = key; + } else { + stack.push(this); + keys.push(key); + } + + if (~stack.indexOf(value)) { + value = cycleReplacer.call(this, key, value); + } + } else { + stack.push(value); + } + + if (value) { + var annotations = value[internals.annotations]; + if (annotations) { + if (Array.isArray(value)) { + var annotated = []; + + for (var i = 0; i < value.length; ++i) { + if (annotations.errors[i]) { + annotated.push('_$idx$_' + annotations.errors[i].sort() + .join(', ') + '_$end$_'); + } + annotated.push(value[i]); + } + + value = annotated; + } else { + var errorKeys = Object.keys(annotations.errors); + for (var _i = 0; _i < errorKeys.length; ++_i) { + var errorKey = errorKeys[_i]; + value[errorKey + '_$key$_' + annotations.errors[errorKey].sort() + .join(', ') + '_$end$_'] = value[errorKey]; + value[errorKey] = undefined; + } + + var missingKeys = Object.keys(annotations.missing); + for (var _i2 = 0; _i2 < missingKeys.length; ++_i2) { + var missingKey = missingKeys[_i2]; + value['_$miss$_' + missingKey + '|' + annotations.missing[missingKey] + '_$end$_'] = '__missing__'; + } + } + + return value; + } + } + + if (value === Infinity || value === -Infinity || Number.isNaN(value) || typeof value === 'function' || (typeof value === 'undefined' ? + 'undefined' : + _typeof( + value)) === 'symbol') { + return '[' + value.toString() + ']'; + } + + return value; + }; + }; + + internals.annotate = function (stripColorCodes) { + + var redFgEscape = stripColorCodes ? '' : '\x1B[31m'; + var redBgEscape = stripColorCodes ? '' : '\x1B[41m'; + var endColor = stripColorCodes ? '' : '\x1B[0m'; + + if (_typeof(this._object) !== 'object') { + return this.details[0].message; + } + + var obj = Hoek.clone(this._object || {}); + + for (var i = this.details.length - 1; i >= 0; --i) { + // Reverse order to process deepest child first + var pos = i + 1; + var error = this.details[i]; + var path = error.path; + var ref = obj; + for (var j = 0; ; ++j) { + var seg = path[j]; + + if (ref.isImmutable) { + ref = ref.clone(); // joi schemas are not cloned by hoek, we have to take this extra step + } + + if (j + 1 < path.length && ref[seg] && typeof ref[seg] !== 'string') { + + ref = ref[seg]; + } else { + var refAnnotations = ref[internals.annotations] = ref[internals.annotations] || { + errors: {}, + missing: {} + }; + var value = ref[seg]; + var cacheKey = seg || error.context.label; + + if (value !== undefined) { + refAnnotations.errors[cacheKey] = refAnnotations.errors[cacheKey] || []; + refAnnotations.errors[cacheKey].push(pos); + } else { + refAnnotations.missing[cacheKey] = pos; + } + + break; + } + } + } + + var 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 + }; + + var message = internals.safeStringify(obj, 2).replace(replacers.key, function ($0, $1) { + return '" ' + redFgEscape + '[' + $1 + ']' + endColor; + }).replace(replacers.missing, function ($0, $1, $2) { + return redBgEscape + '"' + $1 + '"' + endColor + redFgEscape + ' [' + $2 + ']: -- missing --' + endColor; + }).replace(replacers.arrayIndex, function ($0, $1, $2) { + return '\n' + $2 + ' ' + redFgEscape + '[' + $1 + ']' + endColor; + }).replace(replacers.specials, function ($0, $1) { + return $1; + }); + + message = message + '\n' + redFgEscape; + + for (var _i3 = 0; _i3 < this.details.length; ++_i3) { + var _pos = _i3 + 1; + message = message + '\n[' + _pos + '] ' + this.details[_i3].message; + } + + message = message + endColor; + + return message; + }; + + /***/ + }), + /* 7 */ + /***/ (function (module, exports) { + + var g; + +// This works in non-strict mode + g = (function () { + return this; + })(); + + try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1, eval)("this"); + } + catch (e) { + // This works if the window reference is available + if (typeof window === "object") + g = window; + } + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + + module.exports = g; + + + /***/ + }), + /* 8 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty( + obj, + key, + { value: value, enumerable: true, configurable: true, writable: true } + ); + } else { + obj[key] = value; + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Hoek = __webpack_require__(0); + var Any = __webpack_require__(2); + var Cast = __webpack_require__(4); + var Errors = __webpack_require__(6); + var Lazy = __webpack_require__(23); + var Ref = __webpack_require__(1); + +// Declare internals + + var internals = { + alternatives: __webpack_require__(10), + array: __webpack_require__(19), + boolean: __webpack_require__(21), + binary: __webpack_require__(20), + date: __webpack_require__(11), + func: __webpack_require__(22), + number: __webpack_require__(24), + object: __webpack_require__(12), + string: __webpack_require__(25) + }; + + internals.applyDefaults = function (schema) { + + Hoek.assert(this, 'Must be invoked on a Joi instance.'); + + if (this._defaults) { + schema = this._defaults(schema); + } + + schema._currentJoi = this; + + return schema; + }; + + internals.root = function () { + + var any = new Any(); + + var root = any.clone(); + Any.prototype._currentJoi = root; + root._currentJoi = root; + + root.any = function () { + + Hoek.assert(arguments.length === 0, 'Joi.any() does not allow arguments.'); + + return internals.applyDefaults.call(this, any); + }; + + root.alternatives = root.alt = function () { + + var alternatives = internals.applyDefaults.call(this, internals.alternatives); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return args.length ? alternatives.try.apply(alternatives, args) : alternatives; + }; + + root.array = function () { + + Hoek.assert(arguments.length === 0, 'Joi.array() does not allow arguments.'); + + return internals.applyDefaults.call(this, internals.array); + }; + + root.boolean = root.bool = function () { + + Hoek.assert(arguments.length === 0, 'Joi.boolean() does not allow arguments.'); + + return internals.applyDefaults.call(this, internals.boolean); + }; + + root.binary = function () { + + Hoek.assert(arguments.length === 0, 'Joi.binary() does not allow arguments.'); + + return internals.applyDefaults.call(this, internals.binary); + }; + + root.date = function () { + + Hoek.assert(arguments.length === 0, 'Joi.date() does not allow arguments.'); + + return internals.applyDefaults.call(this, internals.date); + }; + + root.func = function () { + + Hoek.assert(arguments.length === 0, 'Joi.func() does not allow arguments.'); + + return internals.applyDefaults.call(this, internals.func); + }; + + root.number = function () { + + Hoek.assert(arguments.length === 0, 'Joi.number() does not allow arguments.'); + + return internals.applyDefaults.call(this, internals.number); + }; + + root.object = function () { + + var object = internals.applyDefaults.call(this, internals.object); + return arguments.length ? object.keys.apply(object, arguments) : object; + }; + + root.string = function () { + + Hoek.assert(arguments.length === 0, 'Joi.string() does not allow arguments.'); + + return internals.applyDefaults.call(this, internals.string); + }; + + root.ref = function () { + + return Ref.create.apply(Ref, arguments); + }; + + root.isRef = function (ref) { + + return Ref.isRef(ref); + }; + + root.validate = function (value) /*, [schema], [options], callback */ { + var _ref; + + var last = (_ref = (arguments.length <= 1 ? + 0 : + arguments.length - 1) - 1 + 1, arguments.length <= _ref ? + undefined : + arguments[_ref]); + var callback = typeof last === 'function' ? last : null; + + var count = (arguments.length <= 1 ? 0 : arguments.length - 1) - (callback ? 1 : 0); + if (count === 0) { + return any.validate(value, callback); + } + + var options = count === 2 ? arguments.length <= 2 ? undefined : arguments[2] : {}; + var schema = root.compile(arguments.length <= 1 ? undefined : arguments[1]); + + return schema._validateWithOptions(value, options, callback); + }; + + root.describe = function () { + + var schema = arguments.length ? + root.compile(arguments.length <= 0 ? undefined : arguments[0]) : + any; + return schema.describe(); + }; + + root.compile = function (schema) { + + try { + return Cast.schema(this, schema); + } + catch (err) { + if (err.hasOwnProperty('path')) { + err.message = err.message + '(' + err.path + ')'; + } + throw err; + } + }; + + root.assert = function (value, schema, message) { + + root.attempt(value, schema, message); + }; + + root.attempt = function (value, schema, message) { + + var result = root.validate(value, schema); + var error = result.error; + if (error) { + if (!message) { + if (typeof error.annotate === 'function') { + error.message = error.annotate(); + } + throw error; + } + + if (!(message instanceof Error)) { + if (typeof error.annotate === 'function') { + error.message = message + ' ' + error.annotate(); + } + throw error; + } + + throw message; + } + + return result.value; + }; + + root.reach = function (schema, path) { + + Hoek.assert(schema && schema instanceof Any, 'you must provide a joi schema'); + Hoek.assert(typeof path === 'string', 'path must be a string'); + + if (path === '') { + return schema; + } + + var parts = path.split('.'); + var children = schema._inner.children; + if (!children) { + return; + } + + var key = parts[0]; + for (var i = 0; i < children.length; ++i) { + var child = children[i]; + if (child.key === key) { + return this.reach(child.schema, path.substr(key.length + 1)); + } + } + }; + + root.lazy = function (fn) { + + return Lazy.set(fn); + }; + + root.defaults = function (fn) { + var _this = this; + + Hoek.assert(typeof fn === 'function', 'Defaults must be a function'); + + var joi = Object.create(this.any()); + joi = fn(joi); + + Hoek.assert(joi && joi instanceof this.constructor, 'defaults() must return a schema'); + + _extends(joi, this, joi.clone()); // Re-add the types from `this` but also keep the settings from joi's potential new defaults + + joi._defaults = function (schema) { + + if (_this._defaults) { + schema = _this._defaults(schema); + Hoek.assert(schema instanceof _this.constructor, 'defaults() must return a schema'); + } + + schema = fn(schema); + Hoek.assert(schema instanceof _this.constructor, 'defaults() must return a schema'); + return schema; + }; + + return joi; + }; + + root.extend = function () { + var _this2 = this; + + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + var extensions = Hoek.flatten(args); + Hoek.assert(extensions.length > 0, 'You need to provide at least one extension'); + + this.assert(extensions, root.extensionsSchema); + + var joi = Object.create(this.any()); + _extends(joi, this); + + var _loop = function _loop(i) { + var extension = extensions[i]; + + if (typeof extension === 'function') { + extension = extension(joi); + } + + _this2.assert(extension, root.extensionSchema); + + var base = (extension.base || _this2.any()).clone(); // Cloning because we're going to override language afterwards + var ctor = base.constructor; + var type = function (_ctor) { + _inherits(type, _ctor); + + // eslint-disable-line no-loop-func + + function type() { + _classCallCheck(this, type); + + var _this3 = _possibleConstructorReturn(this, _ctor.call(this)); + + if (extension.base) { + _extends(_this3, base); + } + + _this3._type = extension.name; + + if (extension.language) { + _this3._settings = _this3._settings || { language: {} }; + _this3._settings.language = Hoek.applyToDefaults( + _this3._settings.language, + _defineProperty({}, extension.name, extension.language) + ); + } + return _this3; + } + + return type; + }(ctor); + + if (extension.coerce) { + type.prototype._coerce = function (value, state, options) { + + if (ctor.prototype._coerce) { + var baseRet = ctor.prototype._coerce.call(this, value, state, options); + + if (baseRet.errors) { + return baseRet; + } + + value = baseRet.value; + } + + var ret = extension.coerce.call(this, value, state, options); + if (ret instanceof Errors.Err) { + return { value: value, errors: ret }; + } + + return { value: ret }; + }; + } + if (extension.pre) { + type.prototype._base = function (value, state, options) { + + if (ctor.prototype._base) { + var baseRet = ctor.prototype._base.call(this, value, state, options); + + if (baseRet.errors) { + return baseRet; + } + + value = baseRet.value; + } + + var ret = extension.pre.call(this, value, state, options); + if (ret instanceof Errors.Err) { + return { value: value, errors: ret }; + } + + return { value: ret }; + }; + } + + if (extension.rules) { + var _loop2 = function _loop2(j) { + var rule = extension.rules[j]; + var ruleArgs = rule.params ? + rule.params instanceof Any ? + rule.params._inner.children.map(function (k) { + return k.key; + }) : + Object.keys(rule.params) : + []; + var validateArgs = rule.params ? Cast.schema(_this2, rule.params) : null; + + type.prototype[rule.name] = function () { + for (var _len3 = arguments.length, rArgs = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + rArgs[_key3] = arguments[_key3]; + } + + // eslint-disable-line no-loop-func + + if (rArgs.length > ruleArgs.length) { + throw new Error('Unexpected number of arguments'); + } + + var hasRef = false; + var arg = {}; + + for (var k = 0; k < ruleArgs.length; ++k) { + arg[ruleArgs[k]] = rArgs[k]; + if (!hasRef && Ref.isRef(rArgs[k])) { + hasRef = true; + } + } + + if (validateArgs) { + arg = joi.attempt(arg, validateArgs); + } + + var schema = void 0; + if (rule.validate) { + var validate = function validate(value, state, options) { + + return rule.validate.call(this, arg, value, state, options); + }; + + schema = this._test(rule.name, arg, validate, { + description: rule.description, + hasRef: hasRef + }); + } else { + schema = this.clone(); + } + + if (rule.setup) { + var newSchema = rule.setup.call(schema, arg); + if (newSchema !== undefined) { + Hoek.assert(newSchema instanceof Any, 'Setup of extension Joi.' + this._type + '().' + rule.name + '() must return undefined or a Joi object'); + schema = newSchema; + } + } + + return schema; + }; + }; + + for (var j = 0; j < extension.rules.length; ++j) { + _loop2(j); + } + } + + if (extension.describe) { + type.prototype.describe = function () { + + var description = ctor.prototype.describe.call(this); + return extension.describe.call(this, description); + }; + } + + var instance = new type(); + joi[extension.name] = function () { + + return internals.applyDefaults.call(this, instance); + }; + }; + + for (var i = 0; i < extensions.length; ++i) { + _loop(i); + } + + return joi; + }; + + root.extensionSchema = internals.object.keys({ + base: internals.object.type(Any, 'Joi object'), + name: internals.string.required(), + coerce: internals.func.arity(3), + pre: internals.func.arity(3), + language: internals.object, + describe: internals.func.arity(1), + rules: internals.array.items(internals.object.keys({ + name: internals.string.required(), + setup: internals.func.arity(1), + validate: internals.func.arity(4), + params: [internals.object.pattern(/.*/, internals.object.type(Any, 'Joi object')), + internals.object.type(internals.object.constructor, 'Joi object')], + description: [internals.string, internals.func.arity(1)] + }).or('setup', 'validate')) + }).strict(); + + root.extensionsSchema = internals.array.items([internals.object, internals.func.arity(1)]) + .strict(); + + root.version = __webpack_require__(33).version; + + return root; + }; + + module.exports = internals.root(); + + /***/ + }), + /* 9 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + /* WEBPACK VAR INJECTION */ + (function (Buffer) { + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? + function (obj) { + return typeof obj; + } : + function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? + "symbol" : + typeof obj; + }; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var Ref = __webpack_require__(1); + + module.exports = function () { + function Set() { + _classCallCheck(this, Set); + + this._set = []; + } + + Set.prototype.add = function add(value, refs) { + + if (!Ref.isRef(value) && this.has(value, null, null, false)) { + + return; + } + + if (refs !== undefined) { + // If it's a merge, we don't have any refs + Ref.push(refs, value); + } + + this._set.push(value); + return this; + }; + + Set.prototype.merge = function merge(add, remove) { + + for (var i = 0; i < add._set.length; ++i) { + this.add(add._set[i]); + } + + for (var _i = 0; _i < remove._set.length; ++_i) { + this.remove(remove._set[_i]); + } + + return this; + }; + + Set.prototype.remove = function remove(value) { + + this._set = this._set.filter(function (item) { + return value !== item; + }); + return this; + }; + + Set.prototype.has = function has(value, state, options, insensitive) { + + for (var i = 0; i < this._set.length; ++i) { + var items = this._set[i]; + + if (state && Ref.isRef(items)) { + // Only resolve references if there is a state, otherwise it's a merge + items = items(state.reference || state.parent, options); + } + + if (!Array.isArray(items)) { + items = [items]; + } + + for (var j = 0; j < items.length; ++j) { + var item = items[j]; + if ((typeof value === 'undefined' ? + 'undefined' : + _typeof(value)) !== (typeof item === 'undefined' ? + 'undefined' : + _typeof(item))) { + continue; + } + + if (value === item || value instanceof Date && item instanceof Date && value.getTime() === item.getTime() || insensitive && typeof value === 'string' && value.toLowerCase() === item.toLowerCase() || Buffer.isBuffer( + value) && Buffer.isBuffer(item) && value.length === item.length && value.toString( + 'binary') === item.toString('binary')) { + + return true; + } + } + } + + return false; + }; + + Set.prototype.values = function values(options) { + + if (options && options.stripUndefined) { + var values = []; + + for (var i = 0; i < this._set.length; ++i) { + var item = this._set[i]; + if (item !== undefined) { + values.push(item); + } + } + + return values; + } + + return this._set.slice(); + }; + + Set.prototype.slice = function slice() { + + var newSet = new Set(); + newSet._set = this._set.slice(); + + return newSet; + }; + + Set.prototype.concat = function concat(source) { + + var newSet = new Set(); + newSet._set = this._set.concat(source._set); + + return newSet; + }; + + return Set; + }(); + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(3).Buffer)) + + /***/ + }), + /* 10 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? + function (obj) { + return typeof obj; + } : + function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? + "symbol" : + typeof obj; + }; + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Hoek = __webpack_require__(0); + var Any = __webpack_require__(2); + var Cast = __webpack_require__(4); + var Ref = __webpack_require__(1); + +// Declare internals + + var internals = {}; + + internals.Alternatives = function (_Any) { + _inherits(_class, _Any); + + function _class() { + _classCallCheck(this, _class); + + var _this = _possibleConstructorReturn(this, _Any.call(this)); + + _this._type = 'alternatives'; + _this._invalids.remove(null); + _this._inner.matches = []; + return _this; + } + + _class.prototype._base = function _base(value, state, options) { + + var errors = []; + var il = this._inner.matches.length; + var baseType = this._baseType; + + for (var i = 0; i < il; ++i) { + var item = this._inner.matches[i]; + if (!item.schema) { + var schema = item.peek || item.is; + var input = item.is ? item.ref(state.reference || state.parent, options) : value; + var failed = schema._validate(input, null, options, state.parent).errors; + + if (failed) { + if (item.otherwise) { + return item.otherwise._validate(value, state, options); + } + } else if (item.then) { + return item.then._validate(value, state, options); + } + + if (i === il - 1 && baseType) { + return baseType._validate(value, state, options); + } + + continue; + } + + var result = item.schema._validate(value, state, options); + if (!result.errors) { + // Found a valid match + return result; + } + + errors = errors.concat(result.errors); + } + + if (errors.length) { + return { + errors: this.createError( + 'alternatives.child', + { reason: errors }, + state, + options + ) + }; + } + + return { errors: this.createError('alternatives.base', null, state, options) }; + }; + + _class.prototype.try = function _try() { + for (var _len = arguments.length, schemas = Array(_len), _key = 0; _key < _len; _key++) { + schemas[_key] = arguments[_key]; + } + + schemas = Hoek.flatten(schemas); + Hoek.assert( + schemas.length, + 'Cannot add other alternatives without at least one schema' + ); + + var obj = this.clone(); + + for (var i = 0; i < schemas.length; ++i) { + var cast = Cast.schema(this._currentJoi, schemas[i]); + if (cast._refs.length) { + obj._refs = obj._refs.concat(cast._refs); + } + obj._inner.matches.push({ schema: cast }); + } + + return obj; + }; + + _class.prototype.when = function when(condition, options) { + + var schemaCondition = false; + Hoek.assert( + Ref.isRef(condition) || typeof condition === 'string' || (schemaCondition = condition instanceof Any), + 'Invalid condition:', + condition + ); + Hoek.assert(options, 'Missing options'); + Hoek.assert((typeof options === 'undefined' ? + 'undefined' : + _typeof(options)) === 'object', 'Invalid options'); + if (schemaCondition) { + Hoek.assert( + !options.hasOwnProperty('is'), + '"is" can not be used with a schema condition' + ); + } 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"' + ); + + var obj = this.clone(); + var is = void 0; + if (!schemaCondition) { + is = Cast.schema(this._currentJoi, options.is); + + if (options.is === null || !(Ref.isRef(options.is) || options.is instanceof Any)) { + + // Only apply required if this wasn't already a schema or a ref, we'll suppose people know what they're doing + is = is.required(); + } + } + + var item = { + ref: schemaCondition ? null : Cast.ref(condition), + peek: schemaCondition ? condition : null, + is: is, + then: options.then !== undefined ? + Cast.schema(this._currentJoi, options.then) : + undefined, + otherwise: options.otherwise !== undefined ? + Cast.schema(this._currentJoi, options.otherwise) : + undefined + }; + + if (obj._baseType) { + + item.then = item.then && obj._baseType.concat(item.then); + item.otherwise = item.otherwise && obj._baseType.concat(item.otherwise); + } + + if (!schemaCondition) { + Ref.push(obj._refs, item.ref); + obj._refs = obj._refs.concat(item.is._refs); + } + + if (item.then && item.then._refs) { + obj._refs = obj._refs.concat(item.then._refs); + } + + if (item.otherwise && item.otherwise._refs) { + obj._refs = obj._refs.concat(item.otherwise._refs); + } + + obj._inner.matches.push(item); + + return obj; + }; + + _class.prototype.describe = function describe() { + + var description = Any.prototype.describe.call(this); + var alternatives = []; + for (var i = 0; i < this._inner.matches.length; ++i) { + var item = this._inner.matches[i]; + if (item.schema) { + + // try() + + alternatives.push(item.schema.describe()); + } else { + + // when() + + var when = item.is ? { + ref: item.ref.toString(), + is: item.is.describe() + } : { + peek: item.peek.describe() + }; + + if (item.then) { + when.then = item.then.describe(); + } + + if (item.otherwise) { + when.otherwise = item.otherwise.describe(); + } + + alternatives.push(when); + } + } + + description.alternatives = alternatives; + return description; + }; + + return _class; + }(Any); + + module.exports = new internals.Alternatives(); + + /***/ + }), + /* 11 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Any = __webpack_require__(2); + var Ref = __webpack_require__(1); + var Hoek = __webpack_require__(0); + +// Declare internals + + var 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)?)?)?)?$/; + internals.invalidDate = new Date(''); + internals.isIsoDate = function () { + + var isoString = internals.isoDate.toString(); + + return function (date) { + + return date && date.toString() === isoString; + }; + }(); + + internals.Date = function (_Any) { + _inherits(_class, _Any); + + function _class() { + _classCallCheck(this, _class); + + var _this = _possibleConstructorReturn(this, _Any.call(this)); + + _this._type = 'date'; + return _this; + } + + _class.prototype._base = function _base(value, state, options) { + + var result = { + value: options.convert && internals.Date.toDate( + value, + this._flags.format, + this._flags.timestamp, + this._flags.multiplier + ) || value + }; + + if (result.value instanceof Date && !isNaN(result.value.getTime())) { + result.errors = null; + } else if (!options.convert) { + result.errors = this.createError('date.strict', null, state, options); + } else { + var type = void 0; + if (internals.isIsoDate(this._flags.format)) { + type = 'isoDate'; + } else if (this._flags.timestamp) { + type = 'timestamp.' + this._flags.timestamp; + } else { + type = 'base'; + } + + result.errors = this.createError('date.' + type, null, state, options); + } + + return result; + }; + + _class.toDate = function toDate(value, format, timestamp, multiplier) { + + if (value instanceof Date) { + return value; + } + + if (typeof value === 'string' || typeof value === 'number' && !isNaN(value) && isFinite( + value)) { + + if (typeof value === 'string' && /^[+-]?\d+(\.\d+)?$/.test(value)) { + + value = parseFloat(value); + } + + var date = void 0; + if (format && internals.isIsoDate(format)) { + date = format.test(value) ? new Date(value) : internals.invalidDate; + } else if (timestamp && multiplier) { + date = /^\s*$/.test(value) ? internals.invalidDate : new Date(value * multiplier); + } else { + date = new Date(value); + } + + if (!isNaN(date.getTime())) { + return date; + } + } + + return null; + }; + + _class.prototype.iso = function iso() { + + if (this._flags.format === internals.isoDate) { + return this; + } + + var obj = this.clone(); + obj._flags.format = internals.isoDate; + return obj; + }; + + _class.prototype.timestamp = function timestamp() { + var type = arguments.length > 0 && arguments[0] !== undefined ? + arguments[0] : + 'javascript'; + + + var allowed = ['javascript', 'unix']; + Hoek.assert(allowed.includes(type), '"type" must be one of "' + allowed.join('", "') + '"'); + + if (this._flags.timestamp === type) { + return this; + } + + var obj = this.clone(); + obj._flags.timestamp = type; + obj._flags.multiplier = type === 'unix' ? 1000 : 1; + return obj; + }; + + _class.prototype._isIsoDate = function _isIsoDate(value) { + + return internals.isoDate.test(value); + }; + + return _class; + }(Any); + + internals.compare = function (type, compare) { + + return function (date) { + + var isNow = date === 'now'; + var isRef = Ref.isRef(date); + + if (!isNow && !isRef) { + date = internals.Date.toDate(date); + } + + Hoek.assert(date, 'Invalid date format'); + + return this._test(type, date, function (value, state, options) { + + var compareTo = void 0; + if (isNow) { + compareTo = Date.now(); + } else if (isRef) { + compareTo = internals.Date.toDate(date(state.reference || state.parent, options)); + + if (!compareTo) { + return this.createError('date.ref', { ref: date.key }, state, options); + } + + compareTo = compareTo.getTime(); + } else { + compareTo = date.getTime(); + } + + if (compare(value.getTime(), compareTo)) { + return value; + } + + return this.createError( + 'date.' + type, { limit: new Date(compareTo) }, + state, + options + ); + }); + }; + }; + internals.Date.prototype.min = internals.compare('min', function (value, date) { + return value >= date; + }); + internals.Date.prototype.max = internals.compare('max', function (value, date) { + return value <= date; + }); + + module.exports = new internals.Date(); + + /***/ + }), + /* 12 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? + function (obj) { + return typeof obj; + } : + function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? + "symbol" : + typeof obj; + }; + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Hoek = __webpack_require__(0); + var Topo = __webpack_require__(28); + var Any = __webpack_require__(2); + var Errors = __webpack_require__(6); + var Cast = __webpack_require__(4); + +// Declare internals + + var internals = {}; + + internals.Object = function (_Any) { + _inherits(_class, _Any); + + function _class() { + _classCallCheck(this, _class); + + var _this = _possibleConstructorReturn(this, _Any.call(this)); + + _this._type = 'object'; + _this._inner.children = null; + _this._inner.renames = []; + _this._inner.dependencies = []; + _this._inner.patterns = []; + return _this; + } + + _class.prototype._base = function _base(value, state, options) { + + var target = value; + var errors = []; + var finish = function finish() { + + return { + value: target, + errors: errors.length ? errors : null + }; + }; + + if (typeof value === 'string' && options.convert) { + + value = internals.safeParse(value); + } + + var type = this._flags.func ? 'function' : 'object'; + if (!value || (typeof value === 'undefined' ? + 'undefined' : + _typeof(value)) !== type || Array.isArray(value)) { + + errors.push(this.createError(type + '.base', null, state, options)); + return finish(); + } + + // Skip if there are no other rules to test + + if (!this._inner.renames.length && !this._inner.dependencies.length && !this._inner.children && // null allows any keys + !this._inner.patterns.length) { + + target = value; + return finish(); + } + + // Ensure target is a local copy (parsed) or shallow copy + + if (target === value) { + if (type === 'object') { + target = Object.create(Object.getPrototypeOf(value)); + } else { + target = function target() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return value.apply(this, args); + }; + + target.prototype = Hoek.clone(value.prototype); + } + + var valueKeys = Object.keys(value); + for (var i = 0; i < valueKeys.length; ++i) { + target[valueKeys[i]] = value[valueKeys[i]]; + } + } else { + target = value; + } + + // Rename keys + + var renamed = {}; + for (var _i = 0; _i < this._inner.renames.length; ++_i) { + var rename = this._inner.renames[_i]; + + if (rename.isRegExp) { + var targetKeys = Object.keys(target); + var matchedTargetKeys = []; + + for (var j = 0; j < targetKeys.length; ++j) { + if (rename.from.test(targetKeys[j])) { + matchedTargetKeys.push(targetKeys[j]); + } + } + + var allUndefined = matchedTargetKeys.every(function (key) { + return target[key] === undefined; + }); + if (rename.options.ignoreUndefined && allUndefined) { + continue; + } + + if (!rename.options.multiple && renamed[rename.to]) { + + errors.push(this.createError( + 'object.rename.regex.multiple', + { from: matchedTargetKeys, to: rename.to }, + state, + options + )); + if (options.abortEarly) { + return finish(); + } + } + + if (Object.prototype.hasOwnProperty.call( + target, + rename.to + ) && !rename.options.override && !renamed[rename.to]) { + + errors.push(this.createError( + 'object.rename.regex.override', + { from: matchedTargetKeys, to: rename.to }, + state, + options + )); + if (options.abortEarly) { + return finish(); + } + } + + if (allUndefined) { + delete target[rename.to]; + } else { + target[rename.to] = target[matchedTargetKeys[matchedTargetKeys.length - 1]]; + } + + renamed[rename.to] = true; + + if (!rename.options.alias) { + for (var _j = 0; _j < matchedTargetKeys.length; ++_j) { + delete target[matchedTargetKeys[_j]]; + } + } + } else { + if (rename.options.ignoreUndefined && target[rename.from] === undefined) { + continue; + } + + if (!rename.options.multiple && renamed[rename.to]) { + + errors.push(this.createError( + 'object.rename.multiple', + { from: rename.from, to: rename.to }, + state, + options + )); + if (options.abortEarly) { + return finish(); + } + } + + if (Object.prototype.hasOwnProperty.call( + target, + rename.to + ) && !rename.options.override && !renamed[rename.to]) { + + errors.push(this.createError( + 'object.rename.override', + { from: rename.from, to: rename.to }, + state, + options + )); + if (options.abortEarly) { + return finish(); + } + } + + if (target[rename.from] === undefined) { + delete target[rename.to]; + } else { + target[rename.to] = target[rename.from]; + } + + renamed[rename.to] = true; + + if (!rename.options.alias) { + delete target[rename.from]; + } + } + } + + // Validate schema + + if (!this._inner.children && // null allows any keys + !this._inner.patterns.length && !this._inner.dependencies.length) { + + return finish(); + } + + var unprocessed = Hoek.mapToObject(Object.keys(target)); + + if (this._inner.children) { + var stripProps = []; + + for (var _i2 = 0; _i2 < this._inner.children.length; ++_i2) { + var child = this._inner.children[_i2]; + var key = child.key; + var item = target[key]; + + delete unprocessed[key]; + + var localState = { + key: key, + path: state.path.concat(key), + parent: target, + reference: state.reference + }; + var result = child.schema._validate(item, localState, options); + if (result.errors) { + errors.push(this.createError( + 'object.child', + { key: key, child: child.schema._getLabel(key), reason: result.errors }, + localState, + options + )); + + if (options.abortEarly) { + return finish(); + } + } else { + if (child.schema._flags.strip || result.value === undefined && result.value !== item) { + stripProps.push(key); + target[key] = result.finalValue; + } else if (result.value !== undefined) { + target[key] = result.value; + } + } + } + + for (var _i3 = 0; _i3 < stripProps.length; ++_i3) { + delete target[stripProps[_i3]]; + } + } + + // Unknown keys + + var unprocessedKeys = Object.keys(unprocessed); + if (unprocessedKeys.length && this._inner.patterns.length) { + + for (var _i4 = 0; _i4 < unprocessedKeys.length; ++_i4) { + var _key2 = unprocessedKeys[_i4]; + var _localState = { + key: _key2, + path: state.path.concat(_key2), + parent: target, + reference: state.reference + }; + var _item = target[_key2]; + + for (var _j2 = 0; _j2 < this._inner.patterns.length; ++_j2) { + var pattern = this._inner.patterns[_j2]; + + if (pattern.regex.test(_key2)) { + delete unprocessed[_key2]; + + var _result = pattern.rule._validate(_item, _localState, options); + if (_result.errors) { + errors.push(this.createError( + 'object.child', + { + key: _key2, + child: pattern.rule._getLabel(_key2), + reason: _result.errors + }, + _localState, + options + )); + + if (options.abortEarly) { + return finish(); + } + } + + if (_result.value !== undefined) { + target[_key2] = _result.value; + } + } + } + } + + unprocessedKeys = Object.keys(unprocessed); + } + + if ((this._inner.children || this._inner.patterns.length) && unprocessedKeys.length) { + if (options.stripUnknown && this._flags.allowUnknown !== true || options.skipFunctions) { + + var stripUnknown = options.stripUnknown ? + options.stripUnknown === true ? + true : + !!options.stripUnknown.objects : + false; + + for (var _i5 = 0; _i5 < unprocessedKeys.length; ++_i5) { + var _key3 = unprocessedKeys[_i5]; + + if (stripUnknown) { + delete target[_key3]; + delete unprocessed[_key3]; + } else if (typeof target[_key3] === 'function') { + delete unprocessed[_key3]; + } + } + + unprocessedKeys = Object.keys(unprocessed); + } + + if (unprocessedKeys.length && (this._flags.allowUnknown !== undefined ? + !this._flags.allowUnknown : + !options.allowUnknown)) { + + for (var _i6 = 0; _i6 < unprocessedKeys.length; ++_i6) { + var unprocessedKey = unprocessedKeys[_i6]; + errors.push(this.createError( + 'object.allowUnknown', + { child: unprocessedKey }, + { key: unprocessedKey, path: state.path.concat(unprocessedKey) }, + options, + {} + )); + } + } + } + + // Validate dependencies + + for (var _i7 = 0; _i7 < this._inner.dependencies.length; ++_i7) { + var dep = this._inner.dependencies[_i7]; + var 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 + ); + if (err instanceof Errors.Err) { + errors.push(err); + if (options.abortEarly) { + return finish(); + } + } + } + + return finish(); + }; + + _class.prototype.keys = function keys(schema) { + + Hoek.assert( + schema === null || schema === undefined || (typeof schema === 'undefined' ? + 'undefined' : + _typeof(schema)) === 'object', + 'Object schema must be a valid object' + ); + Hoek.assert(!schema || !(schema instanceof Any), 'Object schema cannot be a joi schema'); + + var obj = this.clone(); + + if (!schema) { + obj._inner.children = null; + return obj; + } + + var children = Object.keys(schema); + + if (!children.length) { + obj._inner.children = []; + return obj; + } + + var topo = new Topo(); + if (obj._inner.children) { + for (var i = 0; i < obj._inner.children.length; ++i) { + var child = obj._inner.children[i]; + + // Only add the key if we are not going to replace it later + if (!children.includes(child.key)) { + topo.add(child, { after: child._refs, group: child.key }); + } + } + } + + for (var _i8 = 0; _i8 < children.length; ++_i8) { + var key = children[_i8]; + var _child = schema[key]; + try { + var cast = Cast.schema(this._currentJoi, _child); + topo.add({ key: key, schema: cast }, { after: cast._refs, group: key }); + } + catch (castErr) { + if (castErr.hasOwnProperty('path')) { + castErr.path = key + '.' + castErr.path; + } else { + castErr.path = key; + } + throw castErr; + } + } + + obj._inner.children = topo.nodes; + + return obj; + }; + + _class.prototype.unknown = function unknown(allow) { + + var value = allow !== false; + + if (this._flags.allowUnknown === value) { + return this; + } + + var obj = this.clone(); + obj._flags.allowUnknown = value; + return obj; + }; + + _class.prototype.length = function length(limit) { + + Hoek.assert( + Number.isSafeInteger(limit) && limit >= 0, 'limit must be a positive integer'); + + return this._test('length', limit, function (value, state, options) { + + if (Object.keys(value).length === limit) { + return value; + } + + return this.createError('object.length', { limit: limit }, state, options); + }); + }; + + _class.prototype.min = function min(limit) { + + Hoek.assert( + Number.isSafeInteger(limit) && limit >= 0, 'limit must be a positive integer'); + + return this._test('min', limit, function (value, state, options) { + + if (Object.keys(value).length >= limit) { + return value; + } + + return this.createError('object.min', { limit: limit }, state, options); + }); + }; + + _class.prototype.max = function max(limit) { + + Hoek.assert( + Number.isSafeInteger(limit) && limit >= 0, 'limit must be a positive integer'); + + return this._test('max', limit, function (value, state, options) { + + if (Object.keys(value).length <= limit) { + return value; + } + + return this.createError('object.max', { limit: limit }, state, options); + }); + }; + + _class.prototype.pattern = function pattern(_pattern, schema) { + + Hoek.assert(_pattern instanceof RegExp, 'Invalid regular expression'); + Hoek.assert(schema !== undefined, 'Invalid rule'); + + _pattern = new RegExp(_pattern.source, _pattern.ignoreCase ? 'i' : undefined); // Future version should break this and forbid unsupported regex flags + + try { + schema = Cast.schema(this._currentJoi, schema); + } + catch (castErr) { + if (castErr.hasOwnProperty('path')) { + castErr.message = castErr.message + '(' + castErr.path + ')'; + } + + throw castErr; + } + + var obj = this.clone(); + obj._inner.patterns.push({ regex: _pattern, rule: schema }); + return obj; + }; + + _class.prototype.schema = function schema() { + + return this._test('schema', null, function (value, state, options) { + + if (value instanceof Any) { + return value; + } + + return this.createError('object.schema', null, state, options); + }); + }; + + _class.prototype.with = function _with(key, peers) { + + return this._dependency('with', key, peers); + }; + + _class.prototype.without = function without(key, peers) { + + return this._dependency('without', key, peers); + }; + + _class.prototype.xor = function xor() { + for (var _len2 = arguments.length, peers = Array(_len2), _key4 = 0; _key4 < _len2; _key4++) { + peers[_key4] = arguments[_key4]; + } + + peers = Hoek.flatten(peers); + return this._dependency('xor', null, peers); + }; + + _class.prototype.or = function or() { + for (var _len3 = arguments.length, peers = Array(_len3), _key5 = 0; _key5 < _len3; _key5++) { + peers[_key5] = arguments[_key5]; + } + + peers = Hoek.flatten(peers); + return this._dependency('or', null, peers); + }; + + _class.prototype.and = function and() { + for (var _len4 = arguments.length, peers = Array(_len4), _key6 = 0; _key6 < _len4; _key6++) { + peers[_key6] = arguments[_key6]; + } + + peers = Hoek.flatten(peers); + return this._dependency('and', null, peers); + }; + + _class.prototype.nand = function nand() { + for (var _len5 = arguments.length, peers = Array(_len5), _key7 = 0; _key7 < _len5; _key7++) { + peers[_key7] = arguments[_key7]; + } + + peers = Hoek.flatten(peers); + return this._dependency('nand', null, peers); + }; + + _class.prototype.requiredKeys = function requiredKeys() { + for (var _len6 = arguments.length, children = Array(_len6), _key8 = 0; _key8 < _len6; _key8++) { + children[_key8] = arguments[_key8]; + } + + children = Hoek.flatten(children); + return this.applyFunctionToChildren(children, 'required'); + }; + + _class.prototype.optionalKeys = function optionalKeys() { + for (var _len7 = arguments.length, children = Array(_len7), _key9 = 0; _key9 < _len7; _key9++) { + children[_key9] = arguments[_key9]; + } + + children = Hoek.flatten(children); + return this.applyFunctionToChildren(children, 'optional'); + }; + + _class.prototype.forbiddenKeys = function forbiddenKeys() { + for (var _len8 = arguments.length, children = Array(_len8), _key10 = 0; _key10 < _len8; _key10++) { + children[_key10] = arguments[_key10]; + } + + children = Hoek.flatten(children); + return this.applyFunctionToChildren(children, 'forbidden'); + }; + + _class.prototype.rename = function rename(from, to, options) { + + Hoek.assert( + typeof from === 'string' || from instanceof RegExp, 'Rename missing the from argument'); + Hoek.assert(typeof to === 'string', 'Rename missing the to argument'); + Hoek.assert(to !== from, 'Cannot rename key to same name:', from); + + for (var i = 0; i < this._inner.renames.length; ++i) { + Hoek.assert( + this._inner.renames[i].from !== from, 'Cannot rename the same key multiple times'); + } + + var obj = this.clone(); + + obj._inner.renames.push({ + from: from, + to: to, + options: Hoek.applyToDefaults(internals.renameDefaults, options || {}), + isRegExp: from instanceof RegExp + }); + + return obj; + }; + + _class.prototype.applyFunctionToChildren = function applyFunctionToChildren( + children, + fn, + args, + root + ) { + + children = [].concat(children); + Hoek.assert(children.length > 0, 'expected at least one children'); + + var groupedChildren = internals.groupChildren(children); + var obj = void 0; + + if ('' in groupedChildren) { + obj = this[fn].apply(this, args); + delete groupedChildren['']; + } else { + obj = this.clone(); + } + + if (obj._inner.children) { + root = root ? root + '.' : ''; + + for (var i = 0; i < obj._inner.children.length; ++i) { + var child = obj._inner.children[i]; + var group = groupedChildren[child.key]; + + if (group) { + obj._inner.children[i] = { + key: child.key, + _refs: child._refs, + schema: child.schema.applyFunctionToChildren(group, fn, args, root + child.key) + }; + + delete groupedChildren[child.key]; + } + } + } + + var remaining = Object.keys(groupedChildren); + Hoek.assert(remaining.length === 0, 'unknown key(s)', remaining.join(', ')); + + return obj; + }; + + _class.prototype._dependency = function _dependency(type, key, peers) { + + peers = [].concat(peers); + for (var i = 0; i < peers.length; ++i) { + Hoek.assert( + typeof peers[i] === 'string', type, + 'peers must be a string or array of strings' + ); + } + + var obj = this.clone(); + obj._inner.dependencies.push({ type: type, key: key, peers: peers }); + return obj; + }; + + _class.prototype.describe = function describe(shallow) { + + var description = Any.prototype.describe.call(this); + + if (description.rules) { + for (var i = 0; i < description.rules.length; ++i) { + var rule = description.rules[i]; + // Coverage off for future-proof descriptions, only object().assert() is use right now + if (/* $lab:coverage:off$ */rule.arg && _typeof(rule.arg) === 'object' && rule.arg.schema && rule.arg.ref /* $lab:coverage:on$ */) { + rule.arg = { + schema: rule.arg.schema.describe(), + ref: rule.arg.ref.toString() + }; + } + } + } + + if (this._inner.children && !shallow) { + + description.children = {}; + for (var _i9 = 0; _i9 < this._inner.children.length; ++_i9) { + var child = this._inner.children[_i9]; + description.children[child.key] = child.schema.describe(); + } + } + + if (this._inner.dependencies.length) { + description.dependencies = Hoek.clone(this._inner.dependencies); + } + + if (this._inner.patterns.length) { + description.patterns = []; + + for (var _i10 = 0; _i10 < this._inner.patterns.length; ++_i10) { + var pattern = this._inner.patterns[_i10]; + description.patterns.push({ + regex: pattern.regex.toString(), + rule: pattern.rule.describe() + }); + } + } + + if (this._inner.renames.length > 0) { + description.renames = Hoek.clone(this._inner.renames); + } + + return description; + }; + + _class.prototype.assert = function assert(ref, schema, message) { + + 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'; + + try { + schema = Cast.schema(this._currentJoi, schema); + } + catch (castErr) { + if (castErr.hasOwnProperty('path')) { + castErr.message = castErr.message + '(' + castErr.path + ')'; + } + + throw castErr; + } + + var key = ref.path[ref.path.length - 1]; + var path = ref.path.join('.'); + + return this._test( + 'assert', + { schema: schema, ref: ref }, + function (value, state, options) { + + var result = schema._validate(ref(value), null, options, value); + if (!result.errors) { + return value; + } + + var localState = Hoek.merge({}, state); + localState.key = key; + localState.path = ref.path; + return this.createError( + 'object.assert', + { ref: path, message: message }, + localState, + options + ); + } + ); + }; + + _class.prototype.type = function type(constructor) { + var name = arguments.length > 1 && arguments[1] !== undefined ? + arguments[1] : + constructor.name; + + + Hoek.assert(typeof constructor === 'function', 'type must be a constructor function'); + var typeData = { + name: name, + ctor: constructor + }; + + return this._test('type', typeData, function (value, state, options) { + + if (value instanceof constructor) { + return value; + } + + return this.createError('object.type', { type: typeData.name }, state, options); + }); + }; + + return _class; + }(Any); + + internals.safeParse = function (value) { + + try { + return JSON.parse(value); + } + catch (parseErr) { + } + + return value; + }; + + internals.renameDefaults = { + alias: false, // Keep old value in place + multiple: false, // Allow renaming multiple keys into the same target + override: false // Overrides an existing key + }; + + internals.groupChildren = function (children) { + + children.sort(); + + var grouped = {}; + + for (var i = 0; i < children.length; ++i) { + var child = children[i]; + Hoek.assert(typeof child === 'string', 'children must be strings'); + var group = child.split('.')[0]; + var childGroup = grouped[group] = grouped[group] || []; + childGroup.push(child.substring(group.length + 1)); + } + + return grouped; + }; + + internals.keysToLabels = function (schema, keys) { + + var children = schema._inner.children; + + if (!children) { + return keys; + } + + var findLabel = function findLabel(key) { + + var matchingChild = children.find(function (child) { + return child.key === key; + }); + return matchingChild ? matchingChild.schema._getLabel(key) : key; + }; + + if (Array.isArray(keys)) { + return keys.map(findLabel); + } + + return findLabel(keys); + }; + + internals.with = function (value, peers, parent, state, options) { + + if (value === undefined) { + return value; + } + + for (var i = 0; i < peers.length; ++i) { + var peer = peers[i]; + if (!Object.prototype.hasOwnProperty.call(parent, peer) || parent[peer] === undefined) { + + return this.createError('object.with', { + main: state.key, + mainWithLabel: internals.keysToLabels(this, state.key), + peer: peer, + peerWithLabel: internals.keysToLabels(this, peer) + }, state, options); + } + } + + return value; + }; + + internals.without = function (value, peers, parent, state, options) { + + if (value === undefined) { + return value; + } + + for (var i = 0; i < peers.length; ++i) { + var peer = peers[i]; + if (Object.prototype.hasOwnProperty.call(parent, peer) && parent[peer] !== undefined) { + + return this.createError('object.without', { + main: state.key, + mainWithLabel: internals.keysToLabels(this, state.key), + peer: peer, + peerWithLabel: internals.keysToLabels(this, peer) + }, state, options); + } + } + + return value; + }; + + internals.xor = function (value, peers, parent, state, options) { + + var present = []; + for (var i = 0; i < peers.length; ++i) { + var peer = peers[i]; + if (Object.prototype.hasOwnProperty.call(parent, peer) && parent[peer] !== undefined) { + + present.push(peer); + } + } + + if (present.length === 1) { + return value; + } + + var context = { peers: peers, peersWithLabels: internals.keysToLabels(this, peers) }; + + if (present.length === 0) { + return this.createError('object.missing', context, state, options); + } + + return this.createError('object.xor', context, state, options); + }; + + internals.or = function (value, peers, parent, state, options) { + + for (var i = 0; i < peers.length; ++i) { + var peer = peers[i]; + if (Object.prototype.hasOwnProperty.call(parent, peer) && parent[peer] !== undefined) { + return value; + } + } + + return this.createError('object.missing', { + peers: peers, + peersWithLabels: internals.keysToLabels(this, peers) + }, state, options); + }; + + internals.and = function (value, peers, parent, state, options) { + + var missing = []; + var present = []; + var count = peers.length; + for (var i = 0; i < count; ++i) { + var peer = peers[i]; + if (!Object.prototype.hasOwnProperty.call(parent, peer) || parent[peer] === undefined) { + + missing.push(peer); + } else { + present.push(peer); + } + } + + var aon = missing.length === count || present.length === count; + + if (!aon) { + + return this.createError('object.and', { + present: present, + presentWithLabels: internals.keysToLabels(this, present), + missing: missing, + missingWithLabels: internals.keysToLabels(this, missing) + }, state, options); + } + }; + + internals.nand = function (value, peers, parent, state, options) { + + var present = []; + for (var i = 0; i < peers.length; ++i) { + var peer = peers[i]; + if (Object.prototype.hasOwnProperty.call(parent, peer) && parent[peer] !== undefined) { + + present.push(peer); + } + } + + var values = Hoek.clone(peers); + var main = values.splice(0, 1)[0]; + var allPresent = present.length === peers.length; + return allPresent ? this.createError('object.nand', { + main: main, + mainWithLabel: internals.keysToLabels(this, main), + peers: values, + peersWithLabels: internals.keysToLabels(this, values) + }, state, options) : null; + }; + + module.exports = new internals.Object(); + + /***/ + }), + /* 13 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + +// Delcare internals + + var internals = { + rfc3986: {} + }; + + internals.generate = function () { + + /** + * elements separated by forward slash ("/") are alternatives. + */ + var or = '|'; + + /** + * Rule to support zero-padded addresses. + */ + var zeroPad = '0?'; + + /** + * DIGIT = %x30-39 ; 0-9 + */ + var digit = '0-9'; + var digitOnly = '[' + digit + ']'; + + /** + * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z + */ + var alpha = 'a-zA-Z'; + var alphaOnly = '[' + alpha + ']'; + + /** + * IPv4 + * cidr = DIGIT ; 0-9 + * / %x31-32 DIGIT ; 10-29 + * / "3" %x30-32 ; 30-32 + */ + internals.rfc3986.ipv4Cidr = digitOnly + or + '[1-2]' + digitOnly + or + '3' + '[0-2]'; + + /** + * IPv6 + * cidr = DIGIT ; 0-9 + * / %x31-39 DIGIT ; 10-99 + * / "1" %x0-1 DIGIT ; 100-119 + * / "12" %x0-8 ; 120-128 + */ + internals.rfc3986.ipv6Cidr = '(?:' + zeroPad + zeroPad + digitOnly + or + zeroPad + '[1-9]' + digitOnly + or + '1' + '[01]' + digitOnly + or + '12[0-8])'; + + /** + * HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" + */ + var hexDigit = digit + 'A-Fa-f'; + var hexDigitOnly = '[' + hexDigit + ']'; + + /** + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + */ + var unreserved = alpha + digit + '-\\._~'; + + /** + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" + */ + var subDelims = '!\\$&\'\\(\\)\\*\\+,;='; + + /** + * pct-encoded = "%" HEXDIG HEXDIG + */ + var pctEncoded = '%' + hexDigit; + + /** + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + */ + var pchar = unreserved + pctEncoded + subDelims + ':@'; + var pcharOnly = '[' + pchar + ']'; + + /** + * dec-octet = DIGIT ; 0-9 + * / %x31-39 DIGIT ; 10-99 + * / "1" 2DIGIT ; 100-199 + * / "2" %x30-34 DIGIT ; 200-249 + * / "25" %x30-35 ; 250-255 + */ + var decOctect = '(?:' + zeroPad + zeroPad + digitOnly + or + zeroPad + '[1-9]' + digitOnly + or + '1' + digitOnly + digitOnly + or + '2' + '[0-4]' + digitOnly + or + '25' + '[0-5])'; + + /** + * IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet + */ + internals.rfc3986.IPv4address = '(?:' + decOctect + '\\.){3}' + decOctect; + + /** + * h16 = 1*4HEXDIG ; 16 bits of address represented in hexadecimal + * ls32 = ( h16 ":" h16 ) / IPv4address ; least-significant 32 bits of address + * IPv6address = 6( h16 ":" ) ls32 + * / "::" 5( h16 ":" ) ls32 + * / [ h16 ] "::" 4( h16 ":" ) ls32 + * / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + * / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + * / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + * / [ *4( h16 ":" ) h16 ] "::" ls32 + * / [ *5( h16 ":" ) h16 ] "::" h16 + * / [ *6( h16 ":" ) h16 ] "::" + */ + var h16 = hexDigitOnly + '{1,4}'; + var ls32 = '(?:' + h16 + ':' + h16 + '|' + internals.rfc3986.IPv4address + ')'; + var IPv6SixHex = '(?:' + h16 + ':){6}' + ls32; + var IPv6FiveHex = '::(?:' + h16 + ':){5}' + ls32; + var IPv6FourHex = '(?:' + h16 + ')?::(?:' + h16 + ':){4}' + ls32; + var IPv6ThreeHex = '(?:(?:' + h16 + ':){0,1}' + h16 + ')?::(?:' + h16 + ':){3}' + ls32; + var IPv6TwoHex = '(?:(?:' + h16 + ':){0,2}' + h16 + ')?::(?:' + h16 + ':){2}' + ls32; + var IPv6OneHex = '(?:(?:' + h16 + ':){0,3}' + h16 + ')?::' + h16 + ':' + ls32; + var IPv6NoneHex = '(?:(?:' + h16 + ':){0,4}' + h16 + ')?::' + ls32; + var IPv6NoneHex2 = '(?:(?:' + h16 + ':){0,5}' + h16 + ')?::' + h16; + var IPv6NoneHex3 = '(?:(?:' + h16 + ':){0,6}' + h16 + ')?::'; + internals.rfc3986.IPv6address = '(?:' + IPv6SixHex + or + IPv6FiveHex + or + IPv6FourHex + or + IPv6ThreeHex + or + IPv6TwoHex + or + IPv6OneHex + or + IPv6NoneHex + or + IPv6NoneHex2 + or + IPv6NoneHex3 + ')'; + + /** + * IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) + */ + internals.rfc3986.IPvFuture = 'v' + hexDigitOnly + '+\\.[' + unreserved + subDelims + ':]+'; + + /** + * scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + */ + internals.rfc3986.scheme = alphaOnly + '[' + alpha + digit + '+-\\.]*'; + + /** + * userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) + */ + var userinfo = '[' + unreserved + pctEncoded + subDelims + ':]*'; + + /** + * IP-literal = "[" ( IPv6address / IPvFuture ) "]" + */ + var IPLiteral = '\\[(?:' + internals.rfc3986.IPv6address + or + internals.rfc3986.IPvFuture + ')\\]'; + + /** + * reg-name = *( unreserved / pct-encoded / sub-delims ) + */ + var regName = '[' + unreserved + pctEncoded + subDelims + ']{0,255}'; + + /** + * host = IP-literal / IPv4address / reg-name + */ + var host = '(?:' + IPLiteral + or + internals.rfc3986.IPv4address + or + regName + ')'; + + /** + * port = *DIGIT + */ + var port = digitOnly + '*'; + + /** + * authority = [ userinfo "@" ] host [ ":" port ] + */ + var authority = '(?:' + userinfo + '@)?' + host + '(?::' + port + ')?'; + + /** + * segment = *pchar + * segment-nz = 1*pchar + * path = path-abempty ; begins with "/" or is empty + * / path-absolute ; begins with "/" but not "//" + * / path-noscheme ; begins with a non-colon segment + * / path-rootless ; begins with a segment + * / path-empty ; zero characters + * path-abempty = *( "/" segment ) + * path-absolute = "/" [ segment-nz *( "/" segment ) ] + * path-rootless = segment-nz *( "/" segment ) + */ + var segment = pcharOnly + '*'; + var segmentNz = pcharOnly + '+'; + var segmentNzNc = '[' + unreserved + pctEncoded + subDelims + '@' + ']+'; + var pathEmpty = ''; + var pathAbEmpty = '(?:\\/' + segment + ')*'; + var pathAbsolute = '\\/(?:' + segmentNz + pathAbEmpty + ')?'; + var pathRootless = segmentNz + pathAbEmpty; + var pathNoScheme = segmentNzNc + pathAbEmpty; + + /** + * hier-part = "//" authority path + */ + internals.rfc3986.hierPart = '(?:' + '(?:\\/\\/' + authority + pathAbEmpty + ')' + or + pathAbsolute + or + pathRootless + ')'; + + /** + * relative-part = "//" authority path-abempty + * / path-absolute + * / path-noscheme + * / path-empty + */ + internals.rfc3986.relativeRef = '(?:' + '(?:\\/\\/' + authority + pathAbEmpty + ')' + or + pathAbsolute + or + pathNoScheme + or + pathEmpty + ')'; + + /** + * query = *( pchar / "/" / "?" ) + */ + internals.rfc3986.query = '[' + pchar + '\\/\\?]*(?=#|$)'; //Finish matching either at the fragment part or end of the line. + + /** + * fragment = *( pchar / "/" / "?" ) + */ + internals.rfc3986.fragment = '[' + pchar + '\\/\\?]*'; + }; + + internals.generate(); + + module.exports = internals.rfc3986; + + /***/ + }), + /* 14 */ + /***/ (function (module, exports) { + + + + /***/ + }), + /* 15 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + /* WEBPACK VAR INJECTION */ + (function (Buffer) { + +// Declare internals + + var internals = {}; + + exports.escapeJavaScript = function (input) { + + if (!input) { + return ''; + } + + var escaped = ''; + + for (var i = 0; i < input.length; ++i) { + + var charCode = input.charCodeAt(i); + + if (internals.isSafe(charCode)) { + escaped += input[i]; + } else { + escaped += internals.escapeJavaScriptChar(charCode); + } + } + + return escaped; + }; + + exports.escapeHtml = function (input) { + + if (!input) { + return ''; + } + + var escaped = ''; + + for (var i = 0; i < input.length; ++i) { + + var charCode = input.charCodeAt(i); + + if (internals.isSafe(charCode)) { + escaped += input[i]; + } else { + escaped += internals.escapeHtmlChar(charCode); + } + } + + return escaped; + }; + + exports.escapeJson = function (input) { + + if (!input) { + return ''; + } + + var lessThan = 0x3C; + var greaterThan = 0x3E; + var andSymbol = 0x26; + var lineSeperator = 0x2028; + + // replace method + var charCode = void 0; + return input.replace(/[<>&\u2028\u2029]/g, function (match) { + + charCode = match.charCodeAt(0); + + if (charCode === lessThan) { + return '\\u003c'; + } else if (charCode === greaterThan) { + return '\\u003e'; + } else if (charCode === andSymbol) { + return '\\u0026'; + } else if (charCode === lineSeperator) { + return '\\u2028'; + } + return '\\u2029'; + }); + }; + + internals.escapeJavaScriptChar = function (charCode) { + + if (charCode >= 256) { + return '\\u' + internals.padLeft('' + charCode, 4); + } + + var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex'); + return '\\x' + internals.padLeft(hexValue, 2); + }; + + internals.escapeHtmlChar = function (charCode) { + + var namedEscape = internals.namedHtml[charCode]; + if (typeof namedEscape !== 'undefined') { + return namedEscape; + } + + if (charCode >= 256) { + return '&#' + charCode + ';'; + } + + var hexValue = new Buffer(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; + }; + + internals.isSafe = function (charCode) { + + return typeof internals.safeCharCodes[charCode] !== 'undefined'; + }; + + internals.namedHtml = { + '38': '&', + '60': '<', + '62': '>', + '34': '"', + '160': ' ', + '162': '¢', + '163': '£', + '164': '¤', + '169': '©', + '174': '®' + }; + + internals.safeCharCodes = function () { + + var safe = {}; + + for (var i = 32; i < 123; ++i) { + + if (i >= 97 || // a-z + i >= 65 && i <= 90 || // A-Z + i >= 48 && i <= 57 || // 0-9 + i === 32 || // space + i === 46 || // . + i === 44 || // , + i === 45 || // - + i === 58 || // : + i === 95) { + // _ + + safe[i] = null; + } + } + + return safe; + }(); + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(3).Buffer)) + + /***/ + }), + /* 16 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + /* WEBPACK VAR INJECTION */ + (function (Buffer, process) { + +// Load modules + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? + function (obj) { + return typeof obj; + } : + function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? + "symbol" : + typeof obj; + }; + + var Punycode = __webpack_require__(35); + +// Declare internals + + var 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 + }, + + 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 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 + }, + + components: { + localpart: 0, + domain: 1, + literal: 2, + contextComment: 3, + contextFWS: 4, + contextQuotedString: 5, + contextQuotedPair: 6 + } + }; + + internals.specials = function () { + + var specials = '()<>[]:;@\\,."'; // US-ASCII visible characters not valid for atext (http://tools.ietf.org/html/rfc5322#section-3.2.3) + var lookup = new Array(0x100); + lookup.fill(false); + + for (var i = 0; i < specials.length; ++i) { + lookup[specials.codePointAt(i)] = true; + } + + return function (code) { + + return lookup[code]; + }; + }(); + + internals.c0Controls = function () { + + var lookup = new Array(0x100); + lookup.fill(false); + + // add C0 control characters + + for (var i = 0; i < 33; ++i) { + lookup[i] = true; + } + + return function (code) { + + return lookup[code]; + }; + }(); + + internals.c1Controls = function () { + + var lookup = new Array(0x100); + lookup.fill(false); + + // add C1 control characters + + for (var i = 127; i < 160; ++i) { + lookup[i] = true; + } + + 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}$/ + }; + +// $lab:coverage:off$ + internals.nulNormalize = function (email) { + + var emailPieces = email.split('\0'); + emailPieces = emailPieces.map(function (string) { + + return string.normalize('NFC'); + }); + + return emailPieces.join('\0'); + }; +// $lab:coverage:on$ + + + internals.checkIpV6 = function (items) { + + return items.every(function (value) { + return internals.regex.ipV6.test(value); + }); + }; + + internals.validDomain = function (tldAtom, options) { + + if (options.tldBlacklist) { + if (Array.isArray(options.tldBlacklist)) { + return internals.indexOf.call(options.tldBlacklist, tldAtom) === -1; + } + + return !internals.hasOwn.call(options.tldBlacklist, tldAtom); + } + + if (Array.isArray(options.tldWhitelist)) { + return internals.indexOf.call(options.tldWhitelist, tldAtom) !== -1; + } + + return internals.hasOwn.call(options.tldWhitelist, tldAtom); + }; + + /** + * 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. + * {*} 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) { + + options = options || {}; + email = internals.normalize(email); + + if (typeof options === 'function') { + callback = options; + options = {}; + } + + if (typeof callback !== 'function') { + callback = null; + } + + var diagnose = void 0; + var threshold = void 0; + + if (typeof options.errorLevel === 'number') { + diagnose = true; + threshold = options.errorLevel; + } else { + diagnose = !!options.errorLevel; + threshold = internals.diagnoses.valid; + } + + 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'); + } + } + + 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'); + } + } + + if (options.minDomainAtoms && (options.minDomainAtoms !== (+options.minDomainAtoms | 0) || options.minDomainAtoms < 0)) { + throw new TypeError('expected positive integer minDomainAtoms'); + } + + var maxResult = internals.diagnoses.valid; + var updateResult = function updateResult(value) { + + if (value > maxResult) { + maxResult = value; + } + }; + + var context = { + now: internals.components.localpart, + prev: internals.components.localpart, + stack: [internals.components.localpart] + }; + + var prevToken = ''; + + var parseData = { + local: '', + domain: '' + }; + var atomData = { + locals: [''], + domains: [''] + }; + + var elementCount = 0; + var elementLength = 0; + var crlfCount = 0; + var charCode = void 0; + + var hyphenFlag = false; + var assertEnd = false; + + var emailLength = email.length; + + var token = void 0; // Token is used outside the loop, must declare similarly + for (var 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; + } + + context.stack.push(context.now); + context.now = internals.components.contextComment; + break; + + // 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] = ''; + } + + break; + + // 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'); + + // Quoted string must be the entire element + assertEnd = true; + context.stack.push(context.now); + context.now = internals.components.contextQuotedString; + } else { + updateResult(internals.diagnoses.errExpectingATEXT); + } + + break; + + // Folding white space + case '\r': + if (emailLength === ++i || email[i] !== '\n') { + // Fatal error + updateResult(internals.diagnoses.errCRNoLF); + break; + } + + // 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; + } + + 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$ + + 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); + } + + // 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; + + // 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); + + // Especially if charCode == 10 + if (internals.specials(charCode) || internals.c0Controls(charCode) || internals.c1Controls( + charCode)) { + + // Fatal error + updateResult(internals.diagnoses.errExpectingATEXT); + } + + parseData.local += token; + atomData.locals[elementCount] += token; + elementLength += Buffer.byteLength(token, 'utf8'); + } + } + + break; + + 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); + } + + context.stack.push(context.now); + context.now = internals.components.contextComment; + break; + + // Next dot-atom element + case '.': + var 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); + } + + // 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; + + 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); + } + + break; + + // Folding white space + case '\r': + if (emailLength === ++i || email[i] !== '\n') { + // Fatal error + updateResult(internals.diagnoses.errCRNoLF); + break; + } + + // 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; + } + + context.stack.push(context.now); + context.now = internals.components.contextFWS; + prevToken = token; + break; + + // 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$ + } + } + + charCode = token.codePointAt(0); + // Assume this token isn't a hyphen unless we discover it is + hyphenFlag = false; + + 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); + } + + 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); + } + + parseData.domain += token; + atomData.domains[elementCount] += token; + elementLength += Buffer.byteLength(token, 'utf8'); + } + + break; + + // 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. + + var index = -1; + var addressLiteral = parseData.literal; + var 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'; + } + } + + 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 { + var match = addressLiteral.slice(5); + var maxGroups = internals.maxIPv6Groups; + var 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); + } + + 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; + + // Folding white space + case '\r': + if (emailLength === ++i || email[i] !== '\n') { + updateResult(internals.diagnoses.errCRNoLF); + break; + } + + // Fallthrough + + case ' ': + case '\t': + updateResult(internals.diagnoses.cfwsFWS); + + 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); + } + + parseData.literal += token; + parseData.domain += token; + atomData.domains[elementCount] += token; + elementLength += Buffer.byteLength(token, 'utf8'); + } + + break; + + // 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; + + // 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; + } + + // Fallthrough + + 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. + + // 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 + + parseData.local += ' '; + atomData.locals[elementCount] += ' '; + elementLength += Buffer.byteLength(token, 'utf8'); + + updateResult(internals.diagnoses.cfwsFWS); + context.stack.push(context.now); + context.now = internals.components.contextFWS; + prevToken = token; + break; + + // 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); + } + + parseData.local += token; + atomData.locals[elementCount] += token; + elementLength += Buffer.byteLength(token, 'utf8'); + } + + // 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); + } + + // 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(); + var escapeToken = '\\' + token; + + switch (context.now) { + case internals.components.contextComment: + break; + + case internals.components.contextQuotedString: + parseData.local += escapeToken; + atomData.locals[elementCount] += escapeToken; + + // The maximum sizes specified by RFC 5321 are octet counts, so we must include the backslash + elementLength += 2; + break; + + case internals.components.literal: + parseData.domain += escapeToken; + atomData.domains[elementCount] += escapeToken; + + // The maximum sizes specified by RFC 5321 are octet counts, so we must include the backslash + elementLength += 2; + break; + + // $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; + + // End of comment + case ')': + context.prev = context.now; + context.now = context.stack.pop(); + break; + + // 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; + } + + // Fallthrough + + case ' ': + case '\t': + updateResult(internals.diagnoses.cfwsFWS); + + 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); + } + } + + 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; + } + + if (++crlfCount > 1) { + // Multiple folds => obsolete FWS + updateResult(internals.diagnoses.deprecatedFWS); + } else { + crlfCount = 1; + } + } + + switch (token) { + case '\r': + if (emailLength === ++i || email[i] !== '\n') { + // Fatal error + updateResult(internals.diagnoses.errCRNoLF); + } + + break; + + case ' ': + case '\t': + break; + + default: + if (prevToken === '\r') { + // Fatal error + updateResult(internals.diagnoses.errFWSCRLFEnd); + } + + crlfCount = 0; + + // End of FWS + context.prev = context.now; + context.now = context.stack.pop(); + + // Look at this token again in the parent context + --i; + } + + prevToken = token; + break; + + // Unexpected context + // $lab:coverage:off$ + default: + throw new Error('unknown context: ' + context.now); + // $lab:coverage:on$ + } // Primary state machine + + if (maxResult > internals.categories.rfc5322) { + // Fatal error, no point continuing + break; + } + } // Token loop + + // Check for errors + if (maxResult < internals.categories.rfc5322) { + var _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); + } + + // 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) { + var tldAtom = atomData.domains[elementCount]; + + if (!internals.validDomain(tldAtom, options)) { + updateResult(internals.diagnoses.errUnknownTLD); + } + } + } // 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 + var code = atomData.domains[elementCount].codePointAt(0); + + if (code <= 57) { + updateResult(internals.diagnoses.rfc5321TLDNumeric); + } + } + + if (maxResult < threshold) { + maxResult = internals.diagnoses.valid; + } + + var finishResult = diagnose ? maxResult : maxResult < internals.defaultThreshold; + + if (callback) { + callback(finishResult); + } + + return finishResult; + }; + + exports.diagnoses = internals.validate.diagnoses = function () { + + var diag = {}; + var keys = Object.keys(internals.diagnoses); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + diag[key] = internals.diagnoses[key]; + } + + return diag; + }(); + + exports.normalize = internals.normalize = function (email) { + + // $lab:coverage:off$ + if (process.version[1] === '4' && email.indexOf('\0') >= 0) { + return internals.nulNormalize(email); + } + // $lab:coverage:on$ + + + return email.normalize('NFC'); + }; + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(3).Buffer, __webpack_require__(5))) + + /***/ + }), + /* 17 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + +// Declare internals + + var 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', + allowOnly: 'must be one of {{valids}}', + default: 'threw an error when running default method' + }, + alternatives: { + base: 'not matching any of the allowed alternatives', + child: null + }, + array: { + base: 'must be an array', + includes: 'at position {{pos}} does not match any of the allowed types', + includesSingle: 'single value of "{{!label}}" does not match any of the allowed types', + includesOne: 'at position {{pos}} fails because {{reason}}', + includesOneSingle: 'single value of "{{!label}}" fails because {{reason}}', + includesRequiredUnknowns: 'does not contain {{unknownMisses}} required value(s)', + includesRequiredKnowns: 'does not contain {{knownMisses}}', + 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', + min: 'must contain at least {{limit}} items', + max: 'must contain less than or equal to {{limit}} items', + length: 'must contain {{limit}} items', + ordered: 'at position {{pos}} fails because {{reason}}', + orderedLength: 'at position {{pos}} fails because array must contain at most {{limit}} items', + ref: 'references "{{ref}}" which is not a positive integer', + sparse: 'must not be a sparse array', + unique: 'position {{pos}} contains a duplicate value' + }, + boolean: { + base: 'must be a boolean' + }, + binary: { + base: 'must be a buffer or a string', + min: 'must be at least {{limit}} bytes', + max: 'must be less than or equal to {{limit}} bytes', + length: 'must be {{limit}} bytes' + }, + 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}}"', + isoDate: 'must be a valid ISO 8601 date', + timestamp: { + javascript: 'must be a valid timestamp or number of milliseconds', + unix: 'must be a valid timestamp or number of seconds' + }, + ref: 'references "{{ref}}" which is not a date' + }, + function: { + base: 'must be a Function', + arity: 'must have an arity of {{n}}', + minArity: 'must have an arity greater or equal to {{n}}', + maxArity: 'must have an arity lesser or equal to {{n}}', + ref: 'must be a Joi reference', + class: 'must be a class' + }, + lazy: { + base: '!!schema error: lazy schema must be set', + schema: '!!schema error: lazy schema function must return a schema' + }, + object: { + base: 'must be an object', + child: '!!child "{{!child}}" fails because {{reason}}', + min: 'must have at least {{limit}} children', + max: 'must have less than or equal to {{limit}} children', + length: 'must have {{limit}} children', + allowUnknown: '!!"{{!child}}" is not allowed', + with: '!!"{{mainWithLabel}}" missing required peer "{{peerWithLabel}}"', + 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}}', + 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}}', + rename: { + multiple: 'cannot rename child "{{from}}" because multiple renames are disabled and another key was already renamed to "{{to}}"', + override: 'cannot rename child "{{from}}" because override is disabled and target "{{to}}" exists', + regex: { + multiple: 'cannot rename children {{from}} because multiple renames are disabled and another key was already renamed to "{{to}}"', + override: 'cannot rename children {{from}} because override is disabled and target "{{to}}" exists' + } + }, + type: 'must be an instance of "{{type}}"', + schema: 'must be a Joi instance' + }, + number: { + base: 'must be a 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', + precision: 'must have no more than {{limit}} decimal places', + ref: 'references "{{ref}}" which is not a number', + multiple: 'must be a multiple of {{multiple}}' + }, + string: { + base: 'must be a string', + min: 'length must be at least {{limit}} characters long', + max: 'length must be less than or equal to {{limit}} characters long', + length: 'length must be {{limit}} characters long', + alphanum: 'must only contain alpha-numeric characters', + token: 'must only contain alpha-numeric and underscore characters', + regex: { + base: 'with value "{{!value}}" fails to match the required pattern: {{pattern}}', + name: 'with value "{{!value}}" fails to match the {{name}} pattern', + invert: { + base: 'with value "{{!value}}" matches the inverted pattern: {{pattern}}', + name: 'with value "{{!value}}" matches the inverted {{name}} pattern' + } + }, + email: 'must be a valid email', + uri: 'must be a valid uri', + uriRelativeOnly: 'must be a valid relative uri', + uriCustomScheme: 'must be a valid uri with a scheme matching the {{scheme}} pattern', + isoDate: 'must be a valid ISO 8601 date', + guid: 'must be a valid GUID', + hex: 'must only contain hexadecimal characters', + base64: 'must be a valid base64 string', + hostname: 'must be a valid hostname', + normalize: 'must be unicode normalized in the {{form}} form', + lowercase: 'must only contain lowercase characters', + uppercase: 'must only contain uppercase characters', + trim: 'must not have leading or trailing whitespace', + creditCard: 'must be a credit card', + 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' + } + }; + + /***/ + }), + /* 18 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var Joi = __webpack_require__(8); + +// Declare internals + + var internals = {}; + + exports.options = Joi.object({ + abortEarly: Joi.boolean(), + convert: Joi.boolean(), + allowUnknown: Joi.boolean(), + skipFunctions: Joi.boolean(), + 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 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? + function (obj) { + return typeof obj; + } : + function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? + "symbol" : + typeof obj; + }; + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Any = __webpack_require__(2); + var Cast = __webpack_require__(4); + var Ref = __webpack_require__(1); + var Hoek = __webpack_require__(0); + +// Declare internals + + var internals = {}; + + internals.fastSplice = function (arr, i) { + + var pos = i; + while (pos < arr.length) { + arr[pos++] = arr[pos]; + } + + --arr.length; + }; + + internals.Array = function (_Any) { + _inherits(_class, _Any); + + function _class() { + _classCallCheck(this, _class); + + var _this = _possibleConstructorReturn(this, _Any.call(this)); + + _this._type = 'array'; + _this._inner.items = []; + _this._inner.ordereds = []; + _this._inner.inclusions = []; + _this._inner.exclusions = []; + _this._inner.requireds = []; + _this._flags.sparse = false; + return _this; + } + + _class.prototype._base = function _base(value, state, options) { + + var result = { + value: value + }; + + if (typeof value === 'string' && options.convert) { + + internals.safeParse(value, result); + } + + var isArray = Array.isArray(result.value); + var wasArray = isArray; + if (options.convert && this._flags.single && !isArray) { + result.value = [result.value]; + isArray = true; + } + + if (!isArray) { + result.errors = this.createError('array.base', null, state, options); + return result; + } + + if (this._inner.inclusions.length || this._inner.exclusions.length || this._inner.requireds.length || this._inner.ordereds.length || !this._flags.sparse) { + + // Clone the array so that we don't modify the original + if (wasArray) { + result.value = result.value.slice(0); + } + + result.errors = this._checkItems.call(this, result.value, wasArray, state, options); + + if (result.errors && wasArray && options.convert && this._flags.single) { + + // Attempt a 2nd pass by putting the array inside one. + var previousErrors = result.errors; + + result.value = [result.value]; + result.errors = this._checkItems.call(this, result.value, wasArray, state, options); + + if (result.errors) { + + // Restore previous errors and value since this didn't validate either. + result.errors = previousErrors; + result.value = result.value[0]; + } + } + } + + return result; + }; + + _class.prototype._checkItems = function _checkItems(items, wasArray, state, options) { + + var errors = []; + var errored = void 0; + + var requireds = this._inner.requireds.slice(); + var ordereds = this._inner.ordereds.slice(); + var inclusions = this._inner.inclusions.concat(requireds); + + var il = items.length; + for (var i = 0; i < il; ++i) { + errored = false; + var item = items[i]; + var isValid = false; + var key = wasArray ? i : state.key; + var path = wasArray ? state.path.concat(i) : state.path; + var localState = { + key: key, + path: path, + parent: state.parent, + reference: state.reference + }; + var res = void 0; + + // Sparse + + if (!this._flags.sparse && item === undefined) { + errors.push(this.createError( + 'array.sparse', + null, + { key: state.key, path: localState.path, pos: i }, + options + )); + + if (options.abortEarly) { + return errors; + } + + continue; + } + + // Exclusions + + for (var j = 0; j < this._inner.exclusions.length; ++j) { + res = this._inner.exclusions[j]._validate(item, localState, {}); // Not passing options to use defaults + + if (!res.errors) { + errors.push(this.createError( + wasArray ? 'array.excludes' : 'array.excludesSingle', + { pos: i, value: item }, + { key: state.key, path: localState.path }, + options + )); + errored = true; + + if (options.abortEarly) { + return errors; + } + + break; + } + } + + if (errored) { + continue; + } + + // Ordered + if (this._inner.ordereds.length) { + if (ordereds.length > 0) { + var ordered = ordereds.shift(); + res = ordered._validate(item, localState, options); + if (!res.errors) { + if (ordered._flags.strip) { + internals.fastSplice(items, i); + --i; + --il; + } else if (!this._flags.sparse && res.value === undefined) { + errors.push(this.createError( + 'array.sparse', + null, + { key: state.key, path: localState.path, pos: i }, + options + )); + + if (options.abortEarly) { + return errors; + } + + continue; + } else { + items[i] = res.value; + } + } else { + errors.push(this.createError( + 'array.ordered', + { pos: i, reason: res.errors, value: item }, + { key: state.key, path: localState.path }, + options + )); + if (options.abortEarly) { + return errors; + } + } + continue; + } else if (!this._inner.items.length) { + errors.push(this.createError( + 'array.orderedLength', + { pos: i, limit: this._inner.ordereds.length }, + { key: state.key, path: localState.path }, + options + )); + if (options.abortEarly) { + return errors; + } + continue; + } + } + + // Requireds + + var requiredChecks = []; + var jl = requireds.length; + for (var _j = 0; _j < jl; ++_j) { + res = requiredChecks[_j] = requireds[_j]._validate(item, localState, options); + if (!res.errors) { + items[i] = res.value; + isValid = true; + internals.fastSplice(requireds, _j); + --_j; + --jl; + + if (!this._flags.sparse && res.value === undefined) { + errors.push(this.createError( + 'array.sparse', + null, + { key: state.key, path: localState.path, pos: i }, + options + )); + + if (options.abortEarly) { + return errors; + } + } + + break; + } + } + + if (isValid) { + continue; + } + + // Inclusions + + var stripUnknown = options.stripUnknown ? + options.stripUnknown === true ? + true : + !!options.stripUnknown.arrays : + false; + + jl = inclusions.length; + for (var _j2 = 0; _j2 < jl; ++_j2) { + var inclusion = inclusions[_j2]; + + // Avoid re-running requireds that already didn't match in the previous loop + var previousCheck = requireds.indexOf(inclusion); + if (previousCheck !== -1) { + res = requiredChecks[previousCheck]; + } else { + res = inclusion._validate(item, localState, options); + + if (!res.errors) { + if (inclusion._flags.strip) { + internals.fastSplice(items, i); + --i; + --il; + } else if (!this._flags.sparse && res.value === undefined) { + errors.push(this.createError( + 'array.sparse', + null, + { key: state.key, path: localState.path, pos: i }, + options + )); + errored = true; + } else { + items[i] = res.value; + } + isValid = true; + break; + } + } + + // Return the actual error if only one inclusion defined + if (jl === 1) { + if (stripUnknown) { + internals.fastSplice(items, i); + --i; + --il; + isValid = true; + break; + } + + errors.push(this.createError( + wasArray ? + 'array.includesOne' : + 'array.includesOneSingle', + { pos: i, reason: res.errors, value: item }, + { key: state.key, path: localState.path }, + options + )); + errored = true; + + if (options.abortEarly) { + return errors; + } + + break; + } + } + + if (errored) { + continue; + } + + if (this._inner.inclusions.length && !isValid) { + if (stripUnknown) { + internals.fastSplice(items, i); + --i; + --il; + continue; + } + + errors.push(this.createError( + wasArray ? 'array.includes' : 'array.includesSingle', + { pos: i, value: item }, + { key: state.key, path: localState.path }, + options + )); + + if (options.abortEarly) { + return errors; + } + } + } + + if (requireds.length) { + this._fillMissedErrors.call(this, errors, requireds, state, options); + } + + if (ordereds.length) { + this._fillOrderedErrors.call(this, errors, ordereds, state, options); + } + + return errors.length ? errors : null; + }; + + _class.prototype.describe = function describe() { + + var description = Any.prototype.describe.call(this); + + if (this._inner.ordereds.length) { + description.orderedItems = []; + + for (var i = 0; i < this._inner.ordereds.length; ++i) { + description.orderedItems.push(this._inner.ordereds[i].describe()); + } + } + + if (this._inner.items.length) { + description.items = []; + + for (var _i = 0; _i < this._inner.items.length; ++_i) { + description.items.push(this._inner.items[_i].describe()); + } + } + + return description; + }; + + _class.prototype.items = function items() { + var _this2 = this; + + var obj = this.clone(); + + for (var _len = arguments.length, schemas = Array(_len), _key = 0; _key < _len; _key++) { + schemas[_key] = arguments[_key]; + } + + Hoek.flatten(schemas).forEach(function (type, index) { + + try { + type = Cast.schema(_this2._currentJoi, type); + } + catch (castErr) { + if (castErr.hasOwnProperty('path')) { + castErr.path = index + '.' + castErr.path; + } else { + castErr.path = index; + } + castErr.message = castErr.message + '(' + castErr.path + ')'; + throw castErr; + } + + obj._inner.items.push(type); + + if (type._flags.presence === 'required') { + obj._inner.requireds.push(type); + } else if (type._flags.presence === 'forbidden') { + obj._inner.exclusions.push(type.optional()); + } else { + obj._inner.inclusions.push(type); + } + }); + + return obj; + }; + + _class.prototype.ordered = function ordered() { + var _this3 = this; + + var obj = this.clone(); + + for (var _len2 = arguments.length, schemas = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + schemas[_key2] = arguments[_key2]; + } + + Hoek.flatten(schemas).forEach(function (type, index) { + + try { + type = Cast.schema(_this3._currentJoi, type); + } + catch (castErr) { + if (castErr.hasOwnProperty('path')) { + castErr.path = index + '.' + castErr.path; + } else { + castErr.path = index; + } + castErr.message = castErr.message + '(' + castErr.path + ')'; + throw castErr; + } + obj._inner.ordereds.push(type); + }); + + return obj; + }; + + _class.prototype.min = function min(limit) { + + var isRef = Ref.isRef(limit); + + 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) { + + var compareTo = void 0; + 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); + } + } else { + compareTo = limit; + } + + if (value.length >= compareTo) { + return value; + } + + return this.createError('array.min', { limit: limit, value: value }, state, options); + }); + }; + + _class.prototype.max = function max(limit) { + + var isRef = Ref.isRef(limit); + + 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) { + + var compareTo = void 0; + 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); + } + } else { + compareTo = limit; + } + + if (value.length <= compareTo) { + return value; + } + + return this.createError('array.max', { limit: limit, value: value }, state, options); + }); + }; + + _class.prototype.length = function length(limit) { + + var isRef = Ref.isRef(limit); + + 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) { + + var compareTo = void 0; + 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); + } + } else { + compareTo = limit; + } + + if (value.length === compareTo) { + return value; + } + + return this.createError( + 'array.length', + { limit: limit, value: value }, + state, + options + ); + }); + }; + + _class.prototype.unique = function unique(comparator) { + + Hoek.assert( + comparator === undefined || typeof comparator === 'function' || typeof comparator === 'string', + 'comparator must be a function or a string' + ); + + var settings = {}; + + if (typeof comparator === 'string') { + settings.path = comparator; + } else if (typeof comparator === 'function') { + settings.comparator = comparator; + } + + return this._test('unique', settings, function (value, state, options) { + + var found = { + string: {}, + number: {}, + undefined: {}, + boolean: {}, + object: new Map(), + function: new Map(), + custom: new Map() + }; + + var compare = settings.comparator || Hoek.deepEqual; + + for (var i = 0; i < value.length; ++i) { + var item = settings.path ? Hoek.reach(value[i], settings.path) : value[i]; + var records = settings.comparator ? + found.custom : + found[typeof item === 'undefined' ? 'undefined' : _typeof(item)]; + + // All available types are supported, so it's not possible to reach 100% coverage without ignoring this line. + // I still want to keep the test for future js versions with new types (eg. Symbol). + if (/* $lab:coverage:off$ */records /* $lab:coverage:on$ */) { + if (records instanceof Map) { + var entries = records.entries(); + var current = void 0; + while (!(current = entries.next()).done) { + if (compare(current.value[0], item)) { + var localState = { + key: state.key, + path: state.path.concat(i), + parent: state.parent, + reference: state.reference + }; + + var context = { + pos: i, + value: value[i], + dupePos: current.value[1], + dupeValue: value[current.value[1]] + }; + + if (settings.path) { + context.path = settings.path; + } + + return this.createError('array.unique', context, localState, options); + } + } + + records.set(item, i); + } else { + if (records[item] !== undefined) { + var _localState = { + key: state.key, + path: state.path.concat(i), + parent: state.parent, + reference: state.reference + }; + + var _context = { + pos: i, + value: value[i], + dupePos: records[item], + dupeValue: value[records[item]] + }; + + if (settings.path) { + _context.path = settings.path; + } + + return this.createError('array.unique', _context, _localState, options); + } + + records[item] = i; + } + } + } + + return value; + }); + }; + + _class.prototype.sparse = function sparse(enabled) { + + var value = enabled === undefined ? true : !!enabled; + + if (this._flags.sparse === value) { + return this; + } + + var obj = this.clone(); + obj._flags.sparse = value; + return obj; + }; + + _class.prototype.single = function single(enabled) { + + var value = enabled === undefined ? true : !!enabled; + + if (this._flags.single === value) { + return this; + } + + var obj = this.clone(); + obj._flags.single = value; + return obj; + }; + + _class.prototype._fillMissedErrors = function _fillMissedErrors( + errors, + requireds, + state, + options + ) { + + var knownMisses = []; + var unknownMisses = 0; + for (var i = 0; i < requireds.length; ++i) { + var label = requireds[i]._getLabel(); + if (label) { + knownMisses.push(label); + } else { + ++unknownMisses; + } + } + + if (knownMisses.length) { + if (unknownMisses) { + errors.push(this.createError( + 'array.includesRequiredBoth', + { knownMisses: knownMisses, unknownMisses: unknownMisses }, + { key: state.key, path: state.path }, + options + )); + } else { + errors.push(this.createError( + 'array.includesRequiredKnowns', + { knownMisses: knownMisses }, + { key: state.key, path: state.path }, + options + )); + } + } else { + errors.push(this.createError( + 'array.includesRequiredUnknowns', + { unknownMisses: unknownMisses }, + { key: state.key, path: state.path }, + options + )); + } + }; + + _class.prototype._fillOrderedErrors = function _fillOrderedErrors( + errors, + ordereds, + state, + options + ) { + + var requiredOrdereds = []; + + for (var i = 0; i < ordereds.length; ++i) { + var presence = Hoek.reach(ordereds[i], '_flags.presence'); + if (presence === 'required') { + requiredOrdereds.push(ordereds[i]); + } + } + + if (requiredOrdereds.length) { + this._fillMissedErrors.call(this, errors, requiredOrdereds, state, options); + } + }; + + return _class; + }(Any); + + internals.safeParse = function (value, result) { + + try { + var converted = JSON.parse(value); + if (Array.isArray(converted)) { + result.value = converted; + } + } + catch (e) { + } + }; + + module.exports = new internals.Array(); + + /***/ + }), + /* 20 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + /* WEBPACK VAR INJECTION */ + (function (Buffer) { + +// Load modules + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Any = __webpack_require__(2); + var Hoek = __webpack_require__(0); + +// Declare internals + + var internals = {}; + + internals.Binary = function (_Any) { + _inherits(_class, _Any); + + function _class() { + _classCallCheck(this, _class); + + var _this = _possibleConstructorReturn(this, _Any.call(this)); + + _this._type = 'binary'; + return _this; + } + + _class.prototype._base = function _base(value, state, options) { + + var result = { + value: value + }; + + if (typeof value === 'string' && options.convert) { + + try { + result.value = new Buffer(value, this._flags.encoding); + } + catch (e) { + } + } + + result.errors = Buffer.isBuffer(result.value) ? + null : + this.createError('binary.base', null, state, options); + return result; + }; + + _class.prototype.encoding = function encoding(_encoding) { + + Hoek.assert(Buffer.isEncoding(_encoding), 'Invalid encoding:', _encoding); + + if (this._flags.encoding === _encoding) { + return this; + } + + var obj = this.clone(); + obj._flags.encoding = _encoding; + return obj; + }; + + _class.prototype.min = function min(limit) { + + Hoek.assert( + Number.isSafeInteger(limit) && limit >= 0, 'limit must be a positive integer'); + + return this._test('min', limit, function (value, state, options) { + + if (value.length >= limit) { + return value; + } + + return this.createError( + 'binary.min', + { limit: limit, value: value }, + state, + options + ); + }); + }; + + _class.prototype.max = function max(limit) { + + Hoek.assert( + Number.isSafeInteger(limit) && limit >= 0, 'limit must be a positive integer'); + + return this._test('max', limit, function (value, state, options) { + + if (value.length <= limit) { + return value; + } + + return this.createError( + 'binary.max', + { limit: limit, value: value }, + state, + options + ); + }); + }; + + _class.prototype.length = function length(limit) { + + Hoek.assert( + Number.isSafeInteger(limit) && limit >= 0, 'limit must be a positive integer'); + + return this._test('length', limit, function (value, state, options) { + + if (value.length === limit) { + return value; + } + + return this.createError( + 'binary.length', + { limit: limit, value: value }, + state, + options + ); + }); + }; + + return _class; + }(Any); + + module.exports = new internals.Binary(); + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(3).Buffer)) + + /***/ + }), + /* 21 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Any = __webpack_require__(2); + var Hoek = __webpack_require__(0); + +// Declare internals + + var internals = { + Set: __webpack_require__(9) + }; + + internals.Boolean = function (_Any) { + _inherits(_class, _Any); + + function _class() { + _classCallCheck(this, _class); + + var _this = _possibleConstructorReturn(this, _Any.call(this)); + + _this._type = 'boolean'; + _this._flags.insensitive = true; + _this._inner.truthySet = new internals.Set(); + _this._inner.falsySet = new internals.Set(); + return _this; + } + + _class.prototype._base = function _base(value, state, options) { + + var result = { + value: value + }; + + if (typeof value === 'string' && options.convert) { + + var normalized = this._flags.insensitive ? value.toLowerCase() : value; + result.value = normalized === 'true' ? true : normalized === 'false' ? false : value; + } + + if (typeof result.value !== 'boolean') { + result.value = this._inner.truthySet.has(value, null, null, this._flags.insensitive) ? + true : + 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); + return result; + }; + + _class.prototype.truthy = function truthy() { + for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) { + values[_key] = arguments[_key]; + } + + var obj = this.clone(); + values = Hoek.flatten(values); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + + Hoek.assert(value !== undefined, 'Cannot call truthy with undefined'); + obj._inner.truthySet.add(value); + } + return obj; + }; + + _class.prototype.falsy = function falsy() { + for (var _len2 = arguments.length, values = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + values[_key2] = arguments[_key2]; + } + + var obj = this.clone(); + values = Hoek.flatten(values); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + + Hoek.assert(value !== undefined, 'Cannot call falsy with undefined'); + obj._inner.falsySet.add(value); + } + return obj; + }; + + _class.prototype.insensitive = function insensitive(enabled) { + + var insensitive = enabled === undefined ? true : !!enabled; + + if (this._flags.insensitive === insensitive) { + return this; + } + + var obj = this.clone(); + obj._flags.insensitive = insensitive; + return obj; + }; + + _class.prototype.describe = function describe() { + + var description = Any.prototype.describe.call(this); + description.truthy = [true].concat(this._inner.truthySet.values()); + description.falsy = [false].concat(this._inner.falsySet.values()); + return description; + }; + + return _class; + }(Any); + + module.exports = new internals.Boolean(); + + /***/ + }), + /* 22 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Hoek = __webpack_require__(0); + var ObjectType = __webpack_require__(12); + var Ref = __webpack_require__(1); + +// Declare internals + + var internals = {}; + + internals.Func = function (_ObjectType$construct) { + _inherits(_class, _ObjectType$construct); + + function _class() { + _classCallCheck(this, _class); + + var _this = _possibleConstructorReturn(this, _ObjectType$construct.call(this)); + + _this._flags.func = true; + return _this; + } + + _class.prototype.arity = function arity(n) { + + Hoek.assert(Number.isSafeInteger(n) && n >= 0, 'n must be a positive integer'); + + return this._test('arity', n, function (value, state, options) { + + if (value.length === n) { + return value; + } + + return this.createError('function.arity', { n: n }, state, options); + }); + }; + + _class.prototype.minArity = function minArity(n) { + + Hoek.assert(Number.isSafeInteger(n) && n > 0, 'n must be a strict positive integer'); + + return this._test('minArity', n, function (value, state, options) { + + if (value.length >= n) { + return value; + } + + return this.createError('function.minArity', { n: n }, state, options); + }); + }; + + _class.prototype.maxArity = function maxArity(n) { + + Hoek.assert(Number.isSafeInteger(n) && n >= 0, 'n must be a positive integer'); + + return this._test('maxArity', n, function (value, state, options) { + + if (value.length <= n) { + return value; + } + + return this.createError('function.maxArity', { n: n }, state, options); + }); + }; + + _class.prototype.ref = function ref() { + + return this._test('ref', null, function (value, state, options) { + + if (Ref.isRef(value)) { + return value; + } + + return this.createError('function.ref', null, state, options); + }); + }; + + _class.prototype.class = function _class() { + + return this._test('class', null, function (value, state, options) { + + if (/^\s*class\s/.test(value.toString())) { + return value; + } + + return this.createError('function.class', null, state, options); + }); + }; + + return _class; + }(ObjectType.constructor); + + module.exports = new internals.Func(); + + /***/ + }), + /* 23 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Any = __webpack_require__(2); + var Hoek = __webpack_require__(0); + +// Declare internals + + var internals = {}; + + internals.Lazy = function (_Any) { + _inherits(_class, _Any); + + function _class() { + _classCallCheck(this, _class); + + var _this = _possibleConstructorReturn(this, _Any.call(this)); + + _this._type = 'lazy'; + return _this; + } + + _class.prototype._base = function _base(value, state, options) { + + var result = { value: value }; + var lazy = this._flags.lazy; + + if (!lazy) { + result.errors = this.createError('lazy.base', null, state, options); + return result; + } + + var schema = lazy(); + + if (!(schema instanceof Any)) { + result.errors = this.createError('lazy.schema', null, state, options); + return result; + } + + return schema._validate(value, state, options); + }; + + _class.prototype.set = function set(fn) { + + Hoek.assert(typeof fn === 'function', 'You must provide a function as first argument'); + + var obj = this.clone(); + obj._flags.lazy = fn; + return obj; + }; + + return _class; + }(Any); + + module.exports = new internals.Lazy(); + + /***/ + }), + /* 24 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Any = __webpack_require__(2); + var Ref = __webpack_require__(1); + var Hoek = __webpack_require__(0); + +// Declare internals + + var internals = { + precisionRx: /(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/ + }; + + internals.Number = function (_Any) { + _inherits(_class, _Any); + + function _class() { + _classCallCheck(this, _class); + + var _this = _possibleConstructorReturn(this, _Any.call(this)); + + _this._type = 'number'; + _this._invalids.add(Infinity); + _this._invalids.add(-Infinity); + return _this; + } + + _class.prototype._base = function _base(value, state, options) { + + var result = { + errors: null, + value: value + }; + + if (typeof value === 'string' && options.convert) { + + var number = parseFloat(value); + result.value = isNaN(number) || !isFinite(value) ? NaN : number; + } + + var isNumber = typeof result.value === 'number' && !isNaN(result.value); + + if (options.convert && 'precision' in this._flags && isNumber) { + + // This is conceptually equivalent to using toFixed but it should be much faster + var precision = Math.pow(10, this._flags.precision); + result.value = Math.round(result.value * precision) / precision; + } + + result.errors = isNumber ? null : this.createError('number.base', null, state, options); + return result; + }; + + _class.prototype.multiple = function multiple(base) { + + var isRef = Ref.isRef(base); + + if (!isRef) { + Hoek.assert(typeof base === 'number' && isFinite(base), 'multiple must be a number'); + Hoek.assert(base > 0, 'multiple must be greater than 0'); + } + + return this._test('multiple', base, function (value, state, options) { + + var divisor = isRef ? base(state.reference || state.parent, options) : base; + + if (isRef && (typeof divisor !== 'number' || !isFinite(divisor))) { + return this.createError('number.ref', { ref: base.key }, state, options); + } + + if (value % divisor === 0) { + return value; + } + + return this.createError( + 'number.multiple', + { multiple: base, value: value }, + state, + options + ); + }); + }; + + _class.prototype.integer = function integer() { + + return this._test('integer', undefined, function (value, state, options) { + + return Number.isSafeInteger(value) ? + value : + this.createError('number.integer', { value: value }, state, options); + }); + }; + + _class.prototype.negative = function negative() { + + return this._test('negative', undefined, function (value, state, options) { + + if (value < 0) { + return value; + } + + return this.createError('number.negative', { value: value }, state, options); + }); + }; + + _class.prototype.positive = function positive() { + + return this._test('positive', undefined, function (value, state, options) { + + if (value > 0) { + return value; + } + + return this.createError('number.positive', { value: value }, state, options); + }); + }; + + _class.prototype.precision = function precision(limit) { + + Hoek.assert(Number.isSafeInteger(limit), 'limit must be an integer'); + Hoek.assert(!('precision' in this._flags), 'precision already set'); + + var obj = this._test('precision', limit, function (value, state, options) { + + var places = value.toString().match(internals.precisionRx); + var decimals = Math.max((places[1] ? places[1].length : 0) - (places[2] ? + parseInt( + places[2], + 10 + ) : + 0), 0); + if (decimals <= limit) { + return value; + } + + return this.createError( + 'number.precision', + { limit: limit, value: value }, + state, + options + ); + }); + + obj._flags.precision = limit; + return obj; + }; + + return _class; + }(Any); + + internals.compare = function (type, compare) { + + return function (limit) { + + var isRef = Ref.isRef(limit); + var isNumber = typeof limit === 'number' && !isNaN(limit); + + Hoek.assert(isNumber || isRef, 'limit must be a number or reference'); + + return this._test(type, limit, function (value, state, options) { + + var compareTo = void 0; + if (isRef) { + compareTo = limit(state.reference || state.parent, options); + + if (!(typeof compareTo === 'number' && !isNaN(compareTo))) { + return this.createError('number.ref', { ref: limit.key }, state, options); + } + } else { + compareTo = limit; + } + + if (compare(value, compareTo)) { + return value; + } + + return this.createError( + 'number.' + type, { limit: compareTo, value: value }, + state, + options + ); + }); + }; + }; + + internals.Number.prototype.min = internals.compare('min', function (value, limit) { + return value >= limit; + }); + internals.Number.prototype.max = internals.compare('max', function (value, limit) { + return value <= limit; + }); + internals.Number.prototype.greater = internals.compare('greater', function (value, limit) { + return value > limit; + }); + internals.Number.prototype.less = internals.compare('less', function (value, limit) { + return value < limit; + }); + + module.exports = new internals.Number(); + + /***/ + }), + /* 25 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + /* WEBPACK VAR INJECTION */ + (function (Buffer) { + +// Load modules + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? + function (obj) { + return typeof obj; + } : + function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? + "symbol" : + typeof obj; + }; + + function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? + Object.setPrototypeOf(subClass, superClass) : + _defaults(subClass, superClass); + } + + var Net = __webpack_require__(14); + var Hoek = __webpack_require__(0); + var Isemail = void 0; // Loaded on demand + var Any = __webpack_require__(2); + var Ref = __webpack_require__(1); + var JoiDate = __webpack_require__(11); + var Uri = __webpack_require__(27); + var Ip = __webpack_require__(26); + +// Declare internals + + var internals = { + uriRegex: Uri.createUriRegex(), + ipRegex: Ip.createIpRegex(['ipv4', 'ipv6', 'ipvfuture'], 'optional'), + guidBrackets: { + '{': '}', '[': ']', '(': ')', '': '' + }, + guidVersions: { + uuidv1: '1', + uuidv2: '2', + uuidv3: '3', + uuidv4: '4', + uuidv5: '5' + }, + cidrPresences: ['required', 'optional', 'forbidden'], + normalizationForms: ['NFC', 'NFD', 'NFKC', 'NFKD'] + }; + + internals.String = function (_Any) { + _inherits(_class, _Any); + + function _class() { + _classCallCheck(this, _class); + + var _this = _possibleConstructorReturn(this, _Any.call(this)); + + _this._type = 'string'; + _this._invalids.add(''); + return _this; + } + + _class.prototype._base = function _base(value, state, options) { + + if (typeof value === 'string' && options.convert) { + + if (this._flags.normalize) { + value = value.normalize(this._flags.normalize); + } + + if (this._flags.case) { + value = this._flags.case === 'upper' ? + value.toLocaleUpperCase() : + value.toLocaleLowerCase(); + } + + if (this._flags.trim) { + value = value.trim(); + } + + if (this._inner.replacements) { + + for (var i = 0; i < this._inner.replacements.length; ++i) { + var replacement = this._inner.replacements[i]; + value = value.replace(replacement.pattern, replacement.replacement); + } + } + + if (this._flags.truncate) { + for (var _i = 0; _i < this._tests.length; ++_i) { + var test = this._tests[_i]; + if (test.name === 'max') { + value = value.slice(0, test.arg); + break; + } + } + } + } + + return { + value: value, + errors: typeof value === 'string' ? + null : + this.createError('string.base', { value: value }, state, options) + }; + }; + + _class.prototype.insensitive = function insensitive() { + + if (this._flags.insensitive) { + return this; + } + + var obj = this.clone(); + obj._flags.insensitive = true; + return obj; + }; + + _class.prototype.creditCard = function creditCard() { + + return this._test('creditCard', undefined, function (value, state, options) { + + var i = value.length; + var sum = 0; + var mul = 1; + + while (i--) { + var char = value.charAt(i) * mul; + sum = sum + (char - (char > 9) * 9); + mul = mul ^ 3; + } + + var check = sum % 10 === 0 && sum > 0; + return check ? + value : + this.createError('string.creditCard', { value: value }, state, options); + }); + }; + + _class.prototype.regex = function regex(pattern, patternOptions) { + + Hoek.assert(pattern instanceof RegExp, 'pattern must be a RegExp'); + + var patternObject = { + pattern: new RegExp(pattern.source, pattern.ignoreCase ? 'i' : undefined) // Future version should break this and forbid unsupported regex flags + }; + + if (typeof patternOptions === 'string') { + patternObject.name = patternOptions; + } else if ((typeof patternOptions === 'undefined' ? + 'undefined' : + _typeof(patternOptions)) === 'object') { + patternObject.invert = !!patternOptions.invert; + + if (patternOptions.name) { + patternObject.name = patternOptions.name; + } + } + + var errorCode = ['string.regex', patternObject.invert ? '.invert' : '', + patternObject.name ? '.name' : '.base'].join(''); + + return this._test('regex', patternObject, function (value, state, options) { + + var patternMatch = patternObject.pattern.test(value); + + if (patternMatch ^ patternObject.invert) { + return value; + } + + return this.createError( + errorCode, + { name: patternObject.name, pattern: patternObject.pattern, value: value }, + state, + options + ); + }); + }; + + _class.prototype.alphanum = function alphanum() { + + return this._test('alphanum', undefined, function (value, state, options) { + + if (/^[a-zA-Z0-9]+$/.test(value)) { + return value; + } + + return this.createError('string.alphanum', { value: value }, state, options); + }); + }; + + _class.prototype.token = function token() { + + return this._test('token', undefined, function (value, state, options) { + + if (/^\w+$/.test(value)) { + return value; + } + + return this.createError('string.token', { value: value }, state, options); + }); + }; + + _class.prototype.email = function email(isEmailOptions) { + + if (isEmailOptions) { + Hoek.assert( + (typeof isEmailOptions === 'undefined' ? + 'undefined' : + _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' + ); + } + + return this._test('email', isEmailOptions, function (value, state, options) { + + Isemail = Isemail || __webpack_require__(16); + + try { + var result = Isemail.validate(value, isEmailOptions); + if (result === true || result === 0) { + return value; + } + } + catch (e) { + } + + return this.createError('string.email', { value: value }, state, options); + }); + }; + + _class.prototype.ip = function ip() { + var ipOptions = arguments.length > 0 && arguments[0] !== undefined ? + arguments[0] : + {}; + + + var regex = internals.ipRegex; + Hoek.assert((typeof ipOptions === 'undefined' ? + 'undefined' : + _typeof(ipOptions)) === 'object', 'options must be an object'); + + if (ipOptions.cidr) { + Hoek.assert(typeof ipOptions.cidr === 'string', 'cidr must be a string'); + ipOptions.cidr = ipOptions.cidr.toLowerCase(); + + Hoek.assert(Hoek.contain( + internals.cidrPresences, + ipOptions.cidr + ), 'cidr must be one of ' + internals.cidrPresences.join(', ')); + + // If we only received a `cidr` setting, create a regex for it. But we don't need to create one if `cidr` is "optional" since that is the default + if (!ipOptions.version && ipOptions.cidr !== 'optional') { + regex = Ip.createIpRegex(['ipv4', 'ipv6', 'ipvfuture'], ipOptions.cidr); + } + } else { + + // Set our default cidr strategy + ipOptions.cidr = 'optional'; + } + + var versions = void 0; + if (ipOptions.version) { + if (!Array.isArray(ipOptions.version)) { + ipOptions.version = [ipOptions.version]; + } + + Hoek.assert( + ipOptions.version.length >= 1, 'version must have at least 1 version specified'); + + versions = []; + for (var i = 0; i < ipOptions.version.length; ++i) { + var version = ipOptions.version[i]; + Hoek.assert(typeof version === 'string', 'version at position ' + i + ' must be a string'); + version = version.toLowerCase(); + Hoek.assert(Ip.versions[version], 'version at position ' + i + ' must be one of ' + Object.keys( + Ip.versions).join(', ')); + versions.push(version); + } + + // Make sure we have a set of versions + versions = Hoek.unique(versions); + + regex = Ip.createIpRegex(versions, ipOptions.cidr); + } + + return this._test('ip', ipOptions, function (value, state, options) { + + if (regex.test(value)) { + return value; + } + + if (versions) { + return this.createError( + 'string.ipVersion', + { value: value, cidr: ipOptions.cidr, version: versions }, + state, + options + ); + } + + return this.createError( + 'string.ip', + { value: value, cidr: ipOptions.cidr }, + state, + options + ); + }); + }; + + _class.prototype.uri = function uri(uriOptions) { + + var customScheme = ''; + var allowRelative = false; + var relativeOnly = false; + var regex = internals.uriRegex; + + if (uriOptions) { + Hoek.assert((typeof uriOptions === 'undefined' ? + 'undefined' : + _typeof(uriOptions)) === 'object', 'options must be an object'); + + if (uriOptions.scheme) { + Hoek.assert(uriOptions.scheme instanceof RegExp || typeof uriOptions.scheme === 'string' || Array.isArray( + uriOptions.scheme), 'scheme must be a RegExp, String, or Array'); + + if (!Array.isArray(uriOptions.scheme)) { + uriOptions.scheme = [uriOptions.scheme]; + } + + Hoek.assert( + uriOptions.scheme.length >= 1, 'scheme must have at least 1 scheme specified'); + + // Flatten the array into a string to be used to match the schemes. + for (var i = 0; i < uriOptions.scheme.length; ++i) { + var scheme = uriOptions.scheme[i]; + Hoek.assert(scheme instanceof RegExp || typeof scheme === 'string', 'scheme at position ' + i + ' must be a RegExp or String'); + + // Add OR separators if a value already exists + customScheme = customScheme + (customScheme ? '|' : ''); + + // If someone wants to match HTTP or HTTPS for example then we need to support both RegExp and String so we don't escape their pattern unknowingly. + if (scheme instanceof RegExp) { + customScheme = customScheme + scheme.source; + } else { + Hoek.assert(/[a-zA-Z][a-zA-Z0-9+-\.]*/.test(scheme), 'scheme at position ' + i + ' must be a valid scheme'); + customScheme = customScheme + Hoek.escapeRegex(scheme); + } + } + } + + if (uriOptions.allowRelative) { + allowRelative = true; + } + + if (uriOptions.relativeOnly) { + relativeOnly = true; + } + } + + if (customScheme || allowRelative || relativeOnly) { + regex = Uri.createUriRegex(customScheme, allowRelative, relativeOnly); + } + + return this._test('uri', uriOptions, function (value, state, options) { + + if (regex.test(value)) { + return value; + } + + if (relativeOnly) { + return this.createError( + 'string.uriRelativeOnly', + { value: value }, + state, + options + ); + } + + if (customScheme) { + return this.createError( + 'string.uriCustomScheme', + { scheme: customScheme, value: value }, + state, + options + ); + } + + return this.createError('string.uri', { value: value }, state, options); + }); + }; + + _class.prototype.isoDate = function isoDate() { + + return this._test('isoDate', undefined, function (value, state, options) { + + if (JoiDate._isIsoDate(value)) { + if (!options.convert) { + return value; + } + + var d = new Date(value); + if (!isNaN(d.getTime())) { + return d.toISOString(); + } + } + + return this.createError('string.isoDate', { value: value }, state, options); + }); + }; + + _class.prototype.guid = function guid(guidOptions) { + + var versionNumbers = ''; + + if (guidOptions && guidOptions.version) { + if (!Array.isArray(guidOptions.version)) { + guidOptions.version = [guidOptions.version]; + } + + Hoek.assert( + guidOptions.version.length >= 1, + 'version must have at least 1 valid version specified' + ); + var versions = new Set(); + + for (var i = 0; i < guidOptions.version.length; ++i) { + var version = guidOptions.version[i]; + Hoek.assert(typeof version === 'string', 'version at position ' + i + ' must be a string'); + version = version.toLowerCase(); + var versionNumber = internals.guidVersions[version]; + Hoek.assert(versionNumber, 'version at position ' + i + ' must be one of ' + Object.keys( + internals.guidVersions).join(', ')); + Hoek.assert(!versions.has(versionNumber), 'version at position ' + i + ' must not be a duplicate.'); + + versionNumbers += versionNumber; + versions.add(versionNumber); + } + } + + var guidRegex = new RegExp( + '^([\\[{\\(]?)[0-9A-F]{8}([:-]?)[0-9A-F]{4}\\2?[' + (versionNumbers || '0-9A-F') + '][0-9A-F]{3}\\2?[' + (versionNumbers ? + '89AB' : + '0-9A-F') + '][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$', + 'i' + ); + + return this._test('guid', guidOptions, function (value, state, options) { + + var results = guidRegex.exec(value); + + if (!results) { + return this.createError('string.guid', { value: value }, state, options); + } + + // Matching braces + if (internals.guidBrackets[results[1]] !== results[results.length - 1]) { + return this.createError('string.guid', { value: value }, state, options); + } + + return value; + }); + }; + + _class.prototype.hex = function hex() { + + var regex = /^[a-f0-9]+$/i; + + return this._test('hex', regex, function (value, state, options) { + + if (regex.test(value)) { + return value; + } + + return this.createError('string.hex', { value: value }, state, options); + }); + }; + + _class.prototype.base64 = function base64() { + var base64Options = arguments.length > 0 && arguments[0] !== undefined ? + arguments[0] : + {}; + + + // Validation. + Hoek.assert((typeof base64Options === 'undefined' ? + 'undefined' : + _typeof(base64Options)) === 'object', 'base64 options must be an object'); + Hoek.assert( + typeof base64Options.paddingRequired === 'undefined' || typeof base64Options.paddingRequired === 'boolean', + 'paddingRequired must be boolean' + ); + + // Determine if padding is required. + var paddingRequired = base64Options.paddingRequired === false ? + base64Options.paddingRequired : + base64Options.paddingRequired || true; + + // Set validation based on preference. + var regex = paddingRequired ? + // Padding is required. + /^(?:[A-Za-z0-9+\/]{4})*(?:[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}=?)?$/; + + return this._test('base64', regex, function (value, state, options) { + + if (regex.test(value)) { + return value; + } + + return this.createError('string.base64', { value: value }, state, options); + }); + }; + + _class.prototype.hostname = function hostname() { + + var regex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/; + + return this._test('hostname', undefined, function (value, state, options) { + + if (value.length <= 255 && regex.test(value) || Net.isIPv6(value)) { + + return value; + } + + return this.createError('string.hostname', { value: value }, state, options); + }); + }; + + _class.prototype.normalize = function normalize() { + var form = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'NFC'; + + + Hoek.assert(Hoek.contain( + internals.normalizationForms, + form + ), 'normalization form must be one of ' + internals.normalizationForms.join(', ')); + + var obj = this._test('normalize', form, function (value, state, options) { + + if (options.convert || value === value.normalize(form)) { + + return value; + } + + return this.createError( + 'string.normalize', + { value: value, form: form }, + state, + options + ); + }); + + obj._flags.normalize = form; + return obj; + }; + + _class.prototype.lowercase = function lowercase() { + + var obj = this._test('lowercase', undefined, function (value, state, options) { + + if (options.convert || value === value.toLocaleLowerCase()) { + + return value; + } + + return this.createError('string.lowercase', { value: value }, state, options); + }); + + obj._flags.case = 'lower'; + return obj; + }; + + _class.prototype.uppercase = function uppercase() { + + var obj = this._test('uppercase', undefined, function (value, state, options) { + + if (options.convert || value === value.toLocaleUpperCase()) { + + return value; + } + + return this.createError('string.uppercase', { value: value }, state, options); + }); + + obj._flags.case = 'upper'; + return obj; + }; + + _class.prototype.trim = function trim() { + + var obj = this._test('trim', undefined, function (value, state, options) { + + if (options.convert || value === value.trim()) { + + return value; + } + + return this.createError('string.trim', { value: value }, state, options); + }); + + obj._flags.trim = true; + return obj; + }; + + _class.prototype.replace = function replace(pattern, replacement) { + + if (typeof pattern === 'string') { + pattern = new RegExp(Hoek.escapeRegex(pattern), 'g'); + } + + Hoek.assert(pattern instanceof RegExp, 'pattern must be a RegExp'); + Hoek.assert(typeof replacement === 'string', 'replacement must be a String'); + + // This can not be considere a test like trim, we can't "reject" + // anything from this rule, so just clone the current object + var obj = this.clone(); + + if (!obj._inner.replacements) { + obj._inner.replacements = []; + } + + obj._inner.replacements.push({ + pattern: pattern, + replacement: replacement + }); + + return obj; + }; + + _class.prototype.truncate = function truncate(enabled) { + + var value = enabled === undefined ? true : !!enabled; + + if (this._flags.truncate === value) { + return this; + } + + var obj = this.clone(); + obj._flags.truncate = value; + return obj; + }; + + return _class; + }(Any); + + internals.compare = function (type, compare) { + + return function (limit, encoding) { + + var isRef = Ref.isRef(limit); + + Hoek.assert( + Number.isSafeInteger(limit) && limit >= 0 || isRef, + 'limit must be a positive integer or reference' + ); + Hoek.assert(!encoding || Buffer.isEncoding(encoding), 'Invalid encoding:', encoding); + + return this._test(type, limit, function (value, state, options) { + + var compareTo = void 0; + if (isRef) { + compareTo = limit(state.reference || state.parent, options); + + if (!Number.isSafeInteger(compareTo)) { + return this.createError('string.ref', { ref: limit.key }, state, options); + } + } else { + compareTo = limit; + } + + if (compare(value, compareTo, encoding)) { + return value; + } + + return this.createError('string.' + type, { + limit: compareTo, + value: value, + encoding: encoding + }, state, options); + }); + }; + }; + + internals.String.prototype.min = internals.compare( + 'min', + function (value, limit, encoding) { + + var length = encoding ? Buffer.byteLength(value, encoding) : value.length; + return length >= limit; + } + ); + + internals.String.prototype.max = internals.compare( + 'max', + function (value, limit, encoding) { + + var length = encoding ? Buffer.byteLength(value, encoding) : value.length; + return length <= limit; + } + ); + + internals.String.prototype.length = internals.compare( + 'length', + function (value, limit, encoding) { + + var length = encoding ? Buffer.byteLength(value, encoding) : value.length; + return length === limit; + } + ); + +// Aliases + + internals.String.prototype.uuid = internals.String.prototype.guid; + + module.exports = new internals.String(); + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(3).Buffer)) + + /***/ + }), + /* 26 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var RFC3986 = __webpack_require__(13); + +// Declare internals + + var 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 + } + } + }; + + internals.Ip.createIpRegex = function (versions, cidr) { + + var regex = void 0; + for (var i = 0; i < versions.length; ++i) { + var 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 new RegExp(regex + ')$'); + }; + + module.exports = internals.Ip; + + /***/ + }), + /* 27 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load Modules + + var RFC3986 = __webpack_require__(13); + +// Declare internals + + var internals = { + Uri: { + createUriRegex: function createUriRegex(optionalScheme, allowRelative, relativeOnly) { + + var scheme = RFC3986.scheme; + var prefix = void 0; + + 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 + ')'; + } + + var 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 + '(?:\\?' + RFC3986.query + ')?' + '(?:#' + RFC3986.fragment + ')?$'); + } + } + }; + + module.exports = internals.Uri; + + /***/ + }), + /* 28 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + +// Load modules + + var Hoek = __webpack_require__(0); + +// Declare internals + + var internals = {}; + + exports = module.exports = internals.Topo = function () { + + this._items = []; + this.nodes = []; + }; + + internals.Topo.prototype.add = function (nodes, options) { + var _this = this; + + options = options || {}; + + // Validate rules + + var before = [].concat(options.before || []); + var after = [].concat(options.after || []); + var group = options.group || '?'; + var sort = options.sort || 0; // Used for merging only + + 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'); + + [].concat(nodes).forEach(function (node, i) { + + var item = { + seq: _this._items.length, + sort: sort, + before: before, + after: after, + group: group, + node: node + }; + + _this._items.push(item); + }); + + // Insert event + + var 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) { + + others = [].concat(others); + for (var i = 0; i < others.length; ++i) { + var other = others[i]; + if (other) { + for (var j = 0; j < other._items.length; ++j) { + var item = Hoek.shallow(other._items[j]); + this._items.push(item); + } + } + } + + // Sort items + + this._items.sort(internals.mergeSort); + for (var _i = 0; _i < this._items.length; ++_i) { + this._items[_i].seq = _i; + } + + var error = this._sort(); + Hoek.assert(!error, 'merge created a dependencies error'); + + return this.nodes; + }; + + internals.mergeSort = function (a, b) { + + return a.sort === b.sort ? 0 : a.sort < b.sort ? -1 : 1; + }; + + internals.Topo.prototype._sort = function () { + + // Construct graph + + var graph = {}; + var graphAfters = Object.create(null); // A prototype can bungle lookups w/ false positives + var groups = Object.create(null); + + for (var i = 0; i < this._items.length; ++i) { + var item = this._items[i]; + var seq = item.seq; // Unique across all items + var group = item.group; + + // Determine Groups + + groups[group] = groups[group] || []; + groups[group].push(seq); + + // Build intermediary graph using 'before' + + graph[seq] = item.before; + + // Build second intermediary graph with 'after' + + var after = item.after; + for (var j = 0; j < after.length; ++j) { + graphAfters[after[j]] = (graphAfters[after[j]] || []).concat(seq); + } + } + + // Expand intermediary graph + + var graphNodes = Object.keys(graph); + for (var _i2 = 0; _i2 < graphNodes.length; ++_i2) { + var node = graphNodes[_i2]; + var expandedGroups = []; + + var graphNodeItems = Object.keys(graph[node]); + for (var _j = 0; _j < graphNodeItems.length; ++_j) { + var _group = graph[node][graphNodeItems[_j]]; + groups[_group] = groups[_group] || []; + + for (var k = 0; k < groups[_group].length; ++k) { + expandedGroups.push(groups[_group][k]); + } + } + graph[node] = expandedGroups; + } + + // Merge intermediary graph using graphAfters into final graph + + var afterNodes = Object.keys(graphAfters); + for (var _i3 = 0; _i3 < afterNodes.length; ++_i3) { + var _group2 = afterNodes[_i3]; + + if (groups[_group2]) { + for (var _j2 = 0; _j2 < groups[_group2].length; ++_j2) { + var _node = groups[_group2][_j2]; + graph[_node] = graph[_node].concat(graphAfters[_group2]); + } + } + } + + // Compile ancestors + + var children = void 0; + var ancestors = {}; + graphNodes = Object.keys(graph); + for (var _i4 = 0; _i4 < graphNodes.length; ++_i4) { + var _node2 = graphNodes[_i4]; + children = graph[_node2]; + + for (var _j3 = 0; _j3 < children.length; ++_j3) { + ancestors[children[_j3]] = (ancestors[children[_j3]] || []).concat(_node2); + } + } + + // Topo sort + + var visited = {}; + var sorted = []; + + for (var _i5 = 0; _i5 < this._items.length; ++_i5) { + // Really looping thru item.seq values out of order + var next = _i5; + + if (ancestors[_i5]) { + next = null; + for (var _j4 = 0; _j4 < this._items.length; ++_j4) { + // As above, these are item.seq values + if (visited[_j4] === true) { + continue; + } + + if (!ancestors[_j4]) { + ancestors[_j4] = []; + } + + var shouldSeeCount = ancestors[_j4].length; + var seenCount = 0; + for (var _k = 0; _k < shouldSeeCount; ++_k) { + if (visited[ancestors[_j4][_k]]) { + ++seenCount; + } + } + + if (seenCount === shouldSeeCount) { + next = _j4; + break; + } + } + } + + if (next !== null) { + visited[next] = true; + sorted.push(next); + } + } + + if (sorted.length !== this._items.length) { + return new Error('Invalid dependencies'); + } + + var seqIndex = {}; + for (var _i6 = 0; _i6 < this._items.length; ++_i6) { + var _item = this._items[_i6]; + seqIndex[_item.seq] = _item; + } + + var sortedNodes = []; + this._items = sorted.map(function (value) { + + var sortedItem = seqIndex[value]; + sortedNodes.push(sortedItem.node); + return sortedItem; + }); + + this.nodes = sortedNodes; + }; + + /***/ + }), + /* 29 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + + var Joi = __webpack_require__(8); + + module.exports = Joi; + + /***/ + }), + /* 30 */ + /***/ (function (module, exports, __webpack_require__) { + + "use strict"; + + + exports.byteLength = byteLength + exports.toByteArray = toByteArray + exports.fromByteArray = fromByteArray + + var lookup = [] + var revLookup = [] + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i + } + + revLookup['-'.charCodeAt(0)] = 62 + revLookup['_'.charCodeAt(0)] = 63 + + function placeHoldersCount(b64) { + var len = b64.length + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 + } + + function byteLength(b64) { + // base64 is 4/3 + up to two characters of the original data + return (b64.length * 3 / 4) - placeHoldersCount(b64) + } + + function toByteArray(b64) { + var i, l, tmp, placeHolders, arr + var len = b64.length + placeHolders = placeHoldersCount(b64) + + arr = new Arr((len * 3 / 4) - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? len - 4 : len + + var L = 0 + + for (i = 0; i < l; i += 4) { + tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] + arr[L++] = (tmp >> 16) & 0xFF + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + if (placeHolders === 2) { + tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[L++] = tmp & 0xFF + } else if (placeHolders === 1) { + tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + return arr + } + + function tripletToBase64(num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] + } + + function encodeChunk(uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output.push(tripletToBase64(tmp)) + } + return output.join('') + } + + function fromByteArray(uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var output = '' + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk( + uint8, + i, + (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) + )) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + output += lookup[tmp >> 2] + output += lookup[(tmp << 4) & 0x3F] + output += '==' + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) + output += lookup[tmp >> 10] + output += lookup[(tmp >> 4) & 0x3F] + output += lookup[(tmp << 2) & 0x3F] + output += '=' + } + + parts.push(output) + + return parts.join('') + } + + + /***/ + }), + /* 31 */ + /***/ (function (module, exports) { + + exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) + } + + exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) { + } + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) { + } + + buffer[offset + i - d] |= s * 128 + } + + + /***/ + }), + /* 32 */ + /***/ (function (module, exports) { + + var toString = {}.toString; + + module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; + }; + + + /***/ + }), + /* 33 */ + /***/ (function (module, exports) { + + module.exports = { + "_args": [["joi@13.0.1", "/Users/jeff/projects/joi-browser"]], + "_development": true, + "_from": "joi@13.0.1", + "_id": "joi@13.0.1", + "_inBundle": false, + "_integrity": "sha512-ChTMfmbIg5yrN9pUdeaLL8vzylMQhUteXiXa1MWINsMUs3jTQ8I87lUZwR5GdfCLJlpK04U7UgrxgmU8Zp7PhQ==", + "_location": "/joi", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "joi@13.0.1", + "name": "joi", + "escapedName": "joi", + "rawSpec": "13.0.1", + "saveSpec": null, + "fetchSpec": "13.0.1" + }, + "_requiredBy": ["#DEV:/"], + "_resolved": "https://registry.npmjs.org/joi/-/joi-13.0.1.tgz", + "_spec": "13.0.1", + "_where": "/Users/jeff/projects/joi-browser", + "bugs": { "url": "https://github.com/hapijs/joi/issues" }, + "dependencies": { "hoek": "5.x.x", "isemail": "3.x.x", "topo": "3.x.x" }, + "description": "Object schema validation", + "devDependencies": { "hapitoc": "1.x.x", "lab": "14.x.x" }, + "engines": { "node": ">=8.3.0" }, + "homepage": "https://github.com/hapijs/joi", + "keywords": ["hapi", "schema", "validation"], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "name": "joi", + "repository": { "type": "git", "url": "git://github.com/hapijs/joi.git" }, + "scripts": { + "test": "lab -t 100 -a code -L", + "test-cov-html": "lab -r html -o coverage.html -a code", + "test-debug": "lab -a code", + "toc": "hapitoc", + "version": "npm run toc && git add API.md README.md" + }, + "version": "13.0.1" + } + + /***/ + }), + /* 34 */ + /***/ (function (module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */ + (function (process) {// Copyright Joyent, Inc. and other Node contributors. +// +// 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: +// +// 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. + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) + function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; + } + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. + var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + var splitPath = function (filename) { + return splitPathRe.exec(filename).slice(1); + }; + +// path.resolve([from ...], to) +// posix version + exports.resolve = function () { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function (p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; + }; + +// path.normalize(path) +// posix version + exports.normalize = function (path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(filter(path.split('/'), function (p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; + }; + +// posix version + exports.isAbsolute = function (path) { + return path.charAt(0) === '/'; + }; + +// posix version + exports.join = function () { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function (p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); + }; + + +// path.relative(from, to) +// posix version + exports.relative = function (from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); + }; + + exports.sep = '/'; + exports.delimiter = ':'; + + exports.dirname = function (path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; + }; + + + exports.basename = function (path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; + }; + + + exports.extname = function (path) { + return splitPath(path)[3]; + }; + + function filter(xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; + } + +// String.prototype.substr - negative index don't work in IE8 + var substr = 'ab'.substr(-1) === 'b' + ? function (str, start, len) { + return str.substr(start, len) + } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + } + ; + + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(5))) + + /***/ + }), + /* 35 */ + /***/ (function (module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */ + (function (module, global) { + var __WEBPACK_AMD_DEFINE_RESULT__; + /*! https://mths.be/punycode v1.4.1 by @mathias */ + ;(function (root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw new RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function (value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? + basic + 1 : + 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.4.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + true + ) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { + return punycode; + }.call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { + // in Node.js, io.js, or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { + // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { + // in Rhino or a web browser + root.punycode = punycode; + } + + }(this)); + + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(39)(module), __webpack_require__(7))) + + /***/ + }), + /* 36 */ + /***/ (function (module, exports) { + + if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; + } else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () { + } + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } + + + /***/ + }), + /* 37 */ + /***/ (function (module, exports) { + + module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; + } + + /***/ + }), + /* 38 */ + /***/ (function (module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */ + (function (global, process) {// Copyright Joyent, Inc. and other Node contributors. +// +// 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: +// +// 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. + + var formatRegExp = /%[sdj%]/g; + exports.format = function (f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function (x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': + return String(args[i++]); + case '%d': + return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } + catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; + }; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. + exports.deprecate = function (fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function () { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; + }; + + + var debugs = {}; + var debugEnviron; + exports.debuglog = function (set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function () { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function () { + }; + } + } + return debugs[set]; + }; + + + /** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ + + /* legacy: obj, showHidden, depth, colors*/ + function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); + } + + exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics + inspect.colors = { + 'bold': [1, 22], + 'italic': [3, 23], + 'underline': [4, 24], + 'inverse': [7, 27], + 'white': [37, 39], + 'grey': [90, 39], + 'black': [30, 39], + 'blue': [34, 39], + 'cyan': [36, 39], + 'green': [32, 39], + 'magenta': [35, 39], + 'red': [31, 39], + 'yellow': [33, 39] + }; + +// Don't use 'blue' not visible on cmd.exe + inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' + }; + + + function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } + } + + + function stylizeNoColor(str, styleType) { + return str; + } + + + function arrayToHash(array) { + var hash = {}; + + array.forEach(function (val, idx) { + hash[val] = true; + }); + + return hash; + } + + + function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function (key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); + } + + + function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); + } + + + function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; + } + + + function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true + )); + } else { + output.push(''); + } + } + keys.forEach(function (key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true + )); + } + }); + return output; + } + + + function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; + } + + + function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function (prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; + } + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { + return Array.isArray(ar); + } + + exports.isArray = isArray; + + function isBoolean(arg) { + return typeof arg === 'boolean'; + } + + exports.isBoolean = isBoolean; + + function isNull(arg) { + return arg === null; + } + + exports.isNull = isNull; + + function isNullOrUndefined(arg) { + return arg == null; + } + + exports.isNullOrUndefined = isNullOrUndefined; + + function isNumber(arg) { + return typeof arg === 'number'; + } + + exports.isNumber = isNumber; + + function isString(arg) { + return typeof arg === 'string'; + } + + exports.isString = isString; + + function isSymbol(arg) { + return typeof arg === 'symbol'; + } + + exports.isSymbol = isSymbol; + + function isUndefined(arg) { + return arg === void 0; + } + + exports.isUndefined = isUndefined; + + function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; + } + + exports.isRegExp = isRegExp; + + function isObject(arg) { + return typeof arg === 'object' && arg !== null; + } + + exports.isObject = isObject; + + function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; + } + + exports.isDate = isDate; + + function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); + } + + exports.isError = isError; + + function isFunction(arg) { + return typeof arg === 'function'; + } + + exports.isFunction = isFunction; + + function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; + } + + exports.isPrimitive = isPrimitive; + + exports.isBuffer = __webpack_require__(37); + + function objectToString(o) { + return Object.prototype.toString.call(o); + } + + + function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); + } + + + var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 + function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); + } + + +// log is just a thin wrapper to console.log that prepends a timestamp + exports.log = function () { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); + }; + + + /** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ + exports.inherits = __webpack_require__(36); + + exports._extend = function (origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; + }; + + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(7), __webpack_require__(5))) + + /***/ + }), + /* 39 */ + /***/ (function (module, exports) { + + module.exports = function (module) { + if (!module.webpackPolyfill) { + module.deprecate = function () { + }; + module.paths = []; + // module.parent = undefined by default + if (!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function () { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function () { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; + }; + + + /***/ + }) + /******/]); + }); +} diff --git a/test/helpers.ts b/test/helpers.ts new file mode 100755 index 0000000..c0053e1 --- /dev/null +++ b/test/helpers.ts @@ -0,0 +1,5 @@ +export function createHTML(content) { + const div = document.createElement('div'); + div.innerHTML = content; + return div.firstElementChild; +} diff --git a/test/lib/extract-data.spec.ts b/test/lib/extract-data.spec.ts new file mode 100755 index 0000000..d34b5e0 --- /dev/null +++ b/test/lib/extract-data.spec.ts @@ -0,0 +1,169 @@ +import { extractData } from '../../src/lib/extract-data'; +import { createHTML } from '../helpers'; + +const expect = require('chai').expect; + +describe('extractDataFromElement', () => { + it('should extract text', () => { + const html = createHTML(`
+

title

+
`); + const expected = 'title'; + const actual = extractData(html, 'h2'); + expect(actual).to.equal(expected); + }); + it('should extract text as object config', () => { + const html = createHTML(`
+

title

+
`); + const expected = 'title'; + const actual = extractData(html, { query: 'h2' }); + expect(actual).to.equal(expected); + }); + + it('should extract text when html', () => { + const html = createHTML(`
+

title

+
`); + const expected = 'title'; + const actual = extractData(html, 'h2'); + expect(actual).to.equal(expected); + }); + it('should extract text when html as object config', () => { + const html = createHTML(`
+

title

+
`); + const expected = 'title'; + const actual = extractData(html, { query: 'h2' }); + expect(actual).to.equal(expected); + }); + + it('should extract html', () => { + const html = createHTML(`
+

description bold

+
`); + const expected = 'description bold'; + const actual = extractData(html, 'p', { html: true }); + expect(actual).to.equal(expected); + }); + + it('should extract html as object config', () => { + const html = createHTML(`
+

description bold

+
`); + const expected = 'description bold'; + const actual = extractData(html, { query: 'p', html: true }); + expect(actual).to.equal(expected); + }); + + it('should extract attribute', () => { + const html = createHTML(`
+ +
`); + const expected = 'foo.jpg'; + const actual = extractData(html, 'img', { attr: 'src' }); + expect(actual).to.equal(expected); + }); + + it('should extract a list', () => { + const html = createHTML(`
+
    +
  • a
  • +
  • b
  • +
  • c
  • +
+
`); + const expected = ['a', 'b', 'c']; + const actual = extractData(html, '.tags > .tag', { list: true }); + expect(actual).to.deep.equal(expected); + }); + + it('should extract a list and fetch attributes', () => { + const html = createHTML(`
+
    +
  • a
  • +
  • b
  • +
  • c
  • +
+
`); + const expected = ['1', '2', '3']; + const actual = extractData(html, '.tags > .tag', { list: true, attr: 'data-id' }); + expect(actual).to.deep.equal(expected); + }); + + it('should extract a list and fetch attributes and text as object', () => { + const html = createHTML(`
+
    +
  • a
  • +
  • b
  • +
  • c
  • +
+
`); + const expected = [ + { id: '1', text: 'a' }, + { id: '2', text: 'b' }, + { id: '3', text: 'c' }, + ]; + const actual = extractData(html, '.tags > .tag', { + list: true, + data: { id: 'data-id', text: true }, + }); + expect(actual).to.deep.equal(expected); + }); + + it('should extract a list and convert the fetched attributes to numbers', () => { + const html = createHTML(`
+
    +
  • a
  • +
  • b
  • +
  • c
  • +
+
`); + const expected = [1, 2, 3]; + const actual = extractData( + html, + '.tags > .tag', + { list: true, attr: 'data-id', convert: 'number' } + ); + expect(actual).to.deep.equal(expected); + }); + + it('should extract a list and fetch attributes and text as object, and convert to number', () => { + const html = createHTML(`
+
    +
  • a
  • +
  • b
  • +
  • c
  • +
+
`); + const expected = [ + { id: 1, text: 'a' }, + { id: 2, text: 'b' }, + { id: 3, text: 'c' }, + ]; + const actual = extractData(html, '.tags > .tag', { + list: true, + data: { + id: { attr: 'data-id', convert: 'number' }, + text: true + }, + }); + expect(actual).to.deep.equal(expected); + }); + + it('should throw in missing first parameter', () => { + const actual = () => { + // @ts-ignore: intentional + extractData(); + }; + expect(actual).to.throw('Missing first parameter \'parent\''); + }); + + it('should throw in missing second parameter', () => { + const actual = () => { + // @ts-ignore: intentional + extractData(document.createElement('div')); + }; + expect(actual).to.throw('Missing second parameter \'config\''); + }); +}); diff --git a/test/lib/extract-from-element.spec.ts b/test/lib/extract-from-element.spec.ts new file mode 100755 index 0000000..64550ff --- /dev/null +++ b/test/lib/extract-from-element.spec.ts @@ -0,0 +1,89 @@ +import { extractFromElement } from '../../src/lib/extract-from-element'; +import { createHTML } from '../helpers'; + +const expect = require('chai').expect; + +describe('extractFromElement', () => { + it('should extract text', () => { + const html = createHTML(`

title

`); + const expected = 'title'; + const actual = extractFromElement(html, {}); + expect(actual).to.equal(expected); + }); + it('should extract text when html', () => { + const html = createHTML(`

title

`); + const expected = 'title'; + const actual = extractFromElement(html, {}); + expect(actual).to.equal(expected); + }); + + it('should extract html', () => { + const html = createHTML(`

description bold

`); + const expected = 'description bold'; + const actual = extractFromElement(html, { html: true }); + expect(actual).to.equal(expected); + }); + + it('should extract attribute', () => { + const html = createHTML(``); + const expected = 'foo.jpg'; + const actual = extractFromElement(html, { attr: 'src' }); + expect(actual).to.equal(expected); + }); + + + it('should extract multiple properties from the same element', () => { + const html = createHTML(`google`); + const expected = { + href: 'http://www.google.com', + target: '_blank', + text: 'google', + }; + const actual = extractFromElement(html, { + data: { + href: 'href', + target: 'target', + text: true, + }, + }); + expect(actual).to.deep.equal(expected); + }); + + + it('should convert the extracted value with user func', () => { + const html = createHTML(`
  • 123
  • `); + const expected = 123; + const actual = extractFromElement(html, { convert: v => parseInt(v, 10) }); + expect(actual).to.equal(expected); + }); + it('should convert the extracted value to number', () => { + const html = createHTML(`
  • 123
  • `); + const expected = 123; + const actual = extractFromElement(html, { convert: 'number' }); + expect(actual).to.equal(expected); + }); + it('should convert the extracted value to float', () => { + const html = createHTML(`
  • 123
  • `); + const expected = 123; + const actual = extractFromElement(html, { convert: 'float' }); + expect(actual).to.equal(expected); + }); + it('should convert the extracted value to boolean', () => { + const html = createHTML(`
  • true
  • `); + const expected = true; + const actual = extractFromElement(html, { convert: 'boolean' }); + expect(actual).to.equal(expected); + }); + it('should convert the extracted value to date', () => { + const html = createHTML(`
  • 2017-02-04
  • `); + const expected = new Date(Date.UTC(2017, 1, 4)).getTime(); + const actual = extractFromElement(html, { convert: 'date' }).getTime(); + expect(actual).to.equal(expected); + }); + + it('should return null when no element match', () => { + const expected = null; + const actual = extractFromElement(null, {}); + expect(actual).to.equal(expected); + }); +}); diff --git a/test/lib/extract-from-html.spec.ts b/test/lib/extract-from-html.spec.ts new file mode 100755 index 0000000..63356f1 --- /dev/null +++ b/test/lib/extract-from-html.spec.ts @@ -0,0 +1,302 @@ +import { extractFromHTML } from '../../src/lib/extract-from-html'; +import { createHTML } from '../helpers'; + +const expect = require('chai').expect; + +describe('extractFromHTML', () => { + it('should extract an object', () => { + const html = createHTML(` +
    +
    +

    title

    +

    description bold

    + foobar +
      +
    • a
    • +
    • b
    • +
    • c
    • +
    + google +
    +
    +

    title

    +

    description bold

    + foobar +
      +
    • a
    • +
    • b
    • +
    • c
    • +
    + google +
    +
    + `); + + const expected = { + title: 'title', + description: 'description bold', + tags: ['a', 'b', 'c'], + image: { + src: 'foo.jpg', + alt: 'foobar', + }, + image2: { + src: "foo.jpg", + alt: "foobar", + }, + link: { + href: 'http://www.google.com', + text: 'google', + target: '_blank', + }, + }; + + const actual = extractFromHTML( + html, + { + query: '.grid-item', + data: { + title: 'h2', + description: { query: 'p', html: true }, + tags: { query: '.tags > .tag', list: true }, + image: (extract) => ({ + src: extract('.js-image', { attr: 'src' }), + alt: extract('.js-image', { attr: 'alt' }), + }), + image2: (extract) => + extract('.js-image', { + data: { src: 'src', alt: 'alt' } + }), + link: { + query: 'a', + data: { + href: 'href', + target: 'target', + text: true, + }, + }, + }, + }, + ); + + expect(actual).to.deep.equal(expected); + }); + + it('should extract an array', () => { + const html = createHTML(` +
    +
    +

    title

    +

    description bold

    + foobar +
      +
    • a
    • +
    • b
    • +
    • c
    • +
    + google +
    +
    +

    title

    +

    description bold

    + foobar +
      +
    • a
    • +
    • b
    • +
    • c
    • +
    + google +
    +
    + `); + + const expected = [ + { + title: 'title', + description: 'description bold', + tags: ['a', 'b', 'c'], + image: { + src: 'foo.jpg', + alt: 'foobar', + }, + }, + { + title: 'title', + description: 'description bold', + tags: ['a', 'b', 'c'], + image: { + src: 'foo.jpg', + alt: 'foobar', + }, + }, + ]; + const actual = extractFromHTML( + html, + { + query: '.grid-item', + list: true, + data: { + title: 'h2', + description: { query: 'p', html: true }, + tags: { query: '.tags > .tag', list: true }, + image: (extract) => ({ + src: extract('.js-image', { attr: 'src' }), + alt: extract('.js-image', { attr: 'alt' }), + }), + }, + }, + ); + + expect(actual).to.deep.equal(expected); + }); + + + it('should merge in initial data', () => { + const html = createHTML(` +
    +
    +

    title

    +

    description bold

    +
      +
    • a
    • +
    • b
    • +
    • c
    • +
    + google +
    +
    + `); + + const expected = { + title: 'title', + description: 'description bold', + tags: ['default', 'a', 'b', 'c'], + link: { + href: 'http://www.google.com', + text: 'google', + target: '_blank', + tested: false, + }, + visible: true, + }; + + const actual = extractFromHTML( + html, + { + query: '.grid-item', + data: { + title: 'h2', + description: { query: 'p', html: true }, + tags: { query: '.tags > .tag', list: true }, + link: { + query: 'a', + data: { + href: 'href', + target: 'target', + text: true, + }, + }, + }, + }, + { + visible: true, + tags: ['default'], + link: { + tested: false, + } + }, + ); + + expect(actual).to.deep.equal(expected); + }); + + it('should extract from own element', () => { + const html = createHTML(` +
    +
    +

    title 1

    +
    +
    +

    title 2

    +
    +
    +

    title 3

    +
    +
    + `); + + const expected = [ + { + id: 1, + title: 'title 1', + }, + { + id: 2, + title: 'title 2', + }, + { + id: 3, + title: 'title 3', + }, + ]; + + const actual = extractFromHTML( + html, + { + list: true, + query: '.grid-item', + data: { + title: 'h2', + }, + self: { + id: { attr: 'data-id', convert: 'number'} + }, + }, + ); + + expect(actual).to.deep.equal(expected); + }); + + it('should extract from own element when passed directly', () => { + const html = createHTML(` +
    +

    title 1

    +
    + `); + + const expected = { + id: 1, + title: 'title 1', + }; + + const actual = extractFromHTML( + html, + { + data: { + title: 'h2', + }, + self: { + id: { attr: 'data-id', convert: 'number'} + }, + }, + ); + + expect(actual).to.deep.equal(expected); + }); + + it('should throw in missing first parameter', () => { + const actual = () => { + // @ts-ignore: intentional + extractFromHTML(); + }; + expect(actual).to.throw('Missing first parameter \'container\''); + }); + + it('should throw in missing second parameter', () => { + const actual = () => { + // @ts-ignore: intentional + extractFromHTML(document.createElement('div')); + }; + expect(actual).to.throw('Missing second parameter \'config\''); + }); +}); diff --git a/test/lib/validation.spec.ts b/test/lib/validation.spec.ts new file mode 100755 index 0000000..0300cb3 --- /dev/null +++ b/test/lib/validation.spec.ts @@ -0,0 +1,52 @@ +import { extractFromHTML } from '../../src/lib/extract-from-html'; +import { createHTML } from '../helpers'; + +const expect = require('chai').expect; + +function getHTML() { + return createHTML(` +
    +
    +
    +
    + `); +} + +describe('validation', () => { + it('should throw on unknown property', () => { + const actual = () => extractFromHTML( + getHTML(), + { + query: 'sdf', + data: { + title: 'h2', + }, + foobar: true, + }, + ); + expect(actual).to.throw('"foobar" is not allowed'); + }); + + it('should throw on missing query when paired with list', () => { + const actual = () => extractFromHTML( + getHTML(), + { + list: true, + data: { + title: 'h2', + }, + }, + ); + expect(actual).to.throw('"list" missing required peer "query"'); + }); + + it('should throw on missing data', () => { + const actual = () => extractFromHTML( + getHTML(), + { + query: '.grid-item', + }, + ); + expect(actual).to.throw('child "data" fails because ["data" is required]'); + }); +}); diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100755 index 0000000..31fcc80 --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1,2 @@ +--require ./test/setup.js +--require jsdom-global/register diff --git a/test/setup.js b/test/setup.js new file mode 100755 index 0000000..fe7cfa5 --- /dev/null +++ b/test/setup.js @@ -0,0 +1,5 @@ +require("@babel/register")({ + // Setting this will remove the currently hooked extensions of .es6, `.es`, `.jsx` + // and .js so you'll have to add them back if you want them to be used again. + extensions: [".es6", ".es", ".jsx", ".js", ".ts"], +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100755 index 0000000..2ebce4e --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "allowJs": false, + "allowSyntheticDefaultImports": true, + "baseUrl": "./src/", + "rootDir": "./src/", + "jsx": "react", + "module": "es2015", + "noEmit": false, + "noUnusedLocals": true, + "noUnusedParameters": true, + "pretty": true, + "skipLibCheck": true, + "sourceMap": true, + "lib": [ + "DOM", + "DOM.Iterable", + "ES2017" + ] + }, + "include": [ + "./src/**/*", + "./types/**/*.d.ts" + ] +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..33a846d --- /dev/null +++ b/tslint.json @@ -0,0 +1,21 @@ +{ + "extends": [ + "tslint-config-airbnb", + "tslint-config-prettier" + ], + "defaultSeverity": "error", + "rules": { + "prefer-array-literal": [true, { "allow-type-parameters": true }], + "variable-name": [ + true, + "ban-keywords", + "check-format", + "allow-pascal-case", + "allow-leading-underscore" + ], + "max-line-length": [true, 100], + "no-increment-decrement": false, + "strict-boolean-expressions": false, + "import-name": [false, {}] + } +} diff --git a/types/types.d.ts b/types/types.d.ts new file mode 100644 index 0000000..4373a98 --- /dev/null +++ b/types/types.d.ts @@ -0,0 +1,38 @@ +declare module 'detect-node'; + +/** + * Re-export types that we use from joi to joi-browser. + */ +declare module 'joi-browser' { + import { BooleanSchema, FunctionSchema, ObjectSchema, StringSchema } from 'joi'; + + export function string(): StringSchema; + + export function object(): ObjectSchema; + + export function bool(): BooleanSchema; + + export function func(): FunctionSchema; + + /** + * Validates a value using the given schema and options. + */ + export function validate(value: T, schema: SchemaLike): ValidationResult; + export function validate( + value: T, + schema: SchemaLike, + callback: (err: ValidationError, value: T) => R, + ): R; + + export function validate( + value: T, + schema: SchemaLike, + options: ValidationOptions, + ): ValidationResult; + export function validate( + value: T, + schema: SchemaLike, + options: ValidationOptions, + callback: (err: ValidationError, value: T) => R, + ): R; +} diff --git a/yarn.lock b/yarn.lock new file mode 100755 index 0000000..5aefa98 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4239 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/cli@^7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.0.0-beta.35.tgz#9e180810080f29daa917747e2f08fe1b903a7e46" + dependencies: + commander "^2.8.1" + convert-source-map "^1.1.0" + fs-readdir-recursive "^1.0.0" + glob "^7.0.0" + lodash "^4.2.0" + output-file-sync "^2.0.0" + slash "^1.0.0" + source-map "^0.5.0" + optionalDependencies: + chokidar "^1.6.1" + +"@babel/code-frame@7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.31.tgz#473d021ecc573a2cce1c07d5b509d5215f46ba35" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@babel/code-frame@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.35.tgz#04eeb6dca7efef8f65776a4c214157303b85ad51" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@babel/core@^7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.0.0-beta.35.tgz#69dc61d317c73177b91fdc4432619f997155b60f" + dependencies: + "@babel/code-frame" "7.0.0-beta.35" + "@babel/generator" "7.0.0-beta.35" + "@babel/helpers" "7.0.0-beta.35" + "@babel/template" "7.0.0-beta.35" + "@babel/traverse" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + babylon "7.0.0-beta.35" + convert-source-map "^1.1.0" + debug "^3.0.1" + json5 "^0.5.0" + lodash "^4.2.0" + micromatch "^2.3.11" + resolve "^1.3.2" + source-map "^0.5.0" + +"@babel/generator@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.35.tgz#09798d7e714ef8a3cd6ac27afb140e21c2794cef" + dependencies: + "@babel/types" "7.0.0-beta.35" + jsesc "^2.5.1" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-annotate-as-pure@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0-beta.35.tgz#d391e76ccb1a6b417007a2b774c688539e115fdb" + dependencies: + "@babel/types" "7.0.0-beta.35" + +"@babel/helper-builder-binary-assignment-operator-visitor@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.0.0-beta.35.tgz#cc63f36ec86a7fa5bae5ec2a255c459414b4263c" + dependencies: + "@babel/helper-explode-assignable-expression" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + +"@babel/helper-call-delegate@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.0.0-beta.35.tgz#4322fd23212ff2d1855792a69cb765ee711fffb6" + dependencies: + "@babel/helper-hoist-variables" "7.0.0-beta.35" + "@babel/traverse" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + +"@babel/helper-define-map@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.0.0-beta.35.tgz#38dea093c57565dc50ac96ead46e355e12985ced" + dependencies: + "@babel/helper-function-name" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + lodash "^4.2.0" + +"@babel/helper-explode-assignable-expression@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.0.0-beta.35.tgz#f88536e506bf1df2d6ec4b975df8324aa37b4b08" + dependencies: + "@babel/traverse" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + +"@babel/helper-function-name@7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.31.tgz#afe63ad799209989348b1109b44feb66aa245f57" + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.31" + "@babel/template" "7.0.0-beta.31" + "@babel/traverse" "7.0.0-beta.31" + "@babel/types" "7.0.0-beta.31" + +"@babel/helper-function-name@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.35.tgz#b2fc51a59fe95fcc56ee5e9db21c500606ea2fab" + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.35" + "@babel/template" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + +"@babel/helper-get-function-arity@7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.31.tgz#1176d79252741218e0aec872ada07efb2b37a493" + dependencies: + "@babel/types" "7.0.0-beta.31" + +"@babel/helper-get-function-arity@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.35.tgz#7f3c86d6646527a03423d42cf0fd06a26718d7cb" + dependencies: + "@babel/types" "7.0.0-beta.35" + +"@babel/helper-hoist-variables@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0-beta.35.tgz#b4fcbafe5c18bc90c6cdad8969ba0dc6bb64e664" + dependencies: + "@babel/types" "7.0.0-beta.35" + +"@babel/helper-module-imports@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.35.tgz#308e350e731752cdb4d0f058df1d704925c64e0a" + dependencies: + "@babel/types" "7.0.0-beta.35" + lodash "^4.2.0" + +"@babel/helper-module-transforms@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.0.0-beta.35.tgz#2219dfb9e470704235bbb3477ac63a946a2b3812" + dependencies: + "@babel/helper-module-imports" "7.0.0-beta.35" + "@babel/helper-simple-access" "7.0.0-beta.35" + "@babel/template" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + lodash "^4.2.0" + +"@babel/helper-optimise-call-expression@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0-beta.35.tgz#3adc8c5347b4a8d4ef8b117d99535f6fa3b61a71" + dependencies: + "@babel/types" "7.0.0-beta.35" + +"@babel/helper-regex@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.0.0-beta.35.tgz#b3f33c8151cb7c1e3de9cc7a5402a5de57e74902" + dependencies: + lodash "^4.2.0" + +"@babel/helper-remap-async-to-generator@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.0.0-beta.35.tgz#272aecf58ae20cd6d4582766fe106c6d77104e1c" + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.35" + "@babel/helper-wrap-function" "7.0.0-beta.35" + "@babel/template" "7.0.0-beta.35" + "@babel/traverse" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + +"@babel/helper-replace-supers@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.0.0-beta.35.tgz#fb59070aba45002d09898c8dfb8f8ac05bde4d19" + dependencies: + "@babel/helper-optimise-call-expression" "7.0.0-beta.35" + "@babel/template" "7.0.0-beta.35" + "@babel/traverse" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + +"@babel/helper-simple-access@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.0.0-beta.35.tgz#1e7221daa67261f541d9125a4f7a1fc7badf884e" + dependencies: + "@babel/template" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + lodash "^4.2.0" + +"@babel/helper-wrap-function@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.0.0-beta.35.tgz#2fb82e91842e0bbdc67fc60babf156b6fa781239" + dependencies: + "@babel/helper-function-name" "7.0.0-beta.35" + "@babel/template" "7.0.0-beta.35" + "@babel/traverse" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + +"@babel/helpers@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.0.0-beta.35.tgz#8cde270b68c227dca8cb35cd30c6eb3e5a280c09" + dependencies: + "@babel/template" "7.0.0-beta.35" + "@babel/traverse" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + +"@babel/plugin-check-constants@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-check-constants/-/plugin-check-constants-7.0.0-beta.35.tgz#18cca7d9fbba746171c879ced7c69defbdc8bc11" + +"@babel/plugin-proposal-async-generator-functions@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.0.0-beta.35.tgz#7f55a538b0f347e13504c9301807a16b8b5b5cc9" + dependencies: + "@babel/helper-remap-async-to-generator" "7.0.0-beta.35" + "@babel/plugin-syntax-async-generators" "7.0.0-beta.35" + +"@babel/plugin-proposal-class-properties@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.0.0-beta.35.tgz#f1c468110959115c7bfd0ba065148048542d06ce" + dependencies: + "@babel/helper-function-name" "7.0.0-beta.35" + "@babel/plugin-syntax-class-properties" "7.0.0-beta.35" + +"@babel/plugin-proposal-object-rest-spread@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0-beta.35.tgz#e5b4e4521bb847cd4931720b5f4472835b5e3c68" + dependencies: + "@babel/plugin-syntax-object-rest-spread" "7.0.0-beta.35" + +"@babel/plugin-proposal-optional-catch-binding@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0-beta.35.tgz#44d6e492243e442ab1a686c96ed851b55a459223" + dependencies: + "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.35" + +"@babel/plugin-proposal-unicode-property-regex@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0-beta.35.tgz#687d134d5e3638f1ded6d334455d576368d73ee1" + dependencies: + "@babel/helper-regex" "7.0.0-beta.35" + regexpu-core "^4.1.3" + +"@babel/plugin-syntax-async-generators@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0-beta.35.tgz#ff672774420f1fa1cedc407ba0c33e8503339198" + +"@babel/plugin-syntax-class-properties@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.0.0-beta.35.tgz#adefdbb84dfcfc8674d0819216363d983ee494ee" + +"@babel/plugin-syntax-dynamic-import@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.0.0-beta.35.tgz#b27bb4225bb1f71c2f876ec6563b364f2a67a870" + +"@babel/plugin-syntax-object-rest-spread@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0-beta.35.tgz#da521551c5439fdd32025bd26299d99fd704df95" + +"@babel/plugin-syntax-optional-catch-binding@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0-beta.35.tgz#a2451f5dd30f858d31ec55ce12602f43d2cf5cdc" + +"@babel/plugin-syntax-typescript@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.0.0-beta.35.tgz#f47c5dea85d3bfa992de9e3070b6b19be9c42a0e" + +"@babel/plugin-transform-arrow-functions@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0-beta.35.tgz#c9764114c629bf1ef0037339b1b05267a5e4aab1" + +"@babel/plugin-transform-async-to-generator@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.0.0-beta.35.tgz#fd83aa60c374f91f549f1ecea39a766702cb15f0" + dependencies: + "@babel/helper-module-imports" "7.0.0-beta.35" + "@babel/helper-remap-async-to-generator" "7.0.0-beta.35" + +"@babel/plugin-transform-block-scoped-functions@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0-beta.35.tgz#7bf54e90261fdf33b152b3a249ecf2ec6b649338" + +"@babel/plugin-transform-block-scoping@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.0.0-beta.35.tgz#065a1bfebe60be2c1c433edfad20591df4ef76f5" + dependencies: + lodash "^4.2.0" + +"@babel/plugin-transform-classes@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.0.0-beta.35.tgz#ae1367d9c41081528f87d5770f6b8c6ee7141b52" + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.35" + "@babel/helper-define-map" "7.0.0-beta.35" + "@babel/helper-function-name" "7.0.0-beta.35" + "@babel/helper-optimise-call-expression" "7.0.0-beta.35" + "@babel/helper-replace-supers" "7.0.0-beta.35" + +"@babel/plugin-transform-computed-properties@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0-beta.35.tgz#2e42ac7d57935c725471e19a1a6127072f3bc2da" + +"@babel/plugin-transform-destructuring@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.0.0-beta.35.tgz#b08d63ca71b54805735681175f0451c7587855b5" + +"@babel/plugin-transform-duplicate-keys@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0-beta.35.tgz#c0409a2d2d8a4718b0abea3a8fd136fdf3b4ff3e" + +"@babel/plugin-transform-exponentiation-operator@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.0.0-beta.35.tgz#a5470fad798a7052596e19fefbb6f391b17ac6e8" + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "7.0.0-beta.35" + +"@babel/plugin-transform-for-of@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0-beta.35.tgz#50774c6c1cf68a38493ee76d34acb7b55470e05f" + +"@babel/plugin-transform-function-name@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.0.0-beta.35.tgz#efad92ef7c63bc34b4f3379f319bcafdccce7b7f" + dependencies: + "@babel/helper-function-name" "7.0.0-beta.35" + +"@babel/plugin-transform-literals@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0-beta.35.tgz#c0634fc137702afd7ae77829a41be45c4fa530ca" + +"@babel/plugin-transform-modules-amd@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.0.0-beta.35.tgz#3d26e48a481938983b9f067daf9b3458717419b7" + dependencies: + "@babel/helper-module-transforms" "7.0.0-beta.35" + +"@babel/plugin-transform-modules-commonjs@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.0.0-beta.35.tgz#b5b85b47d4cef093ce974a55d5012532f0a2b182" + dependencies: + "@babel/helper-module-transforms" "7.0.0-beta.35" + "@babel/helper-simple-access" "7.0.0-beta.35" + +"@babel/plugin-transform-modules-systemjs@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.0.0-beta.35.tgz#ef9704902423054fa6326f9d0596aa3a46e5be80" + dependencies: + "@babel/helper-hoist-variables" "7.0.0-beta.35" + +"@babel/plugin-transform-modules-umd@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.0.0-beta.35.tgz#ca3fbd3f00752310a75c9a97f21f37c1df00c902" + dependencies: + "@babel/helper-module-transforms" "7.0.0-beta.35" + +"@babel/plugin-transform-new-target@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0-beta.35.tgz#457fd711ff6d554c9cd6fc9d5e139e0375739d17" + +"@babel/plugin-transform-object-super@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.0.0-beta.35.tgz#768dd11a3d336a96b42fde9f2c4437c19ab548b4" + dependencies: + "@babel/helper-replace-supers" "7.0.0-beta.35" + +"@babel/plugin-transform-parameters@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.0.0-beta.35.tgz#6c44edc8218df6afc635d65593bf391a0482993c" + dependencies: + "@babel/helper-call-delegate" "7.0.0-beta.35" + "@babel/helper-get-function-arity" "7.0.0-beta.35" + +"@babel/plugin-transform-regenerator@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0-beta.35.tgz#91d87172445d0238dde257e01de74c63fa92c818" + dependencies: + regenerator-transform "^0.12.2" + +"@babel/plugin-transform-shorthand-properties@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0-beta.35.tgz#20077ee7a82d5845d4ecf03e2d11aa13f6b6a4d4" + +"@babel/plugin-transform-spread@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0-beta.35.tgz#aa5c0fa12c01d23b8f02d367e66b49715d4b77a4" + +"@babel/plugin-transform-sticky-regex@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0-beta.35.tgz#ee70fed27bf78e407d2338519db09176cca73597" + dependencies: + "@babel/helper-regex" "7.0.0-beta.35" + +"@babel/plugin-transform-template-literals@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0-beta.35.tgz#fc27efe898e3716066d65742afae7d811eed8667" + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.35" + +"@babel/plugin-transform-typeof-symbol@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0-beta.35.tgz#ab8a83cf44fa63556471622ae886a14187e118c2" + +"@babel/plugin-transform-typescript@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.0.0-beta.35.tgz#0602f98d4e0cb291296e1b91e826ab123094e9bf" + dependencies: + "@babel/plugin-syntax-typescript" "7.0.0-beta.35" + +"@babel/plugin-transform-unicode-regex@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0-beta.35.tgz#0cb1148921dbabfb819221754b9a54d5cf8fb443" + dependencies: + "@babel/helper-regex" "7.0.0-beta.35" + regexpu-core "^4.1.3" + +"@babel/preset-env@^7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.0.0-beta.35.tgz#634431813b14ebe841f293fbf459a3ffa61d7ef6" + dependencies: + "@babel/plugin-check-constants" "7.0.0-beta.35" + "@babel/plugin-proposal-async-generator-functions" "7.0.0-beta.35" + "@babel/plugin-proposal-object-rest-spread" "7.0.0-beta.35" + "@babel/plugin-proposal-optional-catch-binding" "7.0.0-beta.35" + "@babel/plugin-proposal-unicode-property-regex" "7.0.0-beta.35" + "@babel/plugin-syntax-async-generators" "7.0.0-beta.35" + "@babel/plugin-syntax-object-rest-spread" "7.0.0-beta.35" + "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.35" + "@babel/plugin-transform-arrow-functions" "7.0.0-beta.35" + "@babel/plugin-transform-async-to-generator" "7.0.0-beta.35" + "@babel/plugin-transform-block-scoped-functions" "7.0.0-beta.35" + "@babel/plugin-transform-block-scoping" "7.0.0-beta.35" + "@babel/plugin-transform-classes" "7.0.0-beta.35" + "@babel/plugin-transform-computed-properties" "7.0.0-beta.35" + "@babel/plugin-transform-destructuring" "7.0.0-beta.35" + "@babel/plugin-transform-duplicate-keys" "7.0.0-beta.35" + "@babel/plugin-transform-exponentiation-operator" "7.0.0-beta.35" + "@babel/plugin-transform-for-of" "7.0.0-beta.35" + "@babel/plugin-transform-function-name" "7.0.0-beta.35" + "@babel/plugin-transform-literals" "7.0.0-beta.35" + "@babel/plugin-transform-modules-amd" "7.0.0-beta.35" + "@babel/plugin-transform-modules-commonjs" "7.0.0-beta.35" + "@babel/plugin-transform-modules-systemjs" "7.0.0-beta.35" + "@babel/plugin-transform-modules-umd" "7.0.0-beta.35" + "@babel/plugin-transform-new-target" "7.0.0-beta.35" + "@babel/plugin-transform-object-super" "7.0.0-beta.35" + "@babel/plugin-transform-parameters" "7.0.0-beta.35" + "@babel/plugin-transform-regenerator" "7.0.0-beta.35" + "@babel/plugin-transform-shorthand-properties" "7.0.0-beta.35" + "@babel/plugin-transform-spread" "7.0.0-beta.35" + "@babel/plugin-transform-sticky-regex" "7.0.0-beta.35" + "@babel/plugin-transform-template-literals" "7.0.0-beta.35" + "@babel/plugin-transform-typeof-symbol" "7.0.0-beta.35" + "@babel/plugin-transform-unicode-regex" "7.0.0-beta.35" + browserslist "^2.4.0" + invariant "^2.2.2" + semver "^5.3.0" + +"@babel/preset-stage-3@^7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/preset-stage-3/-/preset-stage-3-7.0.0-beta.35.tgz#b051c79023710aa1934643cc77aeb961a66b7ccd" + dependencies: + "@babel/plugin-proposal-async-generator-functions" "7.0.0-beta.35" + "@babel/plugin-proposal-class-properties" "7.0.0-beta.35" + "@babel/plugin-proposal-object-rest-spread" "7.0.0-beta.35" + "@babel/plugin-proposal-optional-catch-binding" "7.0.0-beta.35" + "@babel/plugin-proposal-unicode-property-regex" "7.0.0-beta.35" + "@babel/plugin-syntax-dynamic-import" "7.0.0-beta.35" + +"@babel/preset-typescript@^7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.0.0-beta.35.tgz#b1315b0d599cdb3272f85a3a3d5bf724cd442815" + dependencies: + "@babel/plugin-transform-typescript" "7.0.0-beta.35" + +"@babel/register@^7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.0.0-beta.35.tgz#0af044c0476f5f68535feb73242f8da66e0e4a8b" + dependencies: + core-js "^2.4.0" + find-cache-dir "^1.0.0" + home-or-tmp "^3.0.0" + lodash "^4.2.0" + mkdirp "^0.5.1" + pirates "^3.0.1" + source-map-support "^0.4.2" + +"@babel/template@7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.31.tgz#577bb29389f6c497c3e7d014617e7d6713f68bda" + dependencies: + "@babel/code-frame" "7.0.0-beta.31" + "@babel/types" "7.0.0-beta.31" + babylon "7.0.0-beta.31" + lodash "^4.2.0" + +"@babel/template@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.35.tgz#459230417f51c29401cf71162aeeff6cef2bcca7" + dependencies: + "@babel/code-frame" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + babylon "7.0.0-beta.35" + lodash "^4.2.0" + +"@babel/traverse@7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.31.tgz#db399499ad74aefda014f0c10321ab255134b1df" + dependencies: + "@babel/code-frame" "7.0.0-beta.31" + "@babel/helper-function-name" "7.0.0-beta.31" + "@babel/types" "7.0.0-beta.31" + babylon "7.0.0-beta.31" + debug "^3.0.1" + globals "^10.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +"@babel/traverse@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.35.tgz#c91819807b7ac256d2f6dd5aaa94d4c66e06bbc5" + dependencies: + "@babel/code-frame" "7.0.0-beta.35" + "@babel/helper-function-name" "7.0.0-beta.35" + "@babel/types" "7.0.0-beta.35" + babylon "7.0.0-beta.35" + debug "^3.0.1" + globals "^10.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +"@babel/types@7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.31.tgz#42c9c86784f674c173fb21882ca9643334029de4" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^2.0.0" + +"@babel/types@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.35.tgz#cf933a9a9a38484ca724b335b88d83726d5ab960" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^2.0.0" + +"@types/joi@^13.0.3": + version "13.0.3" + resolved "https://registry.yarnpkg.com/@types/joi/-/joi-13.0.3.tgz#420cd3a59f3e739a711c11619790b3e80068ab92" + +"@types/lodash@^4.14.91": + version "4.14.91" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.91.tgz#794611b28056d16b5436059c6d800b39d573cd3a" + +"@types/mocha@^2.2.44": + version "2.2.44" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.44.tgz#1d4a798e53f35212fd5ad4d04050620171cd5b5e" + +"@types/node@*": + version "8.5.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.1.tgz#4ec3020bcdfe2abffeef9ba3fbf26fca097514b5" + +"@types/strip-bom@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/strip-bom/-/strip-bom-3.0.0.tgz#14a8ec3956c2e81edb7520790aecf21c290aebd2" + +"@types/strip-json-comments@0.0.30": + version "0.0.30" + resolved "https://registry.yarnpkg.com/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1" + +abab@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +acorn-globals@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538" + dependencies: + acorn "^5.0.0" + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^5.0.0, acorn@^5.1.2, acorn@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7" + +ajv-keywords@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" + +ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-escapes@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-escapes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.1.0, ansi-styles@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" + dependencies: + color-convert "^1.9.0" + +any-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242" + +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + +app-root-path@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + +are-we-there-yet@~1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + +array-filter@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" + +array-map@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" + +array-reduce@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0, arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +assertion-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.2.1, aws4@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-eslint@^8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.0.3.tgz#f29ecf02336be438195325cd47c468da81ee4e98" + dependencies: + "@babel/code-frame" "7.0.0-beta.31" + "@babel/traverse" "7.0.0-beta.31" + "@babel/types" "7.0.0-beta.31" + babylon "7.0.0-beta.31" + +babel-generator@^6.18.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.6" + trim-right "^1.0.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-istanbul@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e" + dependencies: + find-up "^2.1.0" + istanbul-lib-instrument "^1.7.5" + test-exclude "^4.1.1" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.18.0, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.18.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@7.0.0-beta.31: + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.31.tgz#7ec10f81e0e456fd0f855ad60fa30c2ac454283f" + +babylon@7.0.0-beta.35: + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.35.tgz#9f9e609ed50c28d4333f545b373a381b47e9e6ed" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +binary-extensions@^1.0.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" + +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +boom@4.x.x: + version "4.3.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" + dependencies: + hoek "4.x.x" + +boom@5.x.x: + version "5.2.0" + resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" + dependencies: + hoek "4.x.x" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browser-process-hrtime@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + +browserslist@^2.4.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.10.0.tgz#bac5ee1cc69ca9d96403ffb8a3abdc5b6aed6346" + dependencies: + caniuse-lite "^1.0.30000780" + electron-to-chromium "^1.3.28" + +builtin-modules@^1.0.0, builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +caching-transform@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" + dependencies: + md5-hex "^1.2.0" + mkdirp "^0.5.1" + write-file-atomic "^1.1.4" + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +caniuse-lite@^1.0.30000780: + version "1.0.30000783" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000783.tgz#9b5499fb1b503d2345d12aa6b8612852f4276ffd" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chai@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" + dependencies: + assertion-error "^1.0.1" + check-error "^1.0.1" + deep-eql "^3.0.0" + get-func-name "^2.0.0" + pathval "^1.0.0" + type-detect "^4.0.0" + +chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + +check-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + +chokidar@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +ci-info@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4" + +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + +cli-cursor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + dependencies: + restore-cursor "^2.0.0" + +cli-spinners@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" + +cli-truncate@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" + dependencies: + slice-ansi "0.0.4" + string-width "^1.0.1" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +coalescy@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/coalescy/-/coalescy-1.0.0.tgz#4b065846b836361ada6c4b4a4abf4bc1cac31bf1" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +color-convert@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +commander@2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + +commander@^2.11.0, commander@^2.8.1, commander@^2.9.0: + version "2.12.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + +content-type-parser@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.2.tgz#caabe80623e63638b2502fd4c7f12ff4ce2352e7" + +convert-source-map@^1.1.0, convert-source-map@^1.3.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + +core-js@^2.4.0: + version "2.5.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cosmiconfig@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-3.1.0.tgz#640a94bf9847f321800403cd273af60665c73397" + dependencies: + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^3.0.0" + require-from-string "^2.0.1" + +cross-env@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.1.1.tgz#b6d8ab97f304c0f71dae7277b75fe424c08dfa74" + dependencies: + cross-spawn "^5.1.0" + is-windows "^1.0.0" + +cross-spawn@^4: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cross-spawn@^5.0.1, cross-spawn@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + +cryptiles@3.x.x: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" + dependencies: + boom "5.x.x" + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" + +"cssstyle@>= 0.2.37 < 0.3.0": + version "0.2.37" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" + dependencies: + cssom "0.3.x" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +date-fns@^1.27.2: + version "1.29.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" + +debug-log@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" + +debug@3.1.0, debug@^3.0.1, debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + +debug@^2.2.0, debug@^2.6.8: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +decamelize@^1.0.0, decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + +deep-eql@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + dependencies: + type-detect "^4.0.0" + +deep-extend@~0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + dependencies: + strip-bom "^2.0.0" + +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +detect-node@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.3.tgz#a2033c09cc8e158d37748fbde7507832bd6ce127" + +diff@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" + +diff@^3.1.0, diff@^3.2.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" + +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-0.7.2.tgz#7cb860359ba3be90e040b26b729ce4bfa654c523" + dependencies: + esutils "^1.1.6" + isarray "0.0.1" + +doctrine@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.2.tgz#68f96ce8efc56cc42651f1faadb4f175273b0075" + dependencies: + esutils "^2.0.2" + +domexception@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.0.tgz#81fe5df81b3f057052cde3a9fa9bf536a85b9ab0" + +duplexer@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +electron-to-chromium@^1.3.28: + version "1.3.28" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.28.tgz#8dd4e6458086644e9f9f0a1cf32e2a1f9dffd9ee" + +elegant-spinner@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" + +error-ex@^1.2.0, error-ex@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.4.3: + version "1.10.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + +es6-object-assign@^1.0.3: + version "1.1.0" + resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escodegen@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.0.tgz#9811a2f265dc1cd3894420ee3717064b632b8852" + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.5.6" + +eslint-config-airbnb-base@^12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-12.1.0.tgz#386441e54a12ccd957b0a92564a4bafebd747944" + dependencies: + eslint-restricted-globals "^0.1.1" + +eslint-config-prettier@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3" + dependencies: + get-stdin "^5.0.1" + +eslint-friendly-formatter@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-friendly-formatter/-/eslint-friendly-formatter-3.0.0.tgz#278874435a6c46ec1d94fa0b1ff494e30ef04290" + dependencies: + chalk "^1.0.0" + coalescy "1.0.0" + extend "^3.0.0" + minimist "^1.2.0" + text-table "^0.2.0" + +eslint-import-resolver-node@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz#4422574cde66a9a7b099938ee4d508a199e0e3cc" + dependencies: + debug "^2.6.8" + resolve "^1.2.0" + +eslint-module-utils@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz#abaec824177613b8a95b299639e1b6facf473449" + dependencies: + debug "^2.6.8" + pkg-dir "^1.0.0" + +eslint-plugin-import@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz#fa1b6ef31fcb3c501c09859c1b86f1fc5b986894" + dependencies: + builtin-modules "^1.1.1" + contains-path "^0.1.0" + debug "^2.6.8" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.1" + eslint-module-utils "^2.1.1" + has "^1.0.1" + lodash.cond "^4.3.0" + minimatch "^3.0.3" + read-pkg-up "^2.0.0" + +eslint-plugin-prettier@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.4.0.tgz#85cab0775c6d5e3344ef01e78d960f166fb93aae" + dependencies: + fast-diff "^1.1.1" + jest-docblock "^21.0.0" + +eslint-restricted-globals@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz#35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7" + +eslint-scope@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint@^4.13.1: + version "4.13.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.13.1.tgz#0055e0014464c7eb7878caf549ef2941992b444f" + dependencies: + ajv "^5.3.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.0.1" + doctrine "^2.0.2" + eslint-scope "^3.7.1" + espree "^3.5.2" + esquery "^1.0.0" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.0.1" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "^4.0.1" + text-table "~0.2.0" + +espree@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca" + dependencies: + acorn "^5.2.1" + acorn-jsx "^3.0.0" + +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" + dependencies: + estraverse "^4.1.0" + object-assign "^4.0.1" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +esutils@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.1.6.tgz#c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +event-stream@~3.3.0: + version "3.3.4" + resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + dependencies: + duplexer "~0.1.1" + from "~0" + map-stream "~0.1.0" + pause-stream "0.0.11" + split "0.3" + stream-combiner "~0.0.4" + through "~2.3.1" + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +execa@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +external-editor@^2.0.4: + version "2.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" + dependencies: + chardet "^0.4.0" + iconv-lite "^0.4.17" + tmp "^0.0.33" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + +fast-deep-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" + +fast-diff@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +figures@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-cache-dir@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" + dependencies: + commondir "^1.0.1" + mkdirp "^0.5.1" + pkg-dir "^1.0.0" + +find-cache-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f" + dependencies: + commondir "^1.0.1" + make-dir "^1.0.0" + pkg-dir "^2.0.0" + +find-parent-dir@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +flat-cache@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +foreground-child@^1.5.3, foreground-child@^1.5.6: + version "1.5.6" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" + dependencies: + cross-spawn "^4" + signal-exit "^3.0.0" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +form-data@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +from@~0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" + +fs-readdir-recursive@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8" + dependencies: + nan "^2.3.0" + node-pre-gyp "^0.6.39" + +fstream-ignore@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +function-bind@^1.0.2, function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + +get-own-enumerable-property-symbols@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" + +get-stdin@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^10.0.0: + version "10.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-10.4.0.tgz#5c477388b128a9e4c5c5d01c7a2aca68c68b2da7" + +globals@^11.0.1: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.1.0.tgz#632644457f5f0e3ae711807183700ebf2e4633e4" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +growl@1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" + +handlebars@^4.0.3: + version "4.0.11" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +has@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +hawk@3.1.3, hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +hawk@~6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" + dependencies: + boom "4.x.x" + cryptiles "3.x.x" + hoek "4.x.x" + sntp "2.x.x" + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + +hoek@4.x.x: + version "4.2.0" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" + +hoek@5.x.x: + version "5.0.2" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.2.tgz#d2f2c95d36fe7189cf8aa8c237abc1950eca1378" + +home-or-tmp@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" + +homedir-polyfill@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" + dependencies: + parse-passwd "^1.0.0" + +hosted-git-info@^2.1.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" + +html-encoding-sniffer@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + dependencies: + whatwg-encoding "^1.0.1" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +husky@^0.14.3: + version "0.14.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" + dependencies: + is-ci "^1.0.10" + normalize-path "^1.0.0" + strip-indent "^2.0.0" + +iconv-lite@0.4.19, iconv-lite@^0.4.17: + version "0.4.19" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" + +ignore@^3.3.3: + version "3.3.7" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + +indent-string@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + +inquirer@^3.0.6: + version "3.3.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.0.4" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + +interpret@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" + +invariant@^2.2.0, invariant@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" + +is-ci@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" + dependencies: + ci-info "^1.0.0" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + dependencies: + is-extglob "^2.1.1" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + +is-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-0.2.0.tgz#b361311d83c6e5d726cabf5e250b0237106f5ae2" + dependencies: + symbol-observable "^0.2.2" + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + dependencies: + path-is-inside "^1.0.1" + +is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + +is-resolvable@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.1.tgz#acca1cd36dbe44b974b924321555a70ba03b1cf4" + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +is-windows@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.1.tgz#310db70f742d259a16a369202b51af84233310d9" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isemail@3.x.x: + version "3.0.0" + resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.0.0.tgz#c89a46bb7a3361e1759f8028f9082488ecce3dff" + dependencies: + punycode "2.x.x" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +istanbul-lib-coverage@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" + +istanbul-lib-hook@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz#8538d970372cb3716d53e55523dd54b557a8d89b" + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.7.5, istanbul-lib-instrument@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz#250b30b3531e5d3251299fdd64b0b2c9db6b558e" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.1.1" + semver "^5.3.0" + +istanbul-lib-report@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.2.tgz#922be27c13b9511b979bd1587359f69798c1d425" + dependencies: + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.2.tgz#750578602435f28a0c04ee6d7d9e0f2960e62c1c" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.3.tgz#3b9e1e8defb6d18b1d425da8e8b32c5a163f2d10" + dependencies: + handlebars "^4.0.3" + +jest-docblock@^21.0.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" + +jest-get-type@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-21.2.0.tgz#f6376ab9db4b60d81e39f30749c6c466f40d4a23" + +jest-validate@^21.1.0: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-21.2.1.tgz#cc0cbca653cd54937ba4f2a111796774530dd3c7" + dependencies: + chalk "^2.0.1" + jest-get-type "^21.2.0" + leven "^2.1.0" + pretty-format "^21.2.1" + +joi-browser@^13.0.1: + version "13.0.1" + resolved "https://registry.yarnpkg.com/joi-browser/-/joi-browser-13.0.1.tgz#06a7b782d94bca6fa0f107138846ea16588b2e7b" + +joi@^13.0.2: + version "13.0.2" + resolved "https://registry.yarnpkg.com/joi/-/joi-13.0.2.tgz#8cc57a573b7c0b64108fa6fd85061c20fcb0d6b0" + dependencies: + hoek "5.x.x" + isemail "3.x.x" + topo "3.x.x" + +js-tokens@^3.0.0, js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@^3.9.0, js-yaml@^3.9.1: + version "3.10.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsdom-global@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/jsdom-global/-/jsdom-global-3.0.2.tgz#6bd299c13b0c4626b2da2c0393cd4385d606acb9" + +jsdom@^11.5.1: + version "11.5.1" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.5.1.tgz#5df753b8d0bca20142ce21f4f6c039f99a992929" + dependencies: + abab "^1.0.3" + acorn "^5.1.2" + acorn-globals "^4.0.0" + array-equal "^1.0.0" + browser-process-hrtime "^0.1.2" + content-type-parser "^1.0.1" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" + domexception "^1.0.0" + escodegen "^1.9.0" + html-encoding-sniffer "^1.0.1" + left-pad "^1.2.0" + nwmatcher "^1.4.3" + parse5 "^3.0.2" + pn "^1.0.0" + request "^2.83.0" + request-promise-native "^1.0.3" + sax "^1.2.1" + symbol-tree "^3.2.1" + tough-cookie "^2.3.3" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.1" + whatwg-url "^6.3.0" + xml-name-validator "^2.0.1" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json-parse-better-errors@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz#50183cd1b2d25275de069e9e71b467ac9eab973a" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json5@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +left-pad@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee" + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lint-staged@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-6.0.0.tgz#7ab7d345f2fe302ff196f1de6a005594ace03210" + dependencies: + app-root-path "^2.0.0" + chalk "^2.1.0" + commander "^2.11.0" + cosmiconfig "^3.1.0" + debug "^3.1.0" + dedent "^0.7.0" + execa "^0.8.0" + find-parent-dir "^0.3.0" + is-glob "^4.0.0" + jest-validate "^21.1.0" + listr "^0.13.0" + lodash "^4.17.4" + log-symbols "^2.0.0" + minimatch "^3.0.0" + npm-which "^3.0.1" + p-map "^1.1.1" + path-is-inside "^1.0.2" + pify "^3.0.0" + staged-git-files "0.0.4" + stringify-object "^3.2.0" + +listr-silent-renderer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + +listr-update-renderer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + elegant-spinner "^1.0.1" + figures "^1.7.0" + indent-string "^3.0.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + strip-ansi "^3.0.1" + +listr-verbose-renderer@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#8206f4cf6d52ddc5827e5fd14989e0e965933a35" + dependencies: + chalk "^1.1.3" + cli-cursor "^1.0.2" + date-fns "^1.27.2" + figures "^1.7.0" + +listr@^0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.13.0.tgz#20bb0ba30bae660ee84cc0503df4be3d5623887d" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + figures "^1.7.0" + indent-string "^2.1.0" + is-observable "^0.2.0" + is-promise "^2.1.0" + is-stream "^1.1.0" + listr-silent-renderer "^1.1.1" + listr-update-renderer "^0.4.0" + listr-verbose-renderer "^0.4.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + ora "^0.2.3" + p-map "^1.1.1" + rxjs "^5.4.2" + stream-to-observable "^0.2.0" + strip-ansi "^3.0.1" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash.cond@^4.3.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + +lodash@^4.13.1, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + dependencies: + chalk "^1.0.0" + +log-symbols@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.1.0.tgz#f35fa60e278832b538dc4dddcbb478a45d3e3be6" + dependencies: + chalk "^2.0.1" + +log-update@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" + dependencies: + ansi-escapes "^1.0.0" + cli-cursor "^1.0.2" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +lru-cache@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +make-dir@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.1.0.tgz#19b4369fe48c116f53c2af95ad102c0e39e85d51" + dependencies: + pify "^3.0.0" + +make-error@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.0.tgz#52ad3a339ccf10ce62b4040b708fe707244b8b96" + +map-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" + +md5-hex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" + dependencies: + md5-o-matic "^0.1.1" + +md5-o-matic@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + +merge-source-map@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.0.4.tgz#a5de46538dae84d4114cc5ea02b4772a6346701f" + dependencies: + source-map "^0.5.6" + +micromatch@^2.1.5, micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +mime-db@~1.30.0: + version "1.30.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" + +mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.7: + version "2.1.17" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" + dependencies: + mime-db "~1.30.0" + +mimic-fn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + +mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.0.1.tgz#0aee5a95cf69a4618820f5e51fa31717117daf1b" + dependencies: + browser-stdout "1.3.0" + commander "2.11.0" + debug "3.1.0" + diff "3.3.1" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.3" + he "1.1.1" + mkdirp "0.5.1" + supports-color "4.4.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + +nan@^2.3.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + +node-pre-gyp@^0.6.39: + version "0.6.39" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" + dependencies: + detect-libc "^1.0.2" + hawk "3.1.3" + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.3.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" + +normalize-path@^2.0.0, normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npm-path@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.3.tgz#15cff4e1c89a38da77f56f6055b24f975dfb2bbe" + dependencies: + which "^1.2.10" + +npm-run-all@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.2.tgz#90d62d078792d20669139e718621186656cea056" + dependencies: + ansi-styles "^3.2.0" + chalk "^2.1.0" + cross-spawn "^5.1.0" + memorystream "^0.3.1" + minimatch "^3.0.4" + ps-tree "^1.1.0" + read-pkg "^3.0.0" + shell-quote "^1.6.1" + string.prototype.padend "^3.0.0" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +npm-which@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" + dependencies: + commander "^2.9.0" + npm-path "^2.0.2" + which "^1.2.10" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +nwmatcher@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c" + +nyc@^11.3.0: + version "11.3.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.3.0.tgz#a42bc17b3cfa41f7b15eb602bc98b2633ddd76f0" + dependencies: + archy "^1.0.0" + arrify "^1.0.1" + caching-transform "^1.0.0" + convert-source-map "^1.3.0" + debug-log "^1.0.1" + default-require-extensions "^1.0.0" + find-cache-dir "^0.1.1" + find-up "^2.1.0" + foreground-child "^1.5.3" + glob "^7.0.6" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-hook "^1.1.0" + istanbul-lib-instrument "^1.9.1" + istanbul-lib-report "^1.1.2" + istanbul-lib-source-maps "^1.2.2" + istanbul-reports "^1.1.3" + md5-hex "^1.2.0" + merge-source-map "^1.0.2" + micromatch "^2.3.11" + mkdirp "^0.5.0" + resolve-from "^2.0.0" + rimraf "^2.5.4" + signal-exit "^3.0.1" + spawn-wrap "=1.3.8" + test-exclude "^4.1.1" + yargs "^10.0.3" + yargs-parser "^8.0.0" + +oauth-sign@~0.8.1, oauth-sign@~0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-keys@^1.0.8: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0, once@^1.3.3: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +onetime@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1, optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +ora@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/ora/-/ora-0.2.3.tgz#37527d220adcd53c39b73571d754156d5db657a4" + dependencies: + chalk "^1.1.1" + cli-cursor "^1.0.2" + cli-spinners "^0.1.2" + object-assign "^4.0.1" + +os-homedir@^1.0.0, os-homedir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +output-file-sync@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-2.0.0.tgz#5d348a1a1eaed1ad168648a01a2d6d13078ce987" + dependencies: + graceful-fs "^4.1.11" + is-plain-obj "^1.1.0" + mkdirp "^0.5.1" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +p-map@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse-json@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-3.0.0.tgz#fa6f47b18e23826ead32f263e744d0e1e847fb13" + dependencies: + error-ex "^1.3.1" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + +parse5@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" + dependencies: + "@types/node" "*" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.1, path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + dependencies: + pify "^2.0.0" + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + dependencies: + pify "^3.0.0" + +pathval@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + +pause-stream@0.0.11: + version "0.0.11" + resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" + dependencies: + through "~2.3" + +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pirates@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-3.0.2.tgz#7e6f85413fd9161ab4e12b539b06010d85954bb9" + dependencies: + node-modules-regexp "^1.0.0" + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + dependencies: + find-up "^2.1.0" + +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + +pn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.0.0.tgz#1cf5a30b0d806cd18f88fc41a6b5d4ad615b3ba9" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +prettier@^1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.2.tgz#96bc2132f7a32338e6078aeb29727178c6335827" + +pretty-format@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-21.2.1.tgz#ae5407f3cf21066cd011aa1ba5fce7b6a2eddb36" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + +private@^0.1.6: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + +ps-tree@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014" + dependencies: + event-stream "~3.3.0" + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +punycode@2.x.x, punycode@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + +qs@~6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" + +randomatic@^1.1.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +rc@^1.1.7: + version "1.2.2" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.2.tgz#d8ce9cb57e8d64d9c7badd9876c7c34cbe3c7077" + dependencies: + deep-extend "~0.4.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + +regenerate-unicode-properties@^5.1.1: + version "5.1.3" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-5.1.3.tgz#54f5891543468f36f2274b67c6bc4c033c27b308" + dependencies: + regenerate "^1.3.3" + +regenerate@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regenerator-transform@^0.12.2: + version "0.12.2" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.12.2.tgz#55c038e9203086b445c67fcd77422eb53a4c406b" + dependencies: + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +regexpu-core@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.1.3.tgz#fb81616dbbc2a917a7419b33f8379144f51eb8d0" + dependencies: + regenerate "^1.3.3" + regenerate-unicode-properties "^5.1.1" + regjsgen "^0.3.0" + regjsparser "^0.2.1" + unicode-match-property-ecmascript "^1.0.3" + unicode-match-property-value-ecmascript "^1.0.1" + +regjsgen@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.3.0.tgz#0ee4a3e9276430cda25f1e789ea6c15b87b0cb43" + +regjsparser@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.2.1.tgz#c3787553faf04e775c302102ef346d995000ec1c" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + +request-promise-native@^1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + +request@2.81.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +request@^2.83.0: + version "2.83.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + hawk "~6.0.2" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + stringstream "~0.0.5" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-from-string@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.1.tgz#c545233e9d7da6616e9d59adfb39fc9f588676ff" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + +resolve-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" + +resolve@^1.1.6, resolve@^1.2.0, resolve@^1.3.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" + dependencies: + path-parse "^1.0.5" + +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + dependencies: + glob "^7.0.5" + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + dependencies: + is-promise "^2.1.0" + +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + +rxjs@^5.4.2: + version "5.5.5" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.5.tgz#e164f11d38eaf29f56f08c3447f74ff02dd84e97" + dependencies: + symbol-observable "1.0.1" + +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +sax@^1.2.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +shell-quote@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" + dependencies: + array-filter "~0.0.0" + array-map "~0.0.0" + array-reduce "~0.0.0" + jsonify "~0.0.0" + +shelljs@^0.7.3: + version "0.7.8" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +shx@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/shx/-/shx-0.2.2.tgz#0a304d020b0edf1306ad81570e80f0346df58a39" + dependencies: + es6-object-assign "^1.0.3" + minimist "^1.2.0" + shelljs "^0.7.3" + +signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + dependencies: + is-fullwidth-code-point "^2.0.0" + +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + +sntp@2.x.x: + version "2.1.0" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" + dependencies: + hoek "4.x.x" + +source-map-support@^0.4.2: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map-support@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.0.tgz#2018a7ad2bdf8faf2691e5fddab26bed5a2bacab" + dependencies: + source-map "^0.6.0" + +source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +spawn-wrap@=1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.3.8.tgz#fa2a79b990cbb0bb0018dca6748d88367b19ec31" + dependencies: + foreground-child "^1.5.6" + mkdirp "^0.5.0" + os-homedir "^1.0.1" + rimraf "^2.3.3" + signal-exit "^3.0.2" + which "^1.2.4" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +split@0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" + dependencies: + through "2" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +staged-git-files@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35" + +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + +stream-combiner@~0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + dependencies: + duplexer "~0.1.1" + +stream-to-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.2.0.tgz#59d6ea393d87c2c0ddac10aa0d561bc6ba6f0e10" + dependencies: + any-observable "^0.2.0" + +string-width@^1.0.1, string-width@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string.prototype.padend@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.4.3" + function-bind "^1.0.2" + +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + +stringify-object@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.1.tgz#2720c2eff940854c819f6ee252aaeb581f30624d" + dependencies: + get-own-enumerable-property-symbols "^2.0.1" + is-obj "^1.0.1" + is-regexp "^1.0.0" + +stringstream@~0.0.4, stringstream@~0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-indent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" + +strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" + dependencies: + has-flag "^2.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +supports-color@^4.0.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" + dependencies: + has-flag "^2.0.0" + +symbol-observable@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" + +symbol-observable@^0.2.2: + version "0.2.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" + +symbol-tree@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + +table@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" + dependencies: + ajv "^5.2.3" + ajv-keywords "^2.1.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" + +tar-pack@^3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" + dependencies: + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" + +tar@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + +test-exclude@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +text-table@^0.2.0, text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +through@2, through@^2.3.6, through@~2.3, through@~2.3.1: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + dependencies: + os-tmpdir "~1.0.2" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + +topo@3.x.x: + version "3.0.0" + resolved "https://registry.yarnpkg.com/topo/-/topo-3.0.0.tgz#37e48c330efeac784538e0acd3e62ca5e231fe7a" + dependencies: + hoek "5.x.x" + +tough-cookie@>=2.3.3, tough-cookie@^2.3.3, tough-cookie@~2.3.0, tough-cookie@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" + dependencies: + punycode "^1.4.1" + +tr46@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + dependencies: + punycode "^2.1.0" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +ts-node@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-4.0.2.tgz#cb3d039b9898fdc79ad09ab7e69c84564c8c41ee" + dependencies: + arrify "^1.0.0" + chalk "^2.3.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.5.0" + tsconfig "^7.0.0" + v8flags "^3.0.0" + yn "^2.0.0" + +tsconfig@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-7.0.0.tgz#84538875a4dc216e5c4a5432b3a4dec3d54e91b7" + dependencies: + "@types/strip-bom" "^3.0.0" + "@types/strip-json-comments" "0.0.30" + strip-bom "^3.0.0" + strip-json-comments "^2.0.0" + +tslib@^1.0.0, tslib@^1.7.1, tslib@^1.8.0: + version "1.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.1.tgz#6946af2d1d651a7b1863b531d6e5afa41aa44eac" + +tslint-config-airbnb@^5.4.2: + version "5.4.2" + resolved "https://registry.yarnpkg.com/tslint-config-airbnb/-/tslint-config-airbnb-5.4.2.tgz#18eeff28f697b578731249d9a3ef8955b2f04f44" + dependencies: + tslint-consistent-codestyle "^1.10.0" + tslint-eslint-rules "^4.1.1" + tslint-microsoft-contrib "~5.0.1" + +tslint-config-prettier@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.6.0.tgz#fec1ee8fb07e8f033c63fed6b135af997f31962a" + +tslint-consistent-codestyle@^1.10.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/tslint-consistent-codestyle/-/tslint-consistent-codestyle-1.11.0.tgz#051493eeb3536a74e98d14b66f38028a785f8c2b" + dependencies: + tslib "^1.7.1" + tsutils "^2.12.2" + +tslint-eslint-rules@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/tslint-eslint-rules/-/tslint-eslint-rules-4.1.1.tgz#7c30e7882f26bc276bff91d2384975c69daf88ba" + dependencies: + doctrine "^0.7.2" + tslib "^1.0.0" + tsutils "^1.4.0" + +tslint-microsoft-contrib@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/tslint-microsoft-contrib/-/tslint-microsoft-contrib-5.0.1.tgz#328ee9c28d07cdf793293204c96e2ffab9221994" + dependencies: + tsutils "^1.4.0" + +tslint@^5.8.0: + version "5.8.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.8.0.tgz#1f49ad5b2e77c76c3af4ddcae552ae4e3612eb13" + dependencies: + babel-code-frame "^6.22.0" + builtin-modules "^1.1.1" + chalk "^2.1.0" + commander "^2.9.0" + diff "^3.2.0" + glob "^7.1.1" + minimatch "^3.0.4" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.7.1" + tsutils "^2.12.1" + +tsutils@^1.4.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0" + +tsutils@^2.12.1, tsutils@^2.12.2: + version "2.13.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.13.1.tgz#d6d1cc0f7c04cf9fb3b28a292973cffb9cfbe09a" + dependencies: + tslib "^1.8.0" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +type-detect@^4.0.0: + version "4.0.5" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.5.tgz#d70e5bc81db6de2a381bcaca0c6e0cbdc7635de2" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +typescript@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4" + +uglify-js@^2.6: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +uid-number@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + +unicode-canonical-property-names-ecmascript@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.3.tgz#f6119f417467593c0086357c85546b6ad5abc583" + +unicode-match-property-ecmascript@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.3.tgz#db9b1cb4ffc67e0c5583780b1b59370e4cbe97b9" + dependencies: + unicode-canonical-property-names-ecmascript "^1.0.2" + unicode-property-aliases-ecmascript "^1.0.3" + +unicode-match-property-value-ecmascript@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.1.tgz#fea059120a016f403afd3bf586162b4db03e0604" + +unicode-property-aliases-ecmascript@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.3.tgz#ac3522583b9e630580f916635333e00c5ead690d" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +uuid@^3.0.0, uuid@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" + +v8flags@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.1.tgz#dce8fc379c17d9f2c9e9ed78d89ce00052b1b76b" + dependencies: + homedir-polyfill "^1.0.1" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +webidl-conversions@^4.0.1, webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + +whatwg-encoding@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz#57c235bc8657e914d24e1a397d3c82daee0a6ba3" + dependencies: + iconv-lite "0.4.19" + +whatwg-url@^6.3.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.0.tgz#08fdf2b9e872783a7a1f6216260a1d66cc722e08" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.0" + webidl-conversions "^4.0.1" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@^1.2.10, which@^1.2.4, which@^1.2.9: + version "1.3.0" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" + dependencies: + string-width "^1.0.2" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-file-atomic@^1.1.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + +xml-name-validator@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yargs-parser@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.0.0.tgz#21d476330e5a82279a4b881345bf066102e219c6" + dependencies: + camelcase "^4.1.0" + +yargs@^10.0.3: + version "10.0.3" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.0.3.tgz#6542debd9080ad517ec5048fb454efe9e4d4aaae" + dependencies: + cliui "^3.2.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.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" + yargs-parser "^8.0.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" + +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a"