From 9a03b991178f4281f26ac7b5d7953e3c3aa40e9c Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 4 Feb 2021 16:27:26 +0000 Subject: [PATCH 01/43] feat: use esbuild and playwright-test - remove webpack, karma and some babel packages - use esbuild to bundle - use playwright-test for browser tests --- cmds/test.js | 2 +- package.json | 26 +---- src/build/index.js | 70 +++++++------ src/config/babelrc.js | 51 --------- src/config/karma-entry.js | 13 --- src/config/karma.conf.js | 147 -------------------------- src/config/pw-test.js | 4 + src/config/register.js | 18 +++- src/config/user.js | 14 +-- src/config/webpack.config.js | 193 ----------------------------------- src/fixtures.browser.js | 4 +- src/test/browser.js | 41 ++++---- 12 files changed, 94 insertions(+), 489 deletions(-) delete mode 100644 src/config/babelrc.js delete mode 100644 src/config/karma-entry.js delete mode 100644 src/config/karma.conf.js create mode 100644 src/config/pw-test.js delete mode 100644 src/config/webpack.config.js diff --git a/cmds/test.js b/cmds/test.js index 6fdb97c9d..b061e6237 100644 --- a/cmds/test.js +++ b/cmds/test.js @@ -65,7 +65,7 @@ module.exports = { default: true }, colors: { - describe: 'Enable colors on output (only available in node runs)', + describe: 'Enable colors on output', type: 'boolean', default: true }, diff --git a/package.json b/package.json index 809acc069..0134a8159 100644 --- a/package.json +++ b/package.json @@ -51,14 +51,10 @@ }, "dependencies": { "@achingbrain/dependency-check": "^4.1.0", - "@babel/cli": "^7.12.10", - "@babel/core": "^7.12.10", - "@babel/plugin-transform-regenerator": "^7.12.1", - "@babel/plugin-transform-runtime": "^7.12.10", - "@babel/preset-env": "^7.12.10", + "@babel/core": "^7.12.13", + "@babel/preset-env": "^7.12.13", "@babel/preset-typescript": "^7.12.7", "@babel/register": "^7.12.10", - "@babel/runtime": "^7.12.5", "@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^11.0.0", "@commitlint/lint": "^11.0.0", @@ -74,7 +70,6 @@ "@types/mocha": "^8.2.0", "@types/node": "^14.14.22", "@types/sinon": "^9.0.10", - "babel-loader": "^8.2.2", "buffer": "^6.0.3", "bytes": "^3.1.0", "camelcase": "^6.2.0", @@ -88,6 +83,7 @@ "cors": "^2.8.5", "dirty-chai": "^2.0.1", "electron-mocha": "^10.0.0", + "esbuild": "^0.8.39", "eslint": "^7.18.0", "eslint-config-ipfs": "^2.0.0", "execa": "^5.0.0", @@ -99,16 +95,6 @@ "globby": "^11.0.2", "ipfs-utils": "^6.0.0", "it-glob": "~0.0.10", - "json-loader": "~0.5.7", - "karma": "^6.0.3", - "karma-chrome-launcher": "^3.1.0", - "karma-cli": "^2.0.0", - "karma-firefox-launcher": "^2.1.0", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-mocha-webworker": "^1.3.0", - "karma-sourcemap-loader": "~0.3.8", - "karma-webpack": "4.0.2", "lilconfig": "^2.0.2", "listr": "~0.14.2", "merge-options": "^3.0.4", @@ -118,6 +104,7 @@ "ora": "^5.3.0", "p-map": "^4.0.0", "pascalcase": "^1.0.0", + "playwright-test": "hugomrdias/playwright-test#feat/esbuild", "polka": "^0.5.2", "premove": "^3.0.1", "prompt-promise": "^1.0.3", @@ -126,14 +113,9 @@ "simple-git": "^2.28.0", "strip-bom": "^4.0.0", "strip-json-comments": "^3.1.1", - "terser-webpack-plugin": "^3.0.5", "typedoc": "^0.20.17", "typescript": "4.1.x", "update-notifier": "^5.0.0", - "webpack": "^4.43.0", - "webpack-bundle-analyzer": "^3.7.0", - "webpack-cli": "^3.3.10", - "webpack-merge": "^4.2.2", "yargs": "^16.2.0", "yargs-parser": "^20.2.3" }, diff --git a/src/build/index.js b/src/build/index.js index 37e3933a8..4fc7fe85c 100644 --- a/src/build/index.js +++ b/src/build/index.js @@ -1,14 +1,17 @@ /* eslint-disable no-console */ 'use strict' - +const esbuild = require('esbuild') const path = require('path') -const { readJsonSync } = require('fs-extra') +const pascalcase = require('pascalcase') const bytes = require('bytes') -const execa = require('execa') const { premove: del } = require('premove') -const { fromAegir, gzipSize, pkg, hasTsconfig } = require('./../utils') +const { gzipSize, pkg, hasTsconfig, fromRoot, paths } = require('./../utils') const tsCmd = require('../ts') const { userConfig } = require('../config/user') +const merge = require('merge-options').bind({ + ignoreUndefined: true, + concatArrays: true +}) /** * @typedef {import("../types").GlobalOptions} GlobalOptions @@ -21,47 +24,22 @@ const { userConfig } = require('../config/user') * @param {GlobalOptions & BuildOptions} argv */ module.exports = async (argv) => { - const input = argv._.slice(1) - const forwardOptions = argv['--'] ? argv['--'] : [] - const useBuiltinConfig = !forwardOptions.includes('--config') - const progress = !forwardOptions.includes('--progress') && !process.env.CI ? ['--progress'] : [] - const webpackConfig = useBuiltinConfig - ? ['--config', fromAegir('src/config/webpack.config.js')] - : [] - // Clean dist await del(path.join(process.cwd(), 'dist')) if (argv.bundle) { - // Run webpack - await execa('webpack-cli', [ - ...webpackConfig, - ...progress, - ...input, - ...forwardOptions - ], { - env: { - NODE_ENV: process.env.NODE_ENV || 'production', - AEGIR_BUILD_ANALYZE: argv.bundlesize ? 'true' : 'false', - AEGIR_NODE: argv.node ? 'true' : 'false', - AEGIR_TS: argv.tsRepo ? 'true' : 'false' - }, - localDir: path.join(__dirname, '../..'), - preferLocal: true, - stdio: 'inherit' - }) + const outfile = await build(argv) if (argv.bundlesize) { // @ts-ignore if (userConfig.bundlesize?.maxSize) { throw new Error('Config property `bundlesize.maxSize` is deprecated, use `build.bundlesizeMax`!') } - const stats = readJsonSync(path.join(process.cwd(), 'dist/stats.json')) - const gzip = await gzipSize(path.join(stats.outputPath, stats.assets[0].name)) + const gzip = await gzipSize(outfile) const maxsize = bytes(userConfig.build.bundlesizeMax) const diff = gzip - maxsize - console.log('Use http://webpack.github.io/analyse/ to load "./dist/stats.json".') + console.log('Use https://www.bundle-buddy.com/ to load "./dist/stats.json".') console.log(`Check previous sizes in https://bundlephobia.com/result?p=${pkg.name}@${pkg.version}`) if (diff > 0) { @@ -82,3 +60,31 @@ module.exports = async (argv) => { }) } } + +/** + * Build command + * + * @param {GlobalOptions & BuildOptions} argv + */ +const build = async (argv) => { + const outfile = path.join(paths.dist, 'index.js') + await esbuild.build(merge( + { + entryPoints: [fromRoot('src', argv.tsRepo ? 'index.ts' : 'index.js')], + bundle: true, + format: 'iife', + mainFields: ['browser', 'module', 'main'], + sourcemap: argv.bundlesize, + minify: true, + globalName: pascalcase(pkg.name), + metafile: argv.bundlesize ? path.join(paths.dist, 'stats.json') : undefined, + outfile, + define: { + 'process.env.NODE_ENV': '"production"' + } + }, + userConfig.build.config + )) + + return outfile +} diff --git a/src/config/babelrc.js b/src/config/babelrc.js deleted file mode 100644 index 65a73d48b..000000000 --- a/src/config/babelrc.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict' -const { pkg, browserslist } = require('./../utils') - -module.exports = function (opts = {}) { - const env = process.env.BABEL_ENV || process.env.NODE_ENV - const isEnvDevelopment = env === 'development' - const isEnvProduction = env === 'production' - const isEnvTest = env === 'test' - const isTSEnable = process.env.AEGIR_TS === 'true' - const targets = { browsers: pkg.browserslist || browserslist } - if (!isEnvDevelopment && !isEnvProduction && !isEnvTest) { - throw new Error( - 'Using `babel-preset-env` requires that you specify `NODE_ENV` or ' + - '`BABEL_ENV` environment variables. Valid values are "development", ' + - '"test", and "production". Instead, received: ' + - JSON.stringify(env) + - '.' - ) - } - - return { - presets: [ - [ - require('@babel/preset-env').default, - { - corejs: 3, - useBuiltIns: 'entry', - modules: 'commonjs', - bugfixes: true, - targets - } - ], - isTSEnable && [ - '@babel/preset-typescript', - { - allowNamespaces: true - } - ] - ].filter(Boolean), - plugins: [ - '@babel/plugin-proposal-class-properties', - [ - require('@babel/plugin-transform-runtime').default, - { - helpers: false, - regenerator: true - } - ] - ] - } -} diff --git a/src/config/karma-entry.js b/src/config/karma-entry.js deleted file mode 100644 index 5525b5ae2..000000000 --- a/src/config/karma-entry.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' -/* eslint-disable */ -let testsContext -if (TS_ENABLED) { - testsContext = require.context(TEST_DIR, true, /\.spec\.ts$/) -} else { - testsContext = require.context(TEST_DIR, true, /\.spec\.js$/) -} - -if (TEST_BROWSER_JS) { - require(TEST_BROWSER_JS) -} -testsContext.keys().forEach(testsContext) diff --git a/src/config/karma.conf.js b/src/config/karma.conf.js deleted file mode 100644 index 2fe5ba5b1..000000000 --- a/src/config/karma.conf.js +++ /dev/null @@ -1,147 +0,0 @@ -'use strict' - -const merge = require('webpack-merge') -const webpack = require('webpack') -const path = require('path') -const webpackConfig = require('./webpack.config') -const { fromRoot, hasFile } = require('../utils') -const { userConfig } = require('./user') -const isTSEnable = process.env.AEGIR_TS === 'true' -const isWebworker = process.env.AEGIR_RUNNER === 'webworker' -const isProgressEnabled = process.env.AEGIR_PROGRESS === 'true' - -// Env to pass in the bundle with DefinePlugin -const env = { - TS_ENABLED: process.env.AEGIR_TS, - 'process.env': JSON.stringify(process.env), - TEST_DIR: JSON.stringify(fromRoot('test')), - TEST_BROWSER_JS: hasFile('test', isTSEnable ? 'browser.ts' : 'browser.js') - ? JSON.stringify(fromRoot('test', isTSEnable ? 'browser.ts' : 'browser.js')) - : JSON.stringify('') -} - -// Webpack overrides for karma -const karmaWebpackConfig = merge.strategy({ plugins: 'replace' })(webpackConfig(), { - entry: '', - plugins: [ - new webpack.DefinePlugin(env) - ], - module: { - rules: [ - { - oneOf: [ - { - test: /\.(js|ts)$/, - include: fromRoot('test'), - use: { - loader: require.resolve('babel-loader'), - options: { - presets: [require('./babelrc')()], - babelrc: false, - cacheDirectory: true - } - } - } - ] - } - ] - } -}) - -const karmaConfig = () => { - const files = JSON.parse(process.env.AEGIR_FILES) - const mocha = { - reporter: 'spec', - timeout: Number(process.env.AEGIR_MOCHA_TIMEOUT), - bail: process.env.AEGIR_MOCHA_BAIL === 'true', - grep: process.env.AEGIR_MOCHA_GREP - } - - const karmaEntry = path.join(__dirname, 'karma-entry.js') - - if (!files.length) { - // only try to load *.spec.js if we aren't specifying custom files - files.push(karmaEntry) - } - - return { - browsers: ['ChromeHeadlessNoSandbox'], - customLaunchers: { - ChromeHeadlessNoSandbox: { - base: 'ChromeHeadless', - flags: ['--no-sandbox'] - } - }, - frameworks: isWebworker ? ['mocha-webworker'] : ['mocha'], - basePath: process.cwd(), - files: files - .map(f => { - return { - pattern: f, - included: !isWebworker - } - }) - .concat([ - { - pattern: 'test/fixtures/**/*', - watched: false, - served: true, - included: false - } - ]), - - preprocessors: files.reduce((acc, f) => { - acc[f] = ['webpack', 'sourcemap'] - return acc - }, {}), - - client: { - mocha, - mochaWebWorker: { - pattern: [ - ...files, - 'karma-entry.js' - ], - mocha - } - }, - - webpack: karmaWebpackConfig, - - webpackMiddleware: { - stats: 'errors-only' - }, - - reporters: [ - isProgressEnabled && 'progress', - !isProgressEnabled && 'mocha' - ].filter(Boolean), - - mochaReporter: { - output: 'autowatch', - showDiff: true - }, - - plugins: [ - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-mocha', - 'karma-mocha-reporter', - 'karma-mocha-webworker', - 'karma-sourcemap-loader', - 'karma-webpack' - ], - - autoWatch: false, - singleRun: true, - colors: true, - browserNoActivityTimeout: 50 * 1000 - } -} - -/** - * @param {any} config - */ -module.exports = (config) => { - config.set(merge(karmaConfig(), userConfig.karma)) -} diff --git a/src/config/pw-test.js b/src/config/pw-test.js new file mode 100644 index 000000000..aba9c50c7 --- /dev/null +++ b/src/config/pw-test.js @@ -0,0 +1,4 @@ +'use strict' +const { userConfig } = require('./user') + +module.exports = userConfig.test.browser.config || {} diff --git a/src/config/register.js b/src/config/register.js index 9ca2a01fb..6acc5ab23 100644 --- a/src/config/register.js +++ b/src/config/register.js @@ -1,7 +1,21 @@ 'use strict' -const { fromAegir } = require('./../utils') require('@babel/register')({ extensions: ['.ts'], - presets: [fromAegir('src/config/babelrc.js')] + presets: [ + [ + '@babel/preset-env', + { + modules: 'commonjs', + bugfixes: true, + targets: { node: true } + } + ], + [ + '@babel/preset-typescript', + { + allowNamespaces: true + } + ] + ] }) diff --git a/src/config/user.js b/src/config/user.js index 84f31053b..38b095319 100644 --- a/src/config/user.js +++ b/src/config/user.js @@ -3,7 +3,6 @@ const { lilconfigSync } = require('lilconfig') const merge = require('merge-options') -const utils = require('../utils') /** * @typedef {import("./../types").Options} Options @@ -71,17 +70,20 @@ const config = (searchFrom) => { debug: false, node: false, tsRepo: false, - // old options - webpack: {}, - karma: {}, hooks: {}, - entry: utils.fromRoot('src', 'index.js'), + // test cmd options + test: { + browser: { + config: {} + } + }, // build cmd options build: { bundle: true, bundlesize: false, bundlesizeMax: '100kB', - types: true + types: true, + config: {} }, // linter cmd options lint: { diff --git a/src/config/webpack.config.js b/src/config/webpack.config.js deleted file mode 100644 index b8b725d47..000000000 --- a/src/config/webpack.config.js +++ /dev/null @@ -1,193 +0,0 @@ -'use strict' - -const path = require('path') -const pascalcase = require('pascalcase') -const webpack = require('webpack') -const merge = require('webpack-merge') -const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') -const TerserPlugin = require('terser-webpack-plugin') -const { fromRoot, pkg, paths } = require('../utils') -const { userConfig } = require('./user') -const isProduction = process.env.NODE_ENV === 'production' -const isTSEnable = process.env.AEGIR_TS === 'true' - -const base = (env, argv) => { - const filename = [ - 'index', - isProduction ? '.min' : null, - '.js' - ] - .filter(Boolean) - .join('') - - return { - bail: Boolean(isProduction), - mode: isProduction ? 'production' : 'development', - entry: [isTSEnable ? fromRoot('src', 'index.ts') : fromRoot('src', 'index.js')], - output: { - path: paths.dist, - filename: filename, - sourceMapFilename: filename + '.map', - library: pascalcase(pkg.name), - libraryTarget: 'umd', - globalObject: 'self', // Use `self` as `window` doesn't not exist within a Service/Web Worker context - devtoolModuleFilenameTemplate: info => 'file:' + encodeURI(info.absoluteResourcePath) - }, - module: { - rules: [ - { - oneOf: [ - { - test: /\.(js|ts)$/, - include: paths.src, - use: { - loader: require.resolve('babel-loader'), - options: { - presets: [require('./babelrc')()], - babelrc: false, - cacheDirectory: true - } - } - }, - { - test: /\.js$/, - exclude: /@babel(?:\/|\\{1,2})runtime/, - use: { - loader: require.resolve('babel-loader'), - options: { - presets: [require('./babelrc')()], - babelrc: false, - cacheDirectory: true, - sourceMaps: false - } - } - } - ] - } - ] - }, - resolve: { - extensions: ['.wasm', '.mjs', '.js', '.json', '.ts', '.d.ts'], - alias: { - '@babel/runtime': path.dirname( - require.resolve('@babel/runtime/package.json') - ) - } - }, - optimization: { - minimize: isProduction, - minimizer: [ - // This is only used in production mode - new TerserPlugin({ - terserOptions: { - parse: { - // we want terser to parse ecma 8 code. However, we don't want it - // to apply any minfication steps that turns valid ecma 5 code - // into invalid ecma 5 code. This is why the 'compress' and 'output' - // sections only apply transformations that are ecma 5 safe - // https://github.com/facebook/create-react-app/pull/4234 - ecma: 8 - }, - compress: { - ecma: 5, - warnings: false - }, - mangle: { - safari10: true - }, - output: { - ecma: 5, - comments: false - } - }, - // Use multi-process parallel running to improve the build speed - // Default number of concurrent runs: os.cpus().length - 1 - parallel: true, - // Enable file caching - cache: true, - sourceMap: true - }) - ] - }, - plugins: [ - new webpack.DefinePlugin({ - 'process.env': JSON.stringify({ - DEBUG: process.env.DEBUG, - NODE_ENV: process.env.NODE_ENV - }) - }) - ], - target: 'web', - node: process.env.AEGIR_NODE === 'false' - ? { - global: true, - __filename: 'mock', - __dirname: 'mock', - dgram: false, - fs: false, - net: false, - tls: false, - child_process: false, - console: false, - // TODO remove this once readable-stream is fixed probably on in v4 - // https://github.com/nodejs/readable-stream/pull/435 - process: true, - Buffer: false, - setImmediate: false, - os: false, - assert: false, - constants: false, - events: false, - http: false, - path: false, - querystring: false, - stream: false, - string_decoder: false, - timers: false, - url: false, - util: false, - crypto: false - } - : { - dgram: 'empty', - fs: 'empty', - net: 'empty', - tls: 'empty', - child_process: 'empty', - console: false, - global: true, - process: true, - __filename: 'mock', - __dirname: 'mock', - Buffer: true, - setImmediate: true - }, - performance: { - hints: false - }, - stats: 'errors-warnings' - } -} - -module.exports = (env, argv) => { - const external = typeof userConfig.webpack === 'function' - ? userConfig.webpack(env, argv) - : userConfig.webpack - if (process.env.AEGIR_BUILD_ANALYZE === 'true') { - return merge( - base(env, argv), - { - plugins: [ - new BundleAnalyzerPlugin({ generateStatsFile: true, analyzerMode: 'static', logLevel: 'error', openAnalyzer: process.env.CI === undefined }) - ], - profile: true - }, - external - ) - } - - return merge( - base(env, argv), - external - ) -} diff --git a/src/fixtures.browser.js b/src/fixtures.browser.js index e2ba305dd..5973b7938 100644 --- a/src/fixtures.browser.js +++ b/src/fixtures.browser.js @@ -5,7 +5,7 @@ const { Buffer } = require('buffer') // note: filePath needs to be relative to the module root module.exports = function loadFixtures (filePath, module) { if (module) { - filePath = 'node_modules/' + module + '/' + filePath + filePath = module + '/' + filePath } return syncXhr(filePath) } @@ -13,7 +13,7 @@ module.exports = function loadFixtures (filePath, module) { // @dignifiedquire: I know this is considered bad practice (syncXhr), but it // makes testing life so much nicer! function syncXhr (filePath) { - const target = '/base/' + filePath + const target = filePath const request = new self.XMLHttpRequest() request.open('GET', target, false) diff --git a/src/test/browser.js b/src/test/browser.js index 04f50fbc2..d833267e8 100644 --- a/src/test/browser.js +++ b/src/test/browser.js @@ -7,37 +7,38 @@ const merge = require('merge-options') /** @typedef { import("execa").Options} ExecaOptions */ module.exports = (argv, execaOptions) => { - const input = argv._.slice(1) - const forwardOptions = argv['--'] ? argv['--'] : [] - const watch = argv.watch ? ['--auto-watch', '--no-single-run'] : [] - const verbose = argv.verbose ? ['--log-level', 'debug'] : ['--log-level', 'error'] - const colors = argv.colors ? ['--colors'] : [] + const extra = argv['--'] ? argv['--'] : [] + const forwardOptions = [ + ...extra, + argv.timeout && `--timeout=${argv.timeout}`, + argv.grep && `--grep=${argv.grep}`, + argv.bail && '--bail' + ].filter(Boolean) + const watch = argv.watch ? ['--watch'] : [] + const files = argv.files.length > 0 + ? [ + ...argv.files + ] + : [ + '**/*.spec.{js,ts}', + 'test/browser.{js,ts}' + ] return hook('browser', 'pre')(argv.userConfig) .then((hook = {}) => { - return execa('karma', + return execa('pw-test', [ - 'start', - fromAegir('src/config/karma.conf.js'), - ...colors, + ...files, + '--mode', argv.webworker ? 'worker' : 'main', ...watch, - ...verbose, - ...input, + '--config', fromAegir('src/config/pw-test.js'), ...forwardOptions ], merge( { env: { + AEGIR_RUNNER: argv.webworker ? 'worker' : 'main', NODE_ENV: process.env.NODE_ENV || 'test', - AEGIR_RUNNER: argv.webworker ? 'webworker' : 'browser', - AEGIR_NODE: argv.node, - AEGIR_TS: argv.tsRepo, - AEGIR_MOCHA_TIMEOUT: argv.timeout ? `${argv.timeout}` : '5000', - AEGIR_MOCHA_GREP: argv.grep, - AEGIR_MOCHA_BAIL: argv.bail ? 'true' : 'false', - AEGIR_PROGRESS: argv.progress ? 'true' : 'false', - AEGIR_FILES: JSON.stringify(argv.files), - IS_WEBPACK_BUILD: true, ...hook.env }, preferLocal: true, From fd5695c9534358c14e9ed522512ab9d9d364c76d Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 4 Feb 2021 18:55:34 +0000 Subject: [PATCH 02/43] fix: remove ? from utils --- actions/bundle-size/action.yml | 2 +- src/utils.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/bundle-size/action.yml b/actions/bundle-size/action.yml index 47f8a23a7..906271345 100644 --- a/actions/bundle-size/action.yml +++ b/actions/bundle-size/action.yml @@ -8,5 +8,5 @@ inputs: description: A directory to run the bundle check in required: false runs: - using: 'node12' + using: 'node14' main: 'dist/index.js' diff --git a/src/utils.js b/src/utils.js index 9c85e2b63..fdd1cba91 100644 --- a/src/utils.js +++ b/src/utils.js @@ -101,10 +101,10 @@ exports.exec = (command, args, options = {}) => { const result = execa(command, args, options) if (!options.quiet) { - result.stdout?.pipe(process.stdout) + result.stdout.pipe(process.stdout) } - result.stderr?.pipe(process.stderr) + result.stderr.pipe(process.stderr) return result } From 62cb87d051c358754a98b5cd44f7d6ec649f4947 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 4 Feb 2021 19:09:42 +0000 Subject: [PATCH 03/43] fix: remove another ? --- actions/bundle-size/action.yml | 2 +- src/build/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/bundle-size/action.yml b/actions/bundle-size/action.yml index 906271345..47f8a23a7 100644 --- a/actions/bundle-size/action.yml +++ b/actions/bundle-size/action.yml @@ -8,5 +8,5 @@ inputs: description: A directory to run the bundle check in required: false runs: - using: 'node14' + using: 'node12' main: 'dist/index.js' diff --git a/src/build/index.js b/src/build/index.js index 4fc7fe85c..cf732e267 100644 --- a/src/build/index.js +++ b/src/build/index.js @@ -32,7 +32,7 @@ module.exports = async (argv) => { if (argv.bundlesize) { // @ts-ignore - if (userConfig.bundlesize?.maxSize) { + if (userConfig.bundlesize && userConfig.bundlesize.maxSize) { throw new Error('Config property `bundlesize.maxSize` is deprecated, use `build.bundlesizeMax`!') } const gzip = await gzipSize(outfile) From 3467aed0f38b1b800b54b95f6ea82c2a39f08830 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 5 Feb 2021 10:30:55 +0000 Subject: [PATCH 04/43] fix: update action --- actions/bundle-size/dist/index.js | 58419 +++++++++++----------------- actions/bundle-size/package.json | 8 +- actions/bundle-size/utils.js | 3 +- 3 files changed, 22494 insertions(+), 35936 deletions(-) diff --git a/actions/bundle-size/dist/index.js b/actions/bundle-size/dist/index.js index 7346e2dee..5b7f75d95 100644 --- a/actions/bundle-size/dist/index.js +++ b/actions/bundle-size/dist/index.js @@ -3,15 +3,15 @@ module.exports = /******/ var __webpack_modules__ = ({ /***/ 32932: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /* eslint-disable no-console */ -const core = __webpack_require__(42186) -const { context, getOctokit } = __webpack_require__(95438) -const { sizeCheck } = __webpack_require__(31252) +const core = __nccwpck_require__(42186) +const { context, getOctokit } = __nccwpck_require__(95438) +const { sizeCheck } = __nccwpck_require__(31252) const run = async () => { try { @@ -28,12 +28,12 @@ run() /***/ }), /***/ 52605: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const artifact_client_1 = __webpack_require__(48802); +const artifact_client_1 = __nccwpck_require__(48802); /** * Constructs an ArtifactClient */ @@ -46,7 +46,7 @@ exports.create = create; /***/ }), /***/ 48802: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -67,14 +67,14 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const core = __importStar(__webpack_require__(42186)); -const upload_specification_1 = __webpack_require__(10183); -const upload_http_client_1 = __webpack_require__(74354); -const utils_1 = __webpack_require__(36327); -const download_http_client_1 = __webpack_require__(8538); -const download_specification_1 = __webpack_require__(95686); -const config_variables_1 = __webpack_require__(42222); -const path_1 = __webpack_require__(85622); +const core = __importStar(__nccwpck_require__(42186)); +const upload_specification_1 = __nccwpck_require__(10183); +const upload_http_client_1 = __nccwpck_require__(74354); +const utils_1 = __nccwpck_require__(36327); +const download_http_client_1 = __nccwpck_require__(8538); +const download_specification_1 = __nccwpck_require__(95686); +const config_variables_1 = __nccwpck_require__(42222); +const path_1 = __nccwpck_require__(85622); class DefaultArtifactClient { /** * Constructs a DefaultArtifactClient @@ -280,7 +280,7 @@ exports.getRetentionDays = getRetentionDays; /***/ }), /***/ 8538: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -301,15 +301,16 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __importStar(__webpack_require__(35747)); -const core = __importStar(__webpack_require__(42186)); -const zlib = __importStar(__webpack_require__(78761)); -const utils_1 = __webpack_require__(36327); -const url_1 = __webpack_require__(78835); -const status_reporter_1 = __webpack_require__(39081); -const perf_hooks_1 = __webpack_require__(70630); -const http_manager_1 = __webpack_require__(16527); -const config_variables_1 = __webpack_require__(42222); +const fs = __importStar(__nccwpck_require__(35747)); +const core = __importStar(__nccwpck_require__(42186)); +const zlib = __importStar(__nccwpck_require__(78761)); +const utils_1 = __nccwpck_require__(36327); +const url_1 = __nccwpck_require__(78835); +const status_reporter_1 = __nccwpck_require__(39081); +const perf_hooks_1 = __nccwpck_require__(70630); +const http_manager_1 = __nccwpck_require__(16527); +const config_variables_1 = __nccwpck_require__(42222); +const requestUtils_1 = __nccwpck_require__(90755); class DownloadHttpClient { constructor() { this.downloadHttpManager = new http_manager_1.HttpManager(config_variables_1.getDownloadFileConcurrency(), '@actions/artifact-download'); @@ -325,13 +326,9 @@ class DownloadHttpClient { // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately const client = this.downloadHttpManager.getClient(0); const headers = utils_1.getDownloadHeaders('application/json'); - const response = yield client.get(artifactUrl, headers); + const response = yield requestUtils_1.retryHttpClientRequest('List Artifacts', () => __awaiter(this, void 0, void 0, function* () { return client.get(artifactUrl, headers); })); const body = yield response.readBody(); - if (utils_1.isSuccessStatusCode(response.message.statusCode) && body) { - return JSON.parse(body); - } - utils_1.displayHttpDiagnostics(response); - throw new Error(`Unable to list artifacts for the run. Resource Url ${artifactUrl}`); + return JSON.parse(body); }); } /** @@ -347,13 +344,9 @@ class DownloadHttpClient { // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately const client = this.downloadHttpManager.getClient(0); const headers = utils_1.getDownloadHeaders('application/json'); - const response = yield client.get(resourceUrl.toString(), headers); + const response = yield requestUtils_1.retryHttpClientRequest('Get Container Items', () => __awaiter(this, void 0, void 0, function* () { return client.get(resourceUrl.toString(), headers); })); const body = yield response.readBody(); - if (utils_1.isSuccessStatusCode(response.message.statusCode) && body) { - return JSON.parse(body); - } - utils_1.displayHttpDiagnostics(response); - throw new Error(`Unable to get ContainersItems from ${resourceUrl}`); + return JSON.parse(body); }); } /** @@ -403,7 +396,7 @@ class DownloadHttpClient { return __awaiter(this, void 0, void 0, function* () { let retryCount = 0; const retryLimit = config_variables_1.getRetryLimit(); - const destinationStream = fs.createWriteStream(downloadPath); + let destinationStream = fs.createWriteStream(downloadPath); const headers = utils_1.getDownloadHeaders('application/json', true, true); // a single GET request is used to download a file const makeDownloadRequest = () => __awaiter(this, void 0, void 0, function* () { @@ -428,22 +421,40 @@ class DownloadHttpClient { if (retryAfterValue) { // Back off by waiting the specified time denoted by the retry-after header core.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the download`); - yield new Promise(resolve => setTimeout(resolve, retryAfterValue)); + yield utils_1.sleep(retryAfterValue); } else { // Back off using an exponential value that depends on the retry count const backoffTime = utils_1.getExponentialRetryTimeInMilliseconds(retryCount); core.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); - yield new Promise(resolve => setTimeout(resolve, backoffTime)); + yield utils_1.sleep(backoffTime); } core.info(`Finished backoff for retry #${retryCount}, continuing with download`); } }); + const isAllBytesReceived = (expected, received) => { + // be lenient, if any input is missing, assume success, i.e. not truncated + if (!expected || + !received || + process.env['ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION']) { + core.info('Skipping download validation.'); + return true; + } + return parseInt(expected) === received; + }; + const resetDestinationStream = (fileDownloadPath) => __awaiter(this, void 0, void 0, function* () { + destinationStream.close(); + yield utils_1.rmFile(fileDownloadPath); + destinationStream = fs.createWriteStream(fileDownloadPath); + }); // keep trying to download a file until a retry limit has been reached while (retryCount <= retryLimit) { let response; try { response = yield makeDownloadRequest(); + if (core.isDebug()) { + utils_1.displayHttpDiagnostics(response); + } } catch (error) { // if an error is caught, it is usually indicative of a timeout so retry the download @@ -454,14 +465,30 @@ class DownloadHttpClient { yield backOff(); continue; } + let forceRetry = false; if (utils_1.isSuccessStatusCode(response.message.statusCode)) { // The body contains the contents of the file however calling response.readBody() causes all the content to be converted to a string // which can cause some gzip encoded data to be lost // Instead of using response.readBody(), response.message is a readableStream that can be directly used to get the raw body contents - return this.pipeResponseToFile(response, destinationStream, isGzip(response.message.headers)); + try { + const isGzipped = isGzip(response.message.headers); + yield this.pipeResponseToFile(response, destinationStream, isGzipped); + if (isGzipped || + isAllBytesReceived(response.message.headers['content-length'], yield utils_1.getFileSize(downloadPath))) { + return; + } + else { + forceRetry = true; + } + } + catch (error) { + // retry on error, most likely streams were corrupted + forceRetry = true; + } } - else if (utils_1.isRetryableStatusCode(response.message.statusCode)) { + if (forceRetry || utils_1.isRetryableStatusCode(response.message.statusCode)) { core.info(`A ${response.message.statusCode} response code has been received while attempting to download an artifact`); + resetDestinationStream(downloadPath); // if a throttled status code is received, try to get the retryAfter header value, else differ to standard exponential backoff utils_1.isThrottledStatusCode(response.message.statusCode) ? yield backOff(utils_1.tryGetRetryAfterValueTimeInMilliseconds(response.message.headers)) @@ -487,24 +514,40 @@ class DownloadHttpClient { if (isGzip) { const gunzip = zlib.createGunzip(); response.message + .on('error', error => { + core.error(`An error occurred while attempting to read the response stream`); + gunzip.close(); + destinationStream.close(); + reject(error); + }) .pipe(gunzip) + .on('error', error => { + core.error(`An error occurred while attempting to decompress the response stream`); + destinationStream.close(); + reject(error); + }) .pipe(destinationStream) .on('close', () => { resolve(); }) .on('error', error => { - core.error(`An error has been encountered while decompressing and writing a downloaded file to ${destinationStream.path}`); + core.error(`An error occurred while writing a downloaded file to ${destinationStream.path}`); reject(error); }); } else { response.message + .on('error', error => { + core.error(`An error occurred while attempting to read the response stream`); + destinationStream.close(); + reject(error); + }) .pipe(destinationStream) .on('close', () => { resolve(); }) .on('error', error => { - core.error(`An error has been encountered while writing a downloaded file to ${destinationStream.path}`); + core.error(`An error occurred while writing a downloaded file to ${destinationStream.path}`); reject(error); }); } @@ -519,7 +562,7 @@ exports.DownloadHttpClient = DownloadHttpClient; /***/ }), /***/ 95686: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -531,7 +574,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __importStar(__webpack_require__(85622)); +const path = __importStar(__nccwpck_require__(85622)); /** * Creates a specification for a set of files that will be downloaded * @param artifactName the name of the artifact @@ -587,12 +630,12 @@ exports.getDownloadSpecification = getDownloadSpecification; /***/ }), /***/ 16527: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils_1 = __webpack_require__(36327); +const utils_1 = __nccwpck_require__(36327); /** * Used for managing http clients during either upload or download */ @@ -624,13 +667,95 @@ exports.HttpManager = HttpManager; /***/ }), +/***/ 90755: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils_1 = __nccwpck_require__(36327); +const core = __importStar(__nccwpck_require__(42186)); +const config_variables_1 = __nccwpck_require__(42222); +function retry(name, operation, customErrorMessages, maxAttempts) { + return __awaiter(this, void 0, void 0, function* () { + let response = undefined; + let statusCode = undefined; + let isRetryable = false; + let errorMessage = ''; + let customErrorInformation = undefined; + let attempt = 1; + while (attempt <= maxAttempts) { + try { + response = yield operation(); + statusCode = response.message.statusCode; + if (utils_1.isSuccessStatusCode(statusCode)) { + return response; + } + // Extra error information that we want to display if a particular response code is hit + if (statusCode) { + customErrorInformation = customErrorMessages.get(statusCode); + } + isRetryable = utils_1.isRetryableStatusCode(statusCode); + errorMessage = `Artifact service responded with ${statusCode}`; + } + catch (error) { + isRetryable = true; + errorMessage = error.message; + } + if (!isRetryable) { + core.info(`${name} - Error is not retryable`); + if (response) { + utils_1.displayHttpDiagnostics(response); + } + break; + } + core.info(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + yield utils_1.sleep(utils_1.getExponentialRetryTimeInMilliseconds(attempt)); + attempt++; + } + if (response) { + utils_1.displayHttpDiagnostics(response); + } + if (customErrorInformation) { + throw Error(`${name} failed: ${customErrorInformation}`); + } + throw Error(`${name} failed: ${errorMessage}`); + }); +} +exports.retry = retry; +function retryHttpClientRequest(name, method, customErrorMessages = new Map(), maxAttempts = config_variables_1.getRetryLimit()) { + return __awaiter(this, void 0, void 0, function* () { + return yield retry(name, method, customErrorMessages, maxAttempts); + }); +} +exports.retryHttpClientRequest = retryHttpClientRequest; +//# sourceMappingURL=requestUtils.js.map + +/***/ }), + /***/ 39081: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const core_1 = __webpack_require__(42186); +const core_1 = __nccwpck_require__(42186); /** * Status Reporter that displays information about the progress/status of an artifact that is being uploaded or downloaded * @@ -696,7 +821,7 @@ exports.StatusReporter = StatusReporter; /***/ }), /***/ 40606: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -724,9 +849,9 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __importStar(__webpack_require__(35747)); -const zlib = __importStar(__webpack_require__(78761)); -const util_1 = __webpack_require__(31669); +const fs = __importStar(__nccwpck_require__(35747)); +const zlib = __importStar(__nccwpck_require__(78761)); +const util_1 = __nccwpck_require__(31669); const stat = util_1.promisify(fs.stat); /** * Creates a Gzip compressed file of an original file at the provided temporary filepath location @@ -792,7 +917,7 @@ exports.createGZipFileInBuffer = createGZipFileInBuffer; /***/ }), /***/ 74354: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -813,18 +938,20 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __importStar(__webpack_require__(35747)); -const core = __importStar(__webpack_require__(42186)); -const tmp = __importStar(__webpack_require__(68065)); -const stream = __importStar(__webpack_require__(92413)); -const utils_1 = __webpack_require__(36327); -const config_variables_1 = __webpack_require__(42222); -const util_1 = __webpack_require__(31669); -const url_1 = __webpack_require__(78835); -const perf_hooks_1 = __webpack_require__(70630); -const status_reporter_1 = __webpack_require__(39081); -const http_manager_1 = __webpack_require__(16527); -const upload_gzip_1 = __webpack_require__(40606); +const fs = __importStar(__nccwpck_require__(35747)); +const core = __importStar(__nccwpck_require__(42186)); +const tmp = __importStar(__nccwpck_require__(68065)); +const stream = __importStar(__nccwpck_require__(92413)); +const utils_1 = __nccwpck_require__(36327); +const config_variables_1 = __nccwpck_require__(42222); +const util_1 = __nccwpck_require__(31669); +const url_1 = __nccwpck_require__(78835); +const perf_hooks_1 = __nccwpck_require__(70630); +const status_reporter_1 = __nccwpck_require__(39081); +const http_client_1 = __nccwpck_require__(39925); +const http_manager_1 = __nccwpck_require__(16527); +const upload_gzip_1 = __nccwpck_require__(40606); +const requestUtils_1 = __nccwpck_require__(90755); const stat = util_1.promisify(fs.stat); class UploadHttpClient { constructor() { @@ -852,20 +979,22 @@ class UploadHttpClient { // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately const client = this.uploadHttpManager.getClient(0); const headers = utils_1.getUploadHeaders('application/json', false); - const rawResponse = yield client.post(artifactUrl, data, headers); - const body = yield rawResponse.readBody(); - if (utils_1.isSuccessStatusCode(rawResponse.message.statusCode) && body) { - return JSON.parse(body); - } - else if (utils_1.isForbiddenStatusCode(rawResponse.message.statusCode)) { - // if a 403 is returned when trying to create a file container, the customer has exceeded - // their storage quota so no new artifact containers can be created - throw new Error(`Artifact storage quota has been hit. Unable to upload any new artifacts`); - } - else { - utils_1.displayHttpDiagnostics(rawResponse); - throw new Error(`Unable to create a container for the artifact ${artifactName} at ${artifactUrl}`); - } + // Extra information to display when a particular HTTP code is returned + // If a 403 is returned when trying to create a file container, the customer has exceeded + // their storage quota so no new artifact containers can be created + const customErrorMessages = new Map([ + [ + http_client_1.HttpCodes.Forbidden, + 'Artifact storage quota has been hit. Unable to upload any new artifacts' + ], + [ + http_client_1.HttpCodes.BadRequest, + `The artifact name ${artifactName} is not valid. Request URL ${artifactUrl}` + ] + ]); + const response = yield requestUtils_1.retryHttpClientRequest('Create Artifact Container', () => __awaiter(this, void 0, void 0, function* () { return client.post(artifactUrl, data, headers); }), customErrorMessages); + const body = yield response.readBody(); + return JSON.parse(body); }); } /** @@ -1089,12 +1218,12 @@ class UploadHttpClient { this.uploadHttpManager.disposeAndReplaceClient(httpClientIndex); if (retryAfterValue) { core.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the upload`); - yield new Promise(resolve => setTimeout(resolve, retryAfterValue)); + yield utils_1.sleep(retryAfterValue); } else { const backoffTime = utils_1.getExponentialRetryTimeInMilliseconds(retryCount); core.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); - yield new Promise(resolve => setTimeout(resolve, backoffTime)); + yield utils_1.sleep(backoffTime); } core.info(`Finished backoff for retry #${retryCount}, continuing with upload`); return; @@ -1146,7 +1275,6 @@ class UploadHttpClient { */ patchArtifactSize(size, artifactName) { return __awaiter(this, void 0, void 0, function* () { - const headers = utils_1.getUploadHeaders('application/json', false); const resourceUrl = new url_1.URL(utils_1.getArtifactUrl()); resourceUrl.searchParams.append('artifactName', artifactName); const parameters = { Size: size }; @@ -1154,19 +1282,18 @@ class UploadHttpClient { core.debug(`URL is ${resourceUrl.toString()}`); // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately const client = this.uploadHttpManager.getClient(0); - const response = yield client.patch(resourceUrl.toString(), data, headers); - const body = yield response.readBody(); - if (utils_1.isSuccessStatusCode(response.message.statusCode)) { - core.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); - } - else if (response.message.statusCode === 404) { - throw new Error(`An Artifact with the name ${artifactName} was not found`); - } - else { - utils_1.displayHttpDiagnostics(response); - core.info(body); - throw new Error(`Unable to finish uploading artifact ${artifactName} to ${resourceUrl}`); - } + const headers = utils_1.getUploadHeaders('application/json', false); + // Extra information to display when a particular HTTP code is returned + const customErrorMessages = new Map([ + [ + http_client_1.HttpCodes.NotFound, + `An Artifact with the name ${artifactName} was not found` + ] + ]); + // TODO retry for all possible response codes, the artifact upload is pretty much complete so it at all costs we should try to finish this + const response = yield requestUtils_1.retryHttpClientRequest('Finalize artifact upload', () => __awaiter(this, void 0, void 0, function* () { return client.patch(resourceUrl.toString(), data, headers); }), customErrorMessages); + yield response.readBody(); + core.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); }); } } @@ -1176,7 +1303,7 @@ exports.UploadHttpClient = UploadHttpClient; /***/ }), /***/ 10183: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1188,10 +1315,10 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __importStar(__webpack_require__(35747)); -const core_1 = __webpack_require__(42186); -const path_1 = __webpack_require__(85622); -const utils_1 = __webpack_require__(36327); +const fs = __importStar(__nccwpck_require__(35747)); +const core_1 = __nccwpck_require__(42186); +const path_1 = __nccwpck_require__(85622); +const utils_1 = __nccwpck_require__(36327); /** * Creates a specification that describes how each file that is part of the artifact will be uploaded * @param artifactName the name of the artifact being uploaded. Used during upload to denote where the artifact is stored on the server @@ -1271,7 +1398,7 @@ exports.getUploadSpecification = getUploadSpecification; /***/ }), /***/ 36327: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1285,11 +1412,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const core_1 = __webpack_require__(42186); -const fs_1 = __webpack_require__(35747); -const http_client_1 = __webpack_require__(39925); -const auth_1 = __webpack_require__(23702); -const config_variables_1 = __webpack_require__(42222); +const core_1 = __nccwpck_require__(42186); +const fs_1 = __nccwpck_require__(35747); +const http_client_1 = __nccwpck_require__(39925); +const auth_1 = __nccwpck_require__(23702); +const config_variables_1 = __nccwpck_require__(42222); /** * Returns a retry time in milliseconds that exponentially gets larger * depending on the amount of retries that have been attempted @@ -1542,6 +1669,20 @@ function createEmptyFilesForArtifact(emptyFilesToCreate) { }); } exports.createEmptyFilesForArtifact = createEmptyFilesForArtifact; +function getFileSize(filePath) { + return __awaiter(this, void 0, void 0, function* () { + const stats = yield fs_1.promises.stat(filePath); + core_1.debug(`${filePath} size:(${stats.size}) blksize:(${stats.blksize}) blocks:(${stats.blocks})`); + return stats.size; + }); +} +exports.getFileSize = getFileSize; +function rmFile(filePath) { + return __awaiter(this, void 0, void 0, function* () { + yield fs_1.promises.unlink(filePath); + }); +} +exports.rmFile = rmFile; function getProperRetention(retentionInput, retentionSetting) { if (retentionInput < 0) { throw new Error('Invalid retention, minimum value is 1.'); @@ -1557,12 +1698,18 @@ function getProperRetention(retentionInput, retentionSetting) { return retention; } exports.getProperRetention = getProperRetention; +function sleep(milliseconds) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise(resolve => setTimeout(resolve, milliseconds)); + }); +} +exports.sleep = sleep; //# sourceMappingURL=utils.js.map /***/ }), /***/ 87351: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1574,8 +1721,8 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const os = __importStar(__webpack_require__(12087)); -const utils_1 = __webpack_require__(5278); +const os = __importStar(__nccwpck_require__(12087)); +const utils_1 = __nccwpck_require__(5278); /** * Commands * @@ -1648,7 +1795,7 @@ function escapeProperty(s) { /***/ }), /***/ 42186: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1669,11 +1816,11 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const command_1 = __webpack_require__(87351); -const file_command_1 = __webpack_require__(717); -const utils_1 = __webpack_require__(5278); -const os = __importStar(__webpack_require__(12087)); -const path = __importStar(__webpack_require__(85622)); +const command_1 = __nccwpck_require__(87351); +const file_command_1 = __nccwpck_require__(717); +const utils_1 = __nccwpck_require__(5278); +const os = __importStar(__nccwpck_require__(12087)); +const path = __importStar(__nccwpck_require__(85622)); /** * The code to exit an action */ @@ -1893,7 +2040,7 @@ exports.getState = getState; /***/ }), /***/ 717: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1908,9 +2055,9 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__webpack_require__(35747)); -const os = __importStar(__webpack_require__(12087)); -const utils_1 = __webpack_require__(5278); +const fs = __importStar(__nccwpck_require__(35747)); +const os = __importStar(__nccwpck_require__(12087)); +const utils_1 = __nccwpck_require__(5278); function issueCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -1955,14 +2102,14 @@ exports.toCommandValue = toCommandValue; /***/ }), /***/ 74087: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Context = void 0; -const fs_1 = __webpack_require__(35747); -const os_1 = __webpack_require__(12087); +const fs_1 = __nccwpck_require__(35747); +const os_1 = __nccwpck_require__(12087); class Context { /** * Hydrate the context from the environment @@ -2012,7 +2159,7 @@ exports.Context = Context; /***/ }), /***/ 95438: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2037,8 +2184,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokit = exports.context = void 0; -const Context = __importStar(__webpack_require__(74087)); -const utils_1 = __webpack_require__(73030); +const Context = __importStar(__nccwpck_require__(74087)); +const utils_1 = __nccwpck_require__(73030); exports.context = new Context.Context(); /** * Returns a hydrated octokit ready to use for GitHub Actions @@ -2055,7 +2202,7 @@ exports.getOctokit = getOctokit; /***/ }), /***/ 47914: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2080,7 +2227,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0; -const httpClient = __importStar(__webpack_require__(39925)); +const httpClient = __importStar(__nccwpck_require__(39925)); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); @@ -2105,7 +2252,7 @@ exports.getApiBaseUrl = getApiBaseUrl; /***/ }), /***/ 73030: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2130,12 +2277,12 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokitOptions = exports.GitHub = exports.context = void 0; -const Context = __importStar(__webpack_require__(74087)); -const Utils = __importStar(__webpack_require__(47914)); +const Context = __importStar(__nccwpck_require__(74087)); +const Utils = __importStar(__nccwpck_require__(47914)); // octokit + plugins -const core_1 = __webpack_require__(76762); -const plugin_rest_endpoint_methods_1 = __webpack_require__(83044); -const plugin_paginate_rest_1 = __webpack_require__(64193); +const core_1 = __nccwpck_require__(76762); +const plugin_rest_endpoint_methods_1 = __nccwpck_require__(83044); +const plugin_paginate_rest_1 = __nccwpck_require__(64193); exports.context = new Context.Context(); const baseUrl = Utils.getApiBaseUrl(); const defaults = { @@ -2232,14 +2379,14 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), /***/ 39925: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const http = __webpack_require__(98605); -const https = __webpack_require__(57211); -const pm = __webpack_require__(16443); +const http = __nccwpck_require__(98605); +const https = __nccwpck_require__(57211); +const pm = __nccwpck_require__(16443); let tunnel; var HttpCodes; (function (HttpCodes) { @@ -2658,7 +2805,7 @@ class HttpClient { if (useProxy) { // If using proxy, need tunnel if (!tunnel) { - tunnel = __webpack_require__(74294); + tunnel = __nccwpck_require__(74294); } const agentOptions = { maxSockets: maxSockets, @@ -2840,7 +2987,7 @@ exports.checkBypass = checkBypass; /***/ }), /***/ 45211: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2851,7 +2998,7 @@ Object.defineProperty(exports, "__esModule", ({ exports.codeFrameColumns = codeFrameColumns; exports.default = _default; -var _highlight = _interopRequireWildcard(__webpack_require__(36860)); +var _highlight = _interopRequireWildcard(__nccwpck_require__(36860)); function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } @@ -3098,7 +3245,7 @@ function isIdentifierName(name) { /***/ }), /***/ 86607: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3155,9 +3302,9 @@ Object.defineProperty(exports, "isKeyword", ({ } })); -var _identifier = __webpack_require__(66396); +var _identifier = __nccwpck_require__(66396); -var _keyword = __webpack_require__(47249); +var _keyword = __nccwpck_require__(47249); /***/ }), @@ -3207,7 +3354,7 @@ function isKeyword(word) { /***/ }), /***/ 36860: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3219,11 +3366,11 @@ exports.shouldHighlight = shouldHighlight; exports.getChalk = getChalk; exports.default = highlight; -var _jsTokens = _interopRequireWildcard(__webpack_require__(51531)); +var _jsTokens = _interopRequireWildcard(__nccwpck_require__(51531)); -var _helperValidatorIdentifier = __webpack_require__(86607); +var _helperValidatorIdentifier = __nccwpck_require__(86607); -var _chalk = _interopRequireDefault(__webpack_require__(38707)); +var _chalk = _interopRequireDefault(__nccwpck_require__(38707)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -3321,12 +3468,12 @@ function highlight(code, options = {}) { /***/ }), /***/ 63803: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(35747); +const fs = __nccwpck_require__(35747); exports.FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, stat: fs.stat, @@ -3368,14 +3515,14 @@ exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_B /***/ }), /***/ 75667: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const async = __webpack_require__(84507); -const sync = __webpack_require__(69560); -const settings_1 = __webpack_require__(88662); +const async = __nccwpck_require__(84507); +const sync = __nccwpck_require__(69560); +const settings_1 = __nccwpck_require__(88662); exports.Settings = settings_1.default; function scandir(path, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { @@ -3400,15 +3547,15 @@ function getSettings(settingsOrOptions = {}) { /***/ }), /***/ 84507: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsStat = __webpack_require__(70109); -const rpl = __webpack_require__(75288); -const constants_1 = __webpack_require__(18838); -const utils = __webpack_require__(16297); +const fsStat = __nccwpck_require__(70109); +const rpl = __nccwpck_require__(75288); +const constants_1 = __nccwpck_require__(18838); +const utils = __nccwpck_require__(16297); function read(directory, settings, callback) { if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { return readdirWithFileTypes(directory, settings, callback); @@ -3498,14 +3645,14 @@ function callSuccessCallback(callback, result) { /***/ }), /***/ 69560: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsStat = __webpack_require__(70109); -const constants_1 = __webpack_require__(18838); -const utils = __webpack_require__(16297); +const fsStat = __nccwpck_require__(70109); +const constants_1 = __nccwpck_require__(18838); +const utils = __nccwpck_require__(16297); function read(directory, settings) { if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { return readdirWithFileTypes(directory, settings); @@ -3558,14 +3705,14 @@ exports.readdir = readdir; /***/ }), /***/ 88662: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); -const fsStat = __webpack_require__(70109); -const fs = __webpack_require__(63803); +const path = __nccwpck_require__(85622); +const fsStat = __nccwpck_require__(70109); +const fs = __nccwpck_require__(63803); class Settings { constructor(_options = {}) { this._options = _options; @@ -3616,24 +3763,24 @@ exports.createDirentFromStats = createDirentFromStats; /***/ }), /***/ 16297: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(60883); +const fs = __nccwpck_require__(60883); exports.fs = fs; /***/ }), /***/ 32987: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(35747); +const fs = __nccwpck_require__(35747); exports.FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, stat: fs.stat, @@ -3652,14 +3799,14 @@ exports.createFileSystemAdapter = createFileSystemAdapter; /***/ }), /***/ 70109: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const async = __webpack_require__(34147); -const sync = __webpack_require__(34527); -const settings_1 = __webpack_require__(12410); +const async = __nccwpck_require__(34147); +const sync = __nccwpck_require__(34527); +const settings_1 = __nccwpck_require__(12410); exports.Settings = settings_1.default; function stat(path, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { @@ -3753,12 +3900,12 @@ exports.read = read; /***/ }), /***/ 12410: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(32987); +const fs = __nccwpck_require__(32987); class Settings { constructor(_options = {}) { this._options = _options; @@ -3777,15 +3924,15 @@ exports.default = Settings; /***/ }), /***/ 26026: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const async_1 = __webpack_require__(77523); -const stream_1 = __webpack_require__(96737); -const sync_1 = __webpack_require__(13068); -const settings_1 = __webpack_require__(50141); +const async_1 = __nccwpck_require__(77523); +const stream_1 = __nccwpck_require__(96737); +const sync_1 = __nccwpck_require__(13068); +const settings_1 = __nccwpck_require__(50141); exports.Settings = settings_1.default; function walk(directory, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { @@ -3817,12 +3964,12 @@ function getSettings(settingsOrOptions = {}) { /***/ }), /***/ 77523: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const async_1 = __webpack_require__(55732); +const async_1 = __nccwpck_require__(55732); class AsyncProvider { constructor(_root, _settings) { this._root = _root; @@ -3855,13 +4002,13 @@ function callSuccessCallback(callback, entries) { /***/ }), /***/ 96737: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __webpack_require__(92413); -const async_1 = __webpack_require__(55732); +const stream_1 = __nccwpck_require__(92413); +const async_1 = __nccwpck_require__(55732); class StreamProvider { constructor(_root, _settings) { this._root = _root; @@ -3893,12 +4040,12 @@ exports.default = StreamProvider; /***/ }), /***/ 13068: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const sync_1 = __webpack_require__(13595); +const sync_1 = __nccwpck_require__(13595); class SyncProvider { constructor(_root, _settings) { this._root = _root; @@ -3915,16 +4062,16 @@ exports.default = SyncProvider; /***/ }), /***/ 55732: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const events_1 = __webpack_require__(28614); -const fsScandir = __webpack_require__(75667); -const fastq = __webpack_require__(7340); -const common = __webpack_require__(97988); -const reader_1 = __webpack_require__(88311); +const events_1 = __nccwpck_require__(28614); +const fsScandir = __nccwpck_require__(75667); +const fastq = __nccwpck_require__(7340); +const common = __nccwpck_require__(97988); +const reader_1 = __nccwpck_require__(88311); class AsyncReader extends reader_1.default { constructor(_root, _settings) { super(_root, _settings); @@ -4048,12 +4195,12 @@ exports.joinPathSegments = joinPathSegments; /***/ }), /***/ 88311: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const common = __webpack_require__(97988); +const common = __nccwpck_require__(97988); class Reader { constructor(_root, _settings) { this._root = _root; @@ -4067,14 +4214,14 @@ exports.default = Reader; /***/ }), /***/ 13595: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsScandir = __webpack_require__(75667); -const common = __webpack_require__(97988); -const reader_1 = __webpack_require__(88311); +const fsScandir = __nccwpck_require__(75667); +const common = __nccwpck_require__(97988); +const reader_1 = __nccwpck_require__(88311); class SyncReader extends reader_1.default { constructor() { super(...arguments); @@ -4134,13 +4281,13 @@ exports.default = SyncReader; /***/ }), /***/ 50141: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); -const fsScandir = __webpack_require__(75667); +const path = __nccwpck_require__(85622); +const fsScandir = __nccwpck_require__(75667); class Settings { constructor(_options = {}) { this._options = _options; @@ -4225,18 +4372,18 @@ exports.createTokenAuth = createTokenAuth; /***/ }), /***/ 76762: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -var universalUserAgent = __webpack_require__(77540); -var beforeAfterHook = __webpack_require__(83682); -var request = __webpack_require__(36234); -var graphql = __webpack_require__(88467); -var authToken = __webpack_require__(40334); +var universalUserAgent = __nccwpck_require__(77540); +var beforeAfterHook = __nccwpck_require__(83682); +var request = __nccwpck_require__(36234); +var graphql = __nccwpck_require__(88467); +var authToken = __nccwpck_require__(40334); function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; @@ -4433,7 +4580,7 @@ exports.getUserAgent = getUserAgent; /***/ }), /***/ 59440: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4442,8 +4589,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var isPlainObject = _interopDefault(__webpack_require__(48840)); -var universalUserAgent = __webpack_require__(45030); +var isPlainObject = _interopDefault(__nccwpck_require__(48840)); +var universalUserAgent = __nccwpck_require__(45030); function lowercaseKeys(object) { if (!object) { @@ -4820,15 +4967,15 @@ exports.endpoint = endpoint; /***/ }), /***/ 88467: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -var request = __webpack_require__(63758); -var universalUserAgent = __webpack_require__(45030); +var request = __nccwpck_require__(63758); +var universalUserAgent = __nccwpck_require__(45030); const VERSION = "4.5.0"; @@ -4913,7 +5060,7 @@ exports.withCustomRequest = withCustomRequest; /***/ }), /***/ 63758: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4922,11 +5069,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var endpoint = __webpack_require__(59440); -var universalUserAgent = __webpack_require__(45030); -var isPlainObject = _interopDefault(__webpack_require__(48840)); -var nodeFetch = _interopDefault(__webpack_require__(55655)); -var requestError = __webpack_require__(10537); +var endpoint = __nccwpck_require__(59440); +var universalUserAgent = __nccwpck_require__(45030); +var isPlainObject = _interopDefault(__nccwpck_require__(48840)); +var nodeFetch = _interopDefault(__nccwpck_require__(55655)); +var requestError = __nccwpck_require__(10537); const VERSION = "5.4.4"; @@ -5069,7 +5216,7 @@ exports.request = request; /***/ }), /***/ 55655: -/***/ ((module, exports, __webpack_require__) => { +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; @@ -5078,11 +5225,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var Stream = _interopDefault(__webpack_require__(92413)); -var http = _interopDefault(__webpack_require__(98605)); -var Url = _interopDefault(__webpack_require__(78835)); -var https = _interopDefault(__webpack_require__(57211)); -var zlib = _interopDefault(__webpack_require__(78761)); +var Stream = _interopDefault(__nccwpck_require__(92413)); +var http = _interopDefault(__nccwpck_require__(98605)); +var Url = _interopDefault(__nccwpck_require__(78835)); +var https = _interopDefault(__nccwpck_require__(57211)); +var zlib = _interopDefault(__nccwpck_require__(78761)); // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js @@ -5233,7 +5380,7 @@ FetchError.prototype.name = 'FetchError'; let convert; try { - convert = __webpack_require__(85100)/* .convert */ .O; + convert = __nccwpck_require__(85100)/* .convert */ .O; } catch (e) {} const INTERNALS = Symbol('Body internals'); @@ -8021,7 +8168,7 @@ exports.restEndpointMethods = restEndpointMethods; /***/ }), /***/ 10537: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -8030,8 +8177,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var deprecation = __webpack_require__(58932); -var once = _interopDefault(__webpack_require__(1223)); +var deprecation = __nccwpck_require__(58932); +var once = _interopDefault(__nccwpck_require__(1223)); const logOnce = once(deprecation => console.warn(deprecation)); /** @@ -8084,7 +8231,7 @@ exports.RequestError = RequestError; /***/ }), /***/ 36234: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -8093,11 +8240,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var endpoint = __webpack_require__(59440); -var universalUserAgent = __webpack_require__(41441); -var isPlainObject = __webpack_require__(49062); -var nodeFetch = _interopDefault(__webpack_require__(80467)); -var requestError = __webpack_require__(30013); +var endpoint = __nccwpck_require__(59440); +var universalUserAgent = __nccwpck_require__(41441); +var isPlainObject = __nccwpck_require__(49062); +var nodeFetch = _interopDefault(__nccwpck_require__(80467)); +var requestError = __nccwpck_require__(30013); const VERSION = "5.4.10"; @@ -8240,7 +8387,7 @@ exports.request = request; /***/ }), /***/ 30013: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -8249,8 +8396,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var deprecation = __webpack_require__(58932); -var once = _interopDefault(__webpack_require__(1223)); +var deprecation = __nccwpck_require__(58932); +var once = _interopDefault(__nccwpck_require__(1223)); const logOnce = once(deprecation => console.warn(deprecation)); /** @@ -8375,12 +8522,12 @@ exports.getUserAgent = getUserAgent; /***/ }), /***/ 52068: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/* module decorator */ module = __webpack_require__.nmd(module); +/* module decorator */ module = __nccwpck_require__.nmd(module); -const colorConvert = __webpack_require__(86931); +const colorConvert = __nccwpck_require__(86931); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); @@ -8629,11 +8776,11 @@ function range(a, b, str) { /***/ }), /***/ 83682: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var register = __webpack_require__(44670) -var addHook = __webpack_require__(5549) -var removeHook = __webpack_require__(6819) +var register = __nccwpck_require__(44670) +var addHook = __nccwpck_require__(5549) +var removeHook = __nccwpck_require__(6819) // bind with array of arguments: https://stackoverflow.com/a/21792913 var bind = Function.bind @@ -8805,10 +8952,10 @@ function removeHook (state, name, method) { /***/ }), /***/ 33717: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var concatMap = __webpack_require__(86891); -var balanced = __webpack_require__(9417); +var concatMap = __nccwpck_require__(86891); +var balanced = __nccwpck_require__(9417); module.exports = expandTop; @@ -9013,15 +9160,15 @@ function expand(str, isTop) { /***/ }), /***/ 50610: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const stringify = __webpack_require__(38750); -const compile = __webpack_require__(79434); -const expand = __webpack_require__(35873); -const parse = __webpack_require__(96477); +const stringify = __nccwpck_require__(38750); +const compile = __nccwpck_require__(79434); +const expand = __nccwpck_require__(35873); +const parse = __nccwpck_require__(96477); /** * Expand the given pattern or create a regex-compatible string. @@ -9191,13 +9338,13 @@ module.exports = braces; /***/ }), /***/ 79434: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fill = __webpack_require__(6330); -const utils = __webpack_require__(45207); +const fill = __nccwpck_require__(6330); +const utils = __nccwpck_require__(45207); const compile = (ast, options = {}) => { let walk = (node, parent = {}) => { @@ -9321,14 +9468,14 @@ module.exports = { /***/ }), /***/ 35873: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fill = __webpack_require__(6330); -const stringify = __webpack_require__(38750); -const utils = __webpack_require__(45207); +const fill = __nccwpck_require__(6330); +const stringify = __nccwpck_require__(38750); +const utils = __nccwpck_require__(45207); const append = (queue = '', stash = '', enclose = false) => { let result = []; @@ -9442,12 +9589,12 @@ module.exports = expand; /***/ }), /***/ 96477: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const stringify = __webpack_require__(38750); +const stringify = __nccwpck_require__(38750); /** * Constants @@ -9469,7 +9616,7 @@ const { CHAR_SINGLE_QUOTE, /* ' */ CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = __webpack_require__(18774); +} = __nccwpck_require__(18774); /** * parse @@ -9783,12 +9930,12 @@ module.exports = parse; /***/ }), /***/ 38750: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const utils = __webpack_require__(45207); +const utils = __nccwpck_require__(45207); module.exports = (ast, options = {}) => { let stringify = (node, parent = {}) => { @@ -9943,15 +10090,15 @@ exports.flatten = (...args) => { /***/ }), /***/ 38707: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const escapeStringRegexp = __webpack_require__(98691); -const ansiStyles = __webpack_require__(52068); -const stdoutColor = __webpack_require__(59318).stdout; +const escapeStringRegexp = __nccwpck_require__(98691); +const ansiStyles = __nccwpck_require__(52068); +const stdoutColor = __nccwpck_require__(59318).stdout; -const template = __webpack_require__(52138); +const template = __nccwpck_require__(52138); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -10315,10 +10462,10 @@ module.exports = (chalk, tmp) => { /***/ }), /***/ 97391: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* MIT license */ -var cssKeywords = __webpack_require__(78510); +var cssKeywords = __nccwpck_require__(78510); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). @@ -11190,10 +11337,10 @@ convert.rgb.gray = function (rgb) { /***/ }), /***/ 86931: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var conversions = __webpack_require__(97391); -var route = __webpack_require__(30880); +var conversions = __nccwpck_require__(97391); +var route = __nccwpck_require__(30880); var convert = {}; @@ -11275,9 +11422,9 @@ module.exports = convert; /***/ }), /***/ 30880: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var conversions = __webpack_require__(97391); +var conversions = __nccwpck_require__(97391); /* this function routes a model to all other models. @@ -11559,14 +11706,14 @@ var isArray = Array.isArray || function (xs) { /***/ }), /***/ 72746: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const cp = __webpack_require__(63129); -const parse = __webpack_require__(66855); -const enoent = __webpack_require__(44101); +const cp = __nccwpck_require__(63129); +const parse = __nccwpck_require__(66855); +const enoent = __nccwpck_require__(44101); function spawn(command, args, options) { // Parse the arguments @@ -11673,15 +11820,15 @@ module.exports = { /***/ }), /***/ 66855: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const resolveCommand = __webpack_require__(87274); -const escape = __webpack_require__(34274); -const readShebang = __webpack_require__(41252); +const path = __nccwpck_require__(85622); +const resolveCommand = __nccwpck_require__(87274); +const escape = __nccwpck_require__(34274); +const readShebang = __nccwpck_require__(41252); const isWin = process.platform === 'win32'; const isExecutableRegExp = /\.(?:com|exe)$/i; @@ -11825,13 +11972,13 @@ module.exports.argument = escapeArgument; /***/ }), /***/ 41252: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const shebangCommand = __webpack_require__(67032); +const fs = __nccwpck_require__(35747); +const shebangCommand = __nccwpck_require__(67032); function readShebang(command) { // Read the first 150 bytes from the file @@ -11856,14 +12003,14 @@ module.exports = readShebang; /***/ }), /***/ 87274: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const which = __webpack_require__(34207); -const getPathKey = __webpack_require__(29060); +const path = __nccwpck_require__(85622); +const which = __nccwpck_require__(34207); +const getPathKey = __nccwpck_require__(29060); function resolveCommandAttempt(parsed, withoutPathExt) { const env = parsed.options.env || process.env; @@ -11968,12 +12115,12 @@ exports.Deprecation = Deprecation; /***/ }), /***/ 12738: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const pathType = __webpack_require__(63433); +const path = __nccwpck_require__(85622); +const pathType = __nccwpck_require__(63433); const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0]; @@ -12051,9 +12198,9 @@ module.exports.sync = (input, options) => { /***/ }), /***/ 81205: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var once = __webpack_require__(1223); +var once = __nccwpck_require__(1223); var noop = function() {}; @@ -12152,13 +12299,13 @@ module.exports = eos; /***/ }), /***/ 23505: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var util = __webpack_require__(31669); -var isArrayish = __webpack_require__(7604); +var util = __nccwpck_require__(31669); +var isArrayish = __nccwpck_require__(7604); var errorEx = function errorEx(name, properties) { if (!name || name.constructor !== String) { @@ -12320,22 +12467,22 @@ module.exports = function (str) { /***/ }), /***/ 55447: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const childProcess = __webpack_require__(63129); -const crossSpawn = __webpack_require__(72746); -const stripFinalNewline = __webpack_require__(88174); -const npmRunPath = __webpack_require__(20502); -const onetime = __webpack_require__(89082); -const makeError = __webpack_require__(62187); -const normalizeStdio = __webpack_require__(10166); -const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__(39819); -const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(32592); -const {mergePromise, getSpawnedPromise} = __webpack_require__(97814); -const {joinCommand, parseCommand} = __webpack_require__(88286); +const path = __nccwpck_require__(85622); +const childProcess = __nccwpck_require__(63129); +const crossSpawn = __nccwpck_require__(72746); +const stripFinalNewline = __nccwpck_require__(88174); +const npmRunPath = __nccwpck_require__(20502); +const onetime = __nccwpck_require__(89082); +const makeError = __nccwpck_require__(62187); +const normalizeStdio = __nccwpck_require__(10166); +const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __nccwpck_require__(39819); +const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __nccwpck_require__(32592); +const {mergePromise, getSpawnedPromise} = __nccwpck_require__(97814); +const {joinCommand, parseCommand} = __nccwpck_require__(88286); const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; @@ -12472,8 +12619,6 @@ const execa = (file, args, options) => { const handlePromiseOnce = onetime(handlePromise); - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); - handleInput(spawned, parsed.options.input); spawned.all = makeAllStream(spawned, parsed.options); @@ -12628,11 +12773,11 @@ module.exports = { /***/ }), /***/ 62187: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {signalsByName} = __webpack_require__(2779); +const {signalsByName} = __nccwpck_require__(2779); const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { if (timedOut) { @@ -12722,12 +12867,12 @@ module.exports = makeError; /***/ }), /***/ 39819: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const onExit = __webpack_require__(24931); +const os = __nccwpck_require__(12087); +const onExit = __nccwpck_require__(24931); const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; @@ -12902,20 +13047,20 @@ module.exports = { const aliases = ['stdin', 'stdout', 'stderr']; -const hasAlias = opts => aliases.some(alias => opts[alias] !== undefined); +const hasAlias = options => aliases.some(alias => options[alias] !== undefined); -const normalizeStdio = opts => { - if (!opts) { +const normalizeStdio = options => { + if (!options) { return; } - const {stdio} = opts; + const {stdio} = options; if (stdio === undefined) { - return aliases.map(alias => opts[alias]); + return aliases.map(alias => options[alias]); } - if (hasAlias(opts)) { + if (hasAlias(options)) { throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); } @@ -12934,8 +13079,8 @@ const normalizeStdio = opts => { module.exports = normalizeStdio; // `ipc` is pushed unless it is already present -module.exports.node = opts => { - const stdio = normalizeStdio(opts); +module.exports.node = options => { + const stdio = normalizeStdio(options); if (stdio === 'ipc') { return 'ipc'; @@ -12956,13 +13101,13 @@ module.exports.node = opts => { /***/ }), /***/ 32592: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const isStream = __webpack_require__(41554); -const getStream = __webpack_require__(21766); -const mergeStream = __webpack_require__(2621); +const isStream = __nccwpck_require__(41554); +const getStream = __nccwpck_require__(21766); +const mergeStream = __nccwpck_require__(2621); // `input` option const handleInput = (spawned, input) => { @@ -13061,16 +13206,16 @@ module.exports = { /***/ }), /***/ 43664: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const taskManager = __webpack_require__(42708); -const async_1 = __webpack_require__(95679); -const stream_1 = __webpack_require__(94630); -const sync_1 = __webpack_require__(42405); -const settings_1 = __webpack_require__(10952); -const utils = __webpack_require__(45444); +const taskManager = __nccwpck_require__(42708); +const async_1 = __nccwpck_require__(95679); +const stream_1 = __nccwpck_require__(94630); +const sync_1 = __nccwpck_require__(42405); +const settings_1 = __nccwpck_require__(10952); +const utils = __nccwpck_require__(45444); async function FastGlob(source, options) { assertPatternsInput(source); const works = getWorks(source, async_1.default, options); @@ -13136,12 +13281,12 @@ module.exports = FastGlob; /***/ }), /***/ 42708: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); +const utils = __nccwpck_require__(45444); function generate(patterns, settings) { const positivePatterns = getPositivePatterns(patterns); const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore); @@ -13208,13 +13353,13 @@ exports.convertPatternGroupToTask = convertPatternGroupToTask; /***/ }), /***/ 95679: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __webpack_require__(12083); -const provider_1 = __webpack_require__(60257); +const stream_1 = __nccwpck_require__(12083); +const provider_1 = __nccwpck_require__(60257); class ProviderAsync extends provider_1.default { constructor() { super(...arguments); @@ -13244,13 +13389,13 @@ exports.default = ProviderAsync; /***/ }), /***/ 36983: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); -const partial_1 = __webpack_require__(35295); +const utils = __nccwpck_require__(45444); +const partial_1 = __nccwpck_require__(35295); class DeepFilter { constructor(_settings, _micromatchOptions) { this._settings = _settings; @@ -13306,12 +13451,12 @@ exports.default = DeepFilter; /***/ }), /***/ 71343: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); +const utils = __nccwpck_require__(45444); class EntryFilter { constructor(_settings, _micromatchOptions) { this._settings = _settings; @@ -13369,12 +13514,12 @@ exports.default = EntryFilter; /***/ }), /***/ 36654: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); +const utils = __nccwpck_require__(45444); class ErrorFilter { constructor(_settings) { this._settings = _settings; @@ -13392,12 +13537,12 @@ exports.default = ErrorFilter; /***/ }), /***/ 32576: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); +const utils = __nccwpck_require__(45444); class Matcher { constructor(_patterns, _settings, _micromatchOptions) { this._patterns = _patterns; @@ -13450,12 +13595,12 @@ exports.default = Matcher; /***/ }), /***/ 35295: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const matcher_1 = __webpack_require__(32576); +const matcher_1 = __nccwpck_require__(32576); class PartialMatcher extends matcher_1.default { match(filepath) { const parts = filepath.split('/'); @@ -13496,16 +13641,16 @@ exports.default = PartialMatcher; /***/ }), /***/ 60257: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); -const deep_1 = __webpack_require__(36983); -const entry_1 = __webpack_require__(71343); -const error_1 = __webpack_require__(36654); -const entry_2 = __webpack_require__(94029); +const path = __nccwpck_require__(85622); +const deep_1 = __nccwpck_require__(36983); +const entry_1 = __nccwpck_require__(71343); +const error_1 = __nccwpck_require__(36654); +const entry_2 = __nccwpck_require__(94029); class Provider { constructor(_settings) { this._settings = _settings; @@ -13552,14 +13697,14 @@ exports.default = Provider; /***/ }), /***/ 94630: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __webpack_require__(92413); -const stream_2 = __webpack_require__(12083); -const provider_1 = __webpack_require__(60257); +const stream_1 = __nccwpck_require__(92413); +const stream_2 = __nccwpck_require__(12083); +const provider_1 = __nccwpck_require__(60257); class ProviderStream extends provider_1.default { constructor() { super(...arguments); @@ -13591,13 +13736,13 @@ exports.default = ProviderStream; /***/ }), /***/ 42405: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const sync_1 = __webpack_require__(76234); -const provider_1 = __webpack_require__(60257); +const sync_1 = __nccwpck_require__(76234); +const provider_1 = __nccwpck_require__(60257); class ProviderSync extends provider_1.default { constructor() { super(...arguments); @@ -13622,12 +13767,12 @@ exports.default = ProviderSync; /***/ }), /***/ 94029: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); +const utils = __nccwpck_require__(45444); class EntryTransformer { constructor(_settings) { this._settings = _settings; @@ -13656,14 +13801,14 @@ exports.default = EntryTransformer; /***/ }), /***/ 65582: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); -const fsStat = __webpack_require__(70109); -const utils = __webpack_require__(45444); +const path = __nccwpck_require__(85622); +const fsStat = __nccwpck_require__(70109); +const utils = __nccwpck_require__(45444); class Reader { constructor(_settings) { this._settings = _settings; @@ -13697,15 +13842,15 @@ exports.default = Reader; /***/ }), /***/ 12083: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __webpack_require__(92413); -const fsStat = __webpack_require__(70109); -const fsWalk = __webpack_require__(26026); -const reader_1 = __webpack_require__(65582); +const stream_1 = __nccwpck_require__(92413); +const fsStat = __nccwpck_require__(70109); +const fsWalk = __nccwpck_require__(26026); +const reader_1 = __nccwpck_require__(65582); class ReaderStream extends reader_1.default { constructor() { super(...arguments); @@ -13760,14 +13905,14 @@ exports.default = ReaderStream; /***/ }), /***/ 76234: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsStat = __webpack_require__(70109); -const fsWalk = __webpack_require__(26026); -const reader_1 = __webpack_require__(65582); +const fsStat = __nccwpck_require__(70109); +const fsWalk = __nccwpck_require__(26026); +const reader_1 = __nccwpck_require__(65582); class ReaderSync extends reader_1.default { constructor() { super(...arguments); @@ -13811,13 +13956,13 @@ exports.default = ReaderSync; /***/ }), /***/ 10952: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(35747); -const os = __webpack_require__(12087); +const fs = __nccwpck_require__(35747); +const os = __nccwpck_require__(12087); const CPU_COUNT = os.cpus().length; exports.DEFAULT_FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, @@ -13940,36 +14085,36 @@ exports.createDirentFromStats = createDirentFromStats; /***/ }), /***/ 45444: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const array = __webpack_require__(85325); +const array = __nccwpck_require__(85325); exports.array = array; -const errno = __webpack_require__(41230); +const errno = __nccwpck_require__(41230); exports.errno = errno; -const fs = __webpack_require__(17543); +const fs = __nccwpck_require__(17543); exports.fs = fs; -const path = __webpack_require__(63873); +const path = __nccwpck_require__(63873); exports.path = path; -const pattern = __webpack_require__(81221); +const pattern = __nccwpck_require__(81221); exports.pattern = pattern; -const stream = __webpack_require__(18382); +const stream = __nccwpck_require__(18382); exports.stream = stream; -const string = __webpack_require__(52203); +const string = __nccwpck_require__(52203); exports.string = string; /***/ }), /***/ 63873: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); +const path = __nccwpck_require__(85622); const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; /** @@ -14004,15 +14149,15 @@ exports.removeLeadingDotSegment = removeLeadingDotSegment; /***/ }), /***/ 81221: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); -const globParent = __webpack_require__(54655); -const micromatch = __webpack_require__(76228); -const picomatch = __webpack_require__(78569); +const path = __nccwpck_require__(85622); +const globParent = __nccwpck_require__(54655); +const micromatch = __nccwpck_require__(76228); +const picomatch = __nccwpck_require__(78569); const GLOBSTAR = '**'; const ESCAPE_SYMBOL = '\\'; const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; @@ -14124,12 +14269,12 @@ exports.matchAny = matchAny; /***/ }), /***/ 18382: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const merge2 = __webpack_require__(82578); +const merge2 = __nccwpck_require__(82578); function merge(streams) { const mergedStream = merge2(streams); streams.forEach((stream) => { @@ -14166,12 +14311,12 @@ exports.isEmpty = isEmpty; /***/ }), /***/ 7340: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var reusify = __webpack_require__(32113) +var reusify = __nccwpck_require__(32113) function fastqueue (context, worker, concurrency) { if (typeof context === 'function') { @@ -14360,7 +14505,7 @@ module.exports = fastqueue /***/ }), /***/ 6330: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /*! @@ -14372,8 +14517,8 @@ module.exports = fastqueue -const util = __webpack_require__(31669); -const toRegexRange = __webpack_require__(1861); +const util = __nccwpck_require__(31669); +const toRegexRange = __nccwpck_require__(1861); const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); @@ -14617,13 +14762,13 @@ module.exports = fill; /***/ }), /***/ 9486: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const locatePath = __webpack_require__(63447); -const pathExists = __webpack_require__(96978); +const path = __nccwpck_require__(85622); +const locatePath = __nccwpck_require__(63447); +const pathExists = __nccwpck_require__(96978); const stop = Symbol('findUp.stop'); @@ -14714,7 +14859,7 @@ module.exports.stop = stop; /***/ }), /***/ 46863: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = realpath realpath.realpath = realpath @@ -14723,13 +14868,13 @@ realpath.realpathSync = realpathSync realpath.monkeypatch = monkeypatch realpath.unmonkeypatch = unmonkeypatch -var fs = __webpack_require__(35747) +var fs = __nccwpck_require__(35747) var origRealpath = fs.realpath var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__(71734) +var old = __nccwpck_require__(71734) function newError (er) { return er && er.syscall === 'realpath' && ( @@ -14787,7 +14932,7 @@ function unmonkeypatch () { /***/ }), /***/ 71734: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { // Copyright Joyent, Inc. and other Node contributors. // @@ -14810,9 +14955,9 @@ function unmonkeypatch () { // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -var pathModule = __webpack_require__(85622); +var pathModule = __nccwpck_require__(85622); var isWindows = process.platform === 'win32'; -var fs = __webpack_require__(35747); +var fs = __nccwpck_require__(35747); // JavaScript implementation of realpath, ported from node pre-v6 @@ -15157,12 +15302,12 @@ module.exports = function bind(that) { /***/ }), /***/ 88334: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var implementation = __webpack_require__(19320); +var implementation = __nccwpck_require__(19320); module.exports = Function.prototype.bind || implementation; @@ -15170,11 +15315,11 @@ module.exports = Function.prototype.bind || implementation; /***/ }), /***/ 91585: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {PassThrough: PassThroughStream} = __webpack_require__(92413); +const {PassThrough: PassThroughStream} = __nccwpck_require__(92413); module.exports = options => { options = {...options}; @@ -15230,12 +15375,16 @@ module.exports = options => { /***/ }), /***/ 21766: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pump = __webpack_require__(18341); -const bufferStream = __webpack_require__(91585); +const {constants: BufferConstants} = __nccwpck_require__(64293); +const stream = __nccwpck_require__(92413); +const {promisify} = __nccwpck_require__(31669); +const bufferStream = __nccwpck_require__(91585); + +const streamPipelinePromisified = promisify(stream.pipeline); class MaxBufferError extends Error { constructor() { @@ -15246,7 +15395,7 @@ class MaxBufferError extends Error { async function getStream(inputStream, options) { if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); + throw new Error('Expected a stream'); } options = { @@ -15255,25 +15404,26 @@ async function getStream(inputStream, options) { }; const {maxBuffer} = options; + const stream = bufferStream(options); - let stream; await new Promise((resolve, reject) => { const rejectPromise = error => { - if (error) { // A null check + // Don't retrieve an oversized buffer. + if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { error.bufferedData = stream.getBufferedValue(); } reject(error); }; - stream = pump(inputStream, bufferStream(options), error => { - if (error) { + (async () => { + try { + await streamPipelinePromisified(inputStream, stream); + resolve(); + } catch (error) { rejectPromise(error); - return; } - - resolve(); - }); + })(); stream.on('data', () => { if (stream.getBufferedLength() > maxBuffer) { @@ -15286,8 +15436,6 @@ async function getStream(inputStream, options) { } module.exports = getStream; -// TODO: Remove this for the next major release -module.exports.default = getStream; module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); module.exports.MaxBufferError = MaxBufferError; @@ -15296,14 +15444,14 @@ module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 54655: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var isGlob = __webpack_require__(34466); -var pathPosixDirname = __webpack_require__(85622).posix.dirname; -var isWin32 = __webpack_require__(12087).platform() === 'win32'; +var isGlob = __nccwpck_require__(34466); +var pathPosixDirname = __nccwpck_require__(85622).posix.dirname; +var isWin32 = __nccwpck_require__(12087).platform() === 'win32'; var slash = '/'; var backslash = /\\/g; @@ -15345,7 +15493,7 @@ module.exports = function globParent(str, opts) { /***/ }), /***/ 47625: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { exports.alphasort = alphasort exports.alphasorti = alphasorti @@ -15361,9 +15509,9 @@ function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } -var path = __webpack_require__(85622) -var minimatch = __webpack_require__(83973) -var isAbsolute = __webpack_require__(38714) +var path = __nccwpck_require__(85622) +var minimatch = __nccwpck_require__(83973) +var isAbsolute = __nccwpck_require__(38714) var Minimatch = minimatch.Minimatch function alphasorti (a, b) { @@ -15592,7 +15740,7 @@ function childrenIgnored (self, path) { /***/ }), /***/ 91957: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Approach: // @@ -15636,27 +15784,27 @@ function childrenIgnored (self, path) { module.exports = glob -var fs = __webpack_require__(35747) -var rp = __webpack_require__(46863) -var minimatch = __webpack_require__(83973) +var fs = __nccwpck_require__(35747) +var rp = __nccwpck_require__(46863) +var minimatch = __nccwpck_require__(83973) var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(44124) -var EE = __webpack_require__(28614).EventEmitter -var path = __webpack_require__(85622) -var assert = __webpack_require__(42357) -var isAbsolute = __webpack_require__(38714) -var globSync = __webpack_require__(29010) -var common = __webpack_require__(47625) +var inherits = __nccwpck_require__(44124) +var EE = __nccwpck_require__(28614).EventEmitter +var path = __nccwpck_require__(85622) +var assert = __nccwpck_require__(42357) +var isAbsolute = __nccwpck_require__(38714) +var globSync = __nccwpck_require__(29010) +var common = __nccwpck_require__(47625) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp -var inflight = __webpack_require__(52492) -var util = __webpack_require__(31669) +var inflight = __nccwpck_require__(52492) +var util = __nccwpck_require__(31669) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored -var once = __webpack_require__(1223) +var once = __nccwpck_require__(1223) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} @@ -16389,21 +16537,21 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { /***/ }), /***/ 29010: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = globSync globSync.GlobSync = GlobSync -var fs = __webpack_require__(35747) -var rp = __webpack_require__(46863) -var minimatch = __webpack_require__(83973) +var fs = __nccwpck_require__(35747) +var rp = __nccwpck_require__(46863) +var minimatch = __nccwpck_require__(83973) var Minimatch = minimatch.Minimatch -var Glob = __webpack_require__(91957).Glob -var util = __webpack_require__(31669) -var path = __webpack_require__(85622) -var assert = __webpack_require__(42357) -var isAbsolute = __webpack_require__(38714) -var common = __webpack_require__(47625) +var Glob = __nccwpck_require__(91957).Glob +var util = __nccwpck_require__(31669) +var path = __nccwpck_require__(85622) +var assert = __nccwpck_require__(42357) +var isAbsolute = __nccwpck_require__(38714) +var common = __nccwpck_require__(47625) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts @@ -16882,16 +17030,16 @@ GlobSync.prototype._makeAbs = function (f) { /***/ }), /***/ 89038: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {promisify} = __webpack_require__(31669); -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const fastGlob = __webpack_require__(43664); -const gitIgnore = __webpack_require__(91230); -const slash = __webpack_require__(97543); +const {promisify} = __nccwpck_require__(31669); +const fs = __nccwpck_require__(35747); +const path = __nccwpck_require__(85622); +const fastGlob = __nccwpck_require__(43664); +const gitIgnore = __nccwpck_require__(91230); +const slash = __nccwpck_require__(97543); const DEFAULT_IGNORE = [ '**/node_modules/**', @@ -16921,13 +17069,15 @@ const parseGitIgnore = (content, options) => { }; const reduceIgnore = files => { - return files.reduce((ignores, file) => { + const ignores = gitIgnore(); + for (const file of files) { ignores.add(parseGitIgnore(file.content, { cwd: file.cwd, fileName: file.filePath })); - return ignores; - }, gitIgnore()); + } + + return ignores; }; const ensureAbsolutePathForCwd = (cwd, p) => { @@ -16944,7 +17094,7 @@ const ensureAbsolutePathForCwd = (cwd, p) => { }; const getIsIgnoredPredecate = (ignores, cwd) => { - return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p)))); + return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p.path || p)))); }; const getFile = async (file, cwd) => { @@ -17008,17 +17158,17 @@ module.exports.sync = options => { /***/ }), /***/ 43398: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const arrayUnion = __webpack_require__(99600); -const merge2 = __webpack_require__(82578); -const fastGlob = __webpack_require__(43664); -const dirGlob = __webpack_require__(12738); -const gitignore = __webpack_require__(89038); -const {FilterStream, UniqueStream} = __webpack_require__(32408); +const fs = __nccwpck_require__(35747); +const arrayUnion = __nccwpck_require__(99600); +const merge2 = __nccwpck_require__(82578); +const fastGlob = __nccwpck_require__(43664); +const dirGlob = __nccwpck_require__(12738); +const gitignore = __nccwpck_require__(89038); +const {FilterStream, UniqueStream} = __nccwpck_require__(32408); const DEFAULT_FILTER = () => false; @@ -17038,7 +17188,7 @@ const checkCwdOption = (options = {}) => { let stat; try { stat = fs.statSync(options.cwd); - } catch (_) { + } catch { return; } @@ -17069,7 +17219,7 @@ const generateGlobTasks = (patterns, taskOptions) => { const ignore = patterns .slice(index) - .filter(isNegative) + .filter(pattern => isNegative(pattern)) .map(pattern => pattern.slice(1)); const options = { @@ -17151,26 +17301,30 @@ module.exports = async (patterns, options) => { module.exports.sync = (patterns, options) => { const globTasks = generateGlobTasks(patterns, options); - const tasks = globTasks.reduce((tasks, task) => { + const tasks = []; + for (const task of globTasks) { const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); - return tasks.concat(newTask); - }, []); + tasks.push(...newTask); + } const filter = getFilterSync(options); - return tasks.reduce( - (matches, task) => arrayUnion(matches, fastGlob.sync(task.pattern, task.options)), - [] - ).filter(path_ => !filter(path_)); + let matches = []; + for (const task of tasks) { + matches = arrayUnion(matches, fastGlob.sync(task.pattern, task.options)); + } + + return matches.filter(path_ => !filter(path_)); }; module.exports.stream = (patterns, options) => { const globTasks = generateGlobTasks(patterns, options); - const tasks = globTasks.reduce((tasks, task) => { + const tasks = []; + for (const task of globTasks) { const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); - return tasks.concat(newTask); - }, []); + tasks.push(...newTask); + } const filter = getFilterSync(options); const filterStream = new FilterStream(p => !filter(p)); @@ -17193,11 +17347,11 @@ module.exports.gitignore = gitignore; /***/ }), /***/ 32408: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {Transform} = __webpack_require__(92413); +const {Transform} = __nccwpck_require__(92413); class ObjectTransform extends Transform { constructor() { @@ -17263,12 +17417,12 @@ module.exports = (flag, argv) => { /***/ }), /***/ 76339: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var bind = __webpack_require__(88334); +var bind = __nccwpck_require__(88334); module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); @@ -17363,11 +17517,11 @@ function formatHashFragment (fragment) { /***/ }), /***/ 18145: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var gitHosts = __webpack_require__(30135) +var gitHosts = __nccwpck_require__(30135) /* eslint-disable node/no-deprecated-api */ // copy-pasta util._extend from node's source, to avoid pulling @@ -17527,13 +17681,13 @@ GitHost.prototype.toString = function (opts) { /***/ }), /***/ 88869: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var url = __webpack_require__(78835) -var gitHosts = __webpack_require__(30135) -var GitHost = module.exports = __webpack_require__(18145) +var url = __nccwpck_require__(78835) +var gitHosts = __nccwpck_require__(30135) +var GitHost = module.exports = __nccwpck_require__(18145) var protocolToRepresentationMap = { 'git+ssh:': 'sshurl', @@ -17963,13 +18117,13 @@ standard:"other"}];exports.SIGNALS=SIGNALS; /***/ }), /***/ 2779: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__webpack_require__(12087); +Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__nccwpck_require__(12087); -var _signals=__webpack_require__(86435); -var _realtime=__webpack_require__(25295); +var _signals=__nccwpck_require__(86435); +var _realtime=__nccwpck_require__(25295); @@ -18067,13 +18221,13 @@ const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX; /***/ }), /***/ 86435: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__webpack_require__(12087); +Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__nccwpck_require__(12087); -var _core=__webpack_require__(28213); -var _realtime=__webpack_require__(25295); +var _core=__nccwpck_require__(28213); +var _realtime=__nccwpck_require__(25295); @@ -18713,11 +18867,11 @@ if ( /***/ }), /***/ 52492: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var wrappy = __webpack_require__(62940) +var wrappy = __nccwpck_require__(62940) var reqs = Object.create(null) -var once = __webpack_require__(1223) +var once = __nccwpck_require__(1223) module.exports = wrappy(inflight) @@ -18774,16 +18928,16 @@ function slice (args) { /***/ }), /***/ 44124: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { try { - var util = __webpack_require__(31669); + var util = __nccwpck_require__(31669); /* istanbul ignore next */ if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { /* istanbul ignore next */ - module.exports = __webpack_require__(8544); + module.exports = __nccwpck_require__(8544); } @@ -18842,12 +18996,12 @@ module.exports = function isArrayish(obj) { /***/ }), /***/ 56873: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var has = __webpack_require__(76339); +var has = __nccwpck_require__(76339); function specifierIncluded(current, specifier) { var nodeParts = current.split('.'); @@ -18909,7 +19063,7 @@ function versionIncluded(nodeVersion, specifierValue) { return matchesRange(current, specifierValue); } -var data = __webpack_require__(93991); +var data = __nccwpck_require__(93991); module.exports = function isCore(x, nodeVersion) { return has(data, x) && versionIncluded(nodeVersion, data[x]); @@ -18946,7 +19100,7 @@ module.exports = function isExtglob(str) { /***/ }), /***/ 34466: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /*! * is-glob @@ -18955,7 +19109,7 @@ module.exports = function isExtglob(str) { * Released under the MIT License. */ -var isExtglob = __webpack_require__(76435); +var isExtglob = __nccwpck_require__(76435); var chars = { '{': '}', '(': ')', '[': ']'}; var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; @@ -19120,14 +19274,14 @@ module.exports = isStream; /***/ }), /***/ 97126: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __webpack_require__(35747) +var fs = __nccwpck_require__(35747) var core if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = __webpack_require__(42001) + core = __nccwpck_require__(42001) } else { - core = __webpack_require__(9728) + core = __nccwpck_require__(9728) } module.exports = isexe @@ -19184,12 +19338,12 @@ function sync (path, options) { /***/ }), /***/ 9728: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = isexe isexe.sync = sync -var fs = __webpack_require__(35747) +var fs = __nccwpck_require__(35747) function isexe (path, options, cb) { fs.stat(path, function (er, stat) { @@ -19232,12 +19386,12 @@ function checkMode (stat, options) { /***/ }), /***/ 42001: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = isexe isexe.sync = sync -var fs = __webpack_require__(35747) +var fs = __nccwpck_require__(35747) function checkPathExt (path, options) { var pathext = options.pathExt !== undefined ? @@ -19423,14 +19577,14 @@ exports.default = LinesAndColumns; /***/ }), /***/ 63447: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const fs = __webpack_require__(35747); -const {promisify} = __webpack_require__(31669); -const pLocate = __webpack_require__(90104); +const path = __nccwpck_require__(85622); +const fs = __nccwpck_require__(35747); +const {promisify} = __nccwpck_require__(31669); +const pLocate = __nccwpck_require__(90104); const fsStat = promisify(fs.stat); const fsLStat = promisify(fs.lstat); @@ -19496,11 +19650,11 @@ module.exports.sync = (paths, options) => { /***/ }), /***/ 7493: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); +const os = __nccwpck_require__(12087); const nameMap = new Map([ [19, 'Catalina'], @@ -19536,12 +19690,12 @@ module.exports.default = macosRelease; /***/ }), /***/ 2621: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { PassThrough } = __webpack_require__(92413); +const { PassThrough } = __nccwpck_require__(92413); module.exports = function (/*streams...*/) { var sources = [] @@ -19585,7 +19739,7 @@ module.exports = function (/*streams...*/) { /***/ }), /***/ 82578: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -19596,7 +19750,7 @@ module.exports = function (/*streams...*/) { * Copyright (c) 2014-2020 Teambition * Licensed under the MIT license. */ -const Stream = __webpack_require__(92413) +const Stream = __nccwpck_require__(92413) const PassThrough = Stream.PassThrough const slice = Array.prototype.slice @@ -19737,15 +19891,15 @@ function pauseStreams (streams, options) { /***/ }), /***/ 76228: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __webpack_require__(31669); -const braces = __webpack_require__(50610); -const picomatch = __webpack_require__(78569); -const utils = __webpack_require__(30479); +const util = __nccwpck_require__(31669); +const braces = __nccwpck_require__(50610); +const picomatch = __nccwpck_require__(78569); +const utils = __nccwpck_require__(30479); const isEmptyString = val => typeof val === 'string' && (val === '' || val === './'); /** @@ -20233,18 +20387,18 @@ module.exports.default = mimicFn; /***/ }), /***/ 83973: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = minimatch minimatch.Minimatch = Minimatch var path = { sep: '/' } try { - path = __webpack_require__(85622) + path = __nccwpck_require__(85622) } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(33717) +var expand = __nccwpck_require__(33717) var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, @@ -21182,7 +21336,7 @@ module.exports = function(fn) { /***/ }), /***/ 80467: -/***/ ((module, exports, __webpack_require__) => { +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; @@ -21191,11 +21345,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var Stream = _interopDefault(__webpack_require__(92413)); -var http = _interopDefault(__webpack_require__(98605)); -var Url = _interopDefault(__webpack_require__(78835)); -var https = _interopDefault(__webpack_require__(57211)); -var zlib = _interopDefault(__webpack_require__(78761)); +var Stream = _interopDefault(__nccwpck_require__(92413)); +var http = _interopDefault(__nccwpck_require__(98605)); +var Url = _interopDefault(__nccwpck_require__(78835)); +var https = _interopDefault(__nccwpck_require__(57211)); +var zlib = _interopDefault(__nccwpck_require__(78761)); // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js @@ -21346,7 +21500,7 @@ FetchError.prototype.name = 'FetchError'; let convert; try { - convert = __webpack_require__(85100)/* .convert */ .O; + convert = __nccwpck_require__(85100)/* .convert */ .O; } catch (e) {} const INTERNALS = Symbol('Body internals'); @@ -22860,16 +23014,16 @@ function extractDescription (d) { /***/ }), /***/ 23492: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var semver = __webpack_require__(85911) -var validateLicense = __webpack_require__(22524); -var hostedGitInfo = __webpack_require__(88869) -var isBuiltinModule = __webpack_require__(39283).isCore +var semver = __nccwpck_require__(85911) +var validateLicense = __nccwpck_require__(22524); +var hostedGitInfo = __nccwpck_require__(88869) +var isBuiltinModule = __nccwpck_require__(39283).isCore var depTypes = ["dependencies","devDependencies","optionalDependencies"] -var extractDescription = __webpack_require__(16976) -var url = __webpack_require__(78835) -var typos = __webpack_require__(49043) +var extractDescription = __nccwpck_require__(16976) +var url = __nccwpck_require__(78835) +var typos = __nccwpck_require__(49043) var fixer = module.exports = { // default warning function @@ -23285,10 +23439,10 @@ function bugsTypos(bugs, warn) { /***/ }), /***/ 29671: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __webpack_require__(31669) -var messages = __webpack_require__(98402) +var util = __nccwpck_require__(31669) +var messages = __nccwpck_require__(98402) module.exports = function() { var args = Array.prototype.slice.call(arguments, 0) @@ -23315,14 +23469,14 @@ function makeTypoWarning (providedName, probableName, field) { /***/ }), /***/ 53188: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = normalize -var fixer = __webpack_require__(23492) +var fixer = __nccwpck_require__(23492) normalize.fixer = fixer -var makeWarning = __webpack_require__(29671) +var makeWarning = __nccwpck_require__(29671) var fieldsToFix = ['name','version','description','repository','modules','scripts' ,'files','bin','man','bugs','keywords','readme','homepage','license'] @@ -23361,12 +23515,12 @@ function ucFirst (string) { /***/ }), /***/ 20502: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const pathKey = __webpack_require__(37278); +const path = __nccwpck_require__(85622); +const pathKey = __nccwpck_require__(37278); const npmRunPath = options => { options = { @@ -23440,9 +23594,9 @@ module.exports.default = pathKey; /***/ }), /***/ 1223: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var wrappy = __webpack_require__(62940) +var wrappy = __nccwpck_require__(62940) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) @@ -23489,71 +23643,65 @@ function onceStrict (fn) { /***/ }), /***/ 89082: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const mimicFn = __webpack_require__(76047); +const mimicFn = __nccwpck_require__(76047); const calledFunctions = new WeakMap(); -const oneTime = (fn, options = {}) => { - if (typeof fn !== 'function') { +const onetime = (function_, options = {}) => { + if (typeof function_ !== 'function') { throw new TypeError('Expected a function'); } - let ret; - let isCalled = false; + let returnValue; let callCount = 0; - const functionName = fn.displayName || fn.name || ''; + const functionName = function_.displayName || function_.name || ''; - const onetime = function (...args) { + const onetime = function (...arguments_) { calledFunctions.set(onetime, ++callCount); - if (isCalled) { - if (options.throw === true) { - throw new Error(`Function \`${functionName}\` can only be called once`); - } - - return ret; + if (callCount === 1) { + returnValue = function_.apply(this, arguments_); + function_ = null; + } else if (options.throw === true) { + throw new Error(`Function \`${functionName}\` can only be called once`); } - isCalled = true; - ret = fn.apply(this, args); - fn = null; - - return ret; + return returnValue; }; - mimicFn(onetime, fn); + mimicFn(onetime, function_); calledFunctions.set(onetime, callCount); return onetime; }; -module.exports = oneTime; +module.exports = onetime; // TODO: Remove this for the next major release -module.exports.default = oneTime; +module.exports.default = onetime; -module.exports.callCount = fn => { - if (!calledFunctions.has(fn)) { - throw new Error(`The given function \`${fn.name}\` is not wrapped by the \`onetime\` package`); +module.exports.callCount = function_ => { + if (!calledFunctions.has(function_)) { + throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); } - return calledFunctions.get(fn); + return calledFunctions.get(function_); }; /***/ }), /***/ 54824: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const macosRelease = __webpack_require__(7493); -const winRelease = __webpack_require__(63515); +const os = __nccwpck_require__(12087); +const macosRelease = __nccwpck_require__(7493); +const winRelease = __nccwpck_require__(63515); const osName = (platform, release) => { if (!platform && release) { @@ -23624,11 +23772,11 @@ module.exports = (promise, onFinally) => { /***/ }), /***/ 57684: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pTry = __webpack_require__(80746); +const pTry = __nccwpck_require__(80746); const pLimit = concurrency => { if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { @@ -23689,11 +23837,11 @@ module.exports.default = pLimit; /***/ }), /***/ 90104: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pLimit = __webpack_require__(57684); +const pLimit = __nccwpck_require__(57684); class EndError extends Error { constructor(value) { @@ -23766,14 +23914,14 @@ module.exports.default = pTry; /***/ }), /***/ 86615: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const errorEx = __webpack_require__(23505); -const fallback = __webpack_require__(55586); -const {default: LinesAndColumns} = __webpack_require__(96309); -const {codeFrameColumns} = __webpack_require__(45211); +const errorEx = __nccwpck_require__(23505); +const fallback = __nccwpck_require__(55586); +const {default: LinesAndColumns} = __nccwpck_require__(96309); +const {codeFrameColumns} = __nccwpck_require__(45211); const JSONError = errorEx('JSONError', { fileName: errorEx.append('in %s'), @@ -23824,12 +23972,12 @@ module.exports = (string, reviver, filename) => { /***/ }), /***/ 96978: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const {promisify} = __webpack_require__(31669); +const fs = __nccwpck_require__(35747); +const {promisify} = __nccwpck_require__(31669); const pAccess = promisify(fs.access); @@ -24005,12 +24153,12 @@ module.exports.win32 = win32.parse; /***/ }), /***/ 63433: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -const {promisify} = __webpack_require__(31669); -const fs = __webpack_require__(35747); +const {promisify} = __nccwpck_require__(31669); +const fs = __nccwpck_require__(35747); async function isType(fsStatType, statsMethodName, filePath) { if (typeof filePath !== 'string') { @@ -24056,23 +24204,23 @@ exports.isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink'); /***/ }), /***/ 78569: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -module.exports = __webpack_require__(33322); +module.exports = __nccwpck_require__(33322); /***/ }), /***/ 16099: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); +const path = __nccwpck_require__(85622); const WIN_SLASH = '\\\\/'; const WIN_NO_SLASH = `[^${WIN_SLASH}]`; @@ -24254,13 +24402,13 @@ module.exports = { /***/ }), /***/ 92139: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const constants = __webpack_require__(16099); -const utils = __webpack_require__(30479); +const constants = __nccwpck_require__(16099); +const utils = __nccwpck_require__(30479); /** * Constants @@ -25340,16 +25488,16 @@ module.exports = parse; /***/ }), /***/ 33322: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const scan = __webpack_require__(32429); -const parse = __webpack_require__(92139); -const utils = __webpack_require__(30479); -const constants = __webpack_require__(16099); +const path = __nccwpck_require__(85622); +const scan = __nccwpck_require__(32429); +const parse = __nccwpck_require__(92139); +const utils = __nccwpck_require__(30479); +const constants = __nccwpck_require__(16099); const isObject = val => val && typeof val === 'object' && !Array.isArray(val); /** @@ -25687,12 +25835,12 @@ module.exports = picomatch; /***/ }), /***/ 32429: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const utils = __webpack_require__(30479); +const utils = __nccwpck_require__(30479); const { CHAR_ASTERISK, /* * */ CHAR_AT, /* @ */ @@ -25709,7 +25857,7 @@ const { CHAR_RIGHT_CURLY_BRACE, /* } */ CHAR_RIGHT_PARENTHESES, /* ) */ CHAR_RIGHT_SQUARE_BRACKET /* ] */ -} = __webpack_require__(16099); +} = __nccwpck_require__(16099); const isPathSeparator = code => { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; @@ -26078,19 +26226,19 @@ module.exports = scan; /***/ }), /***/ 30479: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); +const path = __nccwpck_require__(85622); const win32 = process.platform === 'win32'; const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL -} = __webpack_require__(16099); +} = __nccwpck_require__(16099); exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); @@ -26150,11 +26298,11 @@ exports.wrapOutput = (input, state = {}, options = {}) => { /***/ }), /***/ 18341: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var once = __webpack_require__(1223) -var eos = __webpack_require__(81205) -var fs = __webpack_require__(35747) // we only need fs to get the ReadStream and WriteStream prototypes +var once = __nccwpck_require__(1223) +var eos = __nccwpck_require__(81205) +var fs = __nccwpck_require__(35747) // we only need fs to get the ReadStream and WriteStream prototypes var noop = function () {} var ancient = /^v?\.0/.test(process.version) @@ -26239,13 +26387,13 @@ module.exports = pump /***/ }), /***/ 75767: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const findUp = __webpack_require__(9486); -const readPkg = __webpack_require__(83645); +const path = __nccwpck_require__(85622); +const findUp = __nccwpck_require__(9486); +const readPkg = __nccwpck_require__(83645); module.exports = async options => { const filePath = await findUp('package.json', options); @@ -26277,14 +26425,14 @@ module.exports.sync = options => { /***/ }), /***/ 83645: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {promisify} = __webpack_require__(31669); -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const parseJson = __webpack_require__(86615); +const {promisify} = __nccwpck_require__(31669); +const fs = __nccwpck_require__(35747); +const path = __nccwpck_require__(85622); +const parseJson = __nccwpck_require__(86615); const readFileAsync = promisify(fs.readFile); @@ -26299,7 +26447,7 @@ module.exports = async options => { const json = parseJson(await readFileAsync(filePath, 'utf8')); if (options.normalize) { - __webpack_require__(53188)(json); + __nccwpck_require__(53188)(json); } return json; @@ -26316,7 +26464,7 @@ module.exports.sync = options => { const json = parseJson(fs.readFileSync(filePath, 'utf8')); if (options.normalize) { - __webpack_require__(53188)(json); + __nccwpck_require__(53188)(json); } return json; @@ -26326,12 +26474,12 @@ module.exports.sync = options => { /***/ }), /***/ 39283: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var async = __webpack_require__(2125); -async.core = __webpack_require__(26226); -async.isCore = __webpack_require__(38115); -async.sync = __webpack_require__(55284); +var async = __nccwpck_require__(2125); +async.core = __nccwpck_require__(26226); +async.isCore = __nccwpck_require__(38115); +async.sync = __nccwpck_require__(55284); module.exports = async; @@ -26339,14 +26487,14 @@ module.exports = async; /***/ }), /***/ 2125: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var caller = __webpack_require__(36155); -var nodeModulesPaths = __webpack_require__(1433); -var normalizeOptions = __webpack_require__(17990); -var isCore = __webpack_require__(56873); +var fs = __nccwpck_require__(35747); +var path = __nccwpck_require__(85622); +var caller = __nccwpck_require__(36155); +var nodeModulesPaths = __nccwpck_require__(1433); +var normalizeOptions = __nccwpck_require__(17990); +var isCore = __nccwpck_require__(56873); var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; @@ -26660,7 +26808,7 @@ module.exports = function () { /***/ }), /***/ 26226: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; @@ -26706,7 +26854,7 @@ function versionIncluded(specifierValue) { return matchesRange(specifierValue); } -var data = __webpack_require__(5537); +var data = __nccwpck_require__(5537); var core = {}; for (var mod in data) { // eslint-disable-line no-restricted-syntax @@ -26720,9 +26868,9 @@ module.exports = core; /***/ }), /***/ 38115: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var isCoreModule = __webpack_require__(56873); +var isCoreModule = __nccwpck_require__(56873); module.exports = function isCore(x) { return isCoreModule(x); @@ -26732,10 +26880,10 @@ module.exports = function isCore(x) { /***/ }), /***/ 1433: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var path = __webpack_require__(85622); -var parse = path.parse || __webpack_require__(5980); +var path = __nccwpck_require__(85622); +var parse = path.parse || __nccwpck_require__(5980); var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { var prefix = '/'; @@ -26798,14 +26946,14 @@ module.exports = function (x, opts) { /***/ }), /***/ 55284: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var isCore = __webpack_require__(56873); -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var caller = __webpack_require__(36155); -var nodeModulesPaths = __webpack_require__(1433); -var normalizeOptions = __webpack_require__(17990); +var isCore = __nccwpck_require__(56873); +var fs = __nccwpck_require__(35747); +var path = __nccwpck_require__(85622); +var caller = __nccwpck_require__(36155); +var nodeModulesPaths = __nccwpck_require__(1433); +var normalizeOptions = __nccwpck_require__(17990); var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; @@ -27038,17 +27186,17 @@ module.exports = reusify /***/ }), /***/ 14959: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = rimraf rimraf.sync = rimrafSync -var assert = __webpack_require__(42357) -var path = __webpack_require__(85622) -var fs = __webpack_require__(35747) +var assert = __nccwpck_require__(42357) +var path = __nccwpck_require__(85622) +var fs = __nccwpck_require__(35747) var glob = undefined try { - glob = __webpack_require__(91957) + glob = __nccwpck_require__(91957) } catch (_err) { // treat glob as optional. } @@ -28962,11 +29110,11 @@ function coerce (version) { /***/ }), /***/ 67032: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const shebangRegex = __webpack_require__(72638); +const shebangRegex = __nccwpck_require__(72638); module.exports = (string = '') => { const match = string.match(shebangRegex); @@ -28999,16 +29147,16 @@ module.exports = /^#!(.*)/; /***/ }), /***/ 24931: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Note: since nyc uses this module to output coverage, any lines // that are in the direct sync flow of nyc's outputCoverage are // ignored, since we can never get coverage for them. -var assert = __webpack_require__(42357) -var signals = __webpack_require__(63710) +var assert = __nccwpck_require__(42357) +var signals = __nccwpck_require__(63710) var isWin = /^win/i.test(process.platform) -var EE = __webpack_require__(28614) +var EE = __nccwpck_require__(28614) /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter @@ -29248,7 +29396,7 @@ module.exports = path => { /***/ }), /***/ 92372: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* Copyright spdx-correct.js contributors @@ -29265,8 +29413,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -var parse = __webpack_require__(31620) -var spdxLicenseIds = __webpack_require__(72172) +var parse = __nccwpck_require__(31620) +var spdxLicenseIds = __nccwpck_require__(72172) function valid (string) { try { @@ -29619,13 +29767,13 @@ function upgradeGPLs (value) { /***/ }), /***/ 31620: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var scan = __webpack_require__(97380) -var parse = __webpack_require__(69868) +var scan = __nccwpck_require__(97380) +var parse = __nccwpck_require__(69868) module.exports = function (source) { return parse(scan(source)) @@ -29781,15 +29929,15 @@ module.exports = function (tokens) { /***/ }), /***/ 97380: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; var licenses = [] - .concat(__webpack_require__(72172)) - .concat(__webpack_require__(94185)) -var exceptions = __webpack_require__(19752) + .concat(__nccwpck_require__(72172)) + .concat(__nccwpck_require__(94185)) +var exceptions = __nccwpck_require__(19752) module.exports = function (source) { var index = 0 @@ -29967,12 +30115,12 @@ module.exports = input => { /***/ }), /***/ 59318: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const hasFlag = __webpack_require__(31621); +const os = __nccwpck_require__(12087); +const hasFlag = __nccwpck_require__(31621); const env = process.env; @@ -30106,10 +30254,10 @@ module.exports = { /***/ }), /***/ 68065: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const {promisify} = __webpack_require__(31669); -const tmp = __webpack_require__(8517); +const {promisify} = __nccwpck_require__(31669); +const tmp = __nccwpck_require__(8517); // file module.exports.fileSync = tmp.fileSync; @@ -30161,7 +30309,7 @@ module.exports.setGracefulCleanup = tmp.setGracefulCleanup; /***/ }), /***/ 8517: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /*! * Tmp @@ -30174,14 +30322,14 @@ module.exports.setGracefulCleanup = tmp.setGracefulCleanup; /* * Module dependencies. */ -const fs = __webpack_require__(35747); -const os = __webpack_require__(12087); -const path = __webpack_require__(85622); -const crypto = __webpack_require__(76417); +const fs = __nccwpck_require__(35747); +const os = __nccwpck_require__(12087); +const path = __nccwpck_require__(85622); +const crypto = __nccwpck_require__(76417); const _c = fs.constants && os.constants ? { fs: fs.constants, os: os.constants } : process.binding('constants'); -const rimraf = __webpack_require__(14959); +const rimraf = __nccwpck_require__(14959); /* * The working inner variables. @@ -30930,7 +31078,7 @@ module.exports.setGracefulCleanup = setGracefulCleanup; /***/ }), /***/ 1861: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /*! @@ -30942,7 +31090,7 @@ module.exports.setGracefulCleanup = setGracefulCleanup; -const isNumber = __webpack_require__(75680); +const isNumber = __nccwpck_require__(75680); const toRegexRange = (min, max, options) => { if (isNumber(min) === false) { @@ -31226,26 +31374,26 @@ module.exports = toRegexRange; /***/ }), /***/ 74294: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __webpack_require__(54219); +module.exports = __nccwpck_require__(54219); /***/ }), /***/ 54219: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var net = __webpack_require__(11631); -var tls = __webpack_require__(4016); -var http = __webpack_require__(98605); -var https = __webpack_require__(57211); -var events = __webpack_require__(28614); -var assert = __webpack_require__(42357); -var util = __webpack_require__(31669); +var net = __nccwpck_require__(11631); +var tls = __nccwpck_require__(4016); +var http = __nccwpck_require__(98605); +var https = __nccwpck_require__(57211); +var events = __nccwpck_require__(28614); +var assert = __nccwpck_require__(42357); +var util = __nccwpck_require__(31669); exports.httpOverHttp = httpOverHttp; @@ -31506,7 +31654,7 @@ exports.debug = debug; // for test /***/ }), /***/ 45030: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -31515,7 +31663,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var osName = _interopDefault(__webpack_require__(54824)); +var osName = _interopDefault(__nccwpck_require__(54824)); function getUserAgent() { try { @@ -31536,10 +31684,10 @@ exports.getUserAgent = getUserAgent; /***/ }), /***/ 22524: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var parse = __webpack_require__(31620); -var correct = __webpack_require__(92372); +var parse = __nccwpck_require__(31620); +var correct = __nccwpck_require__(92372); var genericWarning = ( 'license should be ' + @@ -31629,15 +31777,15 @@ module.exports = function(argument) { /***/ }), /***/ 34207: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' -const path = __webpack_require__(85622) +const path = __nccwpck_require__(85622) const COLON = isWindows ? ';' : ':' -const isexe = __webpack_require__(97126) +const isexe = __nccwpck_require__(97126) const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) @@ -31761,12 +31909,12 @@ which.sync = whichSync /***/ }), /***/ 63515: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const execa = __webpack_require__(64780); +const os = __nccwpck_require__(12087); +const execa = __nccwpck_require__(64780); // Reference: https://www.gaijin.at/en/lstwinver.php const names = new Map([ @@ -31821,14 +31969,14 @@ module.exports = windowsRelease; /***/ }), /***/ 36868: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const cp = __webpack_require__(63129); -const parse = __webpack_require__(56876); -const enoent = __webpack_require__(48625); +const cp = __nccwpck_require__(63129); +const parse = __nccwpck_require__(56876); +const enoent = __nccwpck_require__(48625); function spawn(command, args, options) { // Parse the arguments @@ -31935,17 +32083,17 @@ module.exports = { /***/ }), /***/ 56876: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const niceTry = __webpack_require__(38560); -const resolveCommand = __webpack_require__(38741); -const escape = __webpack_require__(44300); -const readShebang = __webpack_require__(58536); -const semver = __webpack_require__(85911); +const path = __nccwpck_require__(85622); +const niceTry = __nccwpck_require__(38560); +const resolveCommand = __nccwpck_require__(38741); +const escape = __nccwpck_require__(44300); +const readShebang = __nccwpck_require__(58536); +const semver = __nccwpck_require__(85911); const isWin = process.platform === 'win32'; const isExecutableRegExp = /\.(?:com|exe)$/i; @@ -32121,13 +32269,13 @@ module.exports.argument = escapeArgument; /***/ }), /***/ 58536: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const shebangCommand = __webpack_require__(32116); +const fs = __nccwpck_require__(35747); +const shebangCommand = __nccwpck_require__(32116); function readShebang(command) { // Read the first 150 bytes from the file @@ -32161,14 +32309,14 @@ module.exports = readShebang; /***/ }), /***/ 38741: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const which = __webpack_require__(13411); -const pathKey = __webpack_require__(20539)(); +const path = __nccwpck_require__(85622); +const which = __nccwpck_require__(13411); +const pathKey = __nccwpck_require__(20539)(); function resolveCommandAttempt(parsed, withoutPathExt) { const cwd = process.cwd(); @@ -32216,21 +32364,21 @@ module.exports = resolveCommand; /***/ }), /***/ 64780: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const childProcess = __webpack_require__(63129); -const crossSpawn = __webpack_require__(36868); -const stripEof = __webpack_require__(85515); -const npmRunPath = __webpack_require__(12509); -const isStream = __webpack_require__(12597); -const _getStream = __webpack_require__(72560); -const pFinally = __webpack_require__(31330); -const onExit = __webpack_require__(24931); -const errname = __webpack_require__(32160); -const stdio = __webpack_require__(27023); +const path = __nccwpck_require__(85622); +const childProcess = __nccwpck_require__(63129); +const crossSpawn = __nccwpck_require__(36868); +const stripEof = __nccwpck_require__(85515); +const npmRunPath = __nccwpck_require__(12509); +const isStream = __nccwpck_require__(12597); +const _getStream = __nccwpck_require__(72560); +const pFinally = __nccwpck_require__(31330); +const onExit = __nccwpck_require__(24931); +const errname = __nccwpck_require__(32160); +const stdio = __nccwpck_require__(27023); const TEN_MEGABYTES = 1000 * 1000 * 10; @@ -32585,13 +32733,13 @@ module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, /***/ }), /***/ 32160: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; // Older verions of Node.js might not have `util.getSystemErrorName()`. // In that case, fall back to a deprecated internal. -const util = __webpack_require__(31669); +const util = __nccwpck_require__(31669); let uv; @@ -32681,11 +32829,11 @@ module.exports = opts => { /***/ }), /***/ 59286: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {PassThrough} = __webpack_require__(92413); +const {PassThrough} = __nccwpck_require__(92413); module.exports = options => { options = Object.assign({}, options); @@ -32740,12 +32888,12 @@ module.exports = options => { /***/ }), /***/ 72560: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pump = __webpack_require__(18341); -const bufferStream = __webpack_require__(59286); +const pump = __nccwpck_require__(18341); +const bufferStream = __nccwpck_require__(59286); class MaxBufferError extends Error { constructor() { @@ -32827,12 +32975,12 @@ isStream.transform = function (stream) { /***/ }), /***/ 12509: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const pathKey = __webpack_require__(20539); +const path = __nccwpck_require__(85622); +const pathKey = __nccwpck_require__(20539); module.exports = opts => { opts = Object.assign({ @@ -32874,11 +33022,11 @@ module.exports.env = opts => { /***/ }), /***/ 32116: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var shebangRegex = __webpack_require__(52998); +var shebangRegex = __nccwpck_require__(52998); module.exports = function (str) { var match = str.match(shebangRegex); @@ -32911,7 +33059,7 @@ module.exports = /^#!.*/; /***/ }), /***/ 13411: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = which which.sync = whichSync @@ -32920,9 +33068,9 @@ var isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' -var path = __webpack_require__(85622) +var path = __nccwpck_require__(85622) var COLON = isWindows ? ';' : ':' -var isexe = __webpack_require__(97126) +var isexe = __nccwpck_require__(97126) function getNotFoundError (cmd) { var er = new Error('not found: ' + cmd) @@ -33093,18 +33241,18 @@ function wrappy (fn, cb) { /***/ }), /***/ 31252: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /* eslint-disable no-console */ -const artifact = __webpack_require__(52605) -const execa = __webpack_require__(55447) -const core = __webpack_require__(42186) -const globby = __webpack_require__(43398) -const readPkgUp = __webpack_require__(75767) -const fs = __webpack_require__(35747) -const { pkg } = __webpack_require__(1590) +const artifact = __nccwpck_require__(52605) +const execa = __nccwpck_require__(55447) +const core = __nccwpck_require__(42186) +const globby = __nccwpck_require__(43398) +const readPkgUp = __nccwpck_require__(75767) +const fs = __nccwpck_require__(35747) +const { pkg } = __nccwpck_require__(1590) const aegirExec = pkg.name === 'aegir' ? './cli.js' : 'aegir' @@ -33129,8 +33277,9 @@ const sizeCheck = async (octokit, context, baseDir) => { try { check = await checkCreate(octokit, context, checkName) + console.log('🚀 ~ file: utils.js ~ line 34 ~ sizeCheck ~ check', check) - const out = await execa(aegirExec, ['build', '-b'], { + const out = await execa(aegirExec, ['build', '-b', '--no-types'], { cwd: baseDir, localDir: '.', preferLocal: true, @@ -33165,8 +33314,6 @@ const sizeCheck = async (octokit, context, baseDir) => { } ) } catch (err) { - console.log('err', err) - if (check) { await octokit.checks.update( { @@ -33213,7 +33360,7 @@ module.exports = { /***/ }), /***/ 36553: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -33224,7 +33371,7 @@ Object.defineProperty(exports, "__esModule", ({ exports.codeFrameColumns = codeFrameColumns; exports.default = _default; -var _highlight = _interopRequireWildcard(__webpack_require__(39571)); +var _highlight = _interopRequireWildcard(__nccwpck_require__(39571)); function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } @@ -33247,7 +33394,7 @@ function getMarkerLines(loc, source, opts) { column: 0, line: -1 }, loc.start); - const endLoc = Object.assign({}, startLoc, {}, loc.end); + const endLoc = Object.assign({}, startLoc, loc.end); const { linesAbove = 2, linesBelow = 3 @@ -33326,7 +33473,7 @@ function codeFrameColumns(rawLines, loc, opts = {}) { let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { const number = start + 1 + index; const paddedNumber = ` ${number}`.slice(-numberMaxWidth); - const gutter = ` ${paddedNumber} | `; + const gutter = ` ${paddedNumber} |`; const hasMarker = markerLines[number]; const lastMarkerLine = !markerLines[number + 1]; @@ -33336,16 +33483,16 @@ function codeFrameColumns(rawLines, loc, opts = {}) { if (Array.isArray(hasMarker)) { const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); const numberOfMarkers = hasMarker[1] || 1; - markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); if (lastMarkerLine && opts.message) { markerLine += " " + maybeHighlight(defs.message, opts.message); } } - return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); } else { - return ` ${maybeHighlight(defs.gutter, gutter)}${line}`; + return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`; } }).join("\n"); @@ -33386,8 +33533,201 @@ function _default(rawLines, lineNumber, colNumber, opts = {}) { /***/ }), +/***/ 14705: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isIdentifierStart = isIdentifierStart; +exports.isIdentifierChar = isIdentifierChar; +exports.isIdentifierName = isIdentifierName; +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + +function isInAstralSet(code, set) { + let pos = 0x10000; + + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + + return false; +} + +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + + return isInAstralSet(code, astralIdentifierStartCodes); +} + +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} + +function isIdentifierName(name) { + let isFirst = true; + + for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) { + const char = _Array$from[_i]; + const cp = char.codePointAt(0); + + if (isFirst) { + if (!isIdentifierStart(cp)) { + return false; + } + + isFirst = false; + } else if (!isIdentifierChar(cp)) { + return false; + } + } + + return !isFirst; +} + +/***/ }), + +/***/ 74246: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "isIdentifierName", ({ + enumerable: true, + get: function () { + return _identifier.isIdentifierName; + } +})); +Object.defineProperty(exports, "isIdentifierChar", ({ + enumerable: true, + get: function () { + return _identifier.isIdentifierChar; + } +})); +Object.defineProperty(exports, "isIdentifierStart", ({ + enumerable: true, + get: function () { + return _identifier.isIdentifierStart; + } +})); +Object.defineProperty(exports, "isReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isReservedWord; + } +})); +Object.defineProperty(exports, "isStrictBindOnlyReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isStrictBindOnlyReservedWord; + } +})); +Object.defineProperty(exports, "isStrictBindReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isStrictBindReservedWord; + } +})); +Object.defineProperty(exports, "isStrictReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isStrictReservedWord; + } +})); +Object.defineProperty(exports, "isKeyword", ({ + enumerable: true, + get: function () { + return _keyword.isKeyword; + } +})); + +var _identifier = __nccwpck_require__(14705); + +var _keyword = __nccwpck_require__(8755); + +/***/ }), + +/***/ 8755: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isReservedWord = isReservedWord; +exports.isStrictReservedWord = isStrictReservedWord; +exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; +exports.isStrictBindReservedWord = isStrictBindReservedWord; +exports.isKeyword = isKeyword; +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); + +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; +} + +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); +} + +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); +} + +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} + +function isKeyword(word) { + return keywords.has(word); +} + +/***/ }), + /***/ 39571: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -33399,11 +33739,11 @@ exports.shouldHighlight = shouldHighlight; exports.getChalk = getChalk; exports.default = highlight; -var _jsTokens = _interopRequireWildcard(__webpack_require__(52388)); +var jsTokensNs = _interopRequireWildcard(__nccwpck_require__(52388)); -var _helperValidatorIdentifier = __webpack_require__(78207); +var _helperValidatorIdentifier = __nccwpck_require__(74246); -var _chalk = _interopRequireDefault(__webpack_require__(85465)); +var _chalk = _interopRequireDefault(__nccwpck_require__(85465)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -33411,11 +33751,13 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); + function getDefs(chalk) { return { keyword: chalk.cyan, capitalized: chalk.yellow, - jsx_tag: chalk.yellow, + jsxIdentifier: chalk.yellow, punctuator: chalk.yellow, number: chalk.magenta, string: chalk.green, @@ -33426,49 +33768,70 @@ function getDefs(chalk) { } const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; -const JSX_TAG = /^[a-z][\w-]*$/i; const BRACKET = /^[()[\]{}]$/; +let tokenize; +{ + const { + matchToToken + } = jsTokensNs; + const JSX_TAG = /^[a-z][\w-]*$/i; -function getTokenType(match) { - const [offset, text] = match.slice(-2); - const token = (0, _jsTokens.matchToToken)(match); + const getTokenType = function (token, offset, text) { + if (token.type === "name") { + if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) { + return "keyword"; + } - if (token.type === "name") { - if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) { - return "keyword"; + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " colorize(str)).join("\n"); + highlighted += value.split(NEWLINE).map(str => colorize(str)).join("\n"); } else { - return args[0]; + highlighted += value; } - }); + } + + return highlighted; } function shouldHighlight(options) { @@ -33500,206 +33863,13 @@ function highlight(code, options = {}) { /***/ }), -/***/ 53921: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isIdentifierStart = isIdentifierStart; -exports.isIdentifierChar = isIdentifierChar; -exports.isIdentifierName = isIdentifierName; -let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; -const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; - -function isInAstralSet(code, set) { - let pos = 0x10000; - - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - - return false; -} - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes); -} - -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -function isIdentifierName(name) { - let isFirst = true; - - for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) { - const char = _Array$from[_i]; - const cp = char.codePointAt(0); - - if (isFirst) { - if (!isIdentifierStart(cp)) { - return false; - } - - isFirst = false; - } else if (!isIdentifierChar(cp)) { - return false; - } - } - - return !isFirst; -} - -/***/ }), - -/***/ 78207: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -Object.defineProperty(exports, "isIdentifierName", ({ - enumerable: true, - get: function () { - return _identifier.isIdentifierName; - } -})); -Object.defineProperty(exports, "isIdentifierChar", ({ - enumerable: true, - get: function () { - return _identifier.isIdentifierChar; - } -})); -Object.defineProperty(exports, "isIdentifierStart", ({ - enumerable: true, - get: function () { - return _identifier.isIdentifierStart; - } -})); -Object.defineProperty(exports, "isReservedWord", ({ - enumerable: true, - get: function () { - return _keyword.isReservedWord; - } -})); -Object.defineProperty(exports, "isStrictBindOnlyReservedWord", ({ - enumerable: true, - get: function () { - return _keyword.isStrictBindOnlyReservedWord; - } -})); -Object.defineProperty(exports, "isStrictBindReservedWord", ({ - enumerable: true, - get: function () { - return _keyword.isStrictBindReservedWord; - } -})); -Object.defineProperty(exports, "isStrictReservedWord", ({ - enumerable: true, - get: function () { - return _keyword.isStrictReservedWord; - } -})); -Object.defineProperty(exports, "isKeyword", ({ - enumerable: true, - get: function () { - return _keyword.isKeyword; - } -})); - -var _identifier = __webpack_require__(53921); - -var _keyword = __webpack_require__(49313); - -/***/ }), - -/***/ 49313: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isReservedWord = isReservedWord; -exports.isStrictReservedWord = isStrictReservedWord; -exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; -exports.isStrictBindReservedWord = isStrictBindReservedWord; -exports.isKeyword = isKeyword; -const reservedWords = { - keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const keywords = new Set(reservedWords.keyword); -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); - -function isReservedWord(word, inModule) { - return inModule && word === "await" || word === "enum"; -} - -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} - -function isStrictBindOnlyReservedWord(word) { - return reservedWordsStrictBindSet.has(word); -} - -function isStrictBindReservedWord(word, inModule) { - return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); -} - -function isKeyword(word) { - return keywords.has(word); -} - -/***/ }), - /***/ 75762: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/* module decorator */ module = __webpack_require__.nmd(module); +/* module decorator */ module = __nccwpck_require__.nmd(module); -const colorConvert = __webpack_require__(5254); +const colorConvert = __nccwpck_require__(5254); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); @@ -33868,15 +34038,15 @@ Object.defineProperty(module, 'exports', { /***/ }), /***/ 85465: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const escapeStringRegexp = __webpack_require__(5813); -const ansiStyles = __webpack_require__(75762); -const stdoutColor = __webpack_require__(96278).stdout; +const escapeStringRegexp = __nccwpck_require__(5813); +const ansiStyles = __nccwpck_require__(75762); +const stdoutColor = __nccwpck_require__(96278).stdout; -const template = __webpack_require__(3195); +const template = __nccwpck_require__(3195); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -34240,10 +34410,10 @@ module.exports = (chalk, tmp) => { /***/ }), /***/ 33394: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* MIT license */ -var cssKeywords = __webpack_require__(66658); +var cssKeywords = __nccwpck_require__(66658); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). @@ -35115,10 +35285,10 @@ convert.rgb.gray = function (rgb) { /***/ }), /***/ 5254: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var conversions = __webpack_require__(33394); -var route = __webpack_require__(93476); +var conversions = __nccwpck_require__(33394); +var route = __nccwpck_require__(93476); var convert = {}; @@ -35200,9 +35370,9 @@ module.exports = convert; /***/ }), /***/ 93476: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var conversions = __webpack_require__(33394); +var conversions = __nccwpck_require__(33394); /* this function routes a model to all other models. @@ -35461,15 +35631,31 @@ module.exports = { }; +/***/ }), + +/***/ 63551: +/***/ ((module) => { + +"use strict"; + +module.exports = (flag, argv) => { + argv = argv || process.argv; + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf('--'); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; + + /***/ }), /***/ 96278: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const hasFlag = __webpack_require__(58379); +const os = __nccwpck_require__(12087); +const hasFlag = __nccwpck_require__(63551); const env = process.env; @@ -35603,7 +35789,7 @@ module.exports = { /***/ }), /***/ 3158: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -35619,12 +35805,12 @@ var __rest = (this && this.__rest) || function (s, e) { return t; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const debug_1 = __webpack_require__(30787); -const env_paths_1 = __webpack_require__(47727); -const fs = __webpack_require__(93070); -const path = __webpack_require__(85622); -const url = __webpack_require__(78835); -const sanitize = __webpack_require__(22752); +const debug_1 = __nccwpck_require__(30787); +const env_paths_1 = __nccwpck_require__(47727); +const filenamify = __nccwpck_require__(25686); +const fs = __nccwpck_require__(93070); +const path = __nccwpck_require__(85622); +const url = __nccwpck_require__(78835); const d = debug_1.default('@electron/get:cache'); const defaultCacheRoot = env_paths_1.default('electron', { suffix: '', @@ -35636,7 +35822,7 @@ class Cache { getCachePath(downloadUrl, fileName) { const _a = url.parse(downloadUrl), { search, hash } = _a, rest = __rest(_a, ["search", "hash"]); const strippedUrl = url.format(rest); - const sanitizedUrl = sanitize(strippedUrl); + const sanitizedUrl = filenamify(strippedUrl, { maxLength: 255, replacement: '' }); return path.resolve(this.cacheRoot, sanitizedUrl, fileName); } async getPathForFileInCache(url, fileName) { @@ -35663,7 +35849,7 @@ exports.Cache = Cache; /***/ }), /***/ 33425: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -35679,10 +35865,10 @@ var __rest = (this && this.__rest) || function (s, e) { return t; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(93070); -const got = __webpack_require__(2673); -const path = __webpack_require__(85622); -const ProgressBar = __webpack_require__(9154); +const fs = __nccwpck_require__(93070); +const got = __nccwpck_require__(2673); +const path = __nccwpck_require__(85622); +const ProgressBar = __nccwpck_require__(9154); const PROGRESS_BAR_DELAY_IN_SECONDS = 30; class GotDownloader { async download(url, targetFilePath, options) { @@ -35745,12 +35931,12 @@ exports.GotDownloader = GotDownloader; /***/ }), /***/ 68052: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils_1 = __webpack_require__(41171); +const utils_1 = __nccwpck_require__(41171); const BASE_URL = 'https://github.com/electron/electron/releases/download/'; const NIGHTLY_BASE_URL = 'https://github.com/electron/nightlies/releases/download/'; function getArtifactFileName(details) { @@ -35808,7 +35994,7 @@ exports.getArtifactRemoteURL = getArtifactRemoteURL; /***/ }), /***/ 3252: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -35818,7 +36004,7 @@ async function getDownloaderForSystem() { // Current thoughts are a dot-file traversal for something like // ".electron.downloader" which would be a text file with the name of the // npm module to import() and use as the downloader - const { GotDownloader } = await Promise.resolve().then(() => __webpack_require__(33425)); + const { GotDownloader } = await Promise.resolve().then(() => __nccwpck_require__(33425)); return new GotDownloader(); } exports.getDownloaderForSystem = getDownloaderForSystem; @@ -35827,22 +36013,23 @@ exports.getDownloaderForSystem = getDownloaderForSystem; /***/ }), /***/ 37196: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const debug_1 = __webpack_require__(30787); -const path = __webpack_require__(85622); -const sumchecker = __webpack_require__(85076); -const artifact_utils_1 = __webpack_require__(68052); -const Cache_1 = __webpack_require__(3158); -const downloader_resolver_1 = __webpack_require__(3252); -const proxy_1 = __webpack_require__(7938); -const utils_1 = __webpack_require__(41171); -var utils_2 = __webpack_require__(41171); +const debug_1 = __nccwpck_require__(30787); +const path = __nccwpck_require__(85622); +const semver = __nccwpck_require__(2217); +const sumchecker = __nccwpck_require__(85076); +const artifact_utils_1 = __nccwpck_require__(68052); +const Cache_1 = __nccwpck_require__(3158); +const downloader_resolver_1 = __nccwpck_require__(3252); +const proxy_1 = __nccwpck_require__(7938); +const utils_1 = __nccwpck_require__(41171); +var utils_2 = __nccwpck_require__(41171); exports.getHostArch = utils_2.getHostArch; -var proxy_2 = __webpack_require__(7938); +var proxy_2 = __nccwpck_require__(7938); exports.initializeProxy = proxy_2.initializeProxy; const d = debug_1.default('@electron/get:index'); if (process.env.ELECTRON_GET_USE_PROXY) { @@ -35908,8 +36095,10 @@ async function downloadArtifact(_artifactDetails) { d(`Downloading ${url} to ${tempDownloadPath} with options: ${JSON.stringify(artifactDetails.downloadOptions)}`); await downloader.download(url, tempDownloadPath, artifactDetails.downloadOptions); // Don't try to verify the hash of the hash file itself + // and for older versions that don't have a SHASUMS256.txt if (!artifactDetails.artifactName.startsWith('SHASUMS256') && - !artifactDetails.unsafelyDisableChecksums) { + !artifactDetails.unsafelyDisableChecksums && + semver.gte(artifactDetails.version, '1.3.2')) { const shasumPath = await downloadArtifact({ isGeneric: true, version: artifactDetails.version, @@ -35920,9 +36109,19 @@ async function downloadArtifact(_artifactDetails) { downloader: artifactDetails.downloader, mirrorOptions: artifactDetails.mirrorOptions, }); - await sumchecker('sha256', shasumPath, path.dirname(tempDownloadPath), [ - path.basename(tempDownloadPath), - ]); + // For versions 1.3.2 - 1.3.4, need to overwrite the `defaultTextEncoding` option: + // https://github.com/electron/electron/pull/6676#discussion_r75332120 + if (semver.satisfies(artifactDetails.version, '1.3.2 - 1.3.4')) { + const validatorOptions = {}; + validatorOptions.defaultTextEncoding = 'binary'; + const checker = new sumchecker.ChecksumValidator('sha256', shasumPath, validatorOptions); + await checker.validate(path.dirname(tempDownloadPath), path.basename(tempDownloadPath)); + } + else { + await sumchecker('sha256', shasumPath, path.dirname(tempDownloadPath), [ + path.basename(tempDownloadPath), + ]); + } } return await cache.putFileInCache(url, tempDownloadPath, fileName); }); @@ -35933,12 +36132,12 @@ exports.downloadArtifact = downloadArtifact; /***/ }), /***/ 7938: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const debug = __webpack_require__(30787); +const debug = __nccwpck_require__(30787); const d = debug('@electron/get:proxy'); /** * Initializes a third-party proxy module for HTTP(S) requests. @@ -35949,11 +36148,11 @@ function initializeProxy() { const MAJOR_NODEJS_VERSION = parseInt(process.version.slice(1).split('.')[0], 10); if (MAJOR_NODEJS_VERSION >= 10) { // `global-agent` works with Node.js v10 and above. - __webpack_require__(22407)/* .bootstrap */ .Ux(); + __nccwpck_require__(22407)/* .bootstrap */ .Ux(); } else { // `global-tunnel-ng` works with Node.js v10 and below. - __webpack_require__(2667).initialize(); + __nccwpck_require__(2667).initialize(); } } catch (e) { @@ -35966,15 +36165,15 @@ exports.initializeProxy = initializeProxy; /***/ }), /***/ 41171: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const childProcess = __webpack_require__(63129); -const fs = __webpack_require__(93070); -const os = __webpack_require__(12087); -const path = __webpack_require__(85622); +const childProcess = __nccwpck_require__(63129); +const fs = __nccwpck_require__(93070); +const os = __nccwpck_require__(12087); +const path = __nccwpck_require__(85622); async function useAndRemoveDirectory(directory, fn) { let result; try { @@ -36055,16 +36254,16 @@ exports.isOfficialLinuxIA32Download = isOfficialLinuxIA32Download; /***/ }), /***/ 88258: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirpSync = __webpack_require__(58844).mkdirsSync -const utimesSync = __webpack_require__(97408).utimesMillisSync -const stat = __webpack_require__(77928) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdirpSync = __nccwpck_require__(58844).mkdirsSync +const utimesSync = __nccwpck_require__(97408).utimesMillisSync +const stat = __nccwpck_require__(77928) function copySync (src, dest, opts) { if (typeof opts === 'function') { @@ -36137,7 +36336,7 @@ function copyFile (srcStat, src, dest, opts) { function copyFileFallback (srcStat, src, dest, opts) { const BUF_LENGTH = 64 * 1024 - const _buff = __webpack_require__(72946)(BUF_LENGTH) + const _buff = __nccwpck_require__(72946)(BUF_LENGTH) const fdr = fs.openSync(src, 'r') const fdw = fs.openSync(dest, 'w', srcStat.mode) @@ -36227,30 +36426,30 @@ module.exports = copySync /***/ }), /***/ 5799: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { - copySync: __webpack_require__(88258) + copySync: __nccwpck_require__(88258) } /***/ }), /***/ 73564: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirp = __webpack_require__(58844).mkdirs -const pathExists = __webpack_require__(86119).pathExists -const utimes = __webpack_require__(97408).utimesMillis -const stat = __webpack_require__(77928) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdirp = __nccwpck_require__(58844).mkdirs +const pathExists = __nccwpck_require__(86119).pathExists +const utimes = __nccwpck_require__(97408).utimesMillis +const stat = __nccwpck_require__(77928) function copy (src, dest, opts, cb) { if (typeof opts === 'function' && !cb) { @@ -36460,30 +36659,30 @@ module.exports = copy /***/ }), /***/ 23583: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E +const u = __nccwpck_require__(24437)/* .fromCallback */ .E module.exports = { - copy: u(__webpack_require__(73564)) + copy: u(__nccwpck_require__(73564)) } /***/ }), /***/ 93813: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(58844) -const remove = __webpack_require__(40153) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(58844) +const remove = __nccwpck_require__(40153) const emptyDir = u(function emptyDir (dir, callback) { callback = callback || function () {} @@ -36530,16 +36729,16 @@ module.exports = { /***/ }), /***/ 37184: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(58844) -const pathExists = __webpack_require__(86119).pathExists +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const mkdir = __nccwpck_require__(58844) +const pathExists = __nccwpck_require__(86119).pathExists function createFile (file, callback) { function makeFile () { @@ -36587,14 +36786,14 @@ module.exports = { /***/ }), /***/ 87910: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const file = __webpack_require__(37184) -const link = __webpack_require__(92109) -const symlink = __webpack_require__(70517) +const file = __nccwpck_require__(37184) +const link = __nccwpck_require__(92109) +const symlink = __nccwpck_require__(70517) module.exports = { // file @@ -36618,16 +36817,16 @@ module.exports = { /***/ }), /***/ 92109: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(58844) -const pathExists = __webpack_require__(86119).pathExists +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const mkdir = __nccwpck_require__(58844) +const pathExists = __nccwpck_require__(86119).pathExists function createLink (srcpath, dstpath, callback) { function makeLink (srcpath, dstpath) { @@ -36687,14 +36886,14 @@ module.exports = { /***/ }), /***/ 59082: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const pathExists = __webpack_require__(86119).pathExists +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const pathExists = __nccwpck_require__(86119).pathExists /** * Function that returns two types of paths, one relative to symlink, and one @@ -36794,12 +36993,12 @@ module.exports = { /***/ }), /***/ 38636: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) +const fs = __nccwpck_require__(82161) function symlinkType (srcpath, type, callback) { callback = (typeof type === 'function') ? type : callback @@ -36833,27 +37032,27 @@ module.exports = { /***/ }), /***/ 70517: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const _mkdirs = __webpack_require__(58844) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const _mkdirs = __nccwpck_require__(58844) const mkdirs = _mkdirs.mkdirs const mkdirsSync = _mkdirs.mkdirsSync -const _symlinkPaths = __webpack_require__(59082) +const _symlinkPaths = __nccwpck_require__(59082) const symlinkPaths = _symlinkPaths.symlinkPaths const symlinkPathsSync = _symlinkPaths.symlinkPathsSync -const _symlinkType = __webpack_require__(38636) +const _symlinkType = __nccwpck_require__(38636) const symlinkType = _symlinkType.symlinkType const symlinkTypeSync = _symlinkType.symlinkTypeSync -const pathExists = __webpack_require__(86119).pathExists +const pathExists = __nccwpck_require__(86119).pathExists function createSymlink (srcpath, dstpath, type, callback) { callback = (typeof type === 'function') ? type : callback @@ -36904,14 +37103,14 @@ module.exports = { /***/ }), /***/ 59330: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; // This is adapted from https://github.com/normalize/mz // Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors -const u = __webpack_require__(24437)/* .fromCallback */ .E -const fs = __webpack_require__(82161) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const fs = __nccwpck_require__(82161) const api = [ 'access', @@ -37021,7 +37220,7 @@ if (typeof fs.realpath.native === 'function') { /***/ }), /***/ 93070: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -37029,24 +37228,24 @@ if (typeof fs.realpath.native === 'function') { module.exports = Object.assign( {}, // Export promiseified graceful-fs: - __webpack_require__(59330), + __nccwpck_require__(59330), // Export extra methods: - __webpack_require__(5799), - __webpack_require__(23583), - __webpack_require__(93813), - __webpack_require__(87910), - __webpack_require__(13148), - __webpack_require__(58844), - __webpack_require__(22332), - __webpack_require__(77818), - __webpack_require__(28158), - __webpack_require__(86119), - __webpack_require__(40153) + __nccwpck_require__(5799), + __nccwpck_require__(23583), + __nccwpck_require__(93813), + __nccwpck_require__(87910), + __nccwpck_require__(13148), + __nccwpck_require__(58844), + __nccwpck_require__(22332), + __nccwpck_require__(77818), + __nccwpck_require__(28158), + __nccwpck_require__(86119), + __nccwpck_require__(40153) ) // Export fs.promises as a getter property so that we don't trigger // ExperimentalWarning before fs.promises is actually accessed. -const fs = __webpack_require__(35747) +const fs = __nccwpck_require__(35747) if (Object.getOwnPropertyDescriptor(fs, 'promises')) { Object.defineProperty(module.exports, "promises", ({ get () { return fs.promises } @@ -37057,16 +37256,16 @@ if (Object.getOwnPropertyDescriptor(fs, 'promises')) { /***/ }), /***/ 13148: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const jsonFile = __webpack_require__(48229) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const jsonFile = __nccwpck_require__(48229) -jsonFile.outputJson = u(__webpack_require__(44029)) -jsonFile.outputJsonSync = __webpack_require__(86105) +jsonFile.outputJson = u(__nccwpck_require__(44029)) +jsonFile.outputJsonSync = __nccwpck_require__(86105) // aliases jsonFile.outputJSON = jsonFile.outputJson jsonFile.outputJSONSync = jsonFile.outputJsonSync @@ -37081,13 +37280,13 @@ module.exports = jsonFile /***/ }), /***/ 48229: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const jsonFile = __webpack_require__(28302) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const jsonFile = __nccwpck_require__(28302) module.exports = { // jsonfile exports @@ -37101,15 +37300,15 @@ module.exports = { /***/ }), /***/ 86105: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(58844) -const jsonFile = __webpack_require__(48229) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(58844) +const jsonFile = __nccwpck_require__(48229) function outputJsonSync (file, data, options) { const dir = path.dirname(file) @@ -37127,15 +37326,15 @@ module.exports = outputJsonSync /***/ }), /***/ 44029: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(58844) -const pathExists = __webpack_require__(86119).pathExists -const jsonFile = __webpack_require__(48229) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(58844) +const pathExists = __nccwpck_require__(86119).pathExists +const jsonFile = __nccwpck_require__(48229) function outputJson (file, data, options, callback) { if (typeof options === 'function') { @@ -37162,13 +37361,13 @@ module.exports = outputJson /***/ }), /***/ 58844: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const mkdirs = u(__webpack_require__(46010)) -const mkdirsSync = __webpack_require__(60214) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const mkdirs = u(__nccwpck_require__(46010)) +const mkdirsSync = __nccwpck_require__(60214) module.exports = { mkdirs, @@ -37184,14 +37383,14 @@ module.exports = { /***/ }), /***/ 60214: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const invalidWin32Path = __webpack_require__(96793).invalidWin32Path +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const invalidWin32Path = __nccwpck_require__(96793).invalidWin32Path const o777 = parseInt('0777', 8) @@ -37246,14 +37445,14 @@ module.exports = mkdirsSync /***/ }), /***/ 46010: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const invalidWin32Path = __webpack_require__(96793).invalidWin32Path +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const invalidWin32Path = __nccwpck_require__(96793).invalidWin32Path const o777 = parseInt('0777', 8) @@ -37317,12 +37516,12 @@ module.exports = mkdirs /***/ }), /***/ 96793: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622) +const path = __nccwpck_require__(85622) // get drive on windows function getRootPath (p) { @@ -37350,30 +37549,30 @@ module.exports = { /***/ }), /***/ 22332: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { - moveSync: __webpack_require__(65613) + moveSync: __nccwpck_require__(65613) } /***/ }), /***/ 65613: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copySync = __webpack_require__(5799).copySync -const removeSync = __webpack_require__(40153).removeSync -const mkdirpSync = __webpack_require__(58844).mkdirpSync -const stat = __webpack_require__(77928) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const copySync = __nccwpck_require__(5799).copySync +const removeSync = __nccwpck_require__(40153).removeSync +const mkdirpSync = __nccwpck_require__(58844).mkdirpSync +const stat = __nccwpck_require__(77928) function moveSync (src, dest, opts) { opts = opts || {} @@ -37418,32 +37617,32 @@ module.exports = moveSync /***/ }), /***/ 77818: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E +const u = __nccwpck_require__(24437)/* .fromCallback */ .E module.exports = { - move: u(__webpack_require__(36000)) + move: u(__nccwpck_require__(36000)) } /***/ }), /***/ 36000: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copy = __webpack_require__(23583).copy -const remove = __webpack_require__(40153).remove -const mkdirp = __webpack_require__(58844).mkdirp -const pathExists = __webpack_require__(86119).pathExists -const stat = __webpack_require__(77928) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const copy = __nccwpck_require__(23583).copy +const remove = __nccwpck_require__(40153).remove +const mkdirp = __nccwpck_require__(58844).mkdirp +const pathExists = __nccwpck_require__(86119).pathExists +const stat = __nccwpck_require__(77928) function move (src, dest, opts, cb) { if (typeof opts === 'function') { @@ -37505,16 +37704,16 @@ module.exports = move /***/ }), /***/ 28158: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(58844) -const pathExists = __webpack_require__(86119).pathExists +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(58844) +const pathExists = __nccwpck_require__(86119).pathExists function outputFile (file, data, encoding, callback) { if (typeof encoding === 'function') { @@ -37553,12 +37752,12 @@ module.exports = { /***/ }), /***/ 86119: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromPromise */ .p -const fs = __webpack_require__(59330) +const u = __nccwpck_require__(24437)/* .fromPromise */ .p +const fs = __nccwpck_require__(59330) function pathExists (path) { return fs.access(path).then(() => true).catch(() => false) @@ -37573,13 +37772,13 @@ module.exports = { /***/ }), /***/ 40153: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const rimraf = __webpack_require__(32852) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const rimraf = __nccwpck_require__(32852) module.exports = { remove: u(rimraf), @@ -37590,14 +37789,14 @@ module.exports = { /***/ }), /***/ 32852: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const assert = __webpack_require__(42357) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const assert = __nccwpck_require__(42357) const isWindows = (process.platform === 'win32') @@ -37932,13 +38131,13 @@ module.exports = function (size) { /***/ }), /***/ 77928: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) const NODE_VERSION_MAJOR_WITH_BIGINT = 10 const NODE_VERSION_MINOR_WITH_BIGINT = 5 @@ -38112,14 +38311,14 @@ module.exports = { /***/ }), /***/ 97408: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const os = __webpack_require__(12087) -const path = __webpack_require__(85622) +const fs = __nccwpck_require__(82161) +const os = __nccwpck_require__(12087) +const path = __nccwpck_require__(85622) // HFS, ext{2,3}, FAT do not, Node.js v0.10 does not function hasMillisResSync () { @@ -38199,13 +38398,13 @@ module.exports = { /***/ }), /***/ 28302: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var _fs try { - _fs = __webpack_require__(82161) + _fs = __nccwpck_require__(82161) } catch (_) { - _fs = __webpack_require__(35747) + _fs = __nccwpck_require__(35747) } function readFile (file, options, callback) { @@ -38339,6331 +38538,2677 @@ module.exports = jsonfile /***/ }), -/***/ 24437: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 2217: +/***/ ((module, exports) => { +exports = module.exports = SemVer -exports.E = function (fn) { - return Object.defineProperty(function () { - if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments) - else { - return new Promise((resolve, reject) => { - arguments[arguments.length] = (err, res) => { - if (err) return reject(err) - resolve(res) - } - arguments.length++ - fn.apply(this, arguments) - }) - } - }, 'name', { value: fn.name }) +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} } -exports.p = function (fn) { - return Object.defineProperty(function () { - const cb = arguments[arguments.length - 1] - if (typeof cb !== 'function') return fn.apply(this, arguments) - else fn.apply(this, arguments).then(r => cb(null, r), cb) - }, 'name', { value: fn.name }) +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' + +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 + +// The actual regexps go on exports.re +var re = exports.re = [] +var src = exports.src = [] +var t = exports.tokens = {} +var R = 0 + +function tok (n) { + t[n] = R++ } +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. -/***/ }), +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. -/***/ 24120: -/***/ ((module, exports, __webpack_require__) => { +tok('NUMERICIDENTIFIER') +src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' +tok('NUMERICIDENTIFIERLOOSE') +src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' -"use strict"; +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. -/// -/// -/// -/// -Object.defineProperty(exports, "__esModule", ({ value: true })); -// TODO: Use the `URL` global when targeting Node.js 10 -// tslint:disable-next-line -const URLGlobal = typeof URL === 'undefined' ? __webpack_require__(78835).URL : URL; -const toString = Object.prototype.toString; -const isOfType = (type) => (value) => typeof value === type; -const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input); -const getObjectType = (value) => { - const objectName = toString.call(value).slice(8, -1); - if (objectName) { - return objectName; - } - return null; -}; -const isObjectOfType = (type) => (value) => getObjectType(value) === type; -function is(value) { - switch (value) { - case null: - return "null" /* null */; - case true: - case false: - return "boolean" /* boolean */; - default: - } - switch (typeof value) { - case 'undefined': - return "undefined" /* undefined */; - case 'string': - return "string" /* string */; - case 'number': - return "number" /* number */; - case 'symbol': - return "symbol" /* symbol */; - default: - } - if (is.function_(value)) { - return "Function" /* Function */; - } - if (is.observable(value)) { - return "Observable" /* Observable */; - } - if (Array.isArray(value)) { - return "Array" /* Array */; - } - if (isBuffer(value)) { - return "Buffer" /* Buffer */; - } - const tagType = getObjectType(value); - if (tagType) { - return tagType; - } - if (value instanceof String || value instanceof Boolean || value instanceof Number) { - throw new TypeError('Please don\'t use object wrappers for primitive types'); - } - return "Object" /* Object */; -} -(function (is) { - // tslint:disable-next-line:strict-type-predicates - const isObject = (value) => typeof value === 'object'; - // tslint:disable:variable-name - is.undefined = isOfType('undefined'); - is.string = isOfType('string'); - is.number = isOfType('number'); - is.function_ = isOfType('function'); - // tslint:disable-next-line:strict-type-predicates - is.null_ = (value) => value === null; - is.class_ = (value) => is.function_(value) && value.toString().startsWith('class '); - is.boolean = (value) => value === true || value === false; - is.symbol = isOfType('symbol'); - // tslint:enable:variable-name - is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value)); - is.array = Array.isArray; - is.buffer = isBuffer; - is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); - is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value)); - is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]); - is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]); - is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); - is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value); - const hasPromiseAPI = (value) => !is.null_(value) && - isObject(value) && - is.function_(value.then) && - is.function_(value.catch); - is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); - is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */); - is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */); - is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); - is.regExp = isObjectOfType("RegExp" /* RegExp */); - is.date = isObjectOfType("Date" /* Date */); - is.error = isObjectOfType("Error" /* Error */); - is.map = (value) => isObjectOfType("Map" /* Map */)(value); - is.set = (value) => isObjectOfType("Set" /* Set */)(value); - is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value); - is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value); - is.int8Array = isObjectOfType("Int8Array" /* Int8Array */); - is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */); - is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */); - is.int16Array = isObjectOfType("Int16Array" /* Int16Array */); - is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */); - is.int32Array = isObjectOfType("Int32Array" /* Int32Array */); - is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */); - is.float32Array = isObjectOfType("Float32Array" /* Float32Array */); - is.float64Array = isObjectOfType("Float64Array" /* Float64Array */); - is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */); - is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */); - is.dataView = isObjectOfType("DataView" /* DataView */); - is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype; - is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value); - is.urlString = (value) => { - if (!is.string(value)) { - return false; - } - try { - new URLGlobal(value); // tslint:disable-line no-unused-expression - return true; - } - catch (_a) { - return false; - } - }; - is.truthy = (value) => Boolean(value); - is.falsy = (value) => !value; - is.nan = (value) => Number.isNaN(value); - const primitiveTypes = new Set([ - 'undefined', - 'string', - 'number', - 'boolean', - 'symbol' - ]); - is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value); - is.integer = (value) => Number.isInteger(value); - is.safeInteger = (value) => Number.isSafeInteger(value); - is.plainObject = (value) => { - // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js - let prototype; - return getObjectType(value) === "Object" /* Object */ && - (prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator - prototype === Object.getPrototypeOf({})); - }; - const typedArrayTypes = new Set([ - "Int8Array" /* Int8Array */, - "Uint8Array" /* Uint8Array */, - "Uint8ClampedArray" /* Uint8ClampedArray */, - "Int16Array" /* Int16Array */, - "Uint16Array" /* Uint16Array */, - "Int32Array" /* Int32Array */, - "Uint32Array" /* Uint32Array */, - "Float32Array" /* Float32Array */, - "Float64Array" /* Float64Array */ - ]); - is.typedArray = (value) => { - const objectType = getObjectType(value); - if (objectType === null) { - return false; - } - return typedArrayTypes.has(objectType); - }; - const isValidLength = (value) => is.safeInteger(value) && value > -1; - is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); - is.inRange = (value, range) => { - if (is.number(range)) { - return value >= Math.min(0, range) && value <= Math.max(range, 0); - } - if (is.array(range) && range.length === 2) { - return value >= Math.min(...range) && value <= Math.max(...range); - } - throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); - }; - const NODE_TYPE_ELEMENT = 1; - const DOM_PROPERTIES_TO_CHECK = [ - 'innerHTML', - 'ownerDocument', - 'style', - 'attributes', - 'nodeValue' - ]; - is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) && - !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value); - is.observable = (value) => { - if (!value) { - return false; - } - if (value[Symbol.observable] && value === value[Symbol.observable]()) { - return true; - } - if (value['@@observable'] && value === value['@@observable']()) { - return true; - } - return false; - }; - is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value); - is.infinite = (value) => value === Infinity || value === -Infinity; - const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem; - is.even = isAbsoluteMod2(0); - is.odd = isAbsoluteMod2(1); - const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false; - is.emptyArray = (value) => is.array(value) && value.length === 0; - is.nonEmptyArray = (value) => is.array(value) && value.length > 0; - is.emptyString = (value) => is.string(value) && value.length === 0; - is.nonEmptyString = (value) => is.string(value) && value.length > 0; - is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); - is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; - is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; - is.emptySet = (value) => is.set(value) && value.size === 0; - is.nonEmptySet = (value) => is.set(value) && value.size > 0; - is.emptyMap = (value) => is.map(value) && value.size === 0; - is.nonEmptyMap = (value) => is.map(value) && value.size > 0; - const predicateOnArray = (method, predicate, values) => { - if (is.function_(predicate) === false) { - throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); - } - if (values.length === 0) { - throw new TypeError('Invalid number of values'); - } - return method.call(values, predicate); - }; - // tslint:disable variable-name - is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values); - is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); - // tslint:enable variable-name -})(is || (is = {})); -// Some few keywords are reserved, but we'll populate them for Node.js users -// See https://github.com/Microsoft/TypeScript/issues/2536 -Object.defineProperties(is, { - class: { - value: is.class_ - }, - function: { - value: is.function_ - }, - null: { - value: is.null_ - } -}); -exports.default = is; -// For CommonJS default export support -module.exports = is; -module.exports.default = is; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 8595: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +tok('NONNUMERICIDENTIFIER') +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' -"use strict"; +// ## Main Version +// Three dot-separated numeric identifiers. -const deferToConnect = __webpack_require__(12097); +tok('MAINVERSION') +src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')' -module.exports = request => { - const timings = { - start: Date.now(), - socket: null, - lookup: null, - connect: null, - upload: null, - response: null, - end: null, - error: null, - phases: { - wait: null, - dns: null, - tcp: null, - request: null, - firstByte: null, - download: null, - total: null - } - }; +tok('MAINVERSIONLOOSE') +src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' - const handleError = origin => { - const emit = origin.emit.bind(origin); - origin.emit = (event, ...args) => { - // Catches the `error` event - if (event === 'error') { - timings.error = Date.now(); - timings.phases.total = timings.error - timings.start; +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. - origin.emit = emit; - } +tok('PRERELEASEIDENTIFIER') +src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' - // Saves the original behavior - return emit(event, ...args); - }; - }; +tok('PRERELEASEIDENTIFIERLOOSE') +src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' - let uploadFinished = false; - const onUpload = () => { - timings.upload = Date.now(); - timings.phases.request = timings.upload - timings.connect; - }; +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. - handleError(request); +tok('PRERELEASE') +src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' - request.once('socket', socket => { - timings.socket = Date.now(); - timings.phases.wait = timings.socket - timings.start; +tok('PRERELEASELOOSE') +src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' - const lookupListener = () => { - timings.lookup = Date.now(); - timings.phases.dns = timings.lookup - timings.socket; - }; +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. - socket.once('lookup', lookupListener); +tok('BUILDIDENTIFIER') +src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' - deferToConnect(socket, () => { - timings.connect = Date.now(); +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. - if (timings.lookup === null) { - socket.removeListener('lookup', lookupListener); - timings.lookup = timings.connect; - timings.phases.dns = timings.lookup - timings.socket; - } +tok('BUILD') +src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' - timings.phases.tcp = timings.connect - timings.lookup; +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. - if (uploadFinished && !timings.upload) { - onUpload(); - } - }); - }); +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. - request.once('finish', () => { - uploadFinished = true; +tok('FULL') +tok('FULLPLAIN') +src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + + src[t.PRERELEASE] + '?' + + src[t.BUILD] + '?' - if (timings.connect) { - onUpload(); - } - }); +src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' - request.once('response', response => { - timings.response = Date.now(); - timings.phases.firstByte = timings.response - timings.upload; +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +tok('LOOSEPLAIN') +src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + + src[t.PRERELEASELOOSE] + '?' + + src[t.BUILD] + '?' - handleError(response); +tok('LOOSE') +src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' - response.once('end', () => { - timings.end = Date.now(); - timings.phases.download = timings.end - timings.response; - timings.phases.total = timings.end - timings.start; - }); - }); +tok('GTLT') +src[t.GTLT] = '((?:<|>)?=?)' - return timings; -}; +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +tok('XRANGEIDENTIFIERLOOSE') +src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +tok('XRANGEIDENTIFIER') +src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' +tok('XRANGEPLAIN') +src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:' + src[t.PRERELEASE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' -/***/ }), +tok('XRANGEPLAINLOOSE') +src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[t.PRERELEASELOOSE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' -/***/ 58588: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +tok('XRANGE') +src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' +tok('XRANGELOOSE') +src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' -"use strict"; -/* module decorator */ module = __webpack_require__.nmd(module); +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +tok('COERCE') +src[t.COERCE] = '(^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' +tok('COERCERTL') +re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') +// Tilde ranges. +// Meaning is "reasonably at or greater than" +tok('LONETILDE') +src[t.LONETILDE] = '(?:~>?)' -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; +tok('TILDETRIM') +src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' +re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +var tildeTrimReplace = '$1~' -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; +tok('TILDE') +src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' +tok('TILDELOOSE') +src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; +// Caret ranges. +// Meaning is "at least and backwards compatible with" +tok('LONECARET') +src[t.LONECARET] = '(?:\\^)' -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; +tok('CARETTRIM') +src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' +re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +var caretTrimReplace = '$1^' -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); +tok('CARET') +src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' +tok('CARETLOOSE') +src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); +// A simple gt/lt/eq thing, or just "" to indicate "any version" +tok('COMPARATORLOOSE') +src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' +tok('COMPARATOR') +src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' - return value; - }, - enumerable: true, - configurable: true - }); -}; +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +tok('COMPARATORTRIM') +src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = __webpack_require__(73991); - } +// this one has to use the /g flag +re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +var comparatorTrimReplace = '$1$2$3' - const offset = isBackground ? 10 : 0; - const styles = {}; +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +tok('HYPHENRANGE') +src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAIN] + ')' + + '\\s*$' - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } +tok('HYPHENRANGELOOSE') +src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s*$' - return styles; -}; +// Star ranges basically just allow anything at all. +tok('STAR') +src[t.STAR] = '(<|>)?=?\\s*\\*' -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + } +} - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; + if (version instanceof SemVer) { + return version + } - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + if (typeof version !== 'string') { + return null + } - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; + if (version.length > MAX_LENGTH) { + return null + } - group[styleName] = styles[styleName]; + var r = options.loose ? re[t.LOOSE] : re[t.FULL] + if (!r.test(version)) { + return null + } - codes.set(style[0], style[1]); - } + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; +exports.SemVer = SemVer - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } - return styles; -} + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose -/***/ }), + var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) -/***/ 52357: -/***/ ((module) => { + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } -"use strict"; + this.raw = version + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] -// there's 3 implementations written in increasing order of efficiency + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } -// 1 - no Set type is defined -function uniqNoSet(arr) { - var ret = []; + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } - for (var i = 0; i < arr.length; i++) { - if (ret.indexOf(arr[i]) === -1) { - ret.push(arr[i]); - } - } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } - return ret; + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() } -// 2 - a simple Set type is defined -function uniqSet(arr) { - var seen = new Set(); - return arr.filter(function (el) { - if (!seen.has(el)) { - seen.add(el); - return true; - } +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} - return false; - }); +SemVer.prototype.toString = function () { + return this.version } -// 3 - a standard Set type is defined and it has a forEach method -function uniqSetWithForEach(arr) { - var ret = []; +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } - (new Set(arr)).forEach(function (el) { - ret.push(el); - }); + return this.compareMain(other) || this.comparePre(other) +} - return ret; +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) } -// V8 currently has a broken implementation -// https://github.com/joyent/node/issues/8449 -function doesForEachActuallyWork() { - var ret = false; +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } - (new Set([true])).forEach(function (el) { - ret = el; - }); + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } - return ret === true; + var i = 0 + do { + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) } -if ('Set' in global) { - if (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) { - module.exports = uniqSetWithForEach; - } else { - module.exports = uniqSet; - } -} else { - module.exports = uniqNoSet; +SemVer.prototype.compareBuild = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + var i = 0 + do { + var a = this.build[i] + var b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) } +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break -/***/ }), + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} -/***/ 84653: -/***/ (function(module, exports, __webpack_require__) { +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } -/* module decorator */ module = __webpack_require__.nmd(module); -(function (global, factory) { - true ? factory(exports) : - 0; -}(this, (function (exports) { 'use strict'; + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} -function slice(arrayLike, start) { - start = start|0; - var newLen = Math.max(arrayLike.length - start, 0); - var newArr = Array(newLen); - for(var idx = 0; idx < newLen; idx++) { - newArr[idx] = arrayLike[start + idx]; +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } } - return newArr; + return defaultResult // may be undefined + } } -/** - * Creates a continuation function with some arguments already applied. - * - * Useful as a shorthand when combined with other control flow functions. Any - * arguments passed to the returned function are added to the arguments - * originally passed to apply. - * - * @name apply - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {Function} fn - The function you want to eventually apply all - * arguments to. Invokes with (arguments...). - * @param {...*} arguments... - Any number of arguments to automatically apply - * when the continuation is called. - * @returns {Function} the partially-applied function - * @example - * - * // using apply - * async.parallel([ - * async.apply(fs.writeFile, 'testfile1', 'test1'), - * async.apply(fs.writeFile, 'testfile2', 'test2') - * ]); - * - * - * // the same process without using apply - * async.parallel([ - * function(callback) { - * fs.writeFile('testfile1', 'test1', callback); - * }, - * function(callback) { - * fs.writeFile('testfile2', 'test2', callback); - * } - * ]); - * - * // It's possible to pass any number of additional arguments when calling the - * // continuation: - * - * node> var fn = async.apply(sys.puts, 'one'); - * node> fn('two', 'three'); - * one - * two - * three - */ -var apply = function(fn/*, ...args*/) { - var args = slice(arguments, 1); - return function(/*callArgs*/) { - var callArgs = slice(arguments); - return fn.apply(null, args.concat(callArgs)); - }; -}; +exports.compareIdentifiers = compareIdentifiers -var initialParams = function (fn) { - return function (/*...args, callback*/) { - var args = slice(arguments); - var callback = args.pop(); - fn.call(this, args, callback); - }; -}; +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 } -var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; -var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} -function fallback(fn) { - setTimeout(fn, 0); +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major } -function wrap(defer) { - return function (fn/*, ...args*/) { - var args = slice(arguments, 1); - defer(function () { - fn.apply(null, args); - }); - }; +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor } -var _defer; +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} -if (hasSetImmediate) { - _defer = setImmediate; -} else if (hasNextTick) { - _defer = process.nextTick; -} else { - _defer = fallback; +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) } -var setImmediate$1 = wrap(_defer); +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} -/** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ -function asyncify(func) { - return initialParams(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (isObject(result) && typeof result.then === 'function') { - result.then(function(value) { - invokeCallback(callback, null, value); - }, function(err) { - invokeCallback(callback, err.message ? err : new Error(err)); - }); - } else { - callback(null, result); - } - }); +exports.compareBuild = compareBuild +function compareBuild (a, b, loose) { + var versionA = new SemVer(a, loose) + var versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) } -function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (e) { - setImmediate$1(rethrow, e); - } +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) } -function rethrow(error) { - throw error; +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(a, b, loose) + }) } -var supportsSymbol = typeof Symbol === 'function'; +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(b, a, loose) + }) +} -function isAsync(fn) { - return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction'; +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 } -function wrapAsync(asyncFn) { - return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 } -function applyEach$1(eachfn) { - return function(fns/*, ...args*/) { - var args = slice(arguments, 1); - var go = initialParams(function(args, callback) { - var that = this; - return eachfn(fns, function (fn, cb) { - wrapAsync(fn).apply(that, args.concat(cb)); - }, callback); - }); - if (args.length) { - return go.apply(this, args); - } - else { - return go; - } - }; +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 } -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} -/** Built-in value references. */ -var Symbol$1 = root.Symbol; +exports.cmp = cmp +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b -/** Used for built-in method references. */ -var objectProto = Object.prototype; + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + case '': + case '=': + case '==': + return eq(a, b, loose) -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; + case '!=': + return neq(a, b, loose) -/** Built-in value references. */ -var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined; + case '>': + return gt(a, b, loose) -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag$1), - tag = value[symToStringTag$1]; + case '>=': + return gte(a, b, loose) - try { - value[symToStringTag$1] = undefined; - var unmasked = true; - } catch (e) {} + case '<': + return lt(a, b, loose) - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag$1] = tag; + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp } else { - delete value[symToStringTag$1]; + comp = comp.value } } - return result; -} -/** Used for built-in method references. */ -var objectProto$1 = Object.prototype; + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString$1 = objectProto$1.toString; + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString$1.call(value); + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) } -/** `Object#toString` result references. */ -var nullTag = '[object Null]'; -var undefinedTag = '[object Undefined]'; +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var m = comp.match(r) -/** Built-in value references. */ -var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined; - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} -/** `Object#toString` result references. */ -var asyncTag = '[object AsyncFunction]'; -var funcTag = '[object Function]'; -var genTag = '[object GeneratorFunction]'; -var proxyTag = '[object Proxy]'; + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - if (!isObject(value)) { - return false; + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +Comparator.prototype.toString = function () { + return this.value } -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) -// A temporary value used to identify if the loop should be broken. -// See #1064, #1293 -var breakLoop = {}; + if (this.semver === ANY || version === ANY) { + return true + } -/** - * This method returns `undefined`. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * _.times(2, _.noop); - * // => [undefined, undefined] - */ -function noop() { - // No operation performed. -} + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } -function once(fn) { - return function () { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, arguments); - }; + return cmp(version, this.operator, this.semver, this.options) } -var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator; +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } -var getIterator = function (coll) { - return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol](); -}; + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); + var rangeTmp - while (++index < n) { - result[index] = iteratee(index); + if (this.operator === '') { + if (this.value === '') { + return true + } + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) } - return result; -} -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan } -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } -/** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; -} + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } -/** Used for built-in method references. */ -var objectProto$3 = Object.prototype; + if (range instanceof Comparator) { + return new Range(range.value, options) + } -/** Used to check objects for own properties. */ -var hasOwnProperty$2 = objectProto$3.hasOwnProperty; + if (!(this instanceof Range)) { + return new Range(range, options) + } -/** Built-in value references. */ -var propertyIsEnumerable = objectProto$3.propertyIsEnumerable; + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); -}; + // First, split based on boolean or || + this.raw = range + this.set = range.split(/\s*\|\|\s*/).map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range) + } -/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; + this.format() } -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; +Range.prototype.toString = function () { + return this.range +} -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + range = range.trim() + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[t.COMPARATORTRIM]) -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER$1 = 9007199254740991; + // normalize spaces + range = range.split(/\s+/).join(' ') -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; + // At this point, the range is completely trimmed and + // ready to be split into comparators. -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER$1 : length; + var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); + return set } -/** `Object#toString` result references. */ -var argsTag$1 = '[object Arguments]'; -var arrayTag = '[object Array]'; -var boolTag = '[object Boolean]'; -var dateTag = '[object Date]'; -var errorTag = '[object Error]'; -var funcTag$1 = '[object Function]'; -var mapTag = '[object Map]'; -var numberTag = '[object Number]'; -var objectTag = '[object Object]'; -var regexpTag = '[object RegExp]'; -var setTag = '[object Set]'; -var stringTag = '[object String]'; -var weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]'; -var dataViewTag = '[object DataView]'; -var float32Tag = '[object Float32Array]'; -var float64Tag = '[object Float64Array]'; -var int8Tag = '[object Int8Array]'; -var int16Tag = '[object Int16Array]'; -var int32Tag = '[object Int32Array]'; -var uint8Tag = '[object Uint8Array]'; -var uint8ClampedTag = '[object Uint8ClampedArray]'; -var uint16Tag = '[object Uint16Array]'; -var uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag$1] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + return this.set.some(function (thisComparators) { + return ( + isSatisfiable(thisComparators, options) && + range.set.some(function (rangeComparators) { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every(function (thisComparator) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) } -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} +// take a set of comparators and determine whether there +// exists a version which can satisfy it +function isSatisfiable (comparators, options) { + var result = true + var remainingComparators = comparators.slice() + var testComparator = remainingComparators.pop() -/** Detect free variable `exports`. */ -var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports; + while (result && remainingComparators.length) { + result = remainingComparators.every(function (otherComparator) { + return testComparator.intersects(otherComparator, options) + }) -/** Detect free variable `module`. */ -var freeModule$1 = freeExports$1 && "object" == 'object' && module && !module.nodeType && module; + testComparator = remainingComparators.pop() + } -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; + return result +} -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports$1 && freeGlobal.process; +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); - -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - -/** Used for built-in method references. */ -var objectProto$2 = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty$1 = objectProto$2.hasOwnProperty; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty$1.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; -} - -/** Used for built-in method references. */ -var objectProto$5 = Object.prototype; - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5; - - return value === proto; -} - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object); - -/** Used for built-in method references. */ -var objectProto$4 = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty$3 = objectProto$4.hasOwnProperty; - -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty$3.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp } -function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? {value: coll[i], key: i} : null; - } +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' } -function createES2015Iterator(iterator) { - var i = -1; - return function next() { - var item = iterator.next(); - if (item.done) - return null; - i++; - return {value: item.value, key: i}; - } +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') } -function createObjectIterator(obj) { - var okeys = keys(obj); - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - return i < len ? {value: obj[key], key: key} : null; - }; -} +function replaceTilde (comp, options) { + var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret -function iterator(coll) { - if (isArrayLike(coll)) { - return createArrayIterator(coll); + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' } - var iterator = getIterator(coll); - return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); + debug('tilde return', ret) + return ret + }) } -function onlyOnce(fn) { - return function() { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, arguments); - }; +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') } -function _eachOfLimit(limit) { - return function (obj, iteratee, callback) { - callback = once(callback || noop); - if (limit <= 0 || !obj) { - return callback(null); - } - var nextElem = iterator(obj); - var done = false; - var running = 0; - var looping = false; +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret - function iterateeCallback(err, value) { - running -= 1; - if (err) { - done = true; - callback(err); - } - else if (value === breakLoop || (done && running <= 0)) { - done = true; - return callback(null); - } - else if (!looping) { - replenish(); - } + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' } - - function replenish () { - looping = true; - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); - } - looping = false; + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } - replenish(); - }; + debug('caret return', ret) + return ret + }) } -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - */ -function eachOfLimit(coll, limit, iteratee, callback) { - _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') } -function doLimit(fn, limit) { - return function (iterable, iteratee, callback) { - return fn(iterable, limit, iteratee, callback); - }; -} +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp -// eachOf implementation optimized for array-likes -function eachOfArrayLike(coll, iteratee, callback) { - callback = once(callback || noop); - var index = 0, - completed = 0, - length = coll.length; - if (length === 0) { - callback(null); + if (gtlt === '=' && anyX) { + gtlt = '' } - function iteratorCallback(err, value) { - if (err) { - callback(err); - } else if ((++completed === length) || value === breakLoop) { - callback(null); + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 } - } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } - for (; index < length; index++) { - iteratee(coll[index], index, onlyOnce(iteratorCallback)); + ret = gtlt + M + '.' + m + '.' + p + pr + } else if (xm) { + ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr + } else if (xp) { + ret = '>=' + M + '.' + m + '.0' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + pr } -} -// a generic version of eachOf which can handle array, object, and iterator cases. -var eachOfGeneric = doLimit(eachOfLimit, Infinity); - -/** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @example - * - * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; - * var configs = {}; - * - * async.forEachOf(obj, function (value, key, callback) { - * fs.readFile(__dirname + value, "utf8", function (err, data) { - * if (err) return callback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * }, function (err) { - * if (err) console.error(err.message); - * // configs is now a map of JSON data - * doSomethingWith(configs); - * }); - */ -var eachOf = function(coll, iteratee, callback) { - var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; - eachOfImplementation(coll, wrapAsync(iteratee), callback); -}; + debug('xRange return', ret) -function doParallel(fn) { - return function (obj, iteratee, callback) { - return fn(eachOf, obj, wrapAsync(iteratee), callback); - }; + return ret + }) } -function _asyncMap(eachfn, arr, iteratee, callback) { - callback = callback || noop; - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = wrapAsync(iteratee); - - eachfn(arr, function (value, _, callback) { - var index = counter++; - _iteratee(value, function (err, v) { - results[index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[t.STAR], '') } -/** - * Produces a new collection of values by mapping each value in `coll` through - * the `iteratee` function. The `iteratee` is called with an item from `coll` - * and a callback for when it has finished processing. Each of these callback - * takes 2 arguments: an `error`, and the transformed item from `coll`. If - * `iteratee` passes an error to its callback, the main `callback` (for the - * `map` function) is immediately called with the error. - * - * Note, that since this function applies the `iteratee` to each item in - * parallel, there is no guarantee that the `iteratee` functions will complete - * in order. However, the results array will be in the same order as the - * original `coll`. - * - * If `map` is passed an Object, the results will be an Array. The results - * will roughly be in the order of the original Objects' keys (but this can - * vary across JavaScript engines). - * - * @name map - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an Array of the - * transformed items from the `coll`. Invoked with (err, results). - * @example - * - * async.map(['file1','file2','file3'], fs.stat, function(err, results) { - * // results is now an array of stats for each file - * }); - */ -var map = doParallel(_asyncMap); +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } -/** - * Applies the provided arguments to each function in the array, calling - * `callback` after all functions have completed. If you only provide the first - * argument, `fns`, then it will return a function which lets you pass in the - * arguments as if it were a single function call. If more arguments are - * provided, `callback` is required while `args` is still optional. - * - * @name applyEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s - * to all call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {Function} - If only the first argument, `fns`, is provided, it will - * return a function which lets you pass in the arguments as if it were a single - * function call. The signature is `(..args, callback)`. If invoked with any - * arguments, `callback` is required. - * @example - * - * async.applyEach([enableSearch, updateSchema], 'bucket', callback); - * - * // partial application example: - * async.each( - * buckets, - * async.applyEach([enableSearch, updateSchema]), - * callback - * ); - */ -var applyEach = applyEach$1(map); + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } -function doParallelLimit(fn) { - return function (obj, limit, iteratee, callback) { - return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback); - }; + return (from + ' ' + to).trim() } -/** - * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. - * - * @name mapLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - */ -var mapLimit = doParallelLimit(_asyncMap); - -/** - * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. - * - * @name mapSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - */ -var mapSeries = doLimit(mapLimit, 1); - -/** - * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. - * - * @name applyEachSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.applyEach]{@link module:ControlFlow.applyEach} - * @category Control Flow - * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all - * call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {Function} - If only the first argument is provided, it will return - * a function which lets you pass in the arguments as if it were a single - * function call. - */ -var applyEachSeries = applyEach$1(mapSeries); +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true } } - return array; + return false } -/** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } } } - return object; - }; -} -/** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); + // Version has a -pre, but it's not one of the ones we like. + return false + } -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); + return true } -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false } - return -1; -} - -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; + return range.test(version) } -/** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null } - return -1; -} - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max } -/** - * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on - * their requirements. Each function can optionally depend on other functions - * being completed first, and each function is run as soon as its requirements - * are satisfied. - * - * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence - * will stop. Further tasks will not execute (so any other functions depending - * on it will not run), and the main `callback` is immediately called with the - * error. - * - * {@link AsyncFunction}s also receive an object containing the results of functions which - * have completed so far as the first argument, if they have dependencies. If a - * task function has no dependencies, it will only be passed a callback. - * - * @name auto - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Object} tasks - An object. Each of its properties is either a - * function or an array of requirements, with the {@link AsyncFunction} itself the last item - * in the array. The object's key of a property serves as the name of the task - * defined by that property, i.e. can be used when specifying requirements for - * other tasks. The function receives one or two arguments: - * * a `results` object, containing the results of the previously executed - * functions, only passed if the task has any dependencies, - * * a `callback(err, result)` function, which must be called when finished, - * passing an `error` (which can be `null`) and the result of the function's - * execution. - * @param {number} [concurrency=Infinity] - An optional `integer` for - * determining the maximum number of tasks that can be run in parallel. By - * default, as many as possible. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback. Results are always returned; however, if an - * error occurs, no further `tasks` will be performed, and the results object - * will only contain partial results. Invoked with (err, results). - * @returns undefined - * @example - * - * async.auto({ - * // this function will just be passed a callback - * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'), - * showData: ['readData', function(results, cb) { - * // results.readData is the file's contents - * // ... - * }] - * }, callback); - * - * async.auto({ - * get_data: function(callback) { - * console.log('in get_data'); - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * console.log('in make_folder'); - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * console.log('in write_file', JSON.stringify(results)); - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * console.log('in email_link', JSON.stringify(results)); - * // once the file is written let's email a link to it... - * // results.write_file contains the filename returned by write_file. - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }, function(err, results) { - * console.log('err = ', err); - * console.log('results = ', results); - * }); - */ -var auto = function (tasks, concurrency, callback) { - if (typeof concurrency === 'function') { - // concurrency is optional, shift the args. - callback = concurrency; - concurrency = null; - } - callback = once(callback || noop); - var keys$$1 = keys(tasks); - var numTasks = keys$$1.length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } } + }) + return min +} - var results = {}; - var runningTasks = 0; - var hasError = false; - - var listeners = Object.create(null); - - var readyTasks = []; +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) - // for cycle detection: - var readyToCheck = []; // tasks that have been identified as reachable - // without the possibility of returning to an ancestor task - var uncheckedDependencies = {}; + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } - baseForOwn(tasks, function (task, key) { - if (!isArray(task)) { - // no dependencies - enqueueTask(key, [task]); - readyToCheck.push(key); - return; - } + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; - } - uncheckedDependencies[key] = remainingDependencies; - - arrayEach(dependencies, function (dependencyName) { - if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + - '` has a non-existent dependency `' + - dependencyName + '` in ' + - dependencies.join(', ')); - } - addListener(dependencyName, function () { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] - checkForDeadlocks(); - processQueue(); + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } - function enqueueTask(key, task) { - readyTasks.push(function () { - runTask(key, task); - }); - } + if (minver && range.test(minver)) { + return minver + } - function processQueue() { - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while(readyTasks.length && runningTasks < concurrency) { - var run = readyTasks.shift(); - run(); - } + return null +} - } +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} - taskListeners.push(fn); - } +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - arrayEach(taskListeners, function (fn) { - fn(); - }); - processQueue(); - } +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } - function runTask(key, task) { - if (hasError) return; + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } - var taskCallback = onlyOnce(function(err, result) { - runningTasks--; - if (arguments.length > 2) { - result = slice(arguments, 1); - } - if (err) { - var safeResults = {}; - baseForOwn(results, function(val, rkey) { - safeResults[rkey] = val; - }); - safeResults[key] = result; - hasError = true; - listeners = Object.create(null); + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] - runningTasks++; - var taskFn = wrapAsync(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } - } + var high = null + var low = null - function checkForDeadlocks() { - // Kahn's algorithm - // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm - // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - arrayEach(getDependents(currentTask), function (dependent) { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) - if (counter !== numTasks) { - throw new Error( - 'async.auto cannot execute tasks due to a recursive dependency' - ); - } + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false } - function getDependents(taskName) { - var result = []; - baseForOwn(tasks, function (task, key) { - if (isArray(task) && baseIndexOf(task, taskName, 0) >= 0) { - result.push(key); - } - }); - return result; + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false } -}; - -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); } - return result; + return true } -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; -var symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) } -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; +exports.coerce = coerce +function coerce (version, options) { + if (version instanceof SemVer) { + return version } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; + if (typeof version === 'number') { + version = String(version) } - return result; -} - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} -/** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ -function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; + if (typeof version !== 'string') { + return null + } - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; -} + options = options || {} -/** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ -function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; + var match = null + if (!options.rtl) { + match = version.match(re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + var next + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1 + } - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; -} + if (match === null) { + return null + } -/** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function asciiToArray(string) { - return string.split(''); + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) } -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff'; -var rsComboMarksRange = '\\u0300-\\u036f'; -var reComboHalfMarksRange = '\\ufe20-\\ufe2f'; -var rsComboSymbolsRange = '\\u20d0-\\u20ff'; -var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; -var rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsZWJ = '\\u200d'; -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); +/***/ }), -/** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ -function hasUnicode(string) { - return reHasUnicode.test(string); -} - -/** Used to compose unicode character classes. */ -var rsAstralRange$1 = '\\ud800-\\udfff'; -var rsComboMarksRange$1 = '\\u0300-\\u036f'; -var reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f'; -var rsComboSymbolsRange$1 = '\\u20d0-\\u20ff'; -var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1; -var rsVarRange$1 = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange$1 + ']'; -var rsCombo = '[' + rsComboRange$1 + ']'; -var rsFitz = '\\ud83c[\\udffb-\\udfff]'; -var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; -var rsNonAstral = '[^' + rsAstralRange$1 + ']'; -var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; -var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; -var rsZWJ$1 = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?'; -var rsOptVar = '[' + rsVarRange$1 + ']?'; -var rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; -var rsSeq = rsOptVar + reOptMod + rsOptJoin; -var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); +/***/ 24437: +/***/ ((__unused_webpack_module, exports) => { -/** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function unicodeToArray(string) { - return string.match(reUnicode) || []; -} +"use strict"; -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); -} -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); +exports.E = function (fn) { + return Object.defineProperty(function () { + if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments) + else { + return new Promise((resolve, reject) => { + arguments[arguments.length] = (err, res) => { + if (err) return reject(err) + resolve(res) + } + arguments.length++ + fn.apply(this, arguments) + }) + } + }, 'name', { value: fn.name }) } -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** - * Removes leading and trailing whitespace or specified characters from `string`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to trim. - * @param {string} [chars=whitespace] The characters to trim. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {string} Returns the trimmed string. - * @example - * - * _.trim(' abc '); - * // => 'abc' - * - * _.trim('-_-abc-_-', '_-'); - * // => 'abc' - * - * _.map([' foo ', ' bar '], _.trim); - * // => ['foo', 'bar'] - */ -function trim(string, chars, guard) { - string = toString(string); - if (string && (guard || chars === undefined)) { - return string.replace(reTrim, ''); - } - if (!string || !(chars = baseToString(chars))) { - return string; - } - var strSymbols = stringToArray(string), - chrSymbols = stringToArray(chars), - start = charsStartIndex(strSymbols, chrSymbols), - end = charsEndIndex(strSymbols, chrSymbols) + 1; - - return castSlice(strSymbols, start, end).join(''); +exports.p = function (fn) { + return Object.defineProperty(function () { + const cb = arguments[arguments.length - 1] + if (typeof cb !== 'function') return fn.apply(this, arguments) + else fn.apply(this, arguments).then(r => cb(null, r), cb) + }, 'name', { value: fn.name }) } -var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m; -var FN_ARG_SPLIT = /,/; -var FN_ARG = /(=.+)?(\s*)$/; -var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; - -function parseParams(func) { - func = func.toString().replace(STRIP_COMMENTS, ''); - func = func.match(FN_ARGS)[2].replace(' ', ''); - func = func ? func.split(FN_ARG_SPLIT) : []; - func = func.map(function (arg){ - return trim(arg.replace(FN_ARG, '')); - }); - return func; -} -/** - * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent - * tasks are specified as parameters to the function, after the usual callback - * parameter, with the parameter names matching the names of the tasks it - * depends on. This can provide even more readable task graphs which can be - * easier to maintain. - * - * If a final callback is specified, the task results are similarly injected, - * specified as named parameters after the initial error parameter. - * - * The autoInject function is purely syntactic sugar and its semantics are - * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. - * - * @name autoInject - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.auto]{@link module:ControlFlow.auto} - * @category Control Flow - * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of - * the form 'func([dependencies...], callback). The object's key of a property - * serves as the name of the task defined by that property, i.e. can be used - * when specifying requirements for other tasks. - * * The `callback` parameter is a `callback(err, result)` which must be called - * when finished, passing an `error` (which can be `null`) and the result of - * the function's execution. The remaining parameters name other tasks on - * which the task is dependent, and the results from those tasks are the - * arguments of those parameters. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback, and a `results` object with any completed - * task results, similar to `auto`. - * @example - * - * // The example from `auto` can be rewritten as follows: - * async.autoInject({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: function(get_data, make_folder, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }, - * email_link: function(write_file, callback) { - * // once the file is written let's email a link to it... - * // write_file contains the filename returned by write_file. - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * } - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - * - * // If you are using a JS minifier that mangles parameter names, `autoInject` - * // will not work with plain functions, since the parameter names will be - * // collapsed to a single letter identifier. To work around this, you can - * // explicitly specify the names of the parameters your task function needs - * // in an array, similar to Angular.js dependency injection. - * - * // This still has an advantage over plain `auto`, since the results a task - * // depends on are still spread into arguments. - * async.autoInject({ - * //... - * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(write_file, callback) { - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * }] - * //... - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - */ -function autoInject(tasks, callback) { - var newTasks = {}; - - baseForOwn(tasks, function (taskFn, key) { - var params; - var fnIsAsync = isAsync(taskFn); - var hasNoDeps = - (!fnIsAsync && taskFn.length === 1) || - (fnIsAsync && taskFn.length === 0); - - if (isArray(taskFn)) { - params = taskFn.slice(0, -1); - taskFn = taskFn[taskFn.length - 1]; - - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - // no dependencies, use the function as-is - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } +/***/ }), - // remove callback param - if (!fnIsAsync) params.pop(); +/***/ 24120: +/***/ ((module, exports, __nccwpck_require__) => { - newTasks[key] = params.concat(newTask); - } +"use strict"; - function newTask(results, taskCb) { - var newArgs = arrayMap(params, function (name) { - return results[name]; - }); - newArgs.push(taskCb); - wrapAsync(taskFn).apply(null, newArgs); +/// +/// +/// +/// +Object.defineProperty(exports, "__esModule", ({ value: true })); +// TODO: Use the `URL` global when targeting Node.js 10 +// tslint:disable-next-line +const URLGlobal = typeof URL === 'undefined' ? __nccwpck_require__(78835).URL : URL; +const toString = Object.prototype.toString; +const isOfType = (type) => (value) => typeof value === type; +const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input); +const getObjectType = (value) => { + const objectName = toString.call(value).slice(8, -1); + if (objectName) { + return objectName; + } + return null; +}; +const isObjectOfType = (type) => (value) => getObjectType(value) === type; +function is(value) { + switch (value) { + case null: + return "null" /* null */; + case true: + case false: + return "boolean" /* boolean */; + default: + } + switch (typeof value) { + case 'undefined': + return "undefined" /* undefined */; + case 'string': + return "string" /* string */; + case 'number': + return "number" /* number */; + case 'symbol': + return "symbol" /* symbol */; + default: + } + if (is.function_(value)) { + return "Function" /* Function */; + } + if (is.observable(value)) { + return "Observable" /* Observable */; + } + if (Array.isArray(value)) { + return "Array" /* Array */; + } + if (isBuffer(value)) { + return "Buffer" /* Buffer */; + } + const tagType = getObjectType(value); + if (tagType) { + return tagType; + } + if (value instanceof String || value instanceof Boolean || value instanceof Number) { + throw new TypeError('Please don\'t use object wrappers for primitive types'); + } + return "Object" /* Object */; +} +(function (is) { + // tslint:disable-next-line:strict-type-predicates + const isObject = (value) => typeof value === 'object'; + // tslint:disable:variable-name + is.undefined = isOfType('undefined'); + is.string = isOfType('string'); + is.number = isOfType('number'); + is.function_ = isOfType('function'); + // tslint:disable-next-line:strict-type-predicates + is.null_ = (value) => value === null; + is.class_ = (value) => is.function_(value) && value.toString().startsWith('class '); + is.boolean = (value) => value === true || value === false; + is.symbol = isOfType('symbol'); + // tslint:enable:variable-name + is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value)); + is.array = Array.isArray; + is.buffer = isBuffer; + is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); + is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value)); + is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]); + is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]); + is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); + is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value); + const hasPromiseAPI = (value) => !is.null_(value) && + isObject(value) && + is.function_(value.then) && + is.function_(value.catch); + is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); + is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */); + is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */); + is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); + is.regExp = isObjectOfType("RegExp" /* RegExp */); + is.date = isObjectOfType("Date" /* Date */); + is.error = isObjectOfType("Error" /* Error */); + is.map = (value) => isObjectOfType("Map" /* Map */)(value); + is.set = (value) => isObjectOfType("Set" /* Set */)(value); + is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value); + is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value); + is.int8Array = isObjectOfType("Int8Array" /* Int8Array */); + is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */); + is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */); + is.int16Array = isObjectOfType("Int16Array" /* Int16Array */); + is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */); + is.int32Array = isObjectOfType("Int32Array" /* Int32Array */); + is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */); + is.float32Array = isObjectOfType("Float32Array" /* Float32Array */); + is.float64Array = isObjectOfType("Float64Array" /* Float64Array */); + is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */); + is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */); + is.dataView = isObjectOfType("DataView" /* DataView */); + is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype; + is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value); + is.urlString = (value) => { + if (!is.string(value)) { + return false; } - }); + try { + new URLGlobal(value); // tslint:disable-line no-unused-expression + return true; + } + catch (_a) { + return false; + } + }; + is.truthy = (value) => Boolean(value); + is.falsy = (value) => !value; + is.nan = (value) => Number.isNaN(value); + const primitiveTypes = new Set([ + 'undefined', + 'string', + 'number', + 'boolean', + 'symbol' + ]); + is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value); + is.integer = (value) => Number.isInteger(value); + is.safeInteger = (value) => Number.isSafeInteger(value); + is.plainObject = (value) => { + // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js + let prototype; + return getObjectType(value) === "Object" /* Object */ && + (prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator + prototype === Object.getPrototypeOf({})); + }; + const typedArrayTypes = new Set([ + "Int8Array" /* Int8Array */, + "Uint8Array" /* Uint8Array */, + "Uint8ClampedArray" /* Uint8ClampedArray */, + "Int16Array" /* Int16Array */, + "Uint16Array" /* Uint16Array */, + "Int32Array" /* Int32Array */, + "Uint32Array" /* Uint32Array */, + "Float32Array" /* Float32Array */, + "Float64Array" /* Float64Array */ + ]); + is.typedArray = (value) => { + const objectType = getObjectType(value); + if (objectType === null) { + return false; + } + return typedArrayTypes.has(objectType); + }; + const isValidLength = (value) => is.safeInteger(value) && value > -1; + is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); + is.inRange = (value, range) => { + if (is.number(range)) { + return value >= Math.min(0, range) && value <= Math.max(range, 0); + } + if (is.array(range) && range.length === 2) { + return value >= Math.min(...range) && value <= Math.max(...range); + } + throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); + }; + const NODE_TYPE_ELEMENT = 1; + const DOM_PROPERTIES_TO_CHECK = [ + 'innerHTML', + 'ownerDocument', + 'style', + 'attributes', + 'nodeValue' + ]; + is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) && + !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value); + is.observable = (value) => { + if (!value) { + return false; + } + if (value[Symbol.observable] && value === value[Symbol.observable]()) { + return true; + } + if (value['@@observable'] && value === value['@@observable']()) { + return true; + } + return false; + }; + is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value); + is.infinite = (value) => value === Infinity || value === -Infinity; + const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem; + is.even = isAbsoluteMod2(0); + is.odd = isAbsoluteMod2(1); + const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false; + is.emptyArray = (value) => is.array(value) && value.length === 0; + is.nonEmptyArray = (value) => is.array(value) && value.length > 0; + is.emptyString = (value) => is.string(value) && value.length === 0; + is.nonEmptyString = (value) => is.string(value) && value.length > 0; + is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); + is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; + is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; + is.emptySet = (value) => is.set(value) && value.size === 0; + is.nonEmptySet = (value) => is.set(value) && value.size > 0; + is.emptyMap = (value) => is.map(value) && value.size === 0; + is.nonEmptyMap = (value) => is.map(value) && value.size > 0; + const predicateOnArray = (method, predicate, values) => { + if (is.function_(predicate) === false) { + throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); + } + if (values.length === 0) { + throw new TypeError('Invalid number of values'); + } + return method.call(values, predicate); + }; + // tslint:disable variable-name + is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values); + is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); + // tslint:enable variable-name +})(is || (is = {})); +// Some few keywords are reserved, but we'll populate them for Node.js users +// See https://github.com/Microsoft/TypeScript/issues/2536 +Object.defineProperties(is, { + class: { + value: is.class_ + }, + function: { + value: is.function_ + }, + null: { + value: is.null_ + } +}); +exports.default = is; +// For CommonJS default export support +module.exports = is; +module.exports.default = is; +//# sourceMappingURL=index.js.map - auto(newTasks, callback); -} +/***/ }), -// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation -// used for queues. This implementation assumes that the node provided by the user can be modified -// to adjust the next and last properties. We implement only the minimal functionality -// for queue support. -function DLL() { - this.head = this.tail = null; - this.length = 0; -} +/***/ 8595: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; -} +"use strict"; -DLL.prototype.removeLink = function(node) { - if (node.prev) node.prev.next = node.next; - else this.head = node.next; - if (node.next) node.next.prev = node.prev; - else this.tail = node.prev; +const deferToConnect = __nccwpck_require__(12097); - node.prev = node.next = null; - this.length -= 1; - return node; -}; +module.exports = request => { + const timings = { + start: Date.now(), + socket: null, + lookup: null, + connect: null, + upload: null, + response: null, + end: null, + error: null, + phases: { + wait: null, + dns: null, + tcp: null, + request: null, + firstByte: null, + download: null, + total: null + } + }; -DLL.prototype.empty = function () { - while(this.head) this.shift(); - return this; -}; + const handleError = origin => { + const emit = origin.emit.bind(origin); + origin.emit = (event, ...args) => { + // Catches the `error` event + if (event === 'error') { + timings.error = Date.now(); + timings.phases.total = timings.error - timings.start; -DLL.prototype.insertAfter = function(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode; - else this.tail = newNode; - node.next = newNode; - this.length += 1; -}; + origin.emit = emit; + } -DLL.prototype.insertBefore = function(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode; - else this.head = newNode; - node.prev = newNode; - this.length += 1; -}; + // Saves the original behavior + return emit(event, ...args); + }; + }; -DLL.prototype.unshift = function(node) { - if (this.head) this.insertBefore(this.head, node); - else setInitial(this, node); -}; + let uploadFinished = false; + const onUpload = () => { + timings.upload = Date.now(); + timings.phases.request = timings.upload - timings.connect; + }; -DLL.prototype.push = function(node) { - if (this.tail) this.insertAfter(this.tail, node); - else setInitial(this, node); -}; + handleError(request); -DLL.prototype.shift = function() { - return this.head && this.removeLink(this.head); -}; + request.once('socket', socket => { + timings.socket = Date.now(); + timings.phases.wait = timings.socket - timings.start; -DLL.prototype.pop = function() { - return this.tail && this.removeLink(this.tail); -}; + const lookupListener = () => { + timings.lookup = Date.now(); + timings.phases.dns = timings.lookup - timings.socket; + }; -DLL.prototype.toArray = function () { - var arr = Array(this.length); - var curr = this.head; - for(var idx = 0; idx < this.length; idx++) { - arr[idx] = curr.data; - curr = curr.next; - } - return arr; -}; + socket.once('lookup', lookupListener); -DLL.prototype.remove = function (testFn) { - var curr = this.head; - while(!!curr) { - var next = curr.next; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; - } - return this; -}; + deferToConnect(socket, () => { + timings.connect = Date.now(); -function queue(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; - } - else if(concurrency === 0) { - throw new Error('Concurrency must not be zero'); - } + if (timings.lookup === null) { + socket.removeListener('lookup', lookupListener); + timings.lookup = timings.connect; + timings.phases.dns = timings.lookup - timings.socket; + } - var _worker = wrapAsync(worker); - var numRunning = 0; - var workersList = []; + timings.phases.tcp = timings.connect - timings.lookup; - var processingScheduled = false; - function _insert(data, insertAtFront, callback) { - if (callback != null && typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - if (!isArray(data)) { - data = [data]; - } - if (data.length === 0 && q.idle()) { - // call drain immediately if there are no tasks - return setImmediate$1(function() { - q.drain(); - }); - } + if (uploadFinished && !timings.upload) { + onUpload(); + } + }); + }); - for (var i = 0, l = data.length; i < l; i++) { - var item = { - data: data[i], - callback: callback || noop - }; + request.once('finish', () => { + uploadFinished = true; - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } - } + if (timings.connect) { + onUpload(); + } + }); - if (!processingScheduled) { - processingScheduled = true; - setImmediate$1(function() { - processingScheduled = false; - q.process(); - }); - } - } + request.once('response', response => { + timings.response = Date.now(); + timings.phases.firstByte = timings.response - timings.upload; - function _next(tasks) { - return function(err){ - numRunning -= 1; + handleError(response); - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; + response.once('end', () => { + timings.end = Date.now(); + timings.phases.download = timings.end - timings.response; + timings.phases.total = timings.end - timings.start; + }); + }); - var index = baseIndexOf(workersList, task, 0); - if (index === 0) { - workersList.shift(); - } else if (index > 0) { - workersList.splice(index, 1); - } + return timings; +}; - task.callback.apply(task, arguments); - if (err != null) { - q.error(err, task.data); - } - } +/***/ }), - if (numRunning <= (q.concurrency - q.buffer) ) { - q.unsaturated(); - } +/***/ 58588: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (q.idle()) { - q.drain(); - } - q.process(); - }; - } +"use strict"; +/* module decorator */ module = __nccwpck_require__.nmd(module); - var isProcessing = false; - var q = { - _tasks: new DLL(), - concurrency: concurrency, - payload: payload, - saturated: noop, - unsaturated:noop, - buffer: concurrency / 4, - empty: noop, - drain: noop, - error: noop, - started: false, - paused: false, - push: function (data, callback) { - _insert(data, false, callback); - }, - kill: function () { - q.drain = noop; - q._tasks.empty(); - }, - unshift: function (data, callback) { - _insert(data, true, callback); - }, - remove: function (testFn) { - q._tasks.remove(testFn); - }, - process: function () { - // Avoid trying to start too many processing operations. This can occur - // when callbacks resolve synchronously (#1267). - if (isProcessing) { - return; - } - isProcessing = true; - while(!q.paused && numRunning < q.concurrency && q._tasks.length){ - var tasks = [], data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - numRunning += 1; +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; - if (q._tasks.length === 0) { - q.empty(); - } +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; - if (numRunning === q.concurrency) { - q.saturated(); - } +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; - var cb = onlyOnce(_next(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length: function () { - return q._tasks.length; - }, - running: function () { - return numRunning; - }, - workersList: function () { - return workersList; - }, - idle: function() { - return q._tasks.length + numRunning === 0; - }, - pause: function () { - q.paused = true; - }, - resume: function () { - if (q.paused === false) { return; } - q.paused = false; - setImmediate$1(q.process); - } - }; - return q; -} +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; -/** - * A cargo of tasks for the worker function to complete. Cargo inherits all of - * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}. - * @typedef {Object} CargoObject - * @memberOf module:ControlFlow - * @property {Function} length - A function returning the number of items - * waiting to be processed. Invoke like `cargo.length()`. - * @property {number} payload - An `integer` for determining how many tasks - * should be process per round. This property can be changed after a `cargo` is - * created to alter the payload on-the-fly. - * @property {Function} push - Adds `task` to the `queue`. The callback is - * called once the `worker` has finished processing the task. Instead of a - * single task, an array of `tasks` can be submitted. The respective callback is - * used for every task in the list. Invoke like `cargo.push(task, [callback])`. - * @property {Function} saturated - A callback that is called when the - * `queue.length()` hits the concurrency and further tasks will be queued. - * @property {Function} empty - A callback that is called when the last item - * from the `queue` is given to a `worker`. - * @property {Function} drain - A callback that is called when the last item - * from the `queue` has returned from the `worker`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke like `cargo.idle()`. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke like `cargo.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke like `cargo.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`. - */ +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); -/** - * Creates a `cargo` object with the specified payload. Tasks added to the - * cargo will be processed altogether (up to the `payload` limit). If the - * `worker` is in progress, the task is queued until it becomes available. Once - * the `worker` has completed some tasks, each callback of those tasks is - * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) - * for how `cargo` and `queue` work. - * - * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers - * at a time, cargo passes an array of tasks to a single worker, repeating - * when the worker is finished. - * - * @name cargo - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An asynchronous function for processing an array - * of queued tasks. Invoked with `(tasks, callback)`. - * @param {number} [payload=Infinity] - An optional `integer` for determining - * how many tasks should be processed per round; if omitted, the default is - * unlimited. - * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the cargo and inner queue. - * @example - * - * // create a cargo object with payload 2 - * var cargo = async.cargo(function(tasks, callback) { - * for (var i=0; i { + if (colorConvert === undefined) { + colorConvert = __nccwpck_require__(73991); + } -/** - * Version of the compose function that is more natural to read. Each function - * consumes the return value of the previous function. It is the equivalent of - * [compose]{@link module:ControlFlow.compose} with the arguments reversed. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name seq - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.compose]{@link module:ControlFlow.compose} - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} a function that composes the `functions` in order - * @example - * - * // Requires lodash (or underscore), express3 and dresende's orm2. - * // Part of an app, that fetches cats of the logged user. - * // This example uses `seq` function to avoid overnesting and error - * // handling clutter. - * app.get('/cats', function(request, response) { - * var User = request.models.User; - * async.seq( - * _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data)) - * function(user, fn) { - * user.getCats(fn); // 'getCats' has signature (callback(err, data)) - * } - * )(req.session.user_id, function (err, cats) { - * if (err) { - * console.error(err); - * response.json({ status: 'error', message: err.message }); - * } else { - * response.json({ status: 'ok', message: 'Cats found', data: cats }); - * } - * }); - * }); - */ -function seq(/*...functions*/) { - var _functions = arrayMap(arguments, wrapAsync); - return function(/*...args*/) { - var args = slice(arguments); - var that = this; - - var cb = args[args.length - 1]; - if (typeof cb == 'function') { - args.pop(); - } else { - cb = noop; - } + const offset = isBackground ? 10 : 0; + const styles = {}; - reduce(_functions, args, function(newargs, fn, cb) { - fn.apply(that, newargs.concat(function(err/*, ...nextargs*/) { - var nextargs = slice(arguments, 1); - cb(err, nextargs); - })); - }, - function(err, results) { - cb.apply(that, [err].concat(results)); - }); - }; -} + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } -/** - * Creates a function which is a composition of the passed asynchronous - * functions. Each function consumes the return value of the function that - * follows. Composing functions `f()`, `g()`, and `h()` would produce the result - * of `f(g(h()))`, only this version uses callbacks to obtain the return values. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name compose - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} an asynchronous function that is the composed - * asynchronous `functions` - * @example - * - * function add1(n, callback) { - * setTimeout(function () { - * callback(null, n + 1); - * }, 10); - * } - * - * function mul3(n, callback) { - * setTimeout(function () { - * callback(null, n * 3); - * }, 10); - * } - * - * var add1mul3 = async.compose(mul3, add1); - * add1mul3(4, function (err, result) { - * // result now equals 15 - * }); - */ -var compose = function(/*...args*/) { - return seq.apply(null, slice(arguments).reverse()); + return styles; }; -var _concat = Array.prototype.concat; - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - */ -var concatLimit = function(coll, limit, iteratee, callback) { - callback = callback || noop; - var _iteratee = wrapAsync(iteratee); - mapLimit(coll, limit, function(val, callback) { - _iteratee(val, function(err /*, ...args*/) { - if (err) return callback(err); - return callback(null, slice(arguments, 1)); - }); - }, function(err, mapResults) { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = _concat.apply(result, mapResults[i]); - } - } +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], - return callback(err, result); - }); -}; + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], -/** - * Applies `iteratee` to each item in `coll`, concatenating the results. Returns - * the concatenated list. The `iteratee`s are called in parallel, and the - * results are concatenated as they return. There is no guarantee that the - * results array will be returned in the original order of `coll` passed to the - * `iteratee` function. - * - * @name concat - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback(err)] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @example - * - * async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files) { - * // files is now a list of filenames that exist in the 3 directories - * }); - */ -var concat = doLimit(concatLimit, Infinity); + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; -/** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback(err)] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - */ -var concatSeries = doLimit(concatLimit, 1); + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; -/** - * Returns a function that when called, calls-back with the values provided. - * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to - * [`auto`]{@link module:ControlFlow.auto}. - * - * @name constant - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {...*} arguments... - Any number of arguments to automatically invoke - * callback with. - * @returns {AsyncFunction} Returns a function that when invoked, automatically - * invokes the callback with the previous given arguments. - * @example - * - * async.waterfall([ - * async.constant(42), - * function (value, next) { - * // value === 42 - * }, - * //... - * ], callback); - * - * async.waterfall([ - * async.constant(filename, "utf8"), - * fs.readFile, - * function (fileData, next) { - * //... - * } - * //... - * ], callback); - * - * async.auto({ - * hostname: async.constant("https://server.net/"), - * port: findFreePort, - * launchServer: ["hostname", "port", function (options, cb) { - * startServer(options, cb); - * }], - * //... - * }, callback); - */ -var constant = function(/*...values*/) { - var values = slice(arguments); - var args = [null].concat(values); - return function (/*...ignoredArgs, callback*/) { - var callback = arguments[arguments.length - 1]; - return callback.apply(this, args); - }; -}; + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; -/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ -function identity(value) { - return value; -} + group[styleName] = styles[styleName]; -function _createTester(check, getResult) { - return function(eachfn, arr, iteratee, cb) { - cb = cb || noop; - var testPassed = false; - var testResult; - eachfn(arr, function(value, _, callback) { - iteratee(value, function(err, result) { - if (err) { - callback(err); - } else if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - callback(null, breakLoop); - } else { - callback(); - } - }); - }, function(err) { - if (err) { - cb(err); - } else { - cb(null, testPassed ? testResult : getResult(false)); - } - }); - }; -} + codes.set(style[0], style[1]); + } -function _findGetResult(v, x) { - return x; + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; } -/** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @example - * - * async.detect(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, result) { - * // result now equals the first file in the list that exists - * }); - */ -var detect = doParallel(_createTester(identity, _findGetResult)); +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); -/** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - */ -var detectLimit = doParallelLimit(_createTester(identity, _findGetResult)); -/** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - */ -var detectSeries = doLimit(detectLimit, 1); - -function consoleFunc(name) { - return function (fn/*, ...args*/) { - var args = slice(arguments, 1); - args.push(function (err/*, ...args*/) { - var args = slice(arguments, 1); - if (typeof console === 'object') { - if (err) { - if (console.error) { - console.error(err); - } - } else if (console[name]) { - arrayEach(args, function (x) { - console[name](x); - }); - } - } - }); - wrapAsync(fn).apply(null, args); - }; +/***/ }), + +/***/ 898: +/***/ ((module) => { + +module.exports = r => { + const n = process.versions.node.split('.').map(x => parseInt(x, 10)) + r = r.split('.').map(x => parseInt(x, 10)) + return n[0] > r[0] || (n[0] === r[0] && (n[1] > r[1] || (n[1] === r[1] && n[2] >= r[2]))) } -/** - * Logs the result of an [`async` function]{@link AsyncFunction} to the - * `console` using `console.dir` to display the properties of the resulting object. - * Only works in Node.js or in browsers that support `console.dir` and - * `console.error` (such as FF and Chrome). - * If multiple arguments are returned from the async function, - * `console.dir` is called on each argument in order. - * - * @name dir - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, {hello: name}); - * }, 1000); - * }; - * - * // in the node repl - * node> async.dir(hello, 'world'); - * {hello: 'world'} - */ -var dir = consoleFunc('dir'); -/** - * The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in - * the order of operations, the arguments `test` and `fn` are switched. - * - * Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function. - * @name doDuring - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.during]{@link module:ControlFlow.during} - * @category Control Flow - * @param {AsyncFunction} fn - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `fn`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `fn`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `fn` has stopped. `callback` - * will be passed an error if one occurred, otherwise `null`. - */ -function doDuring(fn, test, callback) { - callback = onlyOnce(callback || noop); - var _fn = wrapAsync(fn); - var _test = wrapAsync(test); +/***/ }), - function next(err/*, ...args*/) { - if (err) return callback(err); - var args = slice(arguments, 1); - args.push(check); - _test.apply(this, args); - } +/***/ 19628: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - function check(err, truth) { - if (err) return callback(err); - if (!truth) return callback(null); - _fn(next); - } +"use strict"; - check(null, true); +const { Buffer } = __nccwpck_require__(64293) +const symbol = Symbol.for('BufferList') + +function BufferList (buf) { + if (!(this instanceof BufferList)) { + return new BufferList(buf) + } + + BufferList._init.call(this, buf) } -/** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {Function} test - synchronous truth test to perform after each - * execution of `iteratee`. Invoked with any non-error callback results of - * `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - */ -function doWhilst(iteratee, test, callback) { - callback = onlyOnce(callback || noop); - var _iteratee = wrapAsync(iteratee); - var next = function(err/*, ...args*/) { - if (err) return callback(err); - var args = slice(arguments, 1); - if (test.apply(this, args)) return _iteratee(next); - callback.apply(null, [null].concat(args)); - }; - _iteratee(next); +BufferList._init = function _init (buf) { + Object.defineProperty(this, symbol, { value: true }) + + this._bufs = [] + this.length = 0 + + if (buf) { + this.append(buf) + } } -/** - * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the - * argument ordering differs from `until`. - * - * @name doUntil - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} test - synchronous truth test to perform after each - * execution of `iteratee`. Invoked with any non-error callback results of - * `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - */ -function doUntil(iteratee, test, callback) { - doWhilst(iteratee, function() { - return !test.apply(this, arguments); - }, callback); +BufferList.prototype._new = function _new (buf) { + return new BufferList(buf) } -/** - * Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that - * is passed a callback in the form of `function (err, truth)`. If error is - * passed to `test` or `fn`, the main callback is immediately called with the - * value of the error. - * - * @name during - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `fn`. Invoked with (callback). - * @param {AsyncFunction} fn - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `fn` has stopped. `callback` - * will be passed an error, if one occurred, otherwise `null`. - * @example - * - * var count = 0; - * - * async.during( - * function (callback) { - * return callback(null, count < 5); - * }, - * function (callback) { - * count++; - * setTimeout(callback, 1000); - * }, - * function (err) { - * // 5 seconds have passed - * } - * ); - */ -function during(test, fn, callback) { - callback = onlyOnce(callback || noop); - var _fn = wrapAsync(fn); - var _test = wrapAsync(test); +BufferList.prototype._offset = function _offset (offset) { + if (offset === 0) { + return [0, 0] + } - function next(err) { - if (err) return callback(err); - _test(check); - } + let tot = 0 - function check(err, truth) { - if (err) return callback(err); - if (!truth) return callback(null); - _fn(next); + for (let i = 0; i < this._bufs.length; i++) { + const _t = tot + this._bufs[i].length + if (offset < _t || i === this._bufs.length - 1) { + return [i, offset - tot] } - - _test(check); + tot = _t + } } -function _withoutIndex(iteratee) { - return function (value, index, callback) { - return iteratee(value, callback); - }; -} +BufferList.prototype._reverseOffset = function (blOffset) { + const bufferId = blOffset[0] + let offset = blOffset[1] -/** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @example - * - * // assuming openFiles is an array of file names and saveFile is a function - * // to save the modified contents of that file: - * - * async.each(openFiles, saveFile, function(err){ - * // if any of the saves produced an error, err would equal that error - * }); - * - * // assuming openFiles is an array of file names - * async.each(openFiles, function(file, callback) { - * - * // Perform operation on file here. - * console.log('Processing file ' + file); - * - * if( file.length > 32 ) { - * console.log('This file name is too long'); - * callback('File name too long'); - * } else { - * // Do work to process file here - * console.log('File processed'); - * callback(); - * } - * }, function(err) { - * // if any of the file processing produced an error, err would equal that error - * if( err ) { - * // One of the iterations produced an error. - * // All processing will now stop. - * console.log('A file failed to process'); - * } else { - * console.log('All files have been processed successfully'); - * } - * }); - */ -function eachLimit(coll, iteratee, callback) { - eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback); -} + for (let i = 0; i < bufferId; i++) { + offset += this._bufs[i].length + } -/** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - */ -function eachLimit$1(coll, limit, iteratee, callback) { - _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); + return offset } -/** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - */ -var eachSeries = doLimit(eachLimit$1, 1); +BufferList.prototype.get = function get (index) { + if (index > this.length || index < 0) { + return undefined + } -/** - * Wrap an async function and ensure it calls its callback on a later tick of - * the event loop. If the function already calls its callback on a next tick, - * no extra deferral is added. This is useful for preventing stack overflows - * (`RangeError: Maximum call stack size exceeded`) and generally keeping - * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - * contained. ES2017 `async` functions are returned as-is -- they are immune - * to Zalgo's corrupting influences, as they always resolve on a later tick. - * - * @name ensureAsync - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - an async function, one that expects a node-style - * callback as its last argument. - * @returns {AsyncFunction} Returns a wrapped function with the exact same call - * signature as the function passed in. - * @example - * - * function sometimesAsync(arg, callback) { - * if (cache[arg]) { - * return callback(null, cache[arg]); // this would be synchronous!! - * } else { - * doSomeIO(arg, callback); // this IO would be asynchronous - * } - * } - * - * // this has a risk of stack overflows if many results are cached in a row - * async.mapSeries(args, sometimesAsync, done); - * - * // this will defer sometimesAsync's callback if necessary, - * // preventing stack overflows - * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); - */ -function ensureAsync(fn) { - if (isAsync(fn)) return fn; - return initialParams(function (args, callback) { - var sync = true; - args.push(function () { - var innerArgs = arguments; - if (sync) { - setImmediate$1(function () { - callback.apply(null, innerArgs); - }); - } else { - callback.apply(null, innerArgs); - } - }); - fn.apply(this, args); - sync = false; - }); + const offset = this._offset(index) + + return this._bufs[offset[0]][offset[1]] } -function notId(v) { - return !v; +BufferList.prototype.slice = function slice (start, end) { + if (typeof start === 'number' && start < 0) { + start += this.length + } + + if (typeof end === 'number' && end < 0) { + end += this.length + } + + return this.copy(null, 0, start, end) } -/** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @example - * - * async.every(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, result) { - * // if result is true then every file exists - * }); - */ -var every = doParallel(_createTester(notId, notId)); +BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart !== 'number' || srcStart < 0) { + srcStart = 0 + } -/** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - */ -var everyLimit = doParallelLimit(_createTester(notId, notId)); + if (typeof srcEnd !== 'number' || srcEnd > this.length) { + srcEnd = this.length + } -/** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - */ -var everySeries = doLimit(everyLimit, 1); + if (srcStart >= this.length) { + return dst || Buffer.alloc(0) + } -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} + if (srcEnd <= 0) { + return dst || Buffer.alloc(0) + } -function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, function (x, index, callback) { - iteratee(x, function (err, v) { - truthValues[index] = !!v; - callback(err); - }); - }, function (err) { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); -} + const copy = !!dst + const off = this._offset(srcStart) + const len = srcEnd - srcStart + let bytes = len + let bufoff = (copy && dstStart) || 0 + let start = off[1] -function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, function (x, index, callback) { - iteratee(x, function (err, v) { - if (err) { - callback(err); - } else { - if (v) { - results.push({index: index, value: x}); - } - callback(); - } - }); - }, function (err) { - if (err) { - callback(err); - } else { - callback(null, arrayMap(results.sort(function (a, b) { - return a.index - b.index; - }), baseProperty('value'))); - } - }); -} + // copy/slice everything + if (srcStart === 0 && srcEnd === this.length) { + if (!copy) { + // slice, but full concat if multiple buffers + return this._bufs.length === 1 + ? this._bufs[0] + : Buffer.concat(this._bufs, this.length) + } -function _filter(eachfn, coll, iteratee, callback) { - var filter = isArrayLike(coll) ? filterArray : filterGeneric; - filter(eachfn, coll, wrapAsync(iteratee), callback || noop); -} + // copy, need to copy individual buffers + for (let i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length + } -/** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @example - * - * async.filter(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, results) { - * // results now equals an array of the existing files - * }); - */ -var filter = doParallel(_filter); + return dst + } -/** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - */ -var filterLimit = doParallelLimit(_filter); + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) + } -/** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - */ -var filterSeries = doLimit(filterLimit, 1); + if (!copy) { + // a slice, we need something to copy in to + dst = Buffer.allocUnsafe(len) + } -/** - * Calls the asynchronous function `fn` with a callback parameter that allows it - * to call itself again, in series, indefinitely. + for (let i = off[0]; i < this._bufs.length; i++) { + const l = this._bufs[i].length - start - * If an error is passed to the callback then `errback` is called with the - * error, and execution stops, otherwise it will never be called. - * - * @name forever - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} fn - an async function to call repeatedly. - * Invoked with (next). - * @param {Function} [errback] - when `fn` passes an error to it's callback, - * this function will be called, and execution stops. Invoked with (err). - * @example - * - * async.forever( - * function(next) { - * // next is suitable for passing to things that need a callback(err [, whatever]); - * // it will result in this function being called again. - * }, - * function(err) { - * // if next is called with a value in its first parameter, it will appear - * // in here as 'err', and execution will stop. - * } - * ); - */ -function forever(fn, errback) { - var done = onlyOnce(errback || noop); - var task = wrapAsync(ensureAsync(fn)); + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + bufoff += l + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + bufoff += l + break + } - function next(err) { - if (err) return done(err); - task(next); + bytes -= l + + if (start) { + start = 0 } - next(); -} + } -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. - * - * @name groupByLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - */ -var groupByLimit = function(coll, limit, iteratee, callback) { - callback = callback || noop; - var _iteratee = wrapAsync(iteratee); - mapLimit(coll, limit, function(val, callback) { - _iteratee(val, function(err, key) { - if (err) return callback(err); - return callback(null, {key: key, val: val}); - }); - }, function(err, mapResults) { - var result = {}; - // from MDN, handle object having an `hasOwnProperty` prop - var hasOwnProperty = Object.prototype.hasOwnProperty; - - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var key = mapResults[i].key; - var val = mapResults[i].val; - - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } - } - } + // safeguard so that we don't return uninitialized memory + if (dst.length > bufoff) return dst.slice(0, bufoff) - return callback(err, result); - }); -}; + return dst +} -/** - * Returns a new object, where each value corresponds to an array of items, from - * `coll`, that returned the corresponding key. That is, the keys of the object - * correspond to the values passed to the `iteratee` callback. - * - * Note: Since this function applies the `iteratee` to each item in parallel, - * there is no guarantee that the `iteratee` functions will complete in order. - * However, the values for each key in the `result` will be in the same order as - * the original `coll`. For Objects, the values will roughly be in the order of - * the original Objects' keys (but this can vary across JavaScript engines). - * - * @name groupBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @example - * - * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) { - * db.findById(userId, function(err, user) { - * if (err) return callback(err); - * return callback(null, user.age); - * }); - * }, function(err, result) { - * // result is object containing the userIds grouped by age - * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']}; - * }); - */ -var groupBy = doLimit(groupByLimit, Infinity); +BufferList.prototype.shallowSlice = function shallowSlice (start, end) { + start = start || 0 + end = typeof end !== 'number' ? this.length : end -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. - * - * @name groupBySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - */ -var groupBySeries = doLimit(groupByLimit, 1); + if (start < 0) { + start += this.length + } -/** - * Logs the result of an `async` function to the `console`. Only works in - * Node.js or in browsers that support `console.log` and `console.error` (such - * as FF and Chrome). If multiple arguments are returned from the async - * function, `console.log` is called on each argument in order. - * - * @name log - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, 'hello ' + name); - * }, 1000); - * }; - * - * // in the node repl - * node> async.log(hello, 'world'); - * 'hello world' - */ -var log = consoleFunc('log'); + if (end < 0) { + end += this.length + } -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a - * time. - * - * @name mapValuesLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - */ -function mapValuesLimit(obj, limit, iteratee, callback) { - callback = once(callback || noop); - var newObj = {}; - var _iteratee = wrapAsync(iteratee); - eachOfLimit(obj, limit, function(val, key, next) { - _iteratee(val, key, function (err, result) { - if (err) return next(err); - newObj[key] = result; - next(); - }); - }, function (err) { - callback(err, newObj); - }); -} + if (start === end) { + return this._new() + } -/** - * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. - * - * Produces a new Object by mapping each value of `obj` through the `iteratee` - * function. The `iteratee` is called each `value` and `key` from `obj` and a - * callback for when it has finished processing. Each of these callbacks takes - * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` - * passes an error to its callback, the main `callback` (for the `mapValues` - * function) is immediately called with the error. - * - * Note, the order of the keys in the result is not guaranteed. The keys will - * be roughly in the order they complete, (but this is very engine-specific) - * - * @name mapValues - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @example - * - * async.mapValues({ - * f1: 'file1', - * f2: 'file2', - * f3: 'file3' - * }, function (file, key, callback) { - * fs.stat(file, callback); - * }, function(err, result) { - * // result is now a map of stats for each file, e.g. - * // { - * // f1: [stats for file1], - * // f2: [stats for file2], - * // f3: [stats for file3] - * // } - * }); - */ + const startOffset = this._offset(start) + const endOffset = this._offset(end) + const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) -var mapValues = doLimit(mapValuesLimit, Infinity); + if (endOffset[1] === 0) { + buffers.pop() + } else { + buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]) + } -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. - * - * @name mapValuesSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - */ -var mapValuesSeries = doLimit(mapValuesLimit, 1); + if (startOffset[1] !== 0) { + buffers[0] = buffers[0].slice(startOffset[1]) + } -function has(obj, key) { - return key in obj; + return this._new(buffers) } -/** - * Caches the results of an async function. When creating a hash to store - * function results against, the callback is omitted from the hash and an - * optional hash function can be used. - * - * If no hash function is specified, the first argument is used as a hash key, - * which may work reasonably if it is a string or a data type that converts to a - * distinct string. Note that objects and arrays will not behave reasonably. - * Neither will cases where the other arguments are significant. In such cases, - * specify your own hash function. - * - * The cache of results is exposed as the `memo` property of the function - * returned by `memoize`. - * - * @name memoize - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function to proxy and cache results from. - * @param {Function} hasher - An optional function for generating a custom hash - * for storing results. It has all the arguments applied to it apart from the - * callback, and must be synchronous. - * @returns {AsyncFunction} a memoized version of `fn` - * @example - * - * var slow_fn = function(name, callback) { - * // do something - * callback(null, result); - * }; - * var fn = async.memoize(slow_fn); - * - * // fn can now be used as if it were slow_fn - * fn('some name', function() { - * // callback - * }); - */ -function memoize(fn, hasher) { - var memo = Object.create(null); - var queues = Object.create(null); - hasher = hasher || identity; - var _fn = wrapAsync(fn); - var memoized = initialParams(function memoized(args, callback) { - var key = hasher.apply(null, args); - if (has(memo, key)) { - setImmediate$1(function() { - callback.apply(null, memo[key]); - }); - } else if (has(queues, key)) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn.apply(null, args.concat(function(/*args*/) { - var args = slice(arguments); - memo[key] = args; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, args); - } - })); - } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; +BufferList.prototype.toString = function toString (encoding, start, end) { + return this.slice(start, end).toString(encoding) } -/** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `process.nextTick`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name nextTick - * @static - * @memberOf module:Utils - * @method - * @see [async.setImmediate]{@link module:Utils.setImmediate} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ -var _defer$1; +BufferList.prototype.consume = function consume (bytes) { + // first, normalize the argument, in accordance with how Buffer does it + bytes = Math.trunc(bytes) + // do nothing if not a positive number + if (Number.isNaN(bytes) || bytes <= 0) return this -if (hasNextTick) { - _defer$1 = process.nextTick; -} else if (hasSetImmediate) { - _defer$1 = setImmediate; -} else { - _defer$1 = fallback; + while (this._bufs.length) { + if (bytes >= this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() + } else { + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break + } + } + + return this } -var nextTick = wrap(_defer$1); +BufferList.prototype.duplicate = function duplicate () { + const copy = this._new() -function _parallel(eachfn, tasks, callback) { - callback = callback || noop; - var results = isArrayLike(tasks) ? [] : {}; + for (let i = 0; i < this._bufs.length; i++) { + copy.append(this._bufs[i]) + } - eachfn(tasks, function (task, key, callback) { - wrapAsync(task)(function (err, result) { - if (arguments.length > 2) { - result = slice(arguments, 1); - } - results[key] = result; - callback(err); - }); - }, function (err) { - callback(err, results); - }); + return copy } -/** - * Run the `tasks` collection of functions in parallel, without waiting until - * the previous function has completed. If any of the functions pass an error to - * its callback, the main `callback` is immediately called with the value of the - * error. Once the `tasks` have completed, the results are passed to the final - * `callback` as an array. - * - * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about - * parallel execution of code. If your tasks do not use any timers or perform - * any I/O, they will actually be executed in series. Any synchronous setup - * sections for each task will happen one after the other. JavaScript remains - * single-threaded. - * - * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the - * execution of other tasks when a task fails. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.parallel}. - * - * @name parallel - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * - * @example - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // optional callback - * function(err, results) { - * // the results array will equal ['one','two'] even though - * // the second function had a shorter timeout. - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * // results is now equals to: {one: 1, two: 2} - * }); - */ -function parallelLimit(tasks, callback) { - _parallel(eachOf, tasks, callback); +BufferList.prototype.append = function append (buf) { + if (buf == null) { + return this + } + + if (buf.buffer) { + // append a view of the underlying ArrayBuffer + this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)) + } else if (Array.isArray(buf)) { + for (let i = 0; i < buf.length; i++) { + this.append(buf[i]) + } + } else if (this._isBufferList(buf)) { + // unwrap argument into individual BufferLists + for (let i = 0; i < buf._bufs.length; i++) { + this.append(buf._bufs[i]) + } + } else { + // coerce number arguments to strings, since Buffer(number) does + // uninitialized memory allocation + if (typeof buf === 'number') { + buf = buf.toString() + } + + this._appendBuffer(Buffer.from(buf)) + } + + return this } -/** - * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a - * time. - * - * @name parallelLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.parallel]{@link module:ControlFlow.parallel} - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - */ -function parallelLimit$1(tasks, limit, callback) { - _parallel(_eachOfLimit(limit), tasks, callback); +BufferList.prototype._appendBuffer = function appendBuffer (buf) { + this._bufs.push(buf) + this.length += buf.length } -/** - * A queue of tasks for the worker function to complete. - * @typedef {Object} QueueObject - * @memberOf module:ControlFlow - * @property {Function} length - a function returning the number of items - * waiting to be processed. Invoke with `queue.length()`. - * @property {boolean} started - a boolean indicating whether or not any - * items have been pushed and processed by the queue. - * @property {Function} running - a function returning the number of items - * currently being processed. Invoke with `queue.running()`. - * @property {Function} workersList - a function returning the array of items - * currently being processed. Invoke with `queue.workersList()`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke with `queue.idle()`. - * @property {number} concurrency - an integer for determining how many `worker` - * functions should be run in parallel. This property can be changed after a - * `queue` is created to alter the concurrency on-the-fly. - * @property {Function} push - add a new task to the `queue`. Calls `callback` - * once the `worker` has finished processing the task. Instead of a single task, - * a `tasks` array can be submitted. The respective callback is used for every - * task in the list. Invoke with `queue.push(task, [callback])`, - * @property {Function} unshift - add a new task to the front of the `queue`. - * Invoke with `queue.unshift(task, [callback])`. - * @property {Function} remove - remove items from the queue that match a test - * function. The test function will be passed an object with a `data` property, - * and a `priority` property, if this is a - * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. - * Invoked with `queue.remove(testFn)`, where `testFn` is of the form - * `function ({data, priority}) {}` and returns a Boolean. - * @property {Function} saturated - a callback that is called when the number of - * running workers hits the `concurrency` limit, and further tasks will be - * queued. - * @property {Function} unsaturated - a callback that is called when the number - * of running workers is less than the `concurrency` & `buffer` limits, and - * further tasks will not be queued. - * @property {number} buffer - A minimum threshold buffer in order to say that - * the `queue` is `unsaturated`. - * @property {Function} empty - a callback that is called when the last item - * from the `queue` is given to a `worker`. - * @property {Function} drain - a callback that is called when the last item - * from the `queue` has returned from the `worker`. - * @property {Function} error - a callback that is called when a task errors. - * Has the signature `function(error, task)`. - * @property {boolean} paused - a boolean for determining whether the queue is - * in a paused state. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke with `queue.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke with `queue.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. No more tasks - * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. - */ +BufferList.prototype.indexOf = function (search, offset, encoding) { + if (encoding === undefined && typeof offset === 'string') { + encoding = offset + offset = undefined + } -/** - * Creates a `queue` object with the specified `concurrency`. Tasks added to the - * `queue` are processed in parallel (up to the `concurrency` limit). If all - * `worker`s are in progress, the task is queued until one becomes available. - * Once a `worker` completes a `task`, that `task`'s callback is called. - * - * @name queue - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. Invoked with (task, callback). - * @param {number} [concurrency=1] - An `integer` for determining how many - * `worker` functions should be run in parallel. If omitted, the concurrency - * defaults to `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the queue. - * @example - * - * // create a queue object with concurrency 2 - * var q = async.queue(function(task, callback) { - * console.log('hello ' + task.name); - * callback(); - * }, 2); - * - * // assign a callback - * q.drain = function() { - * console.log('all items have been processed'); - * }; - * - * // add some items to the queue - * q.push({name: 'foo'}, function(err) { - * console.log('finished processing foo'); - * }); - * q.push({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - * - * // add some items to the queue (batch-wise) - * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { - * console.log('finished processing item'); - * }); - * - * // add some items to the front of the queue - * q.unshift({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - */ -var queue$1 = function (worker, concurrency) { - var _worker = wrapAsync(worker); - return queue(function (items, cb) { - _worker(items[0], cb); - }, concurrency, 1); -}; + if (typeof search === 'function' || Array.isArray(search)) { + throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.') + } else if (typeof search === 'number') { + search = Buffer.from([search]) + } else if (typeof search === 'string') { + search = Buffer.from(search, encoding) + } else if (this._isBufferList(search)) { + search = search.slice() + } else if (Array.isArray(search.buffer)) { + search = Buffer.from(search.buffer, search.byteOffset, search.byteLength) + } else if (!Buffer.isBuffer(search)) { + search = Buffer.from(search) + } -/** - * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and - * completed in ascending priority order. - * - * @name priorityQueue - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. - * Invoked with (task, callback). - * @param {number} concurrency - An `integer` for determining how many `worker` - * functions should be run in parallel. If omitted, the concurrency defaults to - * `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two - * differences between `queue` and `priorityQueue` objects: - * * `push(task, priority, [callback])` - `priority` should be a number. If an - * array of `tasks` is given, all tasks will be assigned the same priority. - * * The `unshift` method was removed. - */ -var priorityQueue = function(worker, concurrency) { - // Start with a normal queue - var q = queue$1(worker, concurrency); - - // Override push to accept second parameter representing priority - q.push = function(data, priority, callback) { - if (callback == null) callback = noop; - if (typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - if (!isArray(data)) { - data = [data]; - } - if (data.length === 0) { - // call drain immediately if there are no tasks - return setImmediate$1(function() { - q.drain(); - }); - } + offset = Number(offset || 0) - priority = priority || 0; - var nextNode = q._tasks.head; - while (nextNode && priority >= nextNode.priority) { - nextNode = nextNode.next; + if (isNaN(offset)) { + offset = 0 + } + + if (offset < 0) { + offset = this.length + offset + } + + if (offset < 0) { + offset = 0 + } + + if (search.length === 0) { + return offset > this.length ? this.length : offset + } + + const blOffset = this._offset(offset) + let blIndex = blOffset[0] // index of which internal buffer we're working on + let buffOffset = blOffset[1] // offset of the internal buffer we're working on + + // scan over each buffer + for (; blIndex < this._bufs.length; blIndex++) { + const buff = this._bufs[blIndex] + + while (buffOffset < buff.length) { + const availableWindow = buff.length - buffOffset + + if (availableWindow >= search.length) { + const nativeSearchResult = buff.indexOf(search, buffOffset) + + if (nativeSearchResult !== -1) { + return this._reverseOffset([blIndex, nativeSearchResult]) } - for (var i = 0, l = data.length; i < l; i++) { - var item = { - data: data[i], - priority: priority, - callback: callback - }; + buffOffset = buff.length - search.length + 1 // end of native search window + } else { + const revOffset = this._reverseOffset([blIndex, buffOffset]) - if (nextNode) { - q._tasks.insertBefore(nextNode, item); - } else { - q._tasks.push(item); - } + if (this._match(revOffset, search)) { + return revOffset } - setImmediate$1(q.process); - }; - // Remove unshift function - delete q.unshift; + buffOffset++ + } + } - return q; -}; + buffOffset = 0 + } -/** - * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` complete or pass an - * error to its callback, the main `callback` is immediately called. It's - * equivalent to `Promise.race()`. - * - * @name race - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} - * to run. Each function can complete with an optional `result` value. - * @param {Function} callback - A callback to run once any of the functions have - * completed. This function gets an error or result from the first function that - * completed. Invoked with (err, result). - * @returns undefined - * @example - * - * async.race([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // main callback - * function(err, result) { - * // the result will be equal to 'two' as it finishes earlier - * }); - */ -function race(tasks, callback) { - callback = once(callback || noop); - if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - wrapAsync(tasks[i])(callback); + return -1 +} + +BufferList.prototype._match = function (offset, search) { + if (this.length - offset < search.length) { + return false + } + + for (let searchOffset = 0; searchOffset < search.length; searchOffset++) { + if (this.get(offset + searchOffset) !== search[searchOffset]) { + return false } + } + return true } -/** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee complete with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - */ -function reduceRight (array, memo, iteratee, callback) { - var reversed = slice(array).reverse(); - reduce(reversed, memo, iteratee, callback); +;(function () { + const methods = { + readDoubleBE: 8, + readDoubleLE: 8, + readFloatBE: 4, + readFloatLE: 4, + readInt32BE: 4, + readInt32LE: 4, + readUInt32BE: 4, + readUInt32LE: 4, + readInt16BE: 2, + readInt16LE: 2, + readUInt16BE: 2, + readUInt16LE: 2, + readInt8: 1, + readUInt8: 1, + readIntBE: null, + readIntLE: null, + readUIntBE: null, + readUIntLE: null + } + + for (const m in methods) { + (function (m) { + if (methods[m] === null) { + BufferList.prototype[m] = function (offset, byteLength) { + return this.slice(offset, offset + byteLength)[m](0, byteLength) + } + } else { + BufferList.prototype[m] = function (offset) { + return this.slice(offset, offset + methods[m])[m](0) + } + } + }(m)) + } +}()) + +// Used internally by the class and also as an indicator of this object being +// a `BufferList`. It's not possible to use `instanceof BufferList` in a browser +// environment because there could be multiple different copies of the +// BufferList class and some `BufferList`s might be `BufferList`s. +BufferList.prototype._isBufferList = function _isBufferList (b) { + return b instanceof BufferList || BufferList.isBufferList(b) } -/** - * Wraps the async function in another function that always completes with a - * result object, even when it errors. - * - * The result object has either the property `error` or `value`. - * - * @name reflect - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function you want to wrap - * @returns {Function} - A function that always passes null to it's callback as - * the error. The second argument to the callback will be an `object` with - * either an `error` or a `value` property. - * @example - * - * async.parallel([ - * async.reflect(function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }), - * async.reflect(function(callback) { - * // do some more stuff but error ... - * callback('bad stuff happened'); - * }), - * async.reflect(function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * }) - * ], - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = 'bad stuff happened' - * // results[2].value = 'two' - * }); - */ -function reflect(fn) { - var _fn = wrapAsync(fn); - return initialParams(function reflectOn(args, reflectCallback) { - args.push(function callback(error, cbArg) { - if (error) { - reflectCallback(null, { error: error }); - } else { - var value; - if (arguments.length <= 2) { - value = cbArg; - } else { - value = slice(arguments, 1); - } - reflectCallback(null, { value: value }); - } - }); - - return _fn.apply(this, args); - }); -} - -/** - * A helper function that wraps an array or an object of functions with `reflect`. - * - * @name reflectAll - * @static - * @memberOf module:Utils - * @method - * @see [async.reflect]{@link module:Utils.reflect} - * @category Util - * @param {Array|Object|Iterable} tasks - The collection of - * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. - * @returns {Array} Returns an array of async functions, each wrapped in - * `async.reflect` - * @example - * - * let tasks = [ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * // do some more stuff but error ... - * callback(new Error('bad stuff happened')); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = Error('bad stuff happened') - * // results[2].value = 'two' - * }); - * - * // an example using an object instead of an array - * let tasks = { - * one: function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * two: function(callback) { - * callback('two'); - * }, - * three: function(callback) { - * setTimeout(function() { - * callback(null, 'three'); - * }, 100); - * } - * }; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results.one.value = 'one' - * // results.two.error = 'two' - * // results.three.value = 'three' - * }); - */ -function reflectAll(tasks) { - var results; - if (isArray(tasks)) { - results = arrayMap(tasks, reflect); - } else { - results = {}; - baseForOwn(tasks, function(task, key) { - results[key] = reflect.call(this, task); - }); - } - return results; -} - -function reject$1(eachfn, arr, iteratee, callback) { - _filter(eachfn, arr, function(value, cb) { - iteratee(value, function(err, v) { - cb(err, !v); - }); - }, callback); -} - -/** - * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. - * - * @name reject - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @example - * - * async.reject(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, results) { - * // results now equals an array of missing files - * createFiles(results); - * }); - */ -var reject = doParallel(reject$1); - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a - * time. - * - * @name rejectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - */ -var rejectLimit = doParallelLimit(reject$1); - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. - * - * @name rejectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - */ -var rejectSeries = doLimit(rejectLimit, 1); - -/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] - * - * console.log(objects[0] === objects[1]); - * // => true - */ -function constant$1(value) { - return function() { - return value; - }; -} - -/** - * Attempts to get a successful response from `task` no more than `times` times - * before returning an error. If the task is successful, the `callback` will be - * passed the result of the successful task. If all attempts fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name retry - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @see [async.retryable]{@link module:ControlFlow.retryable} - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an - * object with `times` and `interval` or a number. - * * `times` - The number of attempts to make before giving up. The default - * is `5`. - * * `interval` - The time to wait between retries, in milliseconds. The - * default is `0`. The interval may also be specified as a function of the - * retry count (see example). - * * `errorFilter` - An optional synchronous function that is invoked on - * erroneous result. If it returns `true` the retry attempts will continue; - * if the function returns `false` the retry flow is aborted with the current - * attempt's error and result being returned to the final callback. - * Invoked with (err). - * * If `opts` is a number, the number specifies the number of times to retry, - * with the default interval of `0`. - * @param {AsyncFunction} task - An async function to retry. - * Invoked with (callback). - * @param {Function} [callback] - An optional callback which is called when the - * task has succeeded, or after the final failed attempt. It receives the `err` - * and `result` arguments of the last attempt at completing the `task`. Invoked - * with (err, results). - * - * @example - * - * // The `retry` function can be used as a stand-alone control flow by passing - * // a callback, as shown below: - * - * // try calling apiMethod 3 times - * async.retry(3, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 3 times, waiting 200 ms between each retry - * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 10 times with exponential backoff - * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) - * async.retry({ - * times: 10, - * interval: function(retryCount) { - * return 50 * Math.pow(2, retryCount); - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod the default 5 times no delay between each retry - * async.retry(apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod only when error condition satisfies, all other - * // errors will abort the retry control flow and return to final callback - * async.retry({ - * errorFilter: function(err) { - * return err.message === 'Temporary error'; // only retry on a specific error - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // to retry individual methods that are not as reliable within other - * // control flow functions, use the `retryable` wrapper: - * async.auto({ - * users: api.getUsers.bind(api), - * payments: async.retryable(3, api.getPayments.bind(api)) - * }, function(err, results) { - * // do something with the results - * }); - * - */ -function retry(opts, task, callback) { - var DEFAULT_TIMES = 5; - var DEFAULT_INTERVAL = 0; - - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant$1(DEFAULT_INTERVAL) - }; - - function parseTimes(acc, t) { - if (typeof t === 'object') { - acc.times = +t.times || DEFAULT_TIMES; - - acc.intervalFunc = typeof t.interval === 'function' ? - t.interval : - constant$1(+t.interval || DEFAULT_INTERVAL); - - acc.errorFilter = t.errorFilter; - } else if (typeof t === 'number' || typeof t === 'string') { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } - } - - if (arguments.length < 3 && typeof opts === 'function') { - callback = task || noop; - task = opts; - } else { - parseTimes(options, opts); - callback = callback || noop; - } - - if (typeof task !== 'function') { - throw new Error("Invalid arguments for async.retry"); - } - - var _task = wrapAsync(task); - - var attempt = 1; - function retryAttempt() { - _task(function(err) { - if (err && attempt++ < options.times && - (typeof options.errorFilter != 'function' || - options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt)); - } else { - callback.apply(null, arguments); - } - }); - } - - retryAttempt(); +BufferList.isBufferList = function isBufferList (b) { + return b != null && b[symbol] } -/** - * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method - * wraps a task and makes it retryable, rather than immediately calling it - * with retries. - * - * @name retryable - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.retry]{@link module:ControlFlow.retry} - * @category Control Flow - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional - * options, exactly the same as from `retry` - * @param {AsyncFunction} task - the asynchronous function to wrap. - * This function will be passed any arguments passed to the returned wrapper. - * Invoked with (...args, callback). - * @returns {AsyncFunction} The wrapped function, which when invoked, will - * retry on an error, based on the parameters specified in `opts`. - * This function will accept the same parameters as `task`. - * @example - * - * async.auto({ - * dep1: async.retryable(3, getFromFlakyService), - * process: ["dep1", async.retryable(3, function (results, cb) { - * maybeProcessData(results.dep1, cb); - * })] - * }, callback); - */ -var retryable = function (opts, task) { - if (!task) { - task = opts; - opts = null; - } - var _task = wrapAsync(task); - return initialParams(function (args, callback) { - function taskFn(cb) { - _task.apply(null, args.concat(cb)); - } - - if (opts) retry(opts, taskFn, callback); - else retry(taskFn, callback); - - }); -}; - -/** - * Run the functions in the `tasks` collection in series, each one running once - * the previous function has completed. If any functions in the series pass an - * error to its callback, no more functions are run, and `callback` is - * immediately called with the value of the error. Otherwise, `callback` - * receives an array of results when `tasks` have completed. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function, and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.series}. - * - * **Note** that while many implementations preserve the order of object - * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) - * explicitly states that - * - * > The mechanics and order of enumerating the properties is not specified. - * - * So if you rely on the order in which your series of functions are executed, - * and want this to work on all platforms, consider using an array. - * - * @name series - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection containing - * [async functions]{@link AsyncFunction} to run in series. - * Each function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This function gets a results array (or object) - * containing all the result arguments passed to the `task` callbacks. Invoked - * with (err, result). - * @example - * async.series([ - * function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }, - * function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * } - * ], - * // optional callback - * function(err, results) { - * // results is now equal to ['one', 'two'] - * }); - * - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback){ - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * // results is now equal to: {one: 1, two: 2} - * }); - */ -function series(tasks, callback) { - _parallel(eachOfSeries, tasks, callback); -} +module.exports = BufferList -/** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @example - * - * async.some(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, result) { - * // if result is true then at least one of the files exists - * }); - */ -var some = doParallel(_createTester(Boolean, identity)); -/** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - */ -var someLimit = doParallelLimit(_createTester(Boolean, identity)); +/***/ }), -/** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - */ -var someSeries = doLimit(someLimit, 1); +/***/ 93453: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Sorts a list by the results of running each `coll` value through an async - * `iteratee`. - * - * @name sortBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a value to use as the sort criteria as - * its `result`. - * Invoked with (item, callback). - * @param {Function} callback - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is the items - * from the original `coll` sorted by the values returned by the `iteratee` - * calls. Invoked with (err, results). - * @example - * - * async.sortBy(['file1','file2','file3'], function(file, callback) { - * fs.stat(file, function(err, stats) { - * callback(err, stats.mtime); - * }); - * }, function(err, results) { - * // results is now the original array of files sorted by - * // modified date - * }); - * - * // By modifying the callback parameter the - * // sorting order can be influenced: - * - * // ascending order - * async.sortBy([1,9,3,5], function(x, callback) { - * callback(null, x); - * }, function(err,result) { - * // result callback - * }); - * - * // descending order - * async.sortBy([1,9,3,5], function(x, callback) { - * callback(null, x*-1); //<- x*-1 instead of x, turns the order around - * }, function(err,result) { - * // result callback - * }); - */ -function sortBy (coll, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - map(coll, function (x, callback) { - _iteratee(x, function (err, criteria) { - if (err) return callback(err); - callback(null, {value: x, criteria: criteria}); - }); - }, function (err, results) { - if (err) return callback(err); - callback(null, arrayMap(results.sort(comparator), baseProperty('value'))); - }); +"use strict"; - function comparator(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } -} -/** - * Sets a time limit on an asynchronous function. If the function does not call - * its callback within the specified milliseconds, it will be called with a - * timeout error. The code property for the error object will be `'ETIMEDOUT'`. - * - * @name timeout - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} asyncFn - The async function to limit in time. - * @param {number} milliseconds - The specified time limit. - * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) - * to timeout Error for more information.. - * @returns {AsyncFunction} Returns a wrapped function that can be used with any - * of the control flow functions. - * Invoke this function with the same parameters as you would `asyncFunc`. - * @example - * - * function myFunction(foo, callback) { - * doAsyncTask(foo, function(err, data) { - * // handle errors - * if (err) return callback(err); - * - * // do some stuff ... - * - * // return processed data - * return callback(null, data); - * }); - * } - * - * var wrapped = async.timeout(myFunction, 1000); - * - * // call `wrapped` as you would `myFunction` - * wrapped({ bar: 'bar' }, function(err, data) { - * // if `myFunction` takes < 1000 ms to execute, `err` - * // and `data` will have their expected values - * - * // else `err` will be an Error with the code 'ETIMEDOUT' - * }); - */ -function timeout(asyncFn, milliseconds, info) { - var fn = wrapAsync(asyncFn); - - return initialParams(function (args, callback) { - var timedOut = false; - var timer; - - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; - } - timedOut = true; - callback(error); - } +const DuplexStream = __nccwpck_require__(68193).Duplex +const inherits = __nccwpck_require__(2989) +const BufferList = __nccwpck_require__(19628) - args.push(function () { - if (!timedOut) { - callback.apply(null, arguments); - clearTimeout(timer); - } - }); +function BufferListStream (callback) { + if (!(this instanceof BufferListStream)) { + return new BufferListStream(callback) + } - // setup timer and call original function - timer = setTimeout(timeoutCallback, milliseconds); - fn.apply(null, args); - }); -} + if (typeof callback === 'function') { + this._callback = callback -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil; -var nativeMax = Math.max; + const piper = function piper (err) { + if (this._callback) { + this._callback(err) + this._callback = null + } + }.bind(this) -/** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. - */ -function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); + this.on('pipe', function onPipe (src) { + src.on('error', piper) + }) + this.on('unpipe', function onUnpipe (src) { + src.removeListener('error', piper) + }) - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; + callback = null } - return result; -} -/** - * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a - * time. - * - * @name timesLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} count - The number of times to run the function. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see [async.map]{@link module:Collections.map}. - */ -function timeLimit(count, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - mapLimit(baseRange(0, count, 1), limit, _iteratee, callback); + BufferList._init.call(this, callback) + DuplexStream.call(this) } -/** - * Calls the `iteratee` function `n` times, and accumulates results in the same - * manner you would use with [map]{@link module:Collections.map}. - * - * @name times - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.map]{@link module:Collections.map} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @example - * - * // Pretend this is some complicated async factory - * var createUser = function(id, callback) { - * callback(null, { - * id: 'user' + id - * }); - * }; - * - * // generate 5 users - * async.times(5, function(n, next) { - * createUser(n, function(err, user) { - * next(err, user); - * }); - * }, function(err, users) { - * // we should now have 5 users - * }); - */ -var times = doLimit(timeLimit, Infinity); - -/** - * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. - * - * @name timesSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - */ -var timesSeries = doLimit(timeLimit, 1); +inherits(BufferListStream, DuplexStream) +Object.assign(BufferListStream.prototype, BufferList.prototype) -/** - * A relative of `reduce`. Takes an Object or Array, and iterates over each - * element in series, each step potentially mutating an `accumulator` value. - * The type of the accumulator defaults to the type of collection passed in. - * - * @name transform - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {*} [accumulator] - The initial state of the transform. If omitted, - * it will default to an empty Object or Array, depending on the type of `coll` - * @param {AsyncFunction} iteratee - A function applied to each item in the - * collection that potentially modifies the accumulator. - * Invoked with (accumulator, item, key, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the transformed accumulator. - * Invoked with (err, result). - * @example - * - * async.transform([1,2,3], function(acc, item, index, callback) { - * // pointless async: - * process.nextTick(function() { - * acc.push(item * 2) - * callback(null) - * }); - * }, function(err, result) { - * // result is now equal to [2, 4, 6] - * }); - * - * @example - * - * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) { - * setImmediate(function () { - * obj[key] = val * 2; - * callback(); - * }) - * }, function (err, result) { - * // result is equal to {a: 2, b: 4, c: 6} - * }) - */ -function transform (coll, accumulator, iteratee, callback) { - if (arguments.length <= 3) { - callback = iteratee; - iteratee = accumulator; - accumulator = isArray(coll) ? [] : {}; - } - callback = once(callback || noop); - var _iteratee = wrapAsync(iteratee); - - eachOf(coll, function(v, k, cb) { - _iteratee(accumulator, v, k, cb); - }, function(err) { - callback(err, accumulator); - }); +BufferListStream.prototype._new = function _new (callback) { + return new BufferListStream(callback) } -/** - * It runs each task in series but stops whenever any of the functions were - * successful. If one of the tasks were successful, the `callback` will be - * passed the result of the successful task. If all tasks fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name tryEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection containing functions to - * run, each function is passed a `callback(err, result)` it must call on - * completion with an error `err` (which can be `null`) and an optional `result` - * value. - * @param {Function} [callback] - An optional callback which is called when one - * of the tasks has succeeded, or all have failed. It receives the `err` and - * `result` arguments of the last attempt at completing the `task`. Invoked with - * (err, results). - * @example - * async.tryEach([ - * function getDataFromFirstWebsite(callback) { - * // Try getting the data from the first website - * callback(err, data); - * }, - * function getDataFromSecondWebsite(callback) { - * // First website failed, - * // Try getting the data from the backup website - * callback(err, data); - * } - * ], - * // optional callback - * function(err, results) { - * Now do something with the data. - * }); - * - */ -function tryEach(tasks, callback) { - var error = null; - var result; - callback = callback || noop; - eachSeries(tasks, function(task, callback) { - wrapAsync(task)(function (err, res/*, ...args*/) { - if (arguments.length > 2) { - result = slice(arguments, 1); - } else { - result = res; - } - error = err; - callback(!err); - }); - }, function () { - callback(error, result); - }); -} +BufferListStream.prototype._write = function _write (buf, encoding, callback) { + this._appendBuffer(buf) -/** - * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, - * unmemoized form. Handy for testing. - * - * @name unmemoize - * @static - * @memberOf module:Utils - * @method - * @see [async.memoize]{@link module:Utils.memoize} - * @category Util - * @param {AsyncFunction} fn - the memoized function - * @returns {AsyncFunction} a function that calls the original unmemoized function - */ -function unmemoize(fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; + if (typeof callback === 'function') { + callback() + } } -/** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Function} test - synchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns undefined - * @example - * - * var count = 0; - * async.whilst( - * function() { return count < 5; }, - * function(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ -function whilst(test, iteratee, callback) { - callback = onlyOnce(callback || noop); - var _iteratee = wrapAsync(iteratee); - if (!test()) return callback(null); - var next = function(err/*, ...args*/) { - if (err) return callback(err); - if (test()) return _iteratee(next); - var args = slice(arguments, 1); - callback.apply(null, [null].concat(args)); - }; - _iteratee(next); -} +BufferListStream.prototype._read = function _read (size) { + if (!this.length) { + return this.push(null) + } -/** - * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `iteratee`'s callback. - * - * The inverse of [whilst]{@link module:ControlFlow.whilst}. - * - * @name until - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {Function} test - synchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - */ -function until(test, iteratee, callback) { - whilst(function() { - return !test.apply(this, arguments); - }, iteratee, callback); + size = Math.min(size, this.length) + this.push(this.slice(0, size)) + this.consume(size) } -/** - * Runs the `tasks` array of functions in series, each passing their results to - * the next in the array. However, if any of the `tasks` pass an error to their - * own callback, the next function is not executed, and the main `callback` is - * immediately called with the error. - * - * @name waterfall - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} - * to run. - * Each function should complete with any number of `result` values. - * The `result` values will be passed as arguments, in order, to the next task. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This will be passed the results of the last task's - * callback. Invoked with (err, [results]). - * @returns undefined - * @example - * - * async.waterfall([ - * function(callback) { - * callback(null, 'one', 'two'); - * }, - * function(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * }, - * function(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - * ], function (err, result) { - * // result now equals 'done' - * }); - * - * // Or, with named functions: - * async.waterfall([ - * myFirstFunction, - * mySecondFunction, - * myLastFunction, - * ], function (err, result) { - * // result now equals 'done' - * }); - * function myFirstFunction(callback) { - * callback(null, 'one', 'two'); - * } - * function mySecondFunction(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * } - * function myLastFunction(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - */ -var waterfall = function(tasks, callback) { - callback = once(callback || noop); - if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); - if (!tasks.length) return callback(); - var taskIndex = 0; - - function nextTask(args) { - var task = wrapAsync(tasks[taskIndex++]); - args.push(onlyOnce(next)); - task.apply(null, args); - } - - function next(err/*, ...args*/) { - if (err || taskIndex === tasks.length) { - return callback.apply(null, arguments); - } - nextTask(slice(arguments, 1)); - } - - nextTask([]); -}; - -/** - * An "async function" in the context of Async is an asynchronous function with - * a variable number of parameters, with the final parameter being a callback. - * (`function (arg1, arg2, ..., callback) {}`) - * The final callback is of the form `callback(err, results...)`, which must be - * called once the function is completed. The callback should be called with a - * Error as its first argument to signal that an error occurred. - * Otherwise, if no error occurred, it should be called with `null` as the first - * argument, and any additional `result` arguments that may apply, to signal - * successful completion. - * The callback must be called exactly once, ideally on a later tick of the - * JavaScript event loop. - * - * This type of function is also referred to as a "Node-style async function", - * or a "continuation passing-style function" (CPS). Most of the methods of this - * library are themselves CPS/Node-style async functions, or functions that - * return CPS/Node-style async functions. - * - * Wherever we accept a Node-style async function, we also directly accept an - * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. - * In this case, the `async` function will not be passed a final callback - * argument, and any thrown error will be used as the `err` argument of the - * implicit callback, and the return value will be used as the `result` value. - * (i.e. a `rejected` of the returned Promise becomes the `err` callback - * argument, and a `resolved` value becomes the `result`.) - * - * Note, due to JavaScript limitations, we can only detect native `async` - * functions and not transpilied implementations. - * Your environment must have `async`/`await` support for this to work. - * (e.g. Node > v7.6, or a recent version of a modern browser). - * If you are using `async` functions through a transpiler (e.g. Babel), you - * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, - * because the `async function` will be compiled to an ordinary function that - * returns a promise. - * - * @typedef {Function} AsyncFunction - * @static - */ - -/** - * Async is a utility module which provides straight-forward, powerful functions - * for working with asynchronous JavaScript. Although originally designed for - * use with [Node.js](http://nodejs.org) and installable via - * `npm install --save async`, it can also be used directly in the browser. - * @module async - * @see AsyncFunction - */ - - -/** - * A collection of `async` functions for manipulating collections, such as - * arrays and objects. - * @module Collections - */ - -/** - * A collection of `async` functions for controlling the flow through a script. - * @module ControlFlow - */ - -/** - * A collection of `async` utility functions. - * @module Utils - */ - -var index = { - apply: apply, - applyEach: applyEach, - applyEachSeries: applyEachSeries, - asyncify: asyncify, - auto: auto, - autoInject: autoInject, - cargo: cargo, - compose: compose, - concat: concat, - concatLimit: concatLimit, - concatSeries: concatSeries, - constant: constant, - detect: detect, - detectLimit: detectLimit, - detectSeries: detectSeries, - dir: dir, - doDuring: doDuring, - doUntil: doUntil, - doWhilst: doWhilst, - during: during, - each: eachLimit, - eachLimit: eachLimit$1, - eachOf: eachOf, - eachOfLimit: eachOfLimit, - eachOfSeries: eachOfSeries, - eachSeries: eachSeries, - ensureAsync: ensureAsync, - every: every, - everyLimit: everyLimit, - everySeries: everySeries, - filter: filter, - filterLimit: filterLimit, - filterSeries: filterSeries, - forever: forever, - groupBy: groupBy, - groupByLimit: groupByLimit, - groupBySeries: groupBySeries, - log: log, - map: map, - mapLimit: mapLimit, - mapSeries: mapSeries, - mapValues: mapValues, - mapValuesLimit: mapValuesLimit, - mapValuesSeries: mapValuesSeries, - memoize: memoize, - nextTick: nextTick, - parallel: parallelLimit, - parallelLimit: parallelLimit$1, - priorityQueue: priorityQueue, - queue: queue$1, - race: race, - reduce: reduce, - reduceRight: reduceRight, - reflect: reflect, - reflectAll: reflectAll, - reject: reject, - rejectLimit: rejectLimit, - rejectSeries: rejectSeries, - retry: retry, - retryable: retryable, - seq: seq, - series: series, - setImmediate: setImmediate$1, - some: some, - someLimit: someLimit, - someSeries: someSeries, - sortBy: sortBy, - timeout: timeout, - times: times, - timesLimit: timeLimit, - timesSeries: timesSeries, - transform: transform, - tryEach: tryEach, - unmemoize: unmemoize, - until: until, - waterfall: waterfall, - whilst: whilst, - - // aliases - all: every, - allLimit: everyLimit, - allSeries: everySeries, - any: some, - anyLimit: someLimit, - anySeries: someSeries, - find: detect, - findLimit: detectLimit, - findSeries: detectSeries, - forEach: eachLimit, - forEachSeries: eachSeries, - forEachLimit: eachLimit$1, - forEachOf: eachOf, - forEachOfSeries: eachOfSeries, - forEachOfLimit: eachOfLimit, - inject: reduce, - foldl: reduce, - foldr: reduceRight, - select: filter, - selectLimit: filterLimit, - selectSeries: filterSeries, - wrapSync: asyncify -}; - -exports['default'] = index; -exports.apply = apply; -exports.applyEach = applyEach; -exports.applyEachSeries = applyEachSeries; -exports.asyncify = asyncify; -exports.auto = auto; -exports.autoInject = autoInject; -exports.cargo = cargo; -exports.compose = compose; -exports.concat = concat; -exports.concatLimit = concatLimit; -exports.concatSeries = concatSeries; -exports.constant = constant; -exports.detect = detect; -exports.detectLimit = detectLimit; -exports.detectSeries = detectSeries; -exports.dir = dir; -exports.doDuring = doDuring; -exports.doUntil = doUntil; -exports.doWhilst = doWhilst; -exports.during = during; -exports.each = eachLimit; -exports.eachLimit = eachLimit$1; -exports.eachOf = eachOf; -exports.eachOfLimit = eachOfLimit; -exports.eachOfSeries = eachOfSeries; -exports.eachSeries = eachSeries; -exports.ensureAsync = ensureAsync; -exports.every = every; -exports.everyLimit = everyLimit; -exports.everySeries = everySeries; -exports.filter = filter; -exports.filterLimit = filterLimit; -exports.filterSeries = filterSeries; -exports.forever = forever; -exports.groupBy = groupBy; -exports.groupByLimit = groupByLimit; -exports.groupBySeries = groupBySeries; -exports.log = log; -exports.map = map; -exports.mapLimit = mapLimit; -exports.mapSeries = mapSeries; -exports.mapValues = mapValues; -exports.mapValuesLimit = mapValuesLimit; -exports.mapValuesSeries = mapValuesSeries; -exports.memoize = memoize; -exports.nextTick = nextTick; -exports.parallel = parallelLimit; -exports.parallelLimit = parallelLimit$1; -exports.priorityQueue = priorityQueue; -exports.queue = queue$1; -exports.race = race; -exports.reduce = reduce; -exports.reduceRight = reduceRight; -exports.reflect = reflect; -exports.reflectAll = reflectAll; -exports.reject = reject; -exports.rejectLimit = rejectLimit; -exports.rejectSeries = rejectSeries; -exports.retry = retry; -exports.retryable = retryable; -exports.seq = seq; -exports.series = series; -exports.setImmediate = setImmediate$1; -exports.some = some; -exports.someLimit = someLimit; -exports.someSeries = someSeries; -exports.sortBy = sortBy; -exports.timeout = timeout; -exports.times = times; -exports.timesLimit = timeLimit; -exports.timesSeries = timesSeries; -exports.transform = transform; -exports.tryEach = tryEach; -exports.unmemoize = unmemoize; -exports.until = until; -exports.waterfall = waterfall; -exports.whilst = whilst; -exports.all = every; -exports.allLimit = everyLimit; -exports.allSeries = everySeries; -exports.any = some; -exports.anyLimit = someLimit; -exports.anySeries = someSeries; -exports.find = detect; -exports.findLimit = detectLimit; -exports.findSeries = detectSeries; -exports.forEach = eachLimit; -exports.forEachSeries = eachSeries; -exports.forEachLimit = eachLimit$1; -exports.forEachOf = eachOf; -exports.forEachOfSeries = eachOfSeries; -exports.forEachOfLimit = eachOfLimit; -exports.inject = reduce; -exports.foldl = reduce; -exports.foldr = reduceRight; -exports.select = filter; -exports.selectLimit = filterLimit; -exports.selectSeries = filterSeries; -exports.wrapSync = asyncify; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); - - -/***/ }), - -/***/ 898: -/***/ ((module) => { +BufferListStream.prototype.end = function end (chunk) { + DuplexStream.prototype.end.call(this, chunk) -module.exports = r => { - const n = process.versions.node.split('.').map(x => parseInt(x, 10)) - r = r.split('.').map(x => parseInt(x, 10)) - return n[0] > r[0] || (n[0] === r[0] && (n[1] > r[1] || (n[1] === r[1] && n[2] >= r[2]))) + if (this._callback) { + this._callback(null, this.slice()) + this._callback = null + } } - -/***/ }), - -/***/ 20587: -/***/ ((module) => { - -"use strict"; - -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; +BufferListStream.prototype._destroy = function _destroy (err, cb) { + this._bufs.length = 0 + this.length = 0 + cb(err) } -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; +BufferListStream.prototype._isBufferList = function _isBufferList (b) { + return b instanceof BufferListStream || b instanceof BufferList || BufferListStream.isBufferList(b) } -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } +BufferListStream.isBufferList = BufferList.isBufferList - return result; -} +module.exports = BufferListStream +module.exports.BufferListStream = BufferListStream +module.exports.BufferList = BufferList /***/ }), @@ -44674,6 +41219,7 @@ function range(a, b, str) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.boolean = void 0; const boolean = function (value) { if (typeof value === 'string') { return ['true', 't', 'yes', 'y', 'on', '1'].includes(value.trim().toLowerCase()); @@ -44691,18564 +41237,8414 @@ exports.boolean = boolean; /***/ }), -/***/ 85533: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 59832: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var concatMap = __webpack_require__(45179); -var balanced = __webpack_require__(20587); +var Buffer = __nccwpck_require__(64293).Buffer; -module.exports = expandTop; +var CRC_TABLE = [ + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d +]; -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; +if (typeof Int32Array !== 'undefined') { + CRC_TABLE = new Int32Array(CRC_TABLE); +} -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); +function ensureBuffer(input) { + if (Buffer.isBuffer(input)) { + return input; + } + + var hasNewBufferAPI = + typeof Buffer.alloc === "function" && + typeof Buffer.from === "function"; + + if (typeof input === "number") { + return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input); + } + else if (typeof input === "string") { + return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input); + } + else { + throw new Error("input must be buffer, number, or string, received " + + typeof input); + } } -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); +function bufferizeInt(num) { + var tmp = ensureBuffer(4); + tmp.writeInt32BE(num, 0); + return tmp; } -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); +function _crc32(buf, previous) { + buf = ensureBuffer(buf); + if (Buffer.isBuffer(previous)) { + previous = previous.readUInt32BE(0); + } + var crc = ~~previous ^ -1; + for (var n = 0; n < buf.length; n++) { + crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8); + } + return (crc ^ -1); } +function crc32() { + return bufferizeInt(_crc32.apply(null, arguments)); +} +crc32.signed = function () { + return _crc32.apply(null, arguments); +}; +crc32.unsigned = function () { + return _crc32.apply(null, arguments) >>> 0; +}; -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; +module.exports = crc32; - var parts = []; - var m = balanced('{', '}', str); - if (!m) - return str.split(','); +/***/ }), - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); +/***/ 24018: +/***/ ((module) => { - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; +"use strict"; - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } +module.exports = object => { + const result = {}; - return expand(escapeBraces(str), true).map(unescapeBraces); -} + for (const [key, value] of Object.entries(object)) { + result[key.toLowerCase()] = value; + } -function identity(e) { - return e; -} + return result; +}; -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} +/***/ }), -function expand(str, isTop) { - var expansions = []; +/***/ 78837: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; +"use strict"; - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } +const EventEmitter = __nccwpck_require__(28614); +const urlLib = __nccwpck_require__(78835); +const normalizeUrl = __nccwpck_require__(68938); +const getStream = __nccwpck_require__(63886); +const CachePolicy = __nccwpck_require__(19630); +const Response = __nccwpck_require__(39014); +const lowercaseKeys = __nccwpck_require__(24018); +const cloneResponse = __nccwpck_require__(2116); +const Keyv = __nccwpck_require__(88735); - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. +class CacheableRequest { + constructor(request, cacheAdapter) { + if (typeof request !== 'function') { + throw new TypeError('Parameter `request` must be a function'); + } - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; + this.cache = new Keyv({ + uri: typeof cacheAdapter === 'string' && cacheAdapter, + store: typeof cacheAdapter !== 'string' && cacheAdapter, + namespace: 'cacheable-request' + }); - var N; + return this.createCacheableRequest(request); + } - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); + createCacheableRequest(request) { + return (opts, cb) => { + let url; + if (typeof opts === 'string') { + url = normalizeUrlObject(urlLib.parse(opts)); + opts = {}; + } else if (opts instanceof urlLib.URL) { + url = normalizeUrlObject(urlLib.parse(opts.toString())); + opts = {}; + } else { + const [pathname, ...searchParts] = (opts.path || '').split('?'); + const search = searchParts.length > 0 ? + `?${searchParts.join('?')}` : + ''; + url = normalizeUrlObject({ ...opts, pathname, search }); + } - N = []; + opts = { + headers: {}, + method: 'GET', + cache: true, + strictTtl: false, + automaticFailover: false, + ...opts, + ...urlObjectToRequestOptions(url) + }; + opts.headers = lowercaseKeys(opts.headers); - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } + const ee = new EventEmitter(); + const normalizedUrlString = normalizeUrl( + urlLib.format(url), + { + stripWWW: false, + removeTrailingSlash: false, + stripAuthentication: false + } + ); + const key = `${opts.method}:${normalizedUrlString}`; + let revalidate = false; + let madeRequest = false; - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } + const makeRequest = opts => { + madeRequest = true; + let requestErrored = false; + let requestErrorCallback; - return expansions; -} + const requestErrorPromise = new Promise(resolve => { + requestErrorCallback = () => { + if (!requestErrored) { + requestErrored = true; + resolve(); + } + }; + }); + const handler = response => { + if (revalidate && !opts.forceRefresh) { + response.status = response.statusCode; + const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); + if (!revalidatedPolicy.modified) { + const headers = revalidatedPolicy.policy.responseHeaders(); + response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); + response.cachePolicy = revalidatedPolicy.policy; + response.fromCache = true; + } + } + if (!response.fromCache) { + response.cachePolicy = new CachePolicy(opts, response, opts); + response.fromCache = false; + } -/***/ }), + let clonedResponse; + if (opts.cache && response.cachePolicy.storable()) { + clonedResponse = cloneResponse(response); -/***/ 22706: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + (async () => { + try { + const bodyPromise = getStream.buffer(response); -"use strict"; + await Promise.race([ + requestErrorPromise, + new Promise(resolve => response.once('end', resolve)) + ]); + if (requestErrored) { + return; + } -const stringify = __webpack_require__(82698); -const compile = __webpack_require__(13047); -const expand = __webpack_require__(2482); -const parse = __webpack_require__(25900); + const body = await bodyPromise; -/** - * Expand the given pattern or create a regex-compatible string. - * - * ```js - * const braces = require('braces'); - * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] - * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ + const value = { + cachePolicy: response.cachePolicy.toObject(), + url: response.url, + statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, + body + }; -const braces = (input, options = {}) => { - let output = []; + let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; + if (opts.maxTtl) { + ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; + } - if (Array.isArray(input)) { - for (let pattern of input) { - let result = braces.create(pattern, options); - if (Array.isArray(result)) { - output.push(...result); - } else { - output.push(result); - } - } - } else { - output = [].concat(braces.create(input, options)); - } + await this.cache.set(key, value, ttl); + } catch (error) { + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); + } else if (opts.cache && revalidate) { + (async () => { + try { + await this.cache.delete(key); + } catch (error) { + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); + } - if (options && options.expand === true && options.nodupes === true) { - output = [...new Set(output)]; - } - return output; -}; + ee.emit('response', clonedResponse || response); + if (typeof cb === 'function') { + cb(clonedResponse || response); + } + }; -/** - * Parse the given `str` with the given `options`. - * - * ```js - * // braces.parse(pattern, [, options]); - * const ast = braces.parse('a/{b,c}/d'); - * console.log(ast); - * ``` - * @param {String} pattern Brace pattern to parse - * @param {Object} options - * @return {Object} Returns an AST - * @api public - */ + try { + const req = request(opts, handler); + req.once('error', requestErrorCallback); + req.once('abort', requestErrorCallback); + ee.emit('request', req); + } catch (error) { + ee.emit('error', new CacheableRequest.RequestError(error)); + } + }; -braces.parse = (input, options = {}) => parse(input, options); + (async () => { + const get = async opts => { + await Promise.resolve(); -/** - * Creates a braces string from an AST, or an AST node. - * - * ```js - * const braces = require('braces'); - * let ast = braces.parse('foo/{a,b}/bar'); - * console.log(stringify(ast.nodes[2])); //=> '{a,b}' - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; + if (typeof cacheEntry === 'undefined') { + return makeRequest(opts); + } -braces.stringify = (input, options = {}) => { - if (typeof input === 'string') { - return stringify(braces.parse(input, options), options); - } - return stringify(input, options); -}; + const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); + if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { + const headers = policy.responseHeaders(); + const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); + response.cachePolicy = policy; + response.fromCache = true; -/** - * Compiles a brace pattern into a regex-compatible, optimized string. - * This method is called by the main [braces](#braces) function by default. - * - * ```js - * const braces = require('braces'); - * console.log(braces.compile('a/{b,c}/d')); - * //=> ['a/(b|c)/d'] - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + ee.emit('response', response); + if (typeof cb === 'function') { + cb(response); + } + } else { + revalidate = cacheEntry; + opts.headers = policy.revalidationHeaders(opts); + makeRequest(opts); + } + }; -braces.compile = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } - return compile(input, options); -}; + const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); + this.cache.once('error', errorHandler); + ee.on('response', () => this.cache.removeListener('error', errorHandler)); -/** - * Expands a brace pattern into an array. This method is called by the - * main [braces](#braces) function when `options.expand` is true. Before - * using this method it's recommended that you read the [performance notes](#performance)) - * and advantages of using [.compile](#compile) instead. - * - * ```js - * const braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/b/d', 'a/c/d']; - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + try { + await get(opts); + } catch (error) { + if (opts.automaticFailover && !madeRequest) { + makeRequest(opts); + } -braces.expand = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); - let result = expand(input, options); + return ee; + }; + } +} - // filter out empty strings if specified - if (options.noempty === true) { - result = result.filter(Boolean); - } +function urlObjectToRequestOptions(url) { + const options = { ...url }; + options.path = `${url.pathname || '/'}${url.search || ''}`; + delete options.pathname; + delete options.search; + return options; +} - // filter out duplicates if specified - if (options.nodupes === true) { - result = [...new Set(result)]; - } +function normalizeUrlObject(url) { + // If url was parsed by url.parse or new URL: + // - hostname will be set + // - host will be hostname[:port] + // - port will be set if it was explicit in the parsed string + // Otherwise, url was from request options: + // - hostname or host may be set + // - host shall not have port encoded + return { + protocol: url.protocol, + auth: url.auth, + hostname: url.hostname || url.host || 'localhost', + port: url.port, + pathname: url.pathname, + search: url.search + }; +} - return result; +CacheableRequest.RequestError = class extends Error { + constructor(error) { + super(error.message); + this.name = 'RequestError'; + Object.assign(this, error); + } }; -/** - * Processes a brace pattern and returns either an expanded array - * (if `options.expand` is true), a highly optimized regex-compatible string. - * This method is called by the main [braces](#braces) function. - * - * ```js - * const braces = require('braces'); - * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) - * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.create = (input, options = {}) => { - if (input === '' || input.length < 3) { - return [input]; - } - - return options.expand !== true - ? braces.compile(input, options) - : braces.expand(input, options); +CacheableRequest.CacheError = class extends Error { + constructor(error) { + super(error.message); + this.name = 'CacheError'; + Object.assign(this, error); + } }; -/** - * Expose "braces" - */ - -module.exports = braces; +module.exports = CacheableRequest; /***/ }), -/***/ 13047: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 7833: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +const ansiStyles = __nccwpck_require__(58588); +const {stdout: stdoutColor, stderr: stderrColor} = __nccwpck_require__(28106); +const { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex +} = __nccwpck_require__(15254); -const fill = __webpack_require__(35955); -const utils = __webpack_require__(68130); +const {isArray} = Array; -const compile = (ast, options = {}) => { - let walk = (node, parent = {}) => { - let invalidBlock = utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let invalid = invalidBlock === true || invalidNode === true; - let prefix = options.escapeInvalid === true ? '\\' : ''; - let output = ''; +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = [ + 'ansi', + 'ansi', + 'ansi256', + 'ansi16m' +]; - if (node.isOpen === true) { - return prefix + node.value; - } - if (node.isClose === true) { - return prefix + node.value; - } +const styles = Object.create(null); - if (node.type === 'open') { - return invalid ? (prefix + node.value) : '('; - } +const applyOptions = (object, options = {}) => { + if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { + throw new Error('The `level` option should be an integer from 0 to 3'); + } - if (node.type === 'close') { - return invalid ? (prefix + node.value) : ')'; - } + // Detect level if not set manually + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object.level = options.level === undefined ? colorLevel : options.level; +}; - if (node.type === 'comma') { - return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|'); - } +class ChalkClass { + constructor(options) { + // eslint-disable-next-line no-constructor-return + return chalkFactory(options); + } +} - if (node.value) { - return node.value; - } +const chalkFactory = options => { + const chalk = {}; + applyOptions(chalk, options); - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); - let range = fill(...args, { ...options, wrap: false, toRegex: true }); + chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); - if (range.length !== 0) { - return args.length > 1 && range.length > 1 ? `(${range})` : range; - } - } + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); - if (node.nodes) { - for (let child of node.nodes) { - output += walk(child, node); - } - } - return output; - }; + chalk.template.constructor = () => { + throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); + }; - return walk(ast); -}; + chalk.template.Instance = ChalkClass; -module.exports = compile; + return chalk.template; +}; +function Chalk(options) { + return chalkFactory(options); +} -/***/ }), +for (const [styleName, style] of Object.entries(ansiStyles)) { + styles[styleName] = { + get() { + const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); + Object.defineProperty(this, styleName, {value: builder}); + return builder; + } + }; +} -/***/ 9552: -/***/ ((module) => { +styles.visible = { + get() { + const builder = createBuilder(this, this._styler, true); + Object.defineProperty(this, 'visible', {value: builder}); + return builder; + } +}; -"use strict"; +const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; +for (const model of usedModels) { + styles[model] = { + get() { + const {level} = this; + return function (...arguments_) { + const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; +} -module.exports = { - MAX_LENGTH: 1024 * 64, +for (const model of usedModels) { + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const {level} = this; + return function (...arguments_) { + const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; +} - // Digits - CHAR_0: '0', /* 0 */ - CHAR_9: '9', /* 9 */ +const proto = Object.defineProperties(() => {}, { + ...styles, + level: { + enumerable: true, + get() { + return this._generator.level; + }, + set(level) { + this._generator.level = level; + } + } +}); - // Alphabet chars. - CHAR_UPPERCASE_A: 'A', /* A */ - CHAR_LOWERCASE_A: 'a', /* a */ - CHAR_UPPERCASE_Z: 'Z', /* Z */ - CHAR_LOWERCASE_Z: 'z', /* z */ +const createStyler = (open, close, parent) => { + let openAll; + let closeAll; + if (parent === undefined) { + openAll = open; + closeAll = close; + } else { + openAll = parent.openAll + open; + closeAll = close + parent.closeAll; + } - CHAR_LEFT_PARENTHESES: '(', /* ( */ - CHAR_RIGHT_PARENTHESES: ')', /* ) */ + return { + open, + close, + openAll, + closeAll, + parent + }; +}; - CHAR_ASTERISK: '*', /* * */ +const createBuilder = (self, _styler, _isEmpty) => { + const builder = (...arguments_) => { + if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { + // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}` + return applyStyle(builder, chalkTag(builder, ...arguments_)); + } - // Non-alphabetic chars. - CHAR_AMPERSAND: '&', /* & */ - CHAR_AT: '@', /* @ */ - CHAR_BACKSLASH: '\\', /* \ */ - CHAR_BACKTICK: '`', /* ` */ - CHAR_CARRIAGE_RETURN: '\r', /* \r */ - CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ - CHAR_COLON: ':', /* : */ - CHAR_COMMA: ',', /* , */ - CHAR_DOLLAR: '$', /* . */ - CHAR_DOT: '.', /* . */ - CHAR_DOUBLE_QUOTE: '"', /* " */ - CHAR_EQUAL: '=', /* = */ - CHAR_EXCLAMATION_MARK: '!', /* ! */ - CHAR_FORM_FEED: '\f', /* \f */ - CHAR_FORWARD_SLASH: '/', /* / */ - CHAR_HASH: '#', /* # */ - CHAR_HYPHEN_MINUS: '-', /* - */ - CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ - CHAR_LEFT_CURLY_BRACE: '{', /* { */ - CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ - CHAR_LINE_FEED: '\n', /* \n */ - CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ - CHAR_PERCENT: '%', /* % */ - CHAR_PLUS: '+', /* + */ - CHAR_QUESTION_MARK: '?', /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ - CHAR_RIGHT_CURLY_BRACE: '}', /* } */ - CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ - CHAR_SEMICOLON: ';', /* ; */ - CHAR_SINGLE_QUOTE: '\'', /* ' */ - CHAR_SPACE: ' ', /* */ - CHAR_TAB: '\t', /* \t */ - CHAR_UNDERSCORE: '_', /* _ */ - CHAR_VERTICAL_LINE: '|', /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ -}; + // Single argument is hot path, implicit coercion is faster than anything + // eslint-disable-next-line no-implicit-coercion + return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); + }; + // We alter the prototype because we must return a function, but there is + // no way to create a function with a different prototype + Object.setPrototypeOf(builder, proto); -/***/ }), + builder._generator = self; + builder._styler = _styler; + builder._isEmpty = _isEmpty; -/***/ 2482: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + return builder; +}; -"use strict"; +const applyStyle = (self, string) => { + if (self.level <= 0 || !string) { + return self._isEmpty ? '' : string; + } + let styler = self._styler; -const fill = __webpack_require__(35955); -const stringify = __webpack_require__(82698); -const utils = __webpack_require__(68130); + if (styler === undefined) { + return string; + } -const append = (queue = '', stash = '', enclose = false) => { - let result = []; + const {openAll, closeAll} = styler; + if (string.indexOf('\u001B') !== -1) { + while (styler !== undefined) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + string = stringReplaceAll(string, styler.close, styler.open); - queue = [].concat(queue); - stash = [].concat(stash); + styler = styler.parent; + } + } - if (!stash.length) return queue; - if (!queue.length) { - return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; - } + // We can move both next actions out of loop, because remaining actions in loop won't have + // any/visible effect on parts we add here. Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 + const lfIndex = string.indexOf('\n'); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } - for (let item of queue) { - if (Array.isArray(item)) { - for (let value of item) { - result.push(append(value, stash, enclose)); - } - } else { - for (let ele of stash) { - if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; - result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele)); - } - } - } - return utils.flatten(result); + return openAll + string + closeAll; }; -const expand = (ast, options = {}) => { - let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; - - let walk = (node, parent = {}) => { - node.queue = []; +let template; +const chalkTag = (chalk, ...strings) => { + const [firstString] = strings; - let p = parent; - let q = parent.queue; + if (!isArray(firstString) || !isArray(firstString.raw)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return strings.join(' '); + } - while (p.type !== 'brace' && p.type !== 'root' && p.parent) { - p = p.parent; - q = p.queue; - } + const arguments_ = strings.slice(1); + const parts = [firstString.raw[0]]; - if (node.invalid || node.dollar) { - q.push(append(q.pop(), stringify(node, options))); - return; - } + for (let i = 1; i < firstString.length; i++) { + parts.push( + String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), + String(firstString.raw[i]) + ); + } - if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { - q.push(append(q.pop(), ['{}'])); - return; - } + if (template === undefined) { + template = __nccwpck_require__(77183); + } - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); + return template(chalk, parts.join('')); +}; - if (utils.exceedsLimit(...args, options.step, rangeLimit)) { - throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); - } +Object.defineProperties(Chalk.prototype, styles); - let range = fill(...args, options); - if (range.length === 0) { - range = stringify(node, options); - } +const chalk = Chalk(); // eslint-disable-line new-cap +chalk.supportsColor = stdoutColor; +chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap +chalk.stderr.supportsColor = stderrColor; - q.push(append(q.pop(), range)); - node.nodes = []; - return; - } +module.exports = chalk; - let enclose = utils.encloseBrace(node); - let queue = node.queue; - let block = node; - while (block.type !== 'brace' && block.type !== 'root' && block.parent) { - block = block.parent; - queue = block.queue; - } +/***/ }), - for (let i = 0; i < node.nodes.length; i++) { - let child = node.nodes[i]; +/***/ 77183: +/***/ ((module) => { - if (child.type === 'comma' && node.type === 'brace') { - if (i === 1) queue.push(''); - queue.push(''); - continue; - } +"use strict"; - if (child.type === 'close') { - q.push(append(q.pop(), queue, enclose)); - continue; - } +const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; +const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; +const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; +const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; - if (child.value && child.type !== 'open') { - queue.push(append(queue.pop(), child.value)); - continue; - } +const ESCAPES = new Map([ + ['n', '\n'], + ['r', '\r'], + ['t', '\t'], + ['b', '\b'], + ['f', '\f'], + ['v', '\v'], + ['0', '\0'], + ['\\', '\\'], + ['e', '\u001B'], + ['a', '\u0007'] +]); - if (child.nodes) { - walk(child, node); - } - } +function unescape(c) { + const u = c[0] === 'u'; + const bracket = c[1] === '{'; - return queue; - }; + if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { + return String.fromCharCode(parseInt(c.slice(1), 16)); + } - return utils.flatten(walk(ast)); -}; + if (u && bracket) { + return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); + } -module.exports = expand; + return ESCAPES.get(c) || c; +} +function parseArguments(name, arguments_) { + const results = []; + const chunks = arguments_.trim().split(/\s*,\s*/g); + let matches; -/***/ }), + for (const chunk of chunks) { + const number = Number(chunk); + if (!Number.isNaN(number)) { + results.push(number); + } else if ((matches = chunk.match(STRING_REGEX))) { + results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); + } + } -/***/ 25900: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + return results; +} -"use strict"; +function parseStyle(style) { + STYLE_REGEX.lastIndex = 0; + const results = []; + let matches; -const stringify = __webpack_require__(82698); + while ((matches = STYLE_REGEX.exec(style)) !== null) { + const name = matches[1]; -/** - * Constants - */ + if (matches[2]) { + const args = parseArguments(name, matches[2]); + results.push([name].concat(args)); + } else { + results.push([name]); + } + } -const { - MAX_LENGTH, - CHAR_BACKSLASH, /* \ */ - CHAR_BACKTICK, /* ` */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_RIGHT_SQUARE_BRACKET, /* ] */ - CHAR_DOUBLE_QUOTE, /* " */ - CHAR_SINGLE_QUOTE, /* ' */ - CHAR_NO_BREAK_SPACE, - CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = __webpack_require__(9552); + return results; +} -/** - * parse - */ +function buildStyle(chalk, styles) { + const enabled = {}; -const parse = (input, options = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } + for (const layer of styles) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); + } + } - let opts = options || {}; - let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - if (input.length > max) { - throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); - } + let current = chalk; + for (const [styleName, styles] of Object.entries(enabled)) { + if (!Array.isArray(styles)) { + continue; + } - let ast = { type: 'root', input, nodes: [] }; - let stack = [ast]; - let block = ast; - let prev = ast; - let brackets = 0; - let length = input.length; - let index = 0; - let depth = 0; - let value; - let memo = {}; + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } - /** - * Helpers - */ + current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; + } - const advance = () => input[index++]; - const push = node => { - if (node.type === 'text' && prev.type === 'dot') { - prev.type = 'text'; - } + return current; +} - if (prev && prev.type === 'text' && node.type === 'text') { - prev.value += node.value; - return; - } +module.exports = (chalk, temporary) => { + const styles = []; + const chunks = []; + let chunk = []; - block.nodes.push(node); - node.parent = block; - node.prev = prev; - prev = node; - return node; - }; + // eslint-disable-next-line max-params + temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { + if (escapeCharacter) { + chunk.push(unescape(escapeCharacter)); + } else if (style) { + const string = chunk.join(''); + chunk = []; + chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); + styles.push({inverse, styles: parseStyle(style)}); + } else if (close) { + if (styles.length === 0) { + throw new Error('Found extraneous } in Chalk template literal'); + } - push({ type: 'bos' }); + chunks.push(buildStyle(chalk, styles)(chunk.join(''))); + chunk = []; + styles.pop(); + } else { + chunk.push(character); + } + }); - while (index < length) { - block = stack[stack.length - 1]; - value = advance(); + chunks.push(chunk.join('')); - /** - * Invalid chars - */ + if (styles.length > 0) { + const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; + throw new Error(errMessage); + } - if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { - continue; - } + return chunks.join(''); +}; - /** - * Escaped chars - */ - if (value === CHAR_BACKSLASH) { - push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); - continue; - } +/***/ }), - /** - * Right square bracket (literal): ']' - */ +/***/ 15254: +/***/ ((module) => { - if (value === CHAR_RIGHT_SQUARE_BRACKET) { - push({ type: 'text', value: '\\' + value }); - continue; - } +"use strict"; - /** - * Left square bracket: '[' - */ - if (value === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; +const stringReplaceAll = (string, substring, replacer) => { + let index = string.indexOf(substring); + if (index === -1) { + return string; + } - let closed = true; - let next; + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ''; + do { + returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; + endIndex = index + substringLength; + index = string.indexOf(substring, endIndex); + } while (index !== -1); - while (index < length && (next = advance())) { - value += next; + returnValue += string.substr(endIndex); + return returnValue; +}; - if (next === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - continue; - } +const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { + let endIndex = 0; + let returnValue = ''; + do { + const gotCR = string[index - 1] === '\r'; + returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; + endIndex = index + 1; + index = string.indexOf('\n', endIndex); + } while (index !== -1); - if (next === CHAR_BACKSLASH) { - value += advance(); - continue; - } + returnValue += string.substr(endIndex); + return returnValue; +}; - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - brackets--; +module.exports = { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex +}; - if (brackets === 0) { - break; - } - } - } - push({ type: 'text', value }); - continue; - } +/***/ }), - /** - * Parentheses - */ +/***/ 63488: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (value === CHAR_LEFT_PARENTHESES) { - block = push({ type: 'paren', nodes: [] }); - stack.push(block); - push({ type: 'text', value }); - continue; - } +"use strict"; - if (value === CHAR_RIGHT_PARENTHESES) { - if (block.type !== 'paren') { - push({ type: 'text', value }); - continue; - } - block = stack.pop(); - push({ type: 'text', value }); - block = stack[stack.length - 1]; - continue; - } - /** - * Quotes: '|"|` - */ +const spinners = Object.assign({}, __nccwpck_require__(20390)); - if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { - let open = value; - let next; +const spinnersList = Object.keys(spinners); - if (options.keepQuotes !== true) { - value = ''; - } +Object.defineProperty(spinners, 'random', { + get() { + const randomIndex = Math.floor(Math.random() * spinnersList.length); + const spinnerName = spinnersList[randomIndex]; + return spinners[spinnerName]; + } +}); - while (index < length && (next = advance())) { - if (next === CHAR_BACKSLASH) { - value += next + advance(); - continue; - } +module.exports = spinners; +// TODO: Remove this for the next major release +module.exports.default = spinners; - if (next === open) { - if (options.keepQuotes === true) value += next; - break; - } - value += next; - } +/***/ }), - push({ type: 'text', value }); - continue; - } +/***/ 2116: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Left curly brace: '{' - */ +"use strict"; - if (value === CHAR_LEFT_CURLY_BRACE) { - depth++; - let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; - let brace = { - type: 'brace', - open: true, - close: false, - dollar, - depth, - commas: 0, - ranges: 0, - nodes: [] - }; +const PassThrough = __nccwpck_require__(92413).PassThrough; +const mimicResponse = __nccwpck_require__(27480); - block = push(brace); - stack.push(block); - push({ type: 'open', value }); - continue; - } +const cloneResponse = response => { + if (!(response && response.pipe)) { + throw new TypeError('Parameter `response` must be a response stream.'); + } - /** - * Right curly brace: '}' - */ + const clone = new PassThrough(); + mimicResponse(response, clone); - if (value === CHAR_RIGHT_CURLY_BRACE) { - if (block.type !== 'brace') { - push({ type: 'text', value }); - continue; - } + return response.pipe(clone); +}; - let type = 'close'; - block = stack.pop(); - block.close = true; +module.exports = cloneResponse; - push({ type, value }); - depth--; - block = stack[stack.length - 1]; - continue; - } +/***/ }), - /** - * Comma: ',' - */ +/***/ 13405: +/***/ ((module) => { - if (value === CHAR_COMMA && depth > 0) { - if (block.ranges > 0) { - block.ranges = 0; - let open = block.nodes.shift(); - block.nodes = [open, { type: 'text', value: stringify(block) }]; - } +var clone = (function() { +'use strict'; - push({ type: 'comma', value }); - block.commas++; - continue; - } +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). +*/ +function clone(parent, circular, depth, prototype) { + var filter; + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + filter = circular.filter; + circular = circular.circular + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; - /** - * Dot: '.' - */ + var useBuffer = typeof Buffer != 'undefined'; - if (value === CHAR_DOT && depth > 0 && block.commas === 0) { - let siblings = block.nodes; + if (typeof circular == 'undefined') + circular = true; - if (depth === 0 || siblings.length === 0) { - push({ type: 'text', value }); - continue; - } + if (typeof depth == 'undefined') + depth = Infinity; - if (prev.type === 'dot') { - block.range = []; - prev.value += value; - prev.type = 'range'; + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; - if (block.nodes.length !== 3 && block.nodes.length !== 5) { - block.invalid = true; - block.ranges = 0; - prev.type = 'text'; - continue; - } + if (depth == 0) + return parent; - block.ranges++; - block.args = []; - continue; + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + if (Buffer.allocUnsafe) { + // Node.js >= 4.5.0 + child = Buffer.allocUnsafe(parent.length); + } else { + // Older Node.js versions + child = new Buffer(parent.length); + } + parent.copy(child); + return child; + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; } + } - if (prev.type === 'range') { - siblings.pop(); + if (circular) { + var index = allParents.indexOf(parent); - let before = siblings[siblings.length - 1]; - before.value += prev.value + value; - prev = before; - block.ranges--; - continue; + if (index != -1) { + return allChildren[index]; } - - push({ type: 'dot', value }); - continue; + allParents.push(parent); + allChildren.push(child); } - /** - * Text - */ + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } - push({ type: 'text', value }); + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + return child; } - // Mark imbalanced braces and brackets as invalid - do { - block = stack.pop(); + return _clone(parent, depth); +} - if (block.type !== 'root') { - block.nodes.forEach(node => { - if (!node.nodes) { - if (node.type === 'open') node.isOpen = true; - if (node.type === 'close') node.isClose = true; - if (!node.nodes) node.type = 'text'; - node.invalid = true; - } - }); +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; - // get the location of the block on parent.nodes (block's siblings) - let parent = stack[stack.length - 1]; - let index = parent.nodes.indexOf(block); - // replace the (invalid) block with it's nodes - parent.nodes.splice(index, 1, ...block.nodes); - } - } while (stack.length > 0); + var c = function () {}; + c.prototype = parent; + return new c(); +}; - push({ type: 'eos' }); - return ast; +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); }; +clone.__objToStr = __objToStr; -module.exports = parse; +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +}; +clone.__isDate = __isDate; +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +}; +clone.__isArray = __isArray; -/***/ }), +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +}; +clone.__isRegExp = __isRegExp; -/***/ 82698: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +}; +clone.__getRegExpFlags = __getRegExpFlags; -"use strict"; +return clone; +})(); +if ( true && module.exports) { + module.exports = clone; +} -const utils = __webpack_require__(68130); -module.exports = (ast, options = {}) => { - let stringify = (node, parent = {}) => { - let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let output = ''; +/***/ }), - if (node.value) { - if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { - return '\\' + node.value; - } - return node.value; - } +/***/ 92724: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (node.value) { - return node.value; - } +/* MIT license */ +/* eslint-disable no-mixed-operators */ +const cssKeywords = __nccwpck_require__(78679); - if (node.nodes) { - for (let child of node.nodes) { - output += stringify(child); - } - } - return output; - }; +// NOTE: conversions should only return primitive values (i.e. arrays, or +// values that give correct `typeof` results). +// do not use box values types (i.e. Number(), String(), etc.) - return stringify(ast); +const reverseKeywords = {}; +for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; +} + +const convert = { + rgb: {channels: 3, labels: 'rgb'}, + hsl: {channels: 3, labels: 'hsl'}, + hsv: {channels: 3, labels: 'hsv'}, + hwb: {channels: 3, labels: 'hwb'}, + cmyk: {channels: 4, labels: 'cmyk'}, + xyz: {channels: 3, labels: 'xyz'}, + lab: {channels: 3, labels: 'lab'}, + lch: {channels: 3, labels: 'lch'}, + hex: {channels: 1, labels: ['hex']}, + keyword: {channels: 1, labels: ['keyword']}, + ansi16: {channels: 1, labels: ['ansi16']}, + ansi256: {channels: 1, labels: ['ansi256']}, + hcg: {channels: 3, labels: ['h', 'c', 'g']}, + apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, + gray: {channels: 1, labels: ['gray']} }; +module.exports = convert; +// Hide .channels and .labels properties +for (const model of Object.keys(convert)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } -/***/ }), + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } -/***/ 68130: -/***/ ((__unused_webpack_module, exports) => { + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } -"use strict"; + const {channels, labels} = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); +} +convert.rgb.hsl = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min = Math.min(r, g, b); + const max = Math.max(r, g, b); + const delta = max - min; + let h; + let s; -exports.isInteger = num => { - if (typeof num === 'number') { - return Number.isInteger(num); - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isInteger(Number(num)); - } - return false; -}; + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } -/** - * Find a node of the given type - */ + h = Math.min(h * 60, 360); -exports.find = (node, type) => node.nodes.find(node => node.type === type); - -/** - * Find a node of the given type - */ - -exports.exceedsLimit = (min, max, step = 1, limit) => { - if (limit === false) return false; - if (!exports.isInteger(min) || !exports.isInteger(max)) return false; - return ((Number(max) - Number(min)) / Number(step)) >= limit; -}; + if (h < 0) { + h += 360; + } -/** - * Escape the given node with '\\' before node.value - */ + const l = (min + max) / 2; -exports.escapeNode = (block, n = 0, type) => { - let node = block.nodes[n]; - if (!node) return; + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } - if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { - if (node.escaped !== true) { - node.value = '\\' + node.value; - node.escaped = true; - } - } + return [h, s * 100, l * 100]; }; -/** - * Returns true if the given brace node should be enclosed in literal braces - */ +convert.rgb.hsv = function (rgb) { + let rdif; + let gdif; + let bdif; + let h; + let s; -exports.encloseBrace = node => { - if (node.type !== 'brace') return false; - if ((node.commas >> 0 + node.ranges >> 0) === 0) { - node.invalid = true; - return true; - } - return false; -}; + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r, g, b); + const diff = v - Math.min(r, g, b); + const diffc = function (c) { + return (v - c) / 6 / diff + 1 / 2; + }; -/** - * Returns true if a brace node is invalid. - */ + if (diff === 0) { + h = 0; + s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); -exports.isInvalidBrace = block => { - if (block.type !== 'brace') return false; - if (block.invalid === true || block.dollar) return true; - if ((block.commas >> 0 + block.ranges >> 0) === 0) { - block.invalid = true; - return true; - } - if (block.open !== true || block.close !== true) { - block.invalid = true; - return true; - } - return false; -}; + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = (1 / 3) + rdif - bdif; + } else if (b === v) { + h = (2 / 3) + gdif - rdif; + } -/** - * Returns true if a node is an open or close node - */ + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } -exports.isOpenOrClose = node => { - if (node.type === 'open' || node.type === 'close') { - return true; - } - return node.open === true || node.close === true; + return [ + h * 360, + s * 100, + v * 100 + ]; }; -/** - * Reduce an array of text nodes. - */ - -exports.reduce = nodes => nodes.reduce((acc, node) => { - if (node.type === 'text') acc.push(node.value); - if (node.type === 'range') node.type = 'text'; - return acc; -}, []); +convert.rgb.hwb = function (rgb) { + const r = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = 1 / 255 * Math.min(r, Math.min(g, b)); -/** - * Flatten an array - */ + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); -exports.flatten = (...args) => { - const result = []; - const flat = arr => { - for (let i = 0; i < arr.length; i++) { - let ele = arr[i]; - Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele); - } - return result; - }; - flat(args); - return result; + return [h, w * 100, b * 100]; }; +convert.rgb.cmyk = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; -/***/ }), - -/***/ 59832: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var Buffer = __webpack_require__(64293).Buffer; + const k = Math.min(1 - r, 1 - g, 1 - b); + const c = (1 - r - k) / (1 - k) || 0; + const m = (1 - g - k) / (1 - k) || 0; + const y = (1 - b - k) / (1 - k) || 0; -var CRC_TABLE = [ - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, - 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, - 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, - 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, - 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, - 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, - 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, - 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, - 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, - 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, - 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, - 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, - 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, - 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, - 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, - 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, - 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, - 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, - 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, - 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, - 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, - 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, - 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, - 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, - 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, - 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, - 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, - 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, - 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, - 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, - 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, - 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, - 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, - 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, - 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, - 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, - 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, - 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, - 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, - 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, - 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, - 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, - 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, - 0x2d02ef8d -]; + return [c * 100, m * 100, y * 100, k * 100]; +}; -if (typeof Int32Array !== 'undefined') { - CRC_TABLE = new Int32Array(CRC_TABLE); +function comparativeDistance(x, y) { + /* + See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + */ + return ( + ((x[0] - y[0]) ** 2) + + ((x[1] - y[1]) ** 2) + + ((x[2] - y[2]) ** 2) + ); } -function ensureBuffer(input) { - if (Buffer.isBuffer(input)) { - return input; - } +convert.rgb.keyword = function (rgb) { + const reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } - var hasNewBufferAPI = - typeof Buffer.alloc === "function" && - typeof Buffer.from === "function"; + let currentClosestDistance = Infinity; + let currentClosestKeyword; - if (typeof input === "number") { - return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input); - } - else if (typeof input === "string") { - return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input); - } - else { - throw new Error("input must be buffer, number, or string, received " + - typeof input); - } -} + for (const keyword of Object.keys(cssKeywords)) { + const value = cssKeywords[keyword]; -function bufferizeInt(num) { - var tmp = ensureBuffer(4); - tmp.writeInt32BE(num, 0); - return tmp; -} + // Compute comparative distance + const distance = comparativeDistance(rgb, value); -function _crc32(buf, previous) { - buf = ensureBuffer(buf); - if (Buffer.isBuffer(previous)) { - previous = previous.readUInt32BE(0); - } - var crc = ~~previous ^ -1; - for (var n = 0; n < buf.length; n++) { - crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8); - } - return (crc ^ -1); -} + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } -function crc32() { - return bufferizeInt(_crc32.apply(null, arguments)); -} -crc32.signed = function () { - return _crc32.apply(null, arguments); + return currentClosestKeyword; }; -crc32.unsigned = function () { - return _crc32.apply(null, arguments) >>> 0; + +convert.keyword.rgb = function (keyword) { + return cssKeywords[keyword]; }; -module.exports = crc32; +convert.rgb.xyz = function (rgb) { + let r = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; + // Assume sRGB + r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); + g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); + b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); -/***/ }), + const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); -/***/ 24018: -/***/ ((module) => { + return [x * 100, y * 100, z * 100]; +}; -"use strict"; +convert.rgb.lab = function (rgb) { + const xyz = convert.rgb.xyz(rgb); + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; -module.exports = object => { - const result = {}; + x /= 95.047; + y /= 100; + z /= 108.883; - for (const [key, value] of Object.entries(object)) { - result[key.toLowerCase()] = value; - } + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - return result; -}; + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + return [l, a, b]; +}; -/***/ }), +convert.hsl.rgb = function (hsl) { + const h = hsl[0] / 360; + const s = hsl[1] / 100; + const l = hsl[2] / 100; + let t2; + let t3; + let val; -/***/ 78837: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (s === 0) { + val = l * 255; + return [val, val, val]; + } -"use strict"; + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + const t1 = 2 * l - t2; -const EventEmitter = __webpack_require__(28614); -const urlLib = __webpack_require__(78835); -const normalizeUrl = __webpack_require__(68938); -const getStream = __webpack_require__(63886); -const CachePolicy = __webpack_require__(19630); -const Response = __webpack_require__(39014); -const lowercaseKeys = __webpack_require__(24018); -const cloneResponse = __webpack_require__(2116); -const Keyv = __webpack_require__(88735); + const rgb = [0, 0, 0]; + for (let i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } -class CacheableRequest { - constructor(request, cacheAdapter) { - if (typeof request !== 'function') { - throw new TypeError('Parameter `request` must be a function'); + if (t3 > 1) { + t3--; } - this.cache = new Keyv({ - uri: typeof cacheAdapter === 'string' && cacheAdapter, - store: typeof cacheAdapter !== 'string' && cacheAdapter, - namespace: 'cacheable-request' - }); + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } - return this.createCacheableRequest(request); + rgb[i] = val * 255; } - createCacheableRequest(request) { - return (opts, cb) => { - let url; - if (typeof opts === 'string') { - url = normalizeUrlObject(urlLib.parse(opts)); - opts = {}; - } else if (opts instanceof urlLib.URL) { - url = normalizeUrlObject(urlLib.parse(opts.toString())); - opts = {}; - } else { - const [pathname, ...searchParts] = (opts.path || '').split('?'); - const search = searchParts.length > 0 ? - `?${searchParts.join('?')}` : - ''; - url = normalizeUrlObject({ ...opts, pathname, search }); - } + return rgb; +}; - opts = { - headers: {}, - method: 'GET', - cache: true, - strictTtl: false, - automaticFailover: false, - ...opts, - ...urlObjectToRequestOptions(url) - }; - opts.headers = lowercaseKeys(opts.headers); +convert.hsl.hsv = function (hsl) { + const h = hsl[0]; + let s = hsl[1] / 100; + let l = hsl[2] / 100; + let smin = s; + const lmin = Math.max(l, 0.01); - const ee = new EventEmitter(); - const normalizedUrlString = normalizeUrl( - urlLib.format(url), - { - stripWWW: false, - removeTrailingSlash: false, - stripAuthentication: false - } - ); - const key = `${opts.method}:${normalizedUrlString}`; - let revalidate = false; - let madeRequest = false; + l *= 2; + s *= (l <= 1) ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + const v = (l + s) / 2; + const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); - const makeRequest = opts => { - madeRequest = true; - let requestErrored = false; - let requestErrorCallback; + return [h, sv * 100, v * 100]; +}; - const requestErrorPromise = new Promise(resolve => { - requestErrorCallback = () => { - if (!requestErrored) { - requestErrored = true; - resolve(); - } - }; - }); +convert.hsv.rgb = function (hsv) { + const h = hsv[0] / 60; + const s = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; - const handler = response => { - if (revalidate && !opts.forceRefresh) { - response.status = response.statusCode; - const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); - if (!revalidatedPolicy.modified) { - const headers = revalidatedPolicy.policy.responseHeaders(); - response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); - response.cachePolicy = revalidatedPolicy.policy; - response.fromCache = true; - } - } + const f = h - Math.floor(h); + const p = 255 * v * (1 - s); + const q = 255 * v * (1 - (s * f)); + const t = 255 * v * (1 - (s * (1 - f))); + v *= 255; - if (!response.fromCache) { - response.cachePolicy = new CachePolicy(opts, response, opts); - response.fromCache = false; - } + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } +}; - let clonedResponse; - if (opts.cache && response.cachePolicy.storable()) { - clonedResponse = cloneResponse(response); +convert.hsv.hsl = function (hsv) { + const h = hsv[0]; + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l; - (async () => { - try { - const bodyPromise = getStream.buffer(response); + l = (2 - s) * v; + const lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= (lmin <= 1) ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; - await Promise.race([ - requestErrorPromise, - new Promise(resolve => response.once('end', resolve)) - ]); + return [h, sl * 100, l * 100]; +}; - if (requestErrored) { - return; - } +// http://dev.w3.org/csswg/css-color/#hwb-to-rgb +convert.hwb.rgb = function (hwb) { + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f; - const body = await bodyPromise; - - const value = { - cachePolicy: response.cachePolicy.toObject(), - url: response.url, - statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, - body - }; + // Wh + bl cant be > 1 + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } - let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; - if (opts.maxTtl) { - ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; - } + const i = Math.floor(6 * h); + const v = 1 - bl; + f = 6 * h - i; - await this.cache.set(key, value, ttl); - } catch (error) { - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - } else if (opts.cache && revalidate) { - (async () => { - try { - await this.cache.delete(key); - } catch (error) { - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - } + if ((i & 0x01) !== 0) { + f = 1 - f; + } - ee.emit('response', clonedResponse || response); - if (typeof cb === 'function') { - cb(clonedResponse || response); - } - }; + const n = wh + f * (v - wh); // Linear interpolation - try { - const req = request(opts, handler); - req.once('error', requestErrorCallback); - req.once('abort', requestErrorCallback); - ee.emit('request', req); - } catch (error) { - ee.emit('error', new CacheableRequest.RequestError(error)); - } - }; + let r; + let g; + let b; + /* eslint-disable max-statements-per-line,no-multi-spaces */ + switch (i) { + default: + case 6: + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; + } + /* eslint-enable max-statements-per-line,no-multi-spaces */ - (async () => { - const get = async opts => { - await Promise.resolve(); + return [r * 255, g * 255, b * 255]; +}; - const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; - if (typeof cacheEntry === 'undefined') { - return makeRequest(opts); - } +convert.cmyk.rgb = function (cmyk) { + const c = cmyk[0] / 100; + const m = cmyk[1] / 100; + const y = cmyk[2] / 100; + const k = cmyk[3] / 100; - const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); - if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { - const headers = policy.responseHeaders(); - const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); - response.cachePolicy = policy; - response.fromCache = true; + const r = 1 - Math.min(1, c * (1 - k) + k); + const g = 1 - Math.min(1, m * (1 - k) + k); + const b = 1 - Math.min(1, y * (1 - k) + k); - ee.emit('response', response); - if (typeof cb === 'function') { - cb(response); - } - } else { - revalidate = cacheEntry; - opts.headers = policy.revalidationHeaders(opts); - makeRequest(opts); - } - }; + return [r * 255, g * 255, b * 255]; +}; - const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); - this.cache.once('error', errorHandler); - ee.on('response', () => this.cache.removeListener('error', errorHandler)); +convert.xyz.rgb = function (xyz) { + const x = xyz[0] / 100; + const y = xyz[1] / 100; + const z = xyz[2] / 100; + let r; + let g; + let b; - try { - await get(opts); - } catch (error) { - if (opts.automaticFailover && !madeRequest) { - makeRequest(opts); - } + r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); + g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); + b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); + // Assume sRGB + r = r > 0.0031308 + ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) + : r * 12.92; - return ee; - }; - } -} + g = g > 0.0031308 + ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) + : g * 12.92; -function urlObjectToRequestOptions(url) { - const options = { ...url }; - options.path = `${url.pathname || '/'}${url.search || ''}`; - delete options.pathname; - delete options.search; - return options; -} + b = b > 0.0031308 + ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) + : b * 12.92; -function normalizeUrlObject(url) { - // If url was parsed by url.parse or new URL: - // - hostname will be set - // - host will be hostname[:port] - // - port will be set if it was explicit in the parsed string - // Otherwise, url was from request options: - // - hostname or host may be set - // - host shall not have port encoded - return { - protocol: url.protocol, - auth: url.auth, - hostname: url.hostname || url.host || 'localhost', - port: url.port, - pathname: url.pathname, - search: url.search - }; -} + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); -CacheableRequest.RequestError = class extends Error { - constructor(error) { - super(error.message); - this.name = 'RequestError'; - Object.assign(this, error); - } + return [r * 255, g * 255, b * 255]; }; -CacheableRequest.CacheError = class extends Error { - constructor(error) { - super(error.message); - this.name = 'CacheError'; - Object.assign(this, error); - } -}; +convert.xyz.lab = function (xyz) { + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; -module.exports = CacheableRequest; + x /= 95.047; + y /= 100; + z /= 108.883; + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); -/***/ }), + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); -/***/ 7833: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + return [l, a, b]; +}; -"use strict"; +convert.lab.xyz = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let x; + let y; + let z; -const ansiStyles = __webpack_require__(58588); -const {stdout: stdoutColor, stderr: stderrColor} = __webpack_require__(28106); -const { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -} = __webpack_require__(15254); + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; -const {isArray} = Array; + const y2 = y ** 3; + const x2 = x ** 3; + const z2 = z ** 3; + y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = [ - 'ansi', - 'ansi', - 'ansi256', - 'ansi16m' -]; + x *= 95.047; + y *= 100; + z *= 108.883; -const styles = Object.create(null); + return [x, y, z]; +}; -const applyOptions = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error('The `level` option should be an integer from 0 to 3'); - } +convert.lab.lch = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let h; - // Detect level if not set manually - const colorLevel = stdoutColor ? stdoutColor.level : 0; - object.level = options.level === undefined ? colorLevel : options.level; -}; + const hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; -class ChalkClass { - constructor(options) { - // eslint-disable-next-line no-constructor-return - return chalkFactory(options); + if (h < 0) { + h += 360; } -} - -const chalkFactory = options => { - const chalk = {}; - applyOptions(chalk, options); - chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); + const c = Math.sqrt(a * a + b * b); - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); + return [l, c, h]; +}; - chalk.template.constructor = () => { - throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); - }; +convert.lch.lab = function (lch) { + const l = lch[0]; + const c = lch[1]; + const h = lch[2]; - chalk.template.Instance = ChalkClass; + const hr = h / 360 * 2 * Math.PI; + const a = c * Math.cos(hr); + const b = c * Math.sin(hr); - return chalk.template; + return [l, a, b]; }; -function Chalk(options) { - return chalkFactory(options); -} +convert.rgb.ansi16 = function (args, saturation = null) { + const [r, g, b] = args; + let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization -for (const [styleName, style] of Object.entries(ansiStyles)) { - styles[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); - Object.defineProperty(this, styleName, {value: builder}); - return builder; - } - }; -} + value = Math.round(value / 50); -styles.visible = { - get() { - const builder = createBuilder(this, this._styler, true); - Object.defineProperty(this, 'visible', {value: builder}); - return builder; + if (value === 0) { + return 30; + } + + let ansi = 30 + + ((Math.round(b / 255) << 2) + | (Math.round(g / 255) << 1) + | Math.round(r / 255)); + + if (value === 2) { + ansi += 60; } + + return ansi; }; -const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; +convert.hsv.ansi16 = function (args) { + // Optimization here; we already know the value and don't need to get + // it converted for us. + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); +}; -for (const model of usedModels) { - styles[model] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; -} +convert.rgb.ansi256 = function (args) { + const r = args[0]; + const g = args[1]; + const b = args[2]; -for (const model of usedModels) { - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (r === g && g === b) { + if (r < 8) { + return 16; } - }; -} -const proto = Object.defineProperties(() => {}, { - ...styles, - level: { - enumerable: true, - get() { - return this._generator.level; - }, - set(level) { - this._generator.level = level; + if (r > 248) { + return 231; } - } -}); -const createStyler = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === undefined) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; + return Math.round(((r - 8) / 247) * 24) + 232; } - return { - open, - close, - openAll, - closeAll, - parent - }; + const ansi = 16 + + (36 * Math.round(r / 255 * 5)) + + (6 * Math.round(g / 255 * 5)) + + Math.round(b / 255 * 5); + + return ansi; }; -const createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => { - if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { - // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}` - return applyStyle(builder, chalkTag(builder, ...arguments_)); +convert.ansi16.rgb = function (args) { + let color = args % 10; + + // Handle greyscale + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; } - // Single argument is hot path, implicit coercion is faster than anything - // eslint-disable-next-line no-implicit-coercion - return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); - }; + color = color / 10.5 * 255; - // We alter the prototype because we must return a function, but there is - // no way to create a function with a different prototype - Object.setPrototypeOf(builder, proto); + return [color, color, color]; + } - builder._generator = self; - builder._styler = _styler; - builder._isEmpty = _isEmpty; + const mult = (~~(args > 50) + 1) * 0.5; + const r = ((color & 1) * mult) * 255; + const g = (((color >> 1) & 1) * mult) * 255; + const b = (((color >> 2) & 1) * mult) * 255; - return builder; + return [r, g, b]; }; -const applyStyle = (self, string) => { - if (self.level <= 0 || !string) { - return self._isEmpty ? '' : string; +convert.ansi256.rgb = function (args) { + // Handle greyscale + if (args >= 232) { + const c = (args - 232) * 10 + 8; + return [c, c, c]; } - let styler = self._styler; - - if (styler === undefined) { - return string; - } + args -= 16; - const {openAll, closeAll} = styler; - if (string.indexOf('\u001B') !== -1) { - while (styler !== undefined) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - string = stringReplaceAll(string, styler.close, styler.open); + let rem; + const r = Math.floor(args / 36) / 5 * 255; + const g = Math.floor((rem = args % 36) / 6) / 5 * 255; + const b = (rem % 6) / 5 * 255; - styler = styler.parent; - } - } + return [r, g, b]; +}; - // We can move both next actions out of loop, because remaining actions in loop won't have - // any/visible effect on parts we add here. Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 - const lfIndex = string.indexOf('\n'); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); - } +convert.rgb.hex = function (args) { + const integer = ((Math.round(args[0]) & 0xFF) << 16) + + ((Math.round(args[1]) & 0xFF) << 8) + + (Math.round(args[2]) & 0xFF); - return openAll + string + closeAll; + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; }; -let template; -const chalkTag = (chalk, ...strings) => { - const [firstString] = strings; - - if (!isArray(firstString) || !isArray(firstString.raw)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return strings.join(' '); +convert.hex.rgb = function (args) { + const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; } - const arguments_ = strings.slice(1); - const parts = [firstString.raw[0]]; + let colorString = match[0]; - for (let i = 1; i < firstString.length; i++) { - parts.push( - String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), - String(firstString.raw[i]) - ); + if (match[0].length === 3) { + colorString = colorString.split('').map(char => { + return char + char; + }).join(''); } - if (template === undefined) { - template = __webpack_require__(77183); - } + const integer = parseInt(colorString, 16); + const r = (integer >> 16) & 0xFF; + const g = (integer >> 8) & 0xFF; + const b = integer & 0xFF; - return template(chalk, parts.join('')); + return [r, g, b]; }; -Object.defineProperties(Chalk.prototype, styles); - -const chalk = Chalk(); // eslint-disable-line new-cap -chalk.supportsColor = stdoutColor; -chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap -chalk.stderr.supportsColor = stderrColor; - -module.exports = chalk; +convert.rgb.hcg = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(Math.max(r, g), b); + const min = Math.min(Math.min(r, g), b); + const chroma = (max - min); + let grayscale; + let hue; + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } -/***/ }), - -/***/ 77183: -/***/ ((module) => { + if (chroma <= 0) { + hue = 0; + } else + if (max === r) { + hue = ((g - b) / chroma) % 6; + } else + if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma; + } -"use strict"; + hue /= 6; + hue %= 1; -const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; -const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; -const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; -const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; + return [hue * 360, chroma * 100, grayscale * 100]; +}; -const ESCAPES = new Map([ - ['n', '\n'], - ['r', '\r'], - ['t', '\t'], - ['b', '\b'], - ['f', '\f'], - ['v', '\v'], - ['0', '\0'], - ['\\', '\\'], - ['e', '\u001B'], - ['a', '\u0007'] -]); +convert.hsl.hcg = function (hsl) { + const s = hsl[1] / 100; + const l = hsl[2] / 100; -function unescape(c) { - const u = c[0] === 'u'; - const bracket = c[1] === '{'; + const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); - if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { - return String.fromCharCode(parseInt(c.slice(1), 16)); + let f = 0; + if (c < 1.0) { + f = (l - 0.5 * c) / (1.0 - c); } - if (u && bracket) { - return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); - } + return [hsl[0], c * 100, f * 100]; +}; - return ESCAPES.get(c) || c; -} +convert.hsv.hcg = function (hsv) { + const s = hsv[1] / 100; + const v = hsv[2] / 100; -function parseArguments(name, arguments_) { - const results = []; - const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches; + const c = s * v; + let f = 0; - for (const chunk of chunks) { - const number = Number(chunk); - if (!Number.isNaN(number)) { - results.push(number); - } else if ((matches = chunk.match(STRING_REGEX))) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } + if (c < 1.0) { + f = (v - c) / (1 - c); } - return results; -} + return [hsv[0], c * 100, f * 100]; +}; -function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; +convert.hcg.rgb = function (hcg) { + const h = hcg[0] / 360; + const c = hcg[1] / 100; + const g = hcg[2] / 100; - const results = []; - let matches; + if (c === 0.0) { + return [g * 255, g * 255, g * 255]; + } - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; + const pure = [0, 0, 0]; + const hi = (h % 1) * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } + /* eslint-disable max-statements-per-line */ + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; pure[1] = v; pure[2] = 0; break; + case 1: + pure[0] = w; pure[1] = 1; pure[2] = 0; break; + case 2: + pure[0] = 0; pure[1] = 1; pure[2] = v; break; + case 3: + pure[0] = 0; pure[1] = w; pure[2] = 1; break; + case 4: + pure[0] = v; pure[1] = 0; pure[2] = 1; break; + default: + pure[0] = 1; pure[1] = 0; pure[2] = w; } + /* eslint-enable max-statements-per-line */ - return results; -} - -function buildStyle(chalk, styles) { - const enabled = {}; + mg = (1.0 - c) * g; - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; +}; - let current = chalk; - for (const [styleName, styles] of Object.entries(enabled)) { - if (!Array.isArray(styles)) { - continue; - } +convert.hcg.hsv = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } + const v = c + g * (1.0 - c); + let f = 0; - current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; + if (v > 0.0) { + f = c / v; } - return current; -} + return [hcg[0], f * 100, v * 100]; +}; -module.exports = (chalk, temporary) => { - const styles = []; - const chunks = []; - let chunk = []; +convert.hcg.hsl = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; - // eslint-disable-next-line max-params - temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { - if (escapeCharacter) { - chunk.push(unescape(escapeCharacter)); - } else if (style) { - const string = chunk.join(''); - chunk = []; - chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); - styles.push({inverse, styles: parseStyle(style)}); - } else if (close) { - if (styles.length === 0) { - throw new Error('Found extraneous } in Chalk template literal'); - } + const l = g * (1.0 - c) + 0.5 * c; + let s = 0; - chunks.push(buildStyle(chalk, styles)(chunk.join(''))); - chunk = []; - styles.pop(); - } else { - chunk.push(character); - } - }); + if (l > 0.0 && l < 0.5) { + s = c / (2 * l); + } else + if (l >= 0.5 && l < 1.0) { + s = c / (2 * (1 - l)); + } - chunks.push(chunk.join('')); + return [hcg[0], s * 100, l * 100]; +}; - if (styles.length > 0) { - const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; - throw new Error(errMessage); +convert.hcg.hwb = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1.0 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; +}; + +convert.hwb.hcg = function (hwb) { + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c = v - w; + let g = 0; + + if (c < 1) { + g = (v - c) / (1 - c); } - return chunks.join(''); + return [hwb[0], c * 100, g * 100]; }; +convert.apple.rgb = function (apple) { + return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; +}; -/***/ }), +convert.rgb.apple = function (rgb) { + return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; +}; -/***/ 15254: -/***/ ((module) => { +convert.gray.rgb = function (args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; +}; -"use strict"; +convert.gray.hsl = function (args) { + return [0, 0, args[0]]; +}; +convert.gray.hsv = convert.gray.hsl; -const stringReplaceAll = (string, substring, replacer) => { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } +convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; +}; - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ''; - do { - returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); +convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; +}; - returnValue += string.substr(endIndex); - return returnValue; +convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; }; -const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { - let endIndex = 0; - let returnValue = ''; - do { - const gotCR = string[index - 1] === '\r'; - returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; - endIndex = index + 1; - index = string.indexOf('\n', endIndex); - } while (index !== -1); +convert.gray.hex = function (gray) { + const val = Math.round(gray[0] / 100 * 255) & 0xFF; + const integer = (val << 16) + (val << 8) + val; - returnValue += string.substr(endIndex); - return returnValue; + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; }; -module.exports = { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex +convert.rgb.gray = function (rgb) { + const val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; }; /***/ }), -/***/ 63488: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 73991: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const conversions = __nccwpck_require__(92724); +const route = __nccwpck_require__(40577); +const convert = {}; -const spinners = Object.assign({}, __webpack_require__(20390)); +const models = Object.keys(conversions); -const spinnersList = Object.keys(spinners); +function wrapRaw(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; + if (arg0 === undefined || arg0 === null) { + return arg0; + } -Object.defineProperty(spinners, 'random', { - get() { - const randomIndex = Math.floor(Math.random() * spinnersList.length); - const spinnerName = spinnersList[randomIndex]; - return spinners[spinnerName]; + if (arg0.length > 1) { + args = arg0; + } + + return fn(args); + }; + + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; } -}); -module.exports = spinners; -// TODO: Remove this for the next major release -module.exports.default = spinners; + return wrappedFn; +} +function wrapRounded(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; -/***/ }), + if (arg0 === undefined || arg0 === null) { + return arg0; + } -/***/ 2116: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (arg0.length > 1) { + args = arg0; + } -"use strict"; + const result = fn(args); + // We're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (let len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } -const PassThrough = __webpack_require__(92413).PassThrough; -const mimicResponse = __webpack_require__(27480); + return result; + }; -const cloneResponse = response => { - if (!(response && response.pipe)) { - throw new TypeError('Parameter `response` must be a response stream.'); + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; } - const clone = new PassThrough(); - mimicResponse(response, clone); + return wrappedFn; +} - return response.pipe(clone); -}; +models.forEach(fromModel => { + convert[fromModel] = {}; -module.exports = cloneResponse; + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); + const routes = route(fromModel); + const routeModels = Object.keys(routes); -/***/ }), + routeModels.forEach(toModel => { + const fn = routes[toModel]; -/***/ 13405: -/***/ ((module) => { + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); +}); -var clone = (function() { -'use strict'; +module.exports = convert; -/** - * Clones (copies) an Object using deep copying. - * - * This function supports circular references by default, but if you are certain - * there are no circular references in your object, you can save some CPU time - * by calling clone(obj, false). - * - * Caution: if `circular` is false and `parent` contains circular references, - * your program may enter an infinite loop and crash. - * - * @param `parent` - the object to be cloned - * @param `circular` - set to true if the object to be cloned may contain - * circular references. (optional - true by default) - * @param `depth` - set to a number if the object is only to be cloned to - * a particular depth. (optional - defaults to Infinity) - * @param `prototype` - sets the prototype to be used when cloning an object. - * (optional - defaults to parent prototype). -*/ -function clone(parent, circular, depth, prototype) { - var filter; - if (typeof circular === 'object') { - depth = circular.depth; - prototype = circular.prototype; - filter = circular.filter; - circular = circular.circular - } - // maintain two arrays for circular references, where corresponding parents - // and children have the same index - var allParents = []; - var allChildren = []; - var useBuffer = typeof Buffer != 'undefined'; +/***/ }), - if (typeof circular == 'undefined') - circular = true; +/***/ 40577: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (typeof depth == 'undefined') - depth = Infinity; +const conversions = __nccwpck_require__(92724); - // recurse this function so we don't reset allParents and allChildren - function _clone(parent, depth) { - // cloning null always returns null - if (parent === null) - return null; +/* + This function routes a model to all other models. - if (depth == 0) - return parent; + all functions that are routed have a property `.conversion` attached + to the returned synthetic function. This property is an array + of strings, each with the steps in between the 'from' and 'to' + color models (inclusive). - var child; - var proto; - if (typeof parent != 'object') { - return parent; - } + conversions that are not possible simply are not included. +*/ - if (clone.__isArray(parent)) { - child = []; - } else if (clone.__isRegExp(parent)) { - child = new RegExp(parent.source, __getRegExpFlags(parent)); - if (parent.lastIndex) child.lastIndex = parent.lastIndex; - } else if (clone.__isDate(parent)) { - child = new Date(parent.getTime()); - } else if (useBuffer && Buffer.isBuffer(parent)) { - if (Buffer.allocUnsafe) { - // Node.js >= 4.5.0 - child = Buffer.allocUnsafe(parent.length); - } else { - // Older Node.js versions - child = new Buffer(parent.length); - } - parent.copy(child); - return child; - } else { - if (typeof prototype == 'undefined') { - proto = Object.getPrototypeOf(parent); - child = Object.create(proto); - } - else { - child = Object.create(prototype); - proto = prototype; - } - } +function buildGraph() { + const graph = {}; + // https://jsperf.com/object-keys-vs-for-in-with-closure/3 + const models = Object.keys(conversions); - if (circular) { - var index = allParents.indexOf(parent); + for (let len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } - if (index != -1) { - return allChildren[index]; - } - allParents.push(parent); - allChildren.push(child); - } + return graph; +} - for (var i in parent) { - var attrs; - if (proto) { - attrs = Object.getOwnPropertyDescriptor(proto, i); - } +// https://en.wikipedia.org/wiki/Breadth-first_search +function deriveBFS(fromModel) { + const graph = buildGraph(); + const queue = [fromModel]; // Unshift -> queue -> pop - if (attrs && attrs.set == null) { - continue; - } - child[i] = _clone(parent[i], depth - 1); - } + graph[fromModel].distance = 0; - return child; - } + while (queue.length) { + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); - return _clone(parent, depth); -} + for (let len = adjacents.length, i = 0; i < len; i++) { + const adjacent = adjacents[i]; + const node = graph[adjacent]; -/** - * Simple flat clone using prototype, accepts only objects, usefull for property - * override on FLAT configuration object (no nested props). - * - * USE WITH CAUTION! This may not behave as you wish if you do not know how this - * works. - */ -clone.clonePrototype = function clonePrototype(parent) { - if (parent === null) - return null; + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } - var c = function () {}; - c.prototype = parent; - return new c(); -}; - -// private utility functions - -function __objToStr(o) { - return Object.prototype.toString.call(o); -}; -clone.__objToStr = __objToStr; - -function __isDate(o) { - return typeof o === 'object' && __objToStr(o) === '[object Date]'; -}; -clone.__isDate = __isDate; - -function __isArray(o) { - return typeof o === 'object' && __objToStr(o) === '[object Array]'; -}; -clone.__isArray = __isArray; - -function __isRegExp(o) { - return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; -}; -clone.__isRegExp = __isRegExp; - -function __getRegExpFlags(re) { - var flags = ''; - if (re.global) flags += 'g'; - if (re.ignoreCase) flags += 'i'; - if (re.multiline) flags += 'm'; - return flags; -}; -clone.__getRegExpFlags = __getRegExpFlags; - -return clone; -})(); - -if ( true && module.exports) { - module.exports = clone; + return graph; } - -/***/ }), - -/***/ 92724: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/* MIT license */ -/* eslint-disable no-mixed-operators */ -const cssKeywords = __webpack_require__(78679); - -// NOTE: conversions should only return primitive values (i.e. arrays, or -// values that give correct `typeof` results). -// do not use box values types (i.e. Number(), String(), etc.) - -const reverseKeywords = {}; -for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; +function link(from, to) { + return function (args) { + return to(from(args)); + }; } -const convert = { - rgb: {channels: 3, labels: 'rgb'}, - hsl: {channels: 3, labels: 'hsl'}, - hsv: {channels: 3, labels: 'hsv'}, - hwb: {channels: 3, labels: 'hwb'}, - cmyk: {channels: 4, labels: 'cmyk'}, - xyz: {channels: 3, labels: 'xyz'}, - lab: {channels: 3, labels: 'lab'}, - lch: {channels: 3, labels: 'lch'}, - hex: {channels: 1, labels: ['hex']}, - keyword: {channels: 1, labels: ['keyword']}, - ansi16: {channels: 1, labels: ['ansi16']}, - ansi256: {channels: 1, labels: ['ansi256']}, - hcg: {channels: 3, labels: ['h', 'c', 'g']}, - apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, - gray: {channels: 1, labels: ['gray']} -}; - -module.exports = convert; - -// Hide .channels and .labels properties -for (const model of Object.keys(convert)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } - - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } +function wrapConversion(toModel, graph) { + const path = [graph[toModel].parent, toModel]; + let fn = conversions[graph[toModel].parent][toModel]; - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); + let cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; } - const {channels, labels} = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); + fn.conversion = path; + return fn; } -convert.rgb.hsl = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; - - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; - } - - h = Math.min(h * 60, 360); +module.exports = function (fromModel) { + const graph = deriveBFS(fromModel); + const conversion = {}; - if (h < 0) { - h += 360; - } + const models = Object.keys(graph); + for (let len = models.length, i = 0; i < len; i++) { + const toModel = models[i]; + const node = graph[toModel]; - const l = (min + max) / 2; + if (node.parent === null) { + // No possible conversion, or this node is the source model. + continue; + } - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); + conversion[toModel] = wrapConversion(toModel, graph); } - return [h, s * 100, l * 100]; + return conversion; }; -convert.rgb.hsv = function (rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function (c) { - return (v - c) / 6 / diff + 1 / 2; - }; - if (diff === 0) { - h = 0; - s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); +/***/ }), - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = (1 / 3) + rdif - bdif; - } else if (b === v) { - h = (2 / 3) + gdif - rdif; - } +/***/ 78679: +/***/ ((module) => { - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } - } +"use strict"; - return [ - h * 360, - s * 100, - v * 100 - ]; + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] }; -convert.rgb.hwb = function (rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); +/***/ }), - return [h, w * 100, b * 100]; -}; +/***/ 18271: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -convert.rgb.cmyk = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; +var ProtoList = __nccwpck_require__(98051) + , path = __nccwpck_require__(85622) + , fs = __nccwpck_require__(35747) + , ini = __nccwpck_require__(27452) + , EE = __nccwpck_require__(28614).EventEmitter + , url = __nccwpck_require__(78835) + , http = __nccwpck_require__(98605) - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; +var exports = module.exports = function () { + var args = [].slice.call(arguments) + , conf = new ConfigChain() - return [c * 100, m * 100, y * 100, k * 100]; -}; + while(args.length) { + var a = args.shift() + if(a) conf.push + ( 'string' === typeof a + ? json(a) + : a ) + } -function comparativeDistance(x, y) { - /* - See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - */ - return ( - ((x[0] - y[0]) ** 2) + - ((x[1] - y[1]) ** 2) + - ((x[2] - y[2]) ** 2) - ); + return conf } -convert.rgb.keyword = function (rgb) { - const reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; - } +//recursively find a file... - let currentClosestDistance = Infinity; - let currentClosestKeyword; +var find = exports.find = function () { + var rel = path.join.apply(null, [].slice.call(arguments)) - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; + function find(start, rel) { + var file = path.join(start, rel) + try { + fs.statSync(file) + return file + } catch (err) { + if(path.dirname(start) !== start) // root + return find(path.dirname(start), rel) + } + } + return find(__dirname, rel) +} - // Compute comparative distance - const distance = comparativeDistance(rgb, value); +var parse = exports.parse = function (content, file, type) { + content = '' + content + // if we don't know what it is, try json and fall back to ini + // if we know what it is, then it must be that. + if (!type) { + try { return JSON.parse(content) } + catch (er) { return ini.parse(content) } + } else if (type === 'json') { + if (this.emit) { + try { return JSON.parse(content) } + catch (er) { this.emit('error', er) } + } else { + return JSON.parse(content) + } + } else { + return ini.parse(content) + } +} - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } - } +var json = exports.json = function () { + var args = [].slice.call(arguments).filter(function (arg) { return arg != null }) + var file = path.join.apply(null, args) + var content + try { + content = fs.readFileSync(file,'utf-8') + } catch (err) { + return + } + return parse(content, file, 'json') +} - return currentClosestKeyword; -}; +var env = exports.env = function (prefix, env) { + env = env || process.env + var obj = {} + var l = prefix.length + for(var k in env) { + if(k.indexOf(prefix) === 0) + obj[k.substring(l)] = env[k] + } -convert.keyword.rgb = function (keyword) { - return cssKeywords[keyword]; -}; + return obj +} -convert.rgb.xyz = function (rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; +exports.ConfigChain = ConfigChain +function ConfigChain () { + EE.apply(this) + ProtoList.apply(this, arguments) + this._awaiting = 0 + this._saving = 0 + this.sources = {} +} - // Assume sRGB - r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); - g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); - b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); +// multi-inheritance-ish +var extras = { + constructor: { value: ConfigChain } +} +Object.keys(EE.prototype).forEach(function (k) { + extras[k] = Object.getOwnPropertyDescriptor(EE.prototype, k) +}) +ConfigChain.prototype = Object.create(ProtoList.prototype, extras) - const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); +ConfigChain.prototype.del = function (key, where) { + // if not specified where, then delete from the whole chain, scorched + // earth style + if (where) { + var target = this.sources[where] + target = target && target.data + if (!target) { + return this.emit('error', new Error('not found '+where)) + } + delete target[key] + } else { + for (var i = 0, l = this.list.length; i < l; i ++) { + delete this.list[i][key] + } + } + return this +} - return [x * 100, y * 100, z * 100]; -}; +ConfigChain.prototype.set = function (key, value, where) { + var target -convert.rgb.lab = function (rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; + if (where) { + target = this.sources[where] + target = target && target.data + if (!target) { + return this.emit('error', new Error('not found '+where)) + } + } else { + target = this.list[0] + if (!target) { + return this.emit('error', new Error('cannot set, no confs!')) + } + } + target[key] = value + return this +} - x /= 95.047; - y /= 100; - z /= 108.883; +ConfigChain.prototype.get = function (key, where) { + if (where) { + where = this.sources[where] + if (where) where = where.data + if (where && Object.hasOwnProperty.call(where, key)) return where[key] + return undefined + } + return this.list[0][key] +} - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); +ConfigChain.prototype.save = function (where, type, cb) { + if (typeof type === 'function') cb = type, type = null + var target = this.sources[where] + if (!target || !(target.path || target.source) || !target.data) { + // TODO: maybe save() to a url target could be a PUT or something? + // would be easy to swap out with a reddis type thing, too + return this.emit('error', new Error('bad save target: '+where)) + } - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); + if (target.source) { + var pref = target.prefix || '' + Object.keys(target.data).forEach(function (k) { + target.source[pref + k] = target.data[k] + }) + return this + } - return [l, a, b]; -}; + var type = type || target.type + var data = target.data + if (target.type === 'json') { + data = JSON.stringify(data) + } else { + data = ini.stringify(data) + } -convert.hsl.rgb = function (hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; + this._saving ++ + fs.writeFile(target.path, data, 'utf8', function (er) { + this._saving -- + if (er) { + if (cb) return cb(er) + else return this.emit('error', er) + } + if (this._saving === 0) { + if (cb) cb() + this.emit('save') + } + }.bind(this)) + return this +} - if (s === 0) { - val = l * 255; - return [val, val, val]; - } +ConfigChain.prototype.addFile = function (file, type, name) { + name = name || file + var marker = {__source__:name} + this.sources[name] = { path: file, type: type } + this.push(marker) + this._await() + fs.readFile(file, 'utf8', function (er, data) { + if (er) this.emit('error', er) + this.addString(data, file, type, marker) + }.bind(this)) + return this +} - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } +ConfigChain.prototype.addEnv = function (prefix, env, name) { + name = name || 'env' + var data = exports.env(prefix, env) + this.sources[name] = { data: data, source: env, prefix: prefix } + return this.add(data, name) +} - const t1 = 2 * l - t2; +ConfigChain.prototype.addUrl = function (req, type, name) { + this._await() + var href = url.format(req) + name = name || href + var marker = {__source__:name} + this.sources[name] = { href: href, type: type } + this.push(marker) + http.request(req, function (res) { + var c = [] + var ct = res.headers['content-type'] + if (!type) { + type = ct.indexOf('json') !== -1 ? 'json' + : ct.indexOf('ini') !== -1 ? 'ini' + : href.match(/\.json$/) ? 'json' + : href.match(/\.ini$/) ? 'ini' + : null + marker.type = type + } - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } + res.on('data', c.push.bind(c)) + .on('end', function () { + this.addString(Buffer.concat(c), href, type, marker) + }.bind(this)) + .on('error', this.emit.bind(this, 'error')) - if (t3 > 1) { - t3--; - } + }.bind(this)) + .on('error', this.emit.bind(this, 'error')) + .end() - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; - } + return this +} - rgb[i] = val * 255; - } +ConfigChain.prototype.addString = function (data, file, type, marker) { + data = this.parse(data, file, type) + this.add(data, marker) + return this +} - return rgb; -}; +ConfigChain.prototype.add = function (data, marker) { + if (marker && typeof marker === 'object') { + var i = this.list.indexOf(marker) + if (i === -1) { + return this.emit('error', new Error('bad marker')) + } + this.splice(i, 1, data) + marker = marker.__source__ + this.sources[marker] = this.sources[marker] || {} + this.sources[marker].data = data + // we were waiting for this. maybe emit 'load' + this._resolve() + } else { + if (typeof marker === 'string') { + this.sources[marker] = this.sources[marker] || {} + this.sources[marker].data = data + } + // trigger the load event if nothing was already going to do so. + this._await() + this.push(data) + process.nextTick(this._resolve.bind(this)) + } + return this +} -convert.hsl.hsv = function (hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); +ConfigChain.prototype.parse = exports.parse - l *= 2; - s *= (l <= 1) ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); +ConfigChain.prototype._await = function () { + this._awaiting++ +} - return [h, sv * 100, v * 100]; -}; +ConfigChain.prototype._resolve = function () { + this._awaiting-- + if (this._awaiting === 0) this.emit('load', this) +} -convert.hsv.rgb = function (hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - (s * f)); - const t = 255 * v * (1 - (s * (1 - f))); - v *= 255; +/***/ }), - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } -}; +/***/ 23875: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -convert.hsv.hsl = function (hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; +"use strict"; - l = (2 - s) * v; - const lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= (lmin <= 1) ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; - return [h, sl * 100, l * 100]; -}; +const cp = __nccwpck_require__(63129); +const parse = __nccwpck_require__(4915); +const enoent = __nccwpck_require__(39985); -// http://dev.w3.org/csswg/css-color/#hwb-to-rgb -convert.hwb.rgb = function (hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; +function spawn(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); - // Wh + bl cant be > 1 - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } + // Spawn the child process + const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); - const i = Math.floor(6 * h); - const v = 1 - bl; - f = 6 * h - i; + // Hook into child process "exit" event to emit an error if the command + // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + enoent.hookChildProcess(spawned, parsed); - if ((i & 0x01) !== 0) { - f = 1 - f; - } + return spawned; +} - const n = wh + f * (v - wh); // Linear interpolation +function spawnSync(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); - let r; - let g; - let b; - /* eslint-disable max-statements-per-line,no-multi-spaces */ - switch (i) { - default: - case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; - } - /* eslint-enable max-statements-per-line,no-multi-spaces */ + // Spawn the child process + const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); - return [r * 255, g * 255, b * 255]; -}; + // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); -convert.cmyk.rgb = function (cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; + return result; +} - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); +module.exports = spawn; +module.exports.spawn = spawn; +module.exports.sync = spawnSync; - return [r * 255, g * 255, b * 255]; -}; +module.exports._parse = parse; +module.exports._enoent = enoent; -convert.xyz.rgb = function (xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; - r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); - g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); - b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); +/***/ }), - // Assume sRGB - r = r > 0.0031308 - ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) - : r * 12.92; +/***/ 39985: +/***/ ((module) => { - g = g > 0.0031308 - ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) - : g * 12.92; +"use strict"; - b = b > 0.0031308 - ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) - : b * 12.92; - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); +const isWin = process.platform === 'win32'; - return [r * 255, g * 255, b * 255]; -}; +function notFoundError(original, syscall) { + return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { + code: 'ENOENT', + errno: 'ENOENT', + syscall: `${syscall} ${original.command}`, + path: original.command, + spawnargs: original.args, + }); +} -convert.xyz.lab = function (xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; +function hookChildProcess(cp, parsed) { + if (!isWin) { + return; + } - x /= 95.047; - y /= 100; - z /= 108.883; + const originalEmit = cp.emit; - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + cp.emit = function (name, arg1) { + // If emitting "exit" event and exit code is 1, we need to check if + // the command exists and emit an "error" instead + // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 + if (name === 'exit') { + const err = verifyENOENT(arg1, parsed, 'spawn'); - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); + if (err) { + return originalEmit.call(cp, 'error', err); + } + } - return [l, a, b]; -}; + return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params + }; +} -convert.lab.xyz = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; +function verifyENOENT(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawn'); + } - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; + return null; +} - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; - y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; +function verifyENOENTSync(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); + } - x *= 95.047; - y *= 100; - z *= 108.883; + return null; +} - return [x, y, z]; +module.exports = { + hookChildProcess, + verifyENOENT, + verifyENOENTSync, + notFoundError, }; -convert.lab.lch = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; - const hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; +/***/ }), - if (h < 0) { - h += 360; - } +/***/ 4915: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const c = Math.sqrt(a * a + b * b); +"use strict"; - return [l, c, h]; -}; -convert.lch.lab = function (lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; +const path = __nccwpck_require__(85622); +const resolveCommand = __nccwpck_require__(75921); +const escape = __nccwpck_require__(22266); +const readShebang = __nccwpck_require__(15217); - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); +const isWin = process.platform === 'win32'; +const isExecutableRegExp = /\.(?:com|exe)$/i; +const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; - return [l, a, b]; -}; +function detectShebang(parsed) { + parsed.file = resolveCommand(parsed); -convert.rgb.ansi16 = function (args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization + const shebang = parsed.file && readShebang(parsed.file); - value = Math.round(value / 50); + if (shebang) { + parsed.args.unshift(parsed.file); + parsed.command = shebang; - if (value === 0) { - return 30; - } + return resolveCommand(parsed); + } - let ansi = 30 - + ((Math.round(b / 255) << 2) - | (Math.round(g / 255) << 1) - | Math.round(r / 255)); + return parsed.file; +} - if (value === 2) { - ansi += 60; - } +function parseNonShell(parsed) { + if (!isWin) { + return parsed; + } - return ansi; -}; + // Detect & add support for shebangs + const commandFile = detectShebang(parsed); -convert.hsv.ansi16 = function (args) { - // Optimization here; we already know the value and don't need to get - // it converted for us. - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); -}; + // We don't need a shell if the command filename is an executable + const needsShell = !isExecutableRegExp.test(commandFile); -convert.rgb.ansi256 = function (args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; + // If a shell is required, use cmd.exe and take care of escaping everything correctly + // Note that `forceShell` is an hidden option used only in tests + if (parsed.options.forceShell || needsShell) { + // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` + // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument + // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, + // we need to double escape them + const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); - // We use the extended greyscale palette here, with the exception of - // black and white. normal palette only has 4 greyscale shades. - if (r === g && g === b) { - if (r < 8) { - return 16; - } + // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) + // This is necessary otherwise it will always fail with ENOENT in those cases + parsed.command = path.normalize(parsed.command); - if (r > 248) { - return 231; - } + // Escape command & arguments + parsed.command = escape.command(parsed.command); + parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); - return Math.round(((r - 8) / 247) * 24) + 232; - } + const shellCommand = [parsed.command].concat(parsed.args).join(' '); - const ansi = 16 - + (36 * Math.round(r / 255 * 5)) - + (6 * Math.round(g / 255 * 5)) - + Math.round(b / 255 * 5); + parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; + parsed.command = process.env.comspec || 'cmd.exe'; + parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped + } - return ansi; -}; + return parsed; +} -convert.ansi16.rgb = function (args) { - let color = args % 10; +function parse(command, args, options) { + // Normalize arguments, similar to nodejs + if (args && !Array.isArray(args)) { + options = args; + args = null; + } - // Handle greyscale - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } + args = args ? args.slice(0) : []; // Clone array to avoid changing the original + options = Object.assign({}, options); // Clone object to avoid changing the original - color = color / 10.5 * 255; + // Build our parsed object + const parsed = { + command, + args, + options, + file: undefined, + original: { + command, + args, + }, + }; - return [color, color, color]; - } + // Delegate further parsing to shell or non-shell + return options.shell ? parsed : parseNonShell(parsed); +} - const mult = (~~(args > 50) + 1) * 0.5; - const r = ((color & 1) * mult) * 255; - const g = (((color >> 1) & 1) * mult) * 255; - const b = (((color >> 2) & 1) * mult) * 255; +module.exports = parse; - return [r, g, b]; -}; -convert.ansi256.rgb = function (args) { - // Handle greyscale - if (args >= 232) { - const c = (args - 232) * 10 + 8; - return [c, c, c]; - } +/***/ }), - args -= 16; +/***/ 22266: +/***/ ((module) => { - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = (rem % 6) / 5 * 255; +"use strict"; - return [r, g, b]; -}; -convert.rgb.hex = function (args) { - const integer = ((Math.round(args[0]) & 0xFF) << 16) - + ((Math.round(args[1]) & 0xFF) << 8) - + (Math.round(args[2]) & 0xFF); +// See http://www.robvanderwoude.com/escapechars.php +const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; +function escapeCommand(arg) { + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); -convert.hex.rgb = function (args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } + return arg; +} - let colorString = match[0]; +function escapeArgument(arg, doubleEscapeMetaChars) { + // Convert to string + arg = `${arg}`; - if (match[0].length === 3) { - colorString = colorString.split('').map(char => { - return char + char; - }).join(''); - } + // Algorithm below is based on https://qntm.org/cmd - const integer = parseInt(colorString, 16); - const r = (integer >> 16) & 0xFF; - const g = (integer >> 8) & 0xFF; - const b = integer & 0xFF; + // Sequence of backslashes followed by a double quote: + // double up all the backslashes and escape the double quote + arg = arg.replace(/(\\*)"/g, '$1$1\\"'); - return [r, g, b]; -}; + // Sequence of backslashes followed by the end of the string + // (which will become a double quote later): + // double up all the backslashes + arg = arg.replace(/(\\*)$/, '$1$1'); -convert.rgb.hcg = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = (max - min); - let grayscale; - let hue; + // All other backslashes occur literally - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } + // Quote the whole thing: + arg = `"${arg}"`; - if (chroma <= 0) { - hue = 0; - } else - if (max === r) { - hue = ((g - b) / chroma) % 6; - } else - if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma; - } + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); - hue /= 6; - hue %= 1; + // Double escape meta chars if necessary + if (doubleEscapeMetaChars) { + arg = arg.replace(metaCharsRegExp, '^$1'); + } - return [hue * 360, chroma * 100, grayscale * 100]; -}; + return arg; +} -convert.hsl.hcg = function (hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; +module.exports.command = escapeCommand; +module.exports.argument = escapeArgument; - const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); - let f = 0; - if (c < 1.0) { - f = (l - 0.5 * c) / (1.0 - c); - } +/***/ }), - return [hsl[0], c * 100, f * 100]; -}; +/***/ 15217: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -convert.hsv.hcg = function (hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; +"use strict"; - const c = s * v; - let f = 0; - if (c < 1.0) { - f = (v - c) / (1 - c); - } +const fs = __nccwpck_require__(35747); +const shebangCommand = __nccwpck_require__(95598); - return [hsv[0], c * 100, f * 100]; -}; +function readShebang(command) { + // Read the first 150 bytes from the file + const size = 150; + const buffer = Buffer.alloc(size); -convert.hcg.rgb = function (hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; + let fd; - if (c === 0.0) { - return [g * 255, g * 255, g * 255]; - } + try { + fd = fs.openSync(command, 'r'); + fs.readSync(fd, buffer, 0, size, 0); + fs.closeSync(fd); + } catch (e) { /* Empty */ } - const pure = [0, 0, 0]; - const hi = (h % 1) * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; + // Attempt to extract shebang (null is returned if not a shebang) + return shebangCommand(buffer.toString()); +} - /* eslint-disable max-statements-per-line */ - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; pure[1] = v; pure[2] = 0; break; - case 1: - pure[0] = w; pure[1] = 1; pure[2] = 0; break; - case 2: - pure[0] = 0; pure[1] = 1; pure[2] = v; break; - case 3: - pure[0] = 0; pure[1] = w; pure[2] = 1; break; - case 4: - pure[0] = v; pure[1] = 0; pure[2] = 1; break; - default: - pure[0] = 1; pure[1] = 0; pure[2] = w; - } - /* eslint-enable max-statements-per-line */ +module.exports = readShebang; - mg = (1.0 - c) * g; - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; -}; +/***/ }), -convert.hcg.hsv = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; +/***/ 75921: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const v = c + g * (1.0 - c); - let f = 0; +"use strict"; - if (v > 0.0) { - f = c / v; - } - return [hcg[0], f * 100, v * 100]; -}; +const path = __nccwpck_require__(85622); +const which = __nccwpck_require__(67753); +const getPathKey = __nccwpck_require__(37637); -convert.hcg.hsl = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; +function resolveCommandAttempt(parsed, withoutPathExt) { + const env = parsed.options.env || process.env; + const cwd = process.cwd(); + const hasCustomCwd = parsed.options.cwd != null; + // Worker threads do not have process.chdir() + const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled; - const l = g * (1.0 - c) + 0.5 * c; - let s = 0; + // If a custom `cwd` was specified, we need to change the process cwd + // because `which` will do stat calls but does not support a custom cwd + if (shouldSwitchCwd) { + try { + process.chdir(parsed.options.cwd); + } catch (err) { + /* Empty */ + } + } - if (l > 0.0 && l < 0.5) { - s = c / (2 * l); - } else - if (l >= 0.5 && l < 1.0) { - s = c / (2 * (1 - l)); - } + let resolved; - return [hcg[0], s * 100, l * 100]; -}; + try { + resolved = which.sync(parsed.command, { + path: env[getPathKey({ env })], + pathExt: withoutPathExt ? path.delimiter : undefined, + }); + } catch (e) { + /* Empty */ + } finally { + if (shouldSwitchCwd) { + process.chdir(cwd); + } + } -convert.hcg.hwb = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1.0 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; -}; + // If we successfully resolved, ensure that an absolute path is returned + // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it + if (resolved) { + resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); + } -convert.hwb.hcg = function (hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; + return resolved; +} - if (c < 1) { - g = (v - c) / (1 - c); - } +function resolveCommand(parsed) { + return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); +} - return [hwb[0], c * 100, g * 100]; -}; +module.exports = resolveCommand; -convert.apple.rgb = function (apple) { - return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; -}; -convert.rgb.apple = function (rgb) { - return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; -}; +/***/ }), -convert.gray.rgb = function (args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; -}; +/***/ 12369: +/***/ ((module, exports, __nccwpck_require__) => { -convert.gray.hsl = function (args) { - return [0, 0, args[0]]; -}; +/* eslint-env browser */ -convert.gray.hsv = convert.gray.hsl; +/** + * This is the web browser implementation of `debug()`. + */ -convert.gray.hwb = function (gray) { - return [0, 100, gray[0]]; -}; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; -convert.gray.cmyk = function (gray) { - return [0, 0, 0, gray[0]]; -}; + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); -convert.gray.lab = function (gray) { - return [gray[0], 0, 0]; -}; +/** + * Colors. + */ -convert.gray.hex = function (gray) { - const val = Math.round(gray[0] / 100 * 255) & 0xFF; - const integer = (val << 16) + (val << 8) + val; +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ -convert.rgb.gray = function (rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; -}; +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } -/***/ }), + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} -/***/ 73991: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/** + * Colorize log arguments if enabled. + * + * @api public + */ -const conversions = __webpack_require__(92724); -const route = __webpack_require__(40577); +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); -const convert = {}; + if (!this.useColors) { + return; + } -const models = Object.keys(conversions); + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); -function wrapRaw(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - if (arg0 === undefined || arg0 === null) { - return arg0; + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); - if (arg0.length > 1) { - args = arg0; + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} - return fn(args); - }; +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; } - return wrappedFn; + return r; } -function wrapRounded(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - - if (arg0 === undefined || arg0 === null) { - return arg0; - } +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ - if (arg0.length > 1) { - args = arg0; - } +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} - const result = fn(args); +module.exports = __nccwpck_require__(22507)(exports); - // We're assuming the result is an array here. - // see notice in conversions.js; don't use box types - // in conversion functions. - if (typeof result === 'object') { - for (let len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } +const {formatters} = module.exports; - return result; - }; +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; } +}; - return wrappedFn; -} -models.forEach(fromModel => { - convert[fromModel] = {}; +/***/ }), - Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); +/***/ 22507: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const routes = route(fromModel); - const routeModels = Object.keys(routes); - routeModels.forEach(toModel => { - const fn = routes[toModel]; +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __nccwpck_require__(84004); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; }); -}); -module.exports = convert; + /** + * The currently active debug mode names, and names to skip. + */ + createDebug.names = []; + createDebug.skips = []; -/***/ }), + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; -/***/ 40577: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; -const conversions = __webpack_require__(92724); + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } -/* - This function routes a model to all other models. + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; - all functions that are routed have a property `.conversion` attached - to the returned synthetic function. This property is an array - of strings, each with the steps in between the 'from' and 'to' - color models (inclusive). + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; - conversions that are not possible simply are not included. -*/ + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } -function buildGraph() { - const graph = {}; - // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - const models = Object.keys(conversions); + const self = debug; - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; - return graph; -} + args[0] = createDebug.coerce(args[0]); -// https://en.wikipedia.org/wiki/Breadth-first_search -function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; // Unshift -> queue -> pop + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } - graph[fromModel].distance = 0; + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride, + set: v => { + enableOverride = v; } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); } + + return debug; } - return graph; -} + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } -function link(from, to) { - return function (args) { - return to(from(args)); - }; -} + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); -function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; + createDebug.names = []; + createDebug.skips = []; - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } } - fn.conversion = path; - return fn; -} + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } -module.exports = function (fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; + let i; + let len; - if (node.parent === null) { - // No possible conversion, or this node is the source model. - continue; + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } } - conversion[toModel] = wrapConversion(toModel, graph); + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; } - return conversion; -}; + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + return createDebug; +} + +module.exports = setup; /***/ }), -/***/ 78679: -/***/ ((module) => { +/***/ 30787: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = __nccwpck_require__(12369); +} else { + module.exports = __nccwpck_require__(72296); +} /***/ }), -/***/ 28192: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 72296: +/***/ ((module, exports, __nccwpck_require__) => { -var path = __webpack_require__(85622); +/** + * Module dependencies. + */ -module.exports = function (basedir, relfiles) { - if (relfiles) { - var files = relfiles.map(function (r) { - return path.resolve(basedir, r); - }); - } - else { - var files = basedir; - } - - var res = files.slice(1).reduce(function (ps, file) { - if (!file.match(/^([A-Za-z]:)?\/|\\/)) { - throw new Error('relative path without a basedir'); - } - - var xs = file.split(/\/+|\\+/); - for ( - var i = 0; - ps[i] === xs[i] && i < Math.min(ps.length, xs.length); - i++ - ); - return ps.slice(0, i); - }, files[0].split(/\/+|\\+/)); - - // Windows correctly handles paths with forward-slashes - return res.length > 1 ? res.join('/') : '/' -}; +const tty = __nccwpck_require__(33867); +const util = __nccwpck_require__(31669); +/** + * This is the Node.js implementation of `debug()`. + */ -/***/ }), +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); -/***/ 45179: -/***/ ((module) => { +/** + * Colors. + */ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; +exports.colors = [6, 2, 3, 4, 5, 1]; -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = __nccwpck_require__(28106); + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} -/***/ }), +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ -/***/ 18271: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); -var ProtoList = __webpack_require__(98051) - , path = __webpack_require__(85622) - , fs = __webpack_require__(35747) - , ini = __webpack_require__(27452) - , EE = __webpack_require__(28614).EventEmitter - , url = __webpack_require__(78835) - , http = __webpack_require__(98605) + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } -var exports = module.exports = function () { - var args = [].slice.call(arguments) - , conf = new ConfigChain() + obj[prop] = val; + return obj; +}, {}); - while(args.length) { - var a = args.shift() - if(a) conf.push - ( 'string' === typeof a - ? json(a) - : a ) - } +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ - return conf +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); } -//recursively find a file... +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ -var find = exports.find = function () { - var rel = path.join.apply(null, [].slice.call(arguments)) +function formatArgs(args) { + const {namespace: name, useColors} = this; - function find(start, rel) { - var file = path.join(start, rel) - try { - fs.statSync(file) - return file - } catch (err) { - if(path.dirname(start) !== start) // root - return find(path.dirname(start), rel) - } - } - return find(__dirname, rel) -} + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; -var parse = exports.parse = function (content, file, type) { - content = '' + content - // if we don't know what it is, try json and fall back to ini - // if we know what it is, then it must be that. - if (!type) { - try { return JSON.parse(content) } - catch (er) { return ini.parse(content) } - } else if (type === 'json') { - if (this.emit) { - try { return JSON.parse(content) } - catch (er) { this.emit('error', er) } - } else { - return JSON.parse(content) - } - } else { - return ini.parse(content) - } + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } } -var json = exports.json = function () { - var args = [].slice.call(arguments).filter(function (arg) { return arg != null }) - var file = path.join.apply(null, args) - var content - try { - content = fs.readFileSync(file,'utf-8') - } catch (err) { - return - } - return parse(content, file, 'json') +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; } -var env = exports.env = function (prefix, env) { - env = env || process.env - var obj = {} - var l = prefix.length - for(var k in env) { - if(k.indexOf(prefix) === 0) - obj[k.substring(l)] = env[k] - } +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ - return obj +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); } -exports.ConfigChain = ConfigChain -function ConfigChain () { - EE.apply(this) - ProtoList.apply(this, arguments) - this._awaiting = 0 - this._saving = 0 - this.sources = {} +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } } -// multi-inheritance-ish -var extras = { - constructor: { value: ConfigChain } -} -Object.keys(EE.prototype).forEach(function (k) { - extras[k] = Object.getOwnPropertyDescriptor(EE.prototype, k) -}) -ConfigChain.prototype = Object.create(ProtoList.prototype, extras) +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ -ConfigChain.prototype.del = function (key, where) { - // if not specified where, then delete from the whole chain, scorched - // earth style - if (where) { - var target = this.sources[where] - target = target && target.data - if (!target) { - return this.emit('error', new Error('not found '+where)) - } - delete target[key] - } else { - for (var i = 0, l = this.list.length; i < l; i ++) { - delete this.list[i][key] - } - } - return this +function load() { + return process.env.DEBUG; } -ConfigChain.prototype.set = function (key, value, where) { - var target +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ - if (where) { - target = this.sources[where] - target = target && target.data - if (!target) { - return this.emit('error', new Error('not found '+where)) - } - } else { - target = this.list[0] - if (!target) { - return this.emit('error', new Error('cannot set, no confs!')) - } - } - target[key] = value - return this -} +function init(debug) { + debug.inspectOpts = {}; -ConfigChain.prototype.get = function (key, where) { - if (where) { - where = this.sources[where] - if (where) where = where.data - if (where && Object.hasOwnProperty.call(where, key)) return where[key] - return undefined - } - return this.list[0][key] + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } } -ConfigChain.prototype.save = function (where, type, cb) { - if (typeof type === 'function') cb = type, type = null - var target = this.sources[where] - if (!target || !(target.path || target.source) || !target.data) { - // TODO: maybe save() to a url target could be a PUT or something? - // would be easy to swap out with a reddis type thing, too - return this.emit('error', new Error('bad save target: '+where)) - } +module.exports = __nccwpck_require__(22507)(exports); - if (target.source) { - var pref = target.prefix || '' - Object.keys(target.data).forEach(function (k) { - target.source[pref + k] = target.data[k] - }) - return this - } +const {formatters} = module.exports; - var type = type || target.type - var data = target.data - if (target.type === 'json') { - data = JSON.stringify(data) - } else { - data = ini.stringify(data) - } +/** + * Map %o to `util.inspect()`, all on a single line. + */ - this._saving ++ - fs.writeFile(target.path, data, 'utf8', function (er) { - this._saving -- - if (er) { - if (cb) return cb(er) - else return this.emit('error', er) - } - if (this._saving === 0) { - if (cb) cb() - this.emit('save') - } - }.bind(this)) - return this -} +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; -ConfigChain.prototype.addFile = function (file, type, name) { - name = name || file - var marker = {__source__:name} - this.sources[name] = { path: file, type: type } - this.push(marker) - this._await() - fs.readFile(file, 'utf8', function (er, data) { - if (er) this.emit('error', er) - this.addString(data, file, type, marker) - }.bind(this)) - return this -} +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ -ConfigChain.prototype.addEnv = function (prefix, env, name) { - name = name || 'env' - var data = exports.env(prefix, env) - this.sources[name] = { data: data, source: env, prefix: prefix } - return this.add(data, name) -} +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; -ConfigChain.prototype.addUrl = function (req, type, name) { - this._await() - var href = url.format(req) - name = name || href - var marker = {__source__:name} - this.sources[name] = { href: href, type: type } - this.push(marker) - http.request(req, function (res) { - var c = [] - var ct = res.headers['content-type'] - if (!type) { - type = ct.indexOf('json') !== -1 ? 'json' - : ct.indexOf('ini') !== -1 ? 'ini' - : href.match(/\.json$/) ? 'json' - : href.match(/\.ini$/) ? 'ini' - : null - marker.type = type - } - res.on('data', c.push.bind(c)) - .on('end', function () { - this.addString(Buffer.concat(c), href, type, marker) - }.bind(this)) - .on('error', this.emit.bind(this, 'error')) +/***/ }), - }.bind(this)) - .on('error', this.emit.bind(this, 'error')) - .end() +/***/ 47781: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return this -} +"use strict"; -ConfigChain.prototype.addString = function (data, file, type, marker) { - data = this.parse(data, file, type) - this.add(data, marker) - return this -} +const PassThrough = __nccwpck_require__(92413).PassThrough; +const zlib = __nccwpck_require__(78761); +const mimicResponse = __nccwpck_require__(27480); -ConfigChain.prototype.add = function (data, marker) { - if (marker && typeof marker === 'object') { - var i = this.list.indexOf(marker) - if (i === -1) { - return this.emit('error', new Error('bad marker')) - } - this.splice(i, 1, data) - marker = marker.__source__ - this.sources[marker] = this.sources[marker] || {} - this.sources[marker].data = data - // we were waiting for this. maybe emit 'load' - this._resolve() - } else { - if (typeof marker === 'string') { - this.sources[marker] = this.sources[marker] || {} - this.sources[marker].data = data - } - // trigger the load event if nothing was already going to do so. - this._await() - this.push(data) - process.nextTick(this._resolve.bind(this)) - } - return this -} - -ConfigChain.prototype.parse = exports.parse - -ConfigChain.prototype._await = function () { - this._awaiting++ -} - -ConfigChain.prototype._resolve = function () { - this._awaiting-- - if (this._awaiting === 0) this.emit('load', this) -} - - -/***/ }), - -/***/ 23875: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; +module.exports = response => { + // TODO: Use Array#includes when targeting Node.js 6 + if (['gzip', 'deflate'].indexOf(response.headers['content-encoding']) === -1) { + return response; + } + const unzip = zlib.createUnzip(); + const stream = new PassThrough(); -const cp = __webpack_require__(63129); -const parse = __webpack_require__(4915); -const enoent = __webpack_require__(39985); + mimicResponse(response, stream); -function spawn(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); + unzip.on('error', err => { + if (err.code === 'Z_BUF_ERROR') { + stream.end(); + return; + } - // Spawn the child process - const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); + stream.emit('error', err); + }); - // Hook into child process "exit" event to emit an error if the command - // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - enoent.hookChildProcess(spawned, parsed); + response.pipe(unzip).pipe(stream); - return spawned; -} + return stream; +}; -function spawnSync(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); - // Spawn the child process - const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); +/***/ }), - // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); +/***/ 36250: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return result; -} +var clone = __nccwpck_require__(13405); -module.exports = spawn; -module.exports.spawn = spawn; -module.exports.sync = spawnSync; +module.exports = function(options, defaults) { + options = options || {}; -module.exports._parse = parse; -module.exports._enoent = enoent; + Object.keys(defaults).forEach(function(key) { + if (typeof options[key] === 'undefined') { + options[key] = clone(defaults[key]); + } + }); + return options; +}; /***/ }), -/***/ 39985: -/***/ ((module) => { +/***/ 12097: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; - -const isWin = process.platform === 'win32'; - -function notFoundError(original, syscall) { - return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { - code: 'ENOENT', - errno: 'ENOENT', - syscall: `${syscall} ${original.command}`, - path: original.command, - spawnargs: original.args, - }); -} - -function hookChildProcess(cp, parsed) { - if (!isWin) { - return; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tls_1 = __nccwpck_require__(4016); +const deferToConnect = (socket, fn) => { + let listeners; + if (typeof fn === 'function') { + const connect = fn; + listeners = { connect }; } - - const originalEmit = cp.emit; - - cp.emit = function (name, arg1) { - // If emitting "exit" event and exit code is 1, we need to check if - // the command exists and emit an "error" instead - // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 - if (name === 'exit') { - const err = verifyENOENT(arg1, parsed, 'spawn'); - - if (err) { - return originalEmit.call(cp, 'error', err); + else { + listeners = fn; + } + const hasConnectListener = typeof listeners.connect === 'function'; + const hasSecureConnectListener = typeof listeners.secureConnect === 'function'; + const hasCloseListener = typeof listeners.close === 'function'; + const onConnect = () => { + if (hasConnectListener) { + listeners.connect(); + } + if (socket instanceof tls_1.TLSSocket && hasSecureConnectListener) { + if (socket.authorized) { + listeners.secureConnect(); + } + else if (!socket.authorizationError) { + socket.once('secureConnect', listeners.secureConnect); } } - - return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params + if (hasCloseListener) { + socket.once('close', listeners.close); + } }; -} - -function verifyENOENT(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawn'); + if (socket.writable && !socket.connecting) { + onConnect(); } - - return null; -} - -function verifyENOENTSync(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); + else if (socket.connecting) { + socket.once('connect', onConnect); + } + else if (socket.destroyed && hasCloseListener) { + listeners.close(socket._hadError); } - - return null; -} - -module.exports = { - hookChildProcess, - verifyENOENT, - verifyENOENTSync, - notFoundError, }; +exports.default = deferToConnect; +// For CommonJS default export support +module.exports = deferToConnect; +module.exports.default = deferToConnect; /***/ }), -/***/ 4915: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 47778: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const resolveCommand = __webpack_require__(75921); -const escape = __webpack_require__(22266); -const readShebang = __webpack_require__(15217); +var keys = __nccwpck_require__(28777); +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; -const isWin = process.platform === 'win32'; -const isExecutableRegExp = /\.(?:com|exe)$/i; -const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; +var toStr = Object.prototype.toString; +var concat = Array.prototype.concat; +var origDefineProperty = Object.defineProperty; -function detectShebang(parsed) { - parsed.file = resolveCommand(parsed); +var isFunction = function (fn) { + return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; +}; - const shebang = parsed.file && readShebang(parsed.file); +var arePropertyDescriptorsSupported = function () { + var obj = {}; + try { + origDefineProperty(obj, 'x', { enumerable: false, value: obj }); + // eslint-disable-next-line no-unused-vars, no-restricted-syntax + for (var _ in obj) { // jscs:ignore disallowUnusedVariables + return false; + } + return obj.x === obj; + } catch (e) { /* this is IE 8. */ + return false; + } +}; +var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); - if (shebang) { - parsed.args.unshift(parsed.file); - parsed.command = shebang; +var defineProperty = function (object, name, value, predicate) { + if (name in object && (!isFunction(predicate) || !predicate())) { + return; + } + if (supportsDescriptors) { + origDefineProperty(object, name, { + configurable: true, + enumerable: false, + value: value, + writable: true + }); + } else { + object[name] = value; + } +}; - return resolveCommand(parsed); - } +var defineProperties = function (object, map) { + var predicates = arguments.length > 2 ? arguments[2] : {}; + var props = keys(map); + if (hasSymbols) { + props = concat.call(props, Object.getOwnPropertySymbols(map)); + } + for (var i = 0; i < props.length; i += 1) { + defineProperty(object, props[i], map[props[i]], predicates[props[i]]); + } +}; - return parsed.file; -} +defineProperties.supportsDescriptors = !!supportsDescriptors; -function parseNonShell(parsed) { - if (!isWin) { - return parsed; - } +module.exports = defineProperties; - // Detect & add support for shebangs - const commandFile = detectShebang(parsed); - // We don't need a shell if the command filename is an executable - const needsShell = !isExecutableRegExp.test(commandFile); +/***/ }), - // If a shell is required, use cmd.exe and take care of escaping everything correctly - // Note that `forceShell` is an hidden option used only in tests - if (parsed.options.forceShell || needsShell) { - // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` - // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument - // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, - // we need to double escape them - const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); +/***/ 7192: +/***/ ((module) => { - // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) - // This is necessary otherwise it will always fail with ENOENT in those cases - parsed.command = path.normalize(parsed.command); +// Only Node.JS has a process variable that is of [[Class]] process +module.exports = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; - // Escape command & arguments - parsed.command = escape.command(parsed.command); - parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); - const shellCommand = [parsed.command].concat(parsed.args).join(' '); +/***/ }), - parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; - parsed.command = process.env.comspec || 'cmd.exe'; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } +/***/ 71257: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return parsed; -} +"use strict"; -function parse(command, args, options) { - // Normalize arguments, similar to nodejs - if (args && !Array.isArray(args)) { - options = args; - args = null; - } - args = args ? args.slice(0) : []; // Clone array to avoid changing the original - options = Object.assign({}, options); // Clone object to avoid changing the original +var stream = __nccwpck_require__(92413); - // Build our parsed object - const parsed = { - command, - args, - options, - file: undefined, - original: { - command, - args, - }, - }; +function DuplexWrapper(options, writable, readable) { + if (typeof readable === "undefined") { + readable = writable; + writable = options; + options = null; + } - // Delegate further parsing to shell or non-shell - return options.shell ? parsed : parseNonShell(parsed); -} + stream.Duplex.call(this, options); -module.exports = parse; + if (typeof readable.read !== "function") { + readable = (new stream.Readable(options)).wrap(readable); + } + this._writable = writable; + this._readable = readable; + this._waiting = false; -/***/ }), + var self = this; -/***/ 22266: -/***/ ((module) => { + writable.once("finish", function() { + self.end(); + }); -"use strict"; + this.once("finish", function() { + writable.end(); + }); + readable.on("readable", function() { + if (self._waiting) { + self._waiting = false; + self._read(); + } + }); -// See http://www.robvanderwoude.com/escapechars.php -const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; + readable.once("end", function() { + self.push(null); + }); -function escapeCommand(arg) { - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); + if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) { + writable.on("error", function(err) { + self.emit("error", err); + }); - return arg; + readable.on("error", function(err) { + self.emit("error", err); + }); + } } -function escapeArgument(arg, doubleEscapeMetaChars) { - // Convert to string - arg = `${arg}`; +DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}}); - // Algorithm below is based on https://qntm.org/cmd +DuplexWrapper.prototype._write = function _write(input, encoding, done) { + this._writable.write(input, encoding, done); +}; - // Sequence of backslashes followed by a double quote: - // double up all the backslashes and escape the double quote - arg = arg.replace(/(\\*)"/g, '$1$1\\"'); +DuplexWrapper.prototype._read = function _read() { + var buf; + var reads = 0; + while ((buf = this._readable.read()) !== null) { + this.push(buf); + reads++; + } + if (reads === 0) { + this._waiting = true; + } +}; - // Sequence of backslashes followed by the end of the string - // (which will become a double quote later): - // double up all the backslashes - arg = arg.replace(/(\\*)$/, '$1$1'); +module.exports = function duplex2(options, writable, readable) { + return new DuplexWrapper(options, writable, readable); +}; - // All other backslashes occur literally +module.exports.DuplexWrapper = DuplexWrapper; - // Quote the whole thing: - arg = `"${arg}"`; - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); +/***/ }), - // Double escape meta chars if necessary - if (doubleEscapeMetaChars) { - arg = arg.replace(metaCharsRegExp, '^$1'); - } +/***/ 33874: +/***/ ((module) => { - return arg; -} +"use strict"; +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ -module.exports.command = escapeCommand; -module.exports.argument = escapeArgument; -/***/ }), +/** + * Module exports. + * @public + */ -/***/ 15217: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +module.exports = encodeUrl -"use strict"; +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g -const fs = __webpack_require__(35747); -const shebangCommand = __webpack_require__(95598); +/** + * RegExp to match unmatched surrogate pair. + * @private + */ -function readShebang(command) { - // Read the first 150 bytes from the file - const size = 150; - const buffer = Buffer.alloc(size); +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g - let fd; +/** + * String to replace unmatched surrogate pair with. + * @private + */ - try { - fd = fs.openSync(command, 'r'); - fs.readSync(fd, buffer, 0, size, 0); - fs.closeSync(fd); - } catch (e) { /* Empty */ } +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' - // Attempt to extract shebang (null is returned if not a shebang) - return shebangCommand(buffer.toString()); -} +/** + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. + * + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public + */ -module.exports = readShebang; +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} /***/ }), -/***/ 75921: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 85100: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const which = __webpack_require__(67753); -const getPathKey = __webpack_require__(23226); +var iconvLite = __nccwpck_require__(21377); -function resolveCommandAttempt(parsed, withoutPathExt) { - const env = parsed.options.env || process.env; - const cwd = process.cwd(); - const hasCustomCwd = parsed.options.cwd != null; - // Worker threads do not have process.chdir() - const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled; +// Expose to the world +module.exports.O = convert; - // If a custom `cwd` was specified, we need to change the process cwd - // because `which` will do stat calls but does not support a custom cwd - if (shouldSwitchCwd) { +/** + * Convert encoding of an UTF-8 string or a buffer + * + * @param {String|Buffer} str String to be converted + * @param {String} to Encoding to be converted to + * @param {String} [from='UTF-8'] Encoding to be converted from + * @return {Buffer} Encoded string + */ +function convert(str, to, from) { + from = checkEncoding(from || 'UTF-8'); + to = checkEncoding(to || 'UTF-8'); + str = str || ''; + + var result; + + if (from !== 'UTF-8' && typeof str === 'string') { + str = Buffer.from(str, 'binary'); + } + + if (from === to) { + if (typeof str === 'string') { + result = Buffer.from(str); + } else { + result = str; + } + } else { try { - process.chdir(parsed.options.cwd); - } catch (err) { - /* Empty */ + result = convertIconvLite(str, to, from); + } catch (E) { + console.error(E); + result = str; } } - let resolved; + if (typeof result === 'string') { + result = Buffer.from(result, 'utf-8'); + } - try { - resolved = which.sync(parsed.command, { - path: env[getPathKey({ env })], - pathExt: withoutPathExt ? path.delimiter : undefined, - }); - } catch (e) { - /* Empty */ - } finally { - if (shouldSwitchCwd) { - process.chdir(cwd); - } - } + return result; +} - // If we successfully resolved, ensure that an absolute path is returned - // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it - if (resolved) { - resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); +/** + * Convert encoding of astring with iconv-lite + * + * @param {String|Buffer} str String to be converted + * @param {String} to Encoding to be converted to + * @param {String} [from='UTF-8'] Encoding to be converted from + * @return {Buffer} Encoded string + */ +function convertIconvLite(str, to, from) { + if (to === 'UTF-8') { + return iconvLite.decode(str, from); + } else if (from === 'UTF-8') { + return iconvLite.encode(str, to); + } else { + return iconvLite.encode(iconvLite.decode(str, from), to); } - - return resolved; } -function resolveCommand(parsed) { - return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); +/** + * Converts charset name if needed + * + * @param {String} name Character set + * @return {String} Character set name + */ +function checkEncoding(name) { + return (name || '') + .toString() + .trim() + .replace(/^latin[\-_]?(\d+)$/i, 'ISO-8859-$1') + .replace(/^win(?:dows)?[\-_]?(\d+)$/i, 'WINDOWS-$1') + .replace(/^utf[\-_]?(\d+)$/i, 'UTF-$1') + .replace(/^ks_c_5601\-1987$/i, 'CP949') + .replace(/^us[\-_]?ascii$/i, 'ASCII') + .toUpperCase(); } -module.exports = resolveCommand; - /***/ }), -/***/ 23226: -/***/ ((module) => { - -"use strict"; +/***/ 11745: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var once = __nccwpck_require__(96754); -const pathKey = (options = {}) => { - const environment = options.env || process.env; - const platform = options.platform || process.platform; +var noop = function() {}; - if (platform !== 'win32') { - return 'PATH'; - } +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +}; - return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 }; -module.exports = pathKey; -// TODO: Remove this for the next major release -module.exports.default = pathKey; +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + callback = once(callback || noop); -/***/ }), + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + var cancelled = false; -/***/ 12369: -/***/ ((module, exports, __webpack_require__) => { + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; -/* eslint-env browser */ + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; -/** - * This is the web browser implementation of `debug()`. - */ + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; -/** - * Colors. - */ + var onerror = function(err) { + callback.call(stream, err); + }; -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; + var onclose = function() { + process.nextTick(onclosenexttick); + }; -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ + var onclosenexttick = function() { + if (cancelled) return; + if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); + }; -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } + var onrequest = function() { + stream.req.on('finish', onfinish); + }; - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); } - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} + if (isChildProcess(stream)) stream.on('exit', onexit); -/** - * Colorize log arguments if enabled. - * - * @api public - */ + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); + return function() { + cancelled = true; + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +}; - if (!this.useColors) { - return; - } +module.exports = eos; - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); +/***/ }), - args.splice(lastC, 0, c); -} +/***/ 47727: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ -function log(...args) { - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return typeof console === 'object' && - console.log && - console.log(...args); -} +"use strict"; -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} +const path = __nccwpck_require__(85622); +const os = __nccwpck_require__(12087); -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug'); - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } +const homedir = os.homedir(); +const tmpdir = os.tmpdir(); +const {env} = process; - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } +const macos = name => { + const library = path.join(homedir, 'Library'); - return r; -} + return { + data: path.join(library, 'Application Support', name), + config: path.join(library, 'Preferences', name), + cache: path.join(library, 'Caches', name), + log: path.join(library, 'Logs', name), + temp: path.join(tmpdir, name) + }; +}; -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ +const windows = name => { + const appData = env.APPDATA || path.join(homedir, 'AppData', 'Roaming'); + const localAppData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local'); -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? + return { + // Data/config/cache/log are invented by me as Windows isn't opinionated about this + data: path.join(localAppData, name, 'Data'), + config: path.join(appData, name, 'Config'), + cache: path.join(localAppData, name, 'Cache'), + log: path.join(localAppData, name, 'Log'), + temp: path.join(tmpdir, name) + }; +}; + +// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +const linux = name => { + const username = path.basename(homedir); + + return { + data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name), + config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name), + cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name), + // https://wiki.debian.org/XDGBaseDirectorySpecification#state + log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name), + temp: path.join(tmpdir, username, name) + }; +}; + +const envPaths = (name, options) => { + if (typeof name !== 'string') { + throw new TypeError(`Expected string, got ${typeof name}`); } -} -module.exports = __webpack_require__(22507)(exports); + options = Object.assign({suffix: 'nodejs'}, options); -const {formatters} = module.exports; + if (options.suffix) { + // Add suffix to prevent possible conflict with native apps + name += `-${options.suffix}`; + } -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ + if (process.platform === 'darwin') { + return macos(name); + } -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; + if (process.platform === 'win32') { + return windows(name); } + + return linux(name); }; +module.exports = envPaths; +// TODO: Remove this for the next major release +module.exports.default = envPaths; -/***/ }), -/***/ 22507: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ }), +/***/ 98361: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ +"use strict"; -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = __webpack_require__(84004); - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); +var util = __nccwpck_require__(31669); +var isArrayish = __nccwpck_require__(30237); - /** - * Active `debug` instances. - */ - createDebug.instances = []; +var errorEx = function errorEx(name, properties) { + if (!name || name.constructor !== String) { + properties = name || {}; + name = Error.name; + } - /** - * The currently active debug mode names, and names to skip. - */ + var errorExError = function ErrorEXError(message) { + if (!this) { + return new ErrorEXError(message); + } - createDebug.names = []; - createDebug.skips = []; + message = message instanceof Error + ? message.message + : (message || this.message); - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; + Error.call(this, message); + Error.captureStackTrace(this, errorExError); - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; + this.name = name; - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } + Object.defineProperty(this, 'message', { + configurable: true, + enumerable: false, + get: function () { + var newMessage = message.split(/\r?\n/g); - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; + var modifier = properties[key]; - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; + if ('message' in modifier) { + newMessage = modifier.message(this[key], newMessage) || newMessage; + if (!isArrayish(newMessage)) { + newMessage = [newMessage]; + } + } + } + + return newMessage.join('\n'); + }, + set: function (v) { + message = v; } + }); - const self = debug; + var overwrittenStack = null; - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; + var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); + var stackGetter = stackDescriptor.get; + var stackValue = stackDescriptor.value; + delete stackDescriptor.value; + delete stackDescriptor.writable; - args[0] = createDebug.coerce(args[0]); + stackDescriptor.set = function (newstack) { + overwrittenStack = newstack; + }; - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } + stackDescriptor.get = function () { + var stack = (overwrittenStack || ((stackGetter) + ? stackGetter.call(this) + : stackValue)).split(/\r?\n+/g); - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return match; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); + // starting in Node 7, the stack builder caches the message. + // just replace it. + if (!overwrittenStack) { + stack[0] = this.name + ': ' + this.message; + } - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; + var lineCount = 1; + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; } - return match; - }); - - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); - - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - debug.namespace = namespace; - debug.enabled = createDebug.enabled(namespace); - debug.useColors = createDebug.useColors(); - debug.color = selectColor(namespace); - debug.destroy = destroy; - debug.extend = extend; - // Debug.formatArgs = formatArgs; - // debug.rawLog = rawLog; + var modifier = properties[key]; - // env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } + if ('line' in modifier) { + var line = modifier.line(this[key]); + if (line) { + stack.splice(lineCount++, 0, ' ' + line); + } + } - createDebug.instances.push(debug); + if ('stack' in modifier) { + modifier.stack(this[key], stack); + } + } - return debug; - } + return stack.join('\n'); + }; - function destroy() { - const index = createDebug.instances.indexOf(this); - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - return false; - } + Object.defineProperty(this, 'stack', stackDescriptor); + }; - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(errorExError.prototype, Error.prototype); + Object.setPrototypeOf(errorExError, Error); + } else { + util.inherits(errorExError, Error); } - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - - createDebug.names = []; - createDebug.skips = []; + return errorExError; +}; - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; +errorEx.append = function (str, def) { + return { + message: function (v, message) { + v = v || def; - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; + if (v) { + message[0] += ' ' + str.replace('%s', v.toString()); } - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } + return message; } + }; +}; - for (i = 0; i < createDebug.instances.length; i++) { - const instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } - } +errorEx.line = function (str, def) { + return { + line: function (v) { + v = v || def; - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } + if (v) { + return str.replace('%s', v.toString()); + } - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; + return null; } + }; +}; - let i; - let len; +module.exports = errorEx; - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } +/***/ }), - return false; - } +/***/ 65393: +/***/ ((module, exports) => { - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } +"use strict"; - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - createDebug.enable(createDebug.load()); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); - return createDebug; -} +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -module.exports = setup; +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) : subClass.__proto__ = superClass; } -/***/ }), +function _extendableBuiltin(cls) { + function ExtendableBuiltin() { + cls.apply(this, arguments); + } -/***/ 30787: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + ExtendableBuiltin.prototype = Object.create(cls.prototype, { + constructor: { + value: cls, + enumerable: false, + writable: true, + configurable: true + } + }); -/** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. - */ + if (Object.setPrototypeOf) { + Object.setPrototypeOf(ExtendableBuiltin, cls); + } else { + ExtendableBuiltin.__proto__ = cls; + } -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = __webpack_require__(12369); -} else { - module.exports = __webpack_require__(72296); + return ExtendableBuiltin; } +var ExtendableError = function (_extendableBuiltin2) { + _inherits(ExtendableError, _extendableBuiltin2); -/***/ }), + function ExtendableError() { + var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; -/***/ 72296: -/***/ ((module, exports, __webpack_require__) => { + _classCallCheck(this, ExtendableError); -/** - * Module dependencies. - */ + // extending Error is weird and does not propagate `message` + var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message)); -const tty = __webpack_require__(33867); -const util = __webpack_require__(31669); + Object.defineProperty(_this, 'message', { + configurable: true, + enumerable: false, + value: message, + writable: true + }); -/** - * This is the Node.js implementation of `debug()`. - */ + Object.defineProperty(_this, 'name', { + configurable: true, + enumerable: false, + value: _this.constructor.name, + writable: true + }); -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; + if (Error.hasOwnProperty('captureStackTrace')) { + Error.captureStackTrace(_this, _this.constructor); + return _possibleConstructorReturn(_this); + } -/** - * Colors. - */ + Object.defineProperty(_this, 'stack', { + configurable: true, + enumerable: false, + value: new Error(message).stack, + writable: true + }); + return _this; + } -exports.colors = [6, 2, 3, 4, 5, 1]; + return ExtendableError; +}(_extendableBuiltin(Error)); -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = __webpack_require__(28106); +exports.default = ExtendableError; +module.exports = exports['default']; - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } -} catch (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ +/***/ }), -exports.inspectOpts = Object.keys(process.env).filter(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); +/***/ 5813: +/***/ ((module) => { - // Coerce string value into JS value - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } +"use strict"; - obj[prop] = val; - return obj; -}, {}); -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; -function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); -} +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ + return str.replace(matchOperatorsRe, '\\$&'); +}; -function formatArgs(args) { - const {namespace: name, useColors} = this; - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; +/***/ }), - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} +/***/ 51737: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; -} +"use strict"; -/** - * Invokes `util.format()` with the specified arguments and writes to stderr. - */ +const path = __nccwpck_require__(85622); +const childProcess = __nccwpck_require__(63129); +const crossSpawn = __nccwpck_require__(23875); +const stripFinalNewline = __nccwpck_require__(50077); +const npmRunPath = __nccwpck_require__(79391); +const onetime = __nccwpck_require__(81053); +const makeError = __nccwpck_require__(35528); +const normalizeStdio = __nccwpck_require__(89816); +const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __nccwpck_require__(51134); +const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __nccwpck_require__(15156); +const {mergePromise, getSpawnedPromise} = __nccwpck_require__(31045); +const {joinCommand, parseCommand} = __nccwpck_require__(36429); -function log(...args) { - return process.stderr.write(util.format(...args) + '\n'); -} +const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; +const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { + const env = extendEnv ? {...process.env, ...envOption} : envOption; + + if (preferLocal) { + return npmRunPath.env({env, cwd: localDir, execPath}); } -} -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ + return env; +}; -function load() { - return process.env.DEBUG; -} +const handleArguments = (file, args, options = {}) => { + const parsed = crossSpawn._parse(file, args, options); + file = parsed.command; + args = parsed.args; + options = parsed.options; -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ + options = { + maxBuffer: DEFAULT_MAX_BUFFER, + buffer: true, + stripFinalNewline: true, + extendEnv: true, + preferLocal: false, + localDir: options.cwd || process.cwd(), + execPath: process.execPath, + encoding: 'utf8', + reject: true, + cleanup: true, + all: false, + windowsHide: true, + ...options + }; -function init(debug) { - debug.inspectOpts = {}; + options.env = getEnv(options); - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + options.stdio = normalizeStdio(options); + + if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') { + // #116 + args.unshift('/q'); } -} -module.exports = __webpack_require__(22507)(exports); + return {file, args, options, parsed}; +}; -const {formatters} = module.exports; +const handleOutput = (options, value, error) => { + if (typeof value !== 'string' && !Buffer.isBuffer(value)) { + // When `execa.sync()` errors, we normalize it to '' to mimic `execa()` + return error === undefined ? undefined : ''; + } -/** - * Map %o to `util.inspect()`, all on a single line. - */ + if (options.stripFinalNewline) { + return stripFinalNewline(value); + } -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .replace(/\s*\n\s*/g, ' '); + return value; }; -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ +const execa = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; + let spawned; + try { + spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); + } catch (error) { + // Ensure the returned error is always both a promise and a child process + const dummySpawned = new childProcess.ChildProcess(); + const errorPromise = Promise.reject(makeError({ + error, + stdout: '', + stderr: '', + all: '', + command, + parsed, + timedOut: false, + isCanceled: false, + killed: false + })); + return mergePromise(dummySpawned, errorPromise); + } + const spawnedPromise = getSpawnedPromise(spawned); + const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); + const processDone = setExitHandler(spawned, parsed.options, timedPromise); -/***/ }), + const context = {isCanceled: false}; -/***/ 47781: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); + spawned.cancel = spawnedCancel.bind(null, spawned, context); -"use strict"; + const handlePromise = async () => { + const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); + const stdout = handleOutput(parsed.options, stdoutResult); + const stderr = handleOutput(parsed.options, stderrResult); + const all = handleOutput(parsed.options, allResult); -const PassThrough = __webpack_require__(92413).PassThrough; -const zlib = __webpack_require__(78761); -const mimicResponse = __webpack_require__(27480); + if (error || exitCode !== 0 || signal !== null) { + const returnedError = makeError({ + error, + exitCode, + signal, + stdout, + stderr, + all, + command, + parsed, + timedOut, + isCanceled: context.isCanceled, + killed: spawned.killed + }); -module.exports = response => { - // TODO: Use Array#includes when targeting Node.js 6 - if (['gzip', 'deflate'].indexOf(response.headers['content-encoding']) === -1) { - return response; - } + if (!parsed.options.reject) { + return returnedError; + } - const unzip = zlib.createUnzip(); - const stream = new PassThrough(); + throw returnedError; + } - mimicResponse(response, stream); + return { + command, + exitCode: 0, + stdout, + stderr, + all, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; + }; - unzip.on('error', err => { - if (err.code === 'Z_BUF_ERROR') { - stream.end(); - return; - } + const handlePromiseOnce = onetime(handlePromise); - stream.emit('error', err); - }); + handleInput(spawned, parsed.options.input); - response.pipe(unzip).pipe(stream); + spawned.all = makeAllStream(spawned, parsed.options); - return stream; + return mergePromise(spawned, handlePromiseOnce); }; +module.exports = execa; -/***/ }), +module.exports.sync = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); -/***/ 36250: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + validateInputSync(parsed.options); -var clone = __webpack_require__(13405); + let result; + try { + result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); + } catch (error) { + throw makeError({ + error, + stdout: '', + stderr: '', + all: '', + command, + parsed, + timedOut: false, + isCanceled: false, + killed: false + }); + } -module.exports = function(options, defaults) { - options = options || {}; + const stdout = handleOutput(parsed.options, result.stdout, result.error); + const stderr = handleOutput(parsed.options, result.stderr, result.error); - Object.keys(defaults).forEach(function(key) { - if (typeof options[key] === 'undefined') { - options[key] = clone(defaults[key]); - } - }); + if (result.error || result.status !== 0 || result.signal !== null) { + const error = makeError({ + stdout, + stderr, + error: result.error, + signal: result.signal, + exitCode: result.status, + command, + parsed, + timedOut: result.error && result.error.code === 'ETIMEDOUT', + isCanceled: false, + killed: result.signal !== null + }); - return options; + if (!parsed.options.reject) { + return error; + } + + throw error; + } + + return { + command, + exitCode: 0, + stdout, + stderr, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; }; -/***/ }), +module.exports.command = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa(file, args, options); +}; -/***/ 12097: -/***/ ((module, exports, __webpack_require__) => { +module.exports.commandSync = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa.sync(file, args, options); +}; -"use strict"; +module.exports.node = (scriptPath, args, options = {}) => { + if (args && !Array.isArray(args) && typeof args === 'object') { + options = args; + args = []; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tls_1 = __webpack_require__(4016); -const deferToConnect = (socket, fn) => { - let listeners; - if (typeof fn === 'function') { - const connect = fn; - listeners = { connect }; - } - else { - listeners = fn; - } - const hasConnectListener = typeof listeners.connect === 'function'; - const hasSecureConnectListener = typeof listeners.secureConnect === 'function'; - const hasCloseListener = typeof listeners.close === 'function'; - const onConnect = () => { - if (hasConnectListener) { - listeners.connect(); - } - if (socket instanceof tls_1.TLSSocket && hasSecureConnectListener) { - if (socket.authorized) { - listeners.secureConnect(); - } - else if (!socket.authorizationError) { - socket.once('secureConnect', listeners.secureConnect); - } - } - if (hasCloseListener) { - socket.once('close', listeners.close); - } - }; - if (socket.writable && !socket.connecting) { - onConnect(); - } - else if (socket.connecting) { - socket.once('connect', onConnect); - } - else if (socket.destroyed && hasCloseListener) { - listeners.close(socket._hadError); - } + const stdio = normalizeStdio.node(options); + const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect')); + + const { + nodePath = process.execPath, + nodeOptions = defaultExecArgv + } = options; + + return execa( + nodePath, + [ + ...nodeOptions, + scriptPath, + ...(Array.isArray(args) ? args : []) + ], + { + ...options, + stdin: undefined, + stdout: undefined, + stderr: undefined, + stdio, + shell: false + } + ); }; -exports.default = deferToConnect; -// For CommonJS default export support -module.exports = deferToConnect; -module.exports.default = deferToConnect; /***/ }), -/***/ 47778: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 36429: +/***/ ((module) => { "use strict"; +const SPACES_REGEXP = / +/g; -var keys = __webpack_require__(28777); -var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; - -var toStr = Object.prototype.toString; -var concat = Array.prototype.concat; -var origDefineProperty = Object.defineProperty; +const joinCommand = (file, args = []) => { + if (!Array.isArray(args)) { + return file; + } -var isFunction = function (fn) { - return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; + return [file, ...args].join(' '); }; -var arePropertyDescriptorsSupported = function () { - var obj = {}; - try { - origDefineProperty(obj, 'x', { enumerable: false, value: obj }); - // eslint-disable-next-line no-unused-vars, no-restricted-syntax - for (var _ in obj) { // jscs:ignore disallowUnusedVariables - return false; +// Handle `execa.command()` +const parseCommand = command => { + const tokens = []; + for (const token of command.trim().split(SPACES_REGEXP)) { + // Allow spaces to be escaped by a backslash if not meant as a delimiter + const previousToken = tokens[tokens.length - 1]; + if (previousToken && previousToken.endsWith('\\')) { + // Merge previous token with current one + tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; + } else { + tokens.push(token); } - return obj.x === obj; - } catch (e) { /* this is IE 8. */ - return false; } -}; -var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); -var defineProperty = function (object, name, value, predicate) { - if (name in object && (!isFunction(predicate) || !predicate())) { - return; - } - if (supportsDescriptors) { - origDefineProperty(object, name, { - configurable: true, - enumerable: false, - value: value, - writable: true - }); - } else { - object[name] = value; - } + return tokens; }; -var defineProperties = function (object, map) { - var predicates = arguments.length > 2 ? arguments[2] : {}; - var props = keys(map); - if (hasSymbols) { - props = concat.call(props, Object.getOwnPropertySymbols(map)); - } - for (var i = 0; i < props.length; i += 1) { - defineProperty(object, props[i], map[props[i]], predicates[props[i]]); - } +module.exports = { + joinCommand, + parseCommand }; -defineProperties.supportsDescriptors = !!supportsDescriptors; - -module.exports = defineProperties; - /***/ }), -/***/ 3402: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 35528: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/*! - * detect-file - * - * Copyright (c) 2016-2017, Brian Woodward. - * Released under the MIT License. - */ +const {signalsByName} = __nccwpck_require__(18694); +const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { + if (timedOut) { + return `timed out after ${timeout} milliseconds`; + } -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); - -/** - * Detect the given `filepath` if it exists. - * - * ```js - * var res = detect('package.json'); - * console.log(res); - * //=> "package.json" - * - * var res = detect('fake-file.json'); - * console.log(res) - * //=> null - * ``` - * - * @param {String} `filepath` filepath to detect. - * @param {Object} `options` Additional options. - * @param {Boolean} `options.nocase` Set this to `true` to force case-insensitive filename checks. This is useful on case sensitive file systems. - * @return {String} Returns the detected filepath if it exists, otherwise returns `null`. - * @api public - */ + if (isCanceled) { + return 'was canceled'; + } -module.exports = function detect(filepath, options) { - if (!filepath || (typeof filepath !== 'string')) { - return null; - } - if (fs.existsSync(filepath)) { - return path.resolve(filepath); - } + if (errorCode !== undefined) { + return `failed with ${errorCode}`; + } - options = options || {}; - if (options.nocase === true) { - return nocase(filepath); - } - return null; -}; + if (signal !== undefined) { + return `was killed with ${signal} (${signalDescription})`; + } -/** - * Check if the filepath exists by falling back to reading in the entire directory. - * Returns the real filepath (for case sensitive file systems) if found. - * - * @param {String} `filepath` filepath to check. - * @return {String} Returns found filepath if exists, otherwise null. - */ + if (exitCode !== undefined) { + return `failed with exit code ${exitCode}`; + } -function nocase(filepath) { - filepath = path.resolve(filepath); - var res = tryReaddir(filepath); - if (res === null) { - return null; - } + return 'failed'; +}; - // "filepath" is a directory, an error would be - // thrown if it doesn't exist. if we're here, it exists - if (res.path === filepath) { - return res.path; - } +const makeError = ({ + stdout, + stderr, + all, + error, + signal, + exitCode, + command, + timedOut, + isCanceled, + killed, + parsed: {options: {timeout}} +}) => { + // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`. + // We normalize them to `undefined` + exitCode = exitCode === null ? undefined : exitCode; + signal = signal === null ? undefined : signal; + const signalDescription = signal === undefined ? undefined : signalsByName[signal].description; - // "filepath" is not a directory - // compare against upper case later - // see https://nodejs.org/en/docs/guides/working-with-different-filesystems/ - var upper = filepath.toUpperCase(); - var len = res.files.length; - var idx = -1; + const errorCode = error && error.code; - while (++idx < len) { - var fp = path.resolve(res.path, res.files[idx]); - if (filepath === fp || upper === fp) { - return fp; - } - var fpUpper = fp.toUpperCase(); - if (filepath === fpUpper || upper === fpUpper) { - return fp; - } - } + const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}); + const execaMessage = `Command ${prefix}: ${command}`; + const isError = Object.prototype.toString.call(error) === '[object Error]'; + const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage; + const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n'); - return null; -} + if (isError) { + error.originalMessage = error.message; + error.message = message; + } else { + error = new Error(message); + } -/** - * Try to read the filepath as a directory first, then fallback to the filepath's dirname. - * - * @param {String} `filepath` path of the directory to read. - * @return {Object} Object containing `path` and `files` if succesful. Otherwise, null. - */ + error.shortMessage = shortMessage; + error.command = command; + error.exitCode = exitCode; + error.signal = signal; + error.signalDescription = signalDescription; + error.stdout = stdout; + error.stderr = stderr; -function tryReaddir(filepath) { - var ctx = { path: filepath, files: [] }; - try { - ctx.files = fs.readdirSync(filepath); - return ctx; - } catch (err) {} - try { - ctx.path = path.dirname(filepath); - ctx.files = fs.readdirSync(ctx.path); - return ctx; - } catch (err) {} - return null; -} + if (all !== undefined) { + error.all = all; + } + if ('bufferedData' in error) { + delete error.bufferedData; + } -/***/ }), + error.failed = true; + error.timedOut = Boolean(timedOut); + error.isCanceled = isCanceled; + error.killed = killed && !timedOut; -/***/ 7192: -/***/ ((module) => { + return error; +}; -// Only Node.JS has a process variable that is of [[Class]] process -module.exports = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; +module.exports = makeError; /***/ }), -/***/ 71257: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 51134: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +const os = __nccwpck_require__(12087); +const onExit = __nccwpck_require__(22317); -var stream = __webpack_require__(92413); +const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; -function DuplexWrapper(options, writable, readable) { - if (typeof readable === "undefined") { - readable = writable; - writable = options; - options = null; - } +// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior +const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => { + const killResult = kill(signal); + setKillTimeout(kill, signal, options, killResult); + return killResult; +}; - stream.Duplex.call(this, options); +const setKillTimeout = (kill, signal, options, killResult) => { + if (!shouldForceKill(signal, options, killResult)) { + return; + } - if (typeof readable.read !== "function") { - readable = (new stream.Readable(options)).wrap(readable); - } + const timeout = getForceKillAfterTimeout(options); + const t = setTimeout(() => { + kill('SIGKILL'); + }, timeout); - this._writable = writable; - this._readable = readable; - this._waiting = false; - - var self = this; + // Guarded because there's no `.unref()` when `execa` is used in the renderer + // process in Electron. This cannot be tested since we don't run tests in + // Electron. + // istanbul ignore else + if (t.unref) { + t.unref(); + } +}; - writable.once("finish", function() { - self.end(); - }); +const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => { + return isSigterm(signal) && forceKillAfterTimeout !== false && killResult; +}; - this.once("finish", function() { - writable.end(); - }); +const isSigterm = signal => { + return signal === os.constants.signals.SIGTERM || + (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM'); +}; - readable.on("readable", function() { - if (self._waiting) { - self._waiting = false; - self._read(); - } - }); +const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => { + if (forceKillAfterTimeout === true) { + return DEFAULT_FORCE_KILL_TIMEOUT; + } - readable.once("end", function() { - self.push(null); - }); + if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { + throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); + } - if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) { - writable.on("error", function(err) { - self.emit("error", err); - }); + return forceKillAfterTimeout; +}; - readable.on("error", function(err) { - self.emit("error", err); - }); - } -} +// `childProcess.cancel()` +const spawnedCancel = (spawned, context) => { + const killResult = spawned.kill(); -DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}}); + if (killResult) { + context.isCanceled = true; + } +}; -DuplexWrapper.prototype._write = function _write(input, encoding, done) { - this._writable.write(input, encoding, done); +const timeoutKill = (spawned, signal, reject) => { + spawned.kill(signal); + reject(Object.assign(new Error('Timed out'), {timedOut: true, signal})); }; -DuplexWrapper.prototype._read = function _read() { - var buf; - var reads = 0; - while ((buf = this._readable.read()) !== null) { - this.push(buf); - reads++; - } - if (reads === 0) { - this._waiting = true; - } +// `timeout` option handling +const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => { + if (timeout === 0 || timeout === undefined) { + return spawnedPromise; + } + + if (!Number.isFinite(timeout) || timeout < 0) { + throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); + } + + let timeoutId; + const timeoutPromise = new Promise((resolve, reject) => { + timeoutId = setTimeout(() => { + timeoutKill(spawned, killSignal, reject); + }, timeout); + }); + + const safeSpawnedPromise = spawnedPromise.finally(() => { + clearTimeout(timeoutId); + }); + + return Promise.race([timeoutPromise, safeSpawnedPromise]); }; -module.exports = function duplex2(options, writable, readable) { - return new DuplexWrapper(options, writable, readable); +// `cleanup` option handling +const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => { + if (!cleanup || detached) { + return timedPromise; + } + + const removeExitHandler = onExit(() => { + spawned.kill(); + }); + + return timedPromise.finally(() => { + removeExitHandler(); + }); }; -module.exports.DuplexWrapper = DuplexWrapper; +module.exports = { + spawnedKill, + spawnedCancel, + setupTimeout, + setExitHandler +}; /***/ }), -/***/ 33874: +/***/ 31045: /***/ ((module) => { "use strict"; -/*! - * encodeurl - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ +const nativePromisePrototype = (async () => {})().constructor.prototype; +const descriptors = ['then', 'catch', 'finally'].map(property => [ + property, + Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) +]); -/** - * Module exports. - * @public - */ - -module.exports = encodeUrl - -/** - * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") - * and including invalid escape sequences. - * @private - */ +// The return value is a mixin of `childProcess` and `Promise` +const mergePromise = (spawned, promise) => { + for (const [property, descriptor] of descriptors) { + // Starting the main `promise` is deferred to avoid consuming streams + const value = typeof promise === 'function' ? + (...args) => Reflect.apply(descriptor.value, promise(), args) : + descriptor.value.bind(promise); -var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g + Reflect.defineProperty(spawned, property, {...descriptor, value}); + } -/** - * RegExp to match unmatched surrogate pair. - * @private - */ + return spawned; +}; -var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g +// Use promises instead of `child_process` events +const getSpawnedPromise = spawned => { + return new Promise((resolve, reject) => { + spawned.on('exit', (exitCode, signal) => { + resolve({exitCode, signal}); + }); -/** - * String to replace unmatched surrogate pair with. - * @private - */ + spawned.on('error', error => { + reject(error); + }); -var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + if (spawned.stdin) { + spawned.stdin.on('error', error => { + reject(error); + }); + } + }); +}; -/** - * Encode a URL to a percent-encoded form, excluding already-encoded sequences. - * - * This function will take an already-encoded URL and encode all the non-URL - * code points. This function will not encode the "%" character unless it is - * not part of a valid sequence (`%20` will be left as-is, but `%foo` will - * be encoded as `%25foo`). - * - * This encode is meant to be "safe" and does not throw errors. It will try as - * hard as it can to properly encode the given URL, including replacing any raw, - * unpaired surrogate pairs with the Unicode replacement character prior to - * encoding. - * - * @param {string} url - * @return {string} - * @public - */ +module.exports = { + mergePromise, + getSpawnedPromise +}; -function encodeUrl (url) { - return String(url) - .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) - .replace(ENCODE_CHARS_REGEXP, encodeURI) -} /***/ }), -/***/ 85100: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 89816: +/***/ ((module) => { "use strict"; +const aliases = ['stdin', 'stdout', 'stderr']; -var iconvLite = __webpack_require__(24959); +const hasAlias = options => aliases.some(alias => options[alias] !== undefined); -// Expose to the world -module.exports.O = convert; +const normalizeStdio = options => { + if (!options) { + return; + } -/** - * Convert encoding of an UTF-8 string or a buffer - * - * @param {String|Buffer} str String to be converted - * @param {String} to Encoding to be converted to - * @param {String} [from='UTF-8'] Encoding to be converted from - * @return {Buffer} Encoded string - */ -function convert(str, to, from) { - from = checkEncoding(from || 'UTF-8'); - to = checkEncoding(to || 'UTF-8'); - str = str || ''; + const {stdio} = options; - var result; + if (stdio === undefined) { + return aliases.map(alias => options[alias]); + } - if (from !== 'UTF-8' && typeof str === 'string') { - str = Buffer.from(str, 'binary'); - } + if (hasAlias(options)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); + } - if (from === to) { - if (typeof str === 'string') { - result = Buffer.from(str); - } else { - result = str; - } - } else { - try { - result = convertIconvLite(str, to, from); - } catch (E) { - console.error(E); - result = str; - } - } + if (typeof stdio === 'string') { + return stdio; + } - if (typeof result === 'string') { - result = Buffer.from(result, 'utf-8'); - } + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } - return result; -} + const length = Math.max(stdio.length, aliases.length); + return Array.from({length}, (value, index) => stdio[index]); +}; -/** - * Convert encoding of astring with iconv-lite - * - * @param {String|Buffer} str String to be converted - * @param {String} to Encoding to be converted to - * @param {String} [from='UTF-8'] Encoding to be converted from - * @return {Buffer} Encoded string - */ -function convertIconvLite(str, to, from) { - if (to === 'UTF-8') { - return iconvLite.decode(str, from); - } else if (from === 'UTF-8') { - return iconvLite.encode(str, to); - } else { - return iconvLite.encode(iconvLite.decode(str, from), to); - } -} +module.exports = normalizeStdio; -/** - * Converts charset name if needed - * - * @param {String} name Character set - * @return {String} Character set name - */ -function checkEncoding(name) { - return (name || '') - .toString() - .trim() - .replace(/^latin[\-_]?(\d+)$/i, 'ISO-8859-$1') - .replace(/^win(?:dows)?[\-_]?(\d+)$/i, 'WINDOWS-$1') - .replace(/^utf[\-_]?(\d+)$/i, 'UTF-$1') - .replace(/^ks_c_5601\-1987$/i, 'CP949') - .replace(/^us[\-_]?ascii$/i, 'ASCII') - .toUpperCase(); -} +// `ipc` is pushed unless it is already present +module.exports.node = options => { + const stdio = normalizeStdio(options); + + if (stdio === 'ipc') { + return 'ipc'; + } + + if (stdio === undefined || typeof stdio === 'string') { + return [stdio, stdio, stdio, 'ipc']; + } + + if (stdio.includes('ipc')) { + return stdio; + } + + return [...stdio, 'ipc']; +}; /***/ }), -/***/ 32773: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ 15156: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var Buffer = __webpack_require__(52340).Buffer; +const isStream = __nccwpck_require__(93458); +const getStream = __nccwpck_require__(14961); +const mergeStream = __nccwpck_require__(6020); -// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. -// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. -// To save memory and loading time, we read table files only when requested. +// `input` option +const handleInput = (spawned, input) => { + // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 + // TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 + if (input === undefined || spawned.stdin === undefined) { + return; + } -exports._dbcs = DBCSCodec; + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); + } +}; -var UNASSIGNED = -1, - GB18030_CODE = -2, - SEQ_START = -10, - NODE_START = -1000, - UNASSIGNED_NODE = new Array(0x100), - DEF_CHAR = -1; +// `all` interleaves `stdout` and `stderr` +const makeAllStream = (spawned, {all}) => { + if (!all || (!spawned.stdout && !spawned.stderr)) { + return; + } -for (var i = 0; i < 0x100; i++) - UNASSIGNED_NODE[i] = UNASSIGNED; + const mixed = mergeStream(); + if (spawned.stdout) { + mixed.add(spawned.stdout); + } -// Class DBCSCodec reads and initializes mapping tables. -function DBCSCodec(codecOptions, iconv) { - this.encodingName = codecOptions.encodingName; - if (!codecOptions) - throw new Error("DBCS codec is called without the data.") - if (!codecOptions.table) - throw new Error("Encoding '" + this.encodingName + "' has no data."); + if (spawned.stderr) { + mixed.add(spawned.stderr); + } - // Load tables. - var mappingTable = codecOptions.table(); + return mixed; +}; +// On failure, `result.stdout|stderr|all` should contain the currently buffered stream +const getBufferedData = async (stream, streamPromise) => { + if (!stream) { + return; + } - // Decode tables: MBCS -> Unicode. + stream.destroy(); - // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. - // Trie root is decodeTables[0]. - // Values: >= 0 -> unicode character code. can be > 0xFFFF - // == UNASSIGNED -> unknown/unassigned sequence. - // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. - // <= NODE_START -> index of the next node in our trie to process next byte. - // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. - this.decodeTables = []; - this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. + try { + return await streamPromise; + } catch (error) { + return error.bufferedData; + } +}; - // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. - this.decodeTableSeq = []; +const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => { + if (!stream || !buffer) { + return; + } - // Actual mapping tables consist of chunks. Use them to fill up decode tables. - for (var i = 0; i < mappingTable.length; i++) - this._addDecodeChunk(mappingTable[i]); + if (encoding) { + return getStream(stream, {encoding, maxBuffer}); + } - // Load & create GB18030 tables when needed. - if (typeof codecOptions.gb18030 === 'function') { - this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. + return getStream.buffer(stream, {maxBuffer}); +}; - // Add GB18030 common decode nodes. - var commonThirdByteNodeIdx = this.decodeTables.length; - this.decodeTables.push(UNASSIGNED_NODE.slice(0)); +// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) +const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => { + const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer}); + const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer}); + const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2}); - var commonFourthByteNodeIdx = this.decodeTables.length; - this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + try { + return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); + } catch (error) { + return Promise.all([ + {error, signal: error.signal, timedOut: error.timedOut}, + getBufferedData(stdout, stdoutPromise), + getBufferedData(stderr, stderrPromise), + getBufferedData(all, allPromise) + ]); + } +}; - // Fill out the tree - var firstByteNode = this.decodeTables[0]; - for (var i = 0x81; i <= 0xFE; i++) { - var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; - for (var j = 0x30; j <= 0x39; j++) { - if (secondByteNode[j] === UNASSIGNED) { - secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; - } else if (secondByteNode[j] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 2"); - } +const validateInputSync = ({input}) => { + if (isStream(input)) { + throw new TypeError('The `input` option cannot be a stream in sync mode'); + } +}; - var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; - for (var k = 0x81; k <= 0xFE; k++) { - if (thirdByteNode[k] === UNASSIGNED) { - thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; - } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { - continue; - } else if (thirdByteNode[k] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 3"); - } +module.exports = { + handleInput, + makeAllStream, + getSpawnedResult, + validateInputSync +}; - var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; - for (var l = 0x30; l <= 0x39; l++) { - if (fourthByteNode[l] === UNASSIGNED) - fourthByteNode[l] = GB18030_CODE; - } - } - } - } - } - this.defaultCharUnicode = iconv.defaultCharUnicode; - - // Encode tables: Unicode -> DBCS. +/***/ }), - // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. - // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. - // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). - // == UNASSIGNED -> no conversion found. Output a default char. - // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. - this.encodeTable = []; - - // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of - // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key - // means end of sequence (needed when one sequence is a strict subsequence of another). - // Objects are kept separately from encodeTable to increase performance. - this.encodeTableSeq = []; +/***/ 10828: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Some chars can be decoded, but need not be encoded. - var skipEncodeChars = {}; - if (codecOptions.encodeSkipVals) - for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { - var val = codecOptions.encodeSkipVals[i]; - if (typeof val === 'number') - skipEncodeChars[val] = true; - else - for (var j = val.from; j <= val.to; j++) - skipEncodeChars[j] = true; - } - - // Use decode trie to recursively fill out encode tables. - this._fillEncodeTable(0, 0, skipEncodeChars); +"use strict"; - // Add more encoding pairs when needed. - if (codecOptions.encodeAdd) { - for (var uChar in codecOptions.encodeAdd) - if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) - this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); - } +const {PassThrough: PassThroughStream} = __nccwpck_require__(92413); - this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; - if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; - if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); -} +module.exports = options => { + options = {...options}; -DBCSCodec.prototype.encoder = DBCSEncoder; -DBCSCodec.prototype.decoder = DBCSDecoder; + const {array} = options; + let {encoding} = options; + const isBuffer = encoding === 'buffer'; + let objectMode = false; -// Decoder helpers -DBCSCodec.prototype._getDecodeTrieNode = function(addr) { - var bytes = []; - for (; addr > 0; addr >>>= 8) - bytes.push(addr & 0xFF); - if (bytes.length == 0) - bytes.push(0); + if (array) { + objectMode = !(encoding || isBuffer); + } else { + encoding = encoding || 'utf8'; + } - var node = this.decodeTables[0]; - for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. - var val = node[bytes[i]]; + if (isBuffer) { + encoding = null; + } - if (val == UNASSIGNED) { // Create new node. - node[bytes[i]] = NODE_START - this.decodeTables.length; - this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); - } - else if (val <= NODE_START) { // Existing node. - node = this.decodeTables[NODE_START - val]; - } - else - throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); - } - return node; -} + const stream = new PassThroughStream({objectMode}); + if (encoding) { + stream.setEncoding(encoding); + } -DBCSCodec.prototype._addDecodeChunk = function(chunk) { - // First element of chunk is the hex mbcs code where we start. - var curAddr = parseInt(chunk[0], 16); + let length = 0; + const chunks = []; - // Choose the decoding node where we'll write our chars. - var writeTable = this._getDecodeTrieNode(curAddr); - curAddr = curAddr & 0xFF; + stream.on('data', chunk => { + chunks.push(chunk); - // Write all other elements of the chunk to the table. - for (var k = 1; k < chunk.length; k++) { - var part = chunk[k]; - if (typeof part === "string") { // String, write as-is. - for (var l = 0; l < part.length;) { - var code = part.charCodeAt(l++); - if (0xD800 <= code && code < 0xDC00) { // Decode surrogate - var codeTrail = part.charCodeAt(l++); - if (0xDC00 <= codeTrail && codeTrail < 0xE000) - writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); - else - throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); - } - else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) - var len = 0xFFF - code + 2; - var seq = []; - for (var m = 0; m < len; m++) - seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); - writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; - this.decodeTableSeq.push(seq); - } - else - writeTable[curAddr++] = code; // Basic char - } - } - else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. - var charCode = writeTable[curAddr - 1] + 1; - for (var l = 0; l < part; l++) - writeTable[curAddr++] = charCode++; - } - else - throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); - } - if (curAddr > 0xFF) - throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); -} + stream.getBufferedValue = () => { + if (array) { + return chunks; + } -// Encoder helpers -DBCSCodec.prototype._getEncodeBucket = function(uCode) { - var high = uCode >> 8; // This could be > 0xFF because of astral characters. - if (this.encodeTable[high] === undefined) - this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. - return this.encodeTable[high]; -} + return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); + }; -DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { - var bucket = this._getEncodeBucket(uCode); - var low = uCode & 0xFF; - if (bucket[low] <= SEQ_START) - this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. - else if (bucket[low] == UNASSIGNED) - bucket[low] = dbcsCode; -} + stream.getBufferedLength = () => length; -DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { - - // Get the root of character tree according to first character of the sequence. - var uCode = seq[0]; - var bucket = this._getEncodeBucket(uCode); - var low = uCode & 0xFF; + return stream; +}; - var node; - if (bucket[low] <= SEQ_START) { - // There's already a sequence with - use it. - node = this.encodeTableSeq[SEQ_START-bucket[low]]; - } - else { - // There was no sequence object - allocate a new one. - node = {}; - if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. - bucket[low] = SEQ_START - this.encodeTableSeq.length; - this.encodeTableSeq.push(node); - } - // Traverse the character tree, allocating new nodes as needed. - for (var j = 1; j < seq.length-1; j++) { - var oldVal = node[uCode]; - if (typeof oldVal === 'object') - node = oldVal; - else { - node = node[uCode] = {} - if (oldVal !== undefined) - node[DEF_CHAR] = oldVal - } - } +/***/ }), - // Set the leaf to given dbcsCode. - uCode = seq[seq.length-1]; - node[uCode] = dbcsCode; -} +/***/ 14961: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { - var node = this.decodeTables[nodeIdx]; - var hasValues = false; - var subNodeEmpty = {}; - for (var i = 0; i < 0x100; i++) { - var uCode = node[i]; - var mbCode = prefix + i; - if (skipEncodeChars[mbCode]) - continue; +"use strict"; - if (uCode >= 0) { - this._setEncodeChar(uCode, mbCode); - hasValues = true; - } else if (uCode <= NODE_START) { - var subNodeIdx = NODE_START - uCode; - if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). - var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. - if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) - hasValues = true; - else - subNodeEmpty[subNodeIdx] = true; - } - } else if (uCode <= SEQ_START) { - this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); - hasValues = true; - } - } - return hasValues; +const {constants: BufferConstants} = __nccwpck_require__(64293); +const stream = __nccwpck_require__(92413); +const {promisify} = __nccwpck_require__(31669); +const bufferStream = __nccwpck_require__(10828); + +const streamPipelinePromisified = promisify(stream.pipeline); + +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } } +async function getStream(inputStream, options) { + if (!inputStream) { + throw new Error('Expected a stream'); + } + options = { + maxBuffer: Infinity, + ...options + }; -// == Encoder ================================================================== + const {maxBuffer} = options; + const stream = bufferStream(options); -function DBCSEncoder(options, codec) { - // Encoder state - this.leadSurrogate = -1; - this.seqObj = undefined; - - // Static data - this.encodeTable = codec.encodeTable; - this.encodeTableSeq = codec.encodeTableSeq; - this.defaultCharSingleByte = codec.defCharSB; - this.gb18030 = codec.gb18030; + await new Promise((resolve, reject) => { + const rejectPromise = error => { + // Don't retrieve an oversized buffer. + if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { + error.bufferedData = stream.getBufferedValue(); + } + + reject(error); + }; + + (async () => { + try { + await streamPipelinePromisified(inputStream, stream); + resolve(); + } catch (error) { + rejectPromise(error); + } + })(); + + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); + + return stream.getBufferedValue(); } -DBCSEncoder.prototype.write = function(str) { - var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), - leadSurrogate = this.leadSurrogate, - seqObj = this.seqObj, nextChar = -1, - i = 0, j = 0; +module.exports = getStream; +module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); +module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); +module.exports.MaxBufferError = MaxBufferError; - while (true) { - // 0. Get next character. - if (nextChar === -1) { - if (i == str.length) break; - var uCode = str.charCodeAt(i++); - } - else { - var uCode = nextChar; - nextChar = -1; - } - // 1. Handle surrogates. - if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. - if (uCode < 0xDC00) { // We've got lead surrogate. - if (leadSurrogate === -1) { - leadSurrogate = uCode; - continue; - } else { - leadSurrogate = uCode; - // Double lead surrogate found. - uCode = UNASSIGNED; - } - } else { // We've got trail surrogate. - if (leadSurrogate !== -1) { - uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); - leadSurrogate = -1; - } else { - // Incomplete surrogate pair - only trail surrogate found. - uCode = UNASSIGNED; - } - - } - } - else if (leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. - leadSurrogate = -1; - } +/***/ }), - // 2. Convert uCode character. - var dbcsCode = UNASSIGNED; - if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence - var resCode = seqObj[uCode]; - if (typeof resCode === 'object') { // Sequence continues. - seqObj = resCode; - continue; +/***/ 2933: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - } else if (typeof resCode == 'number') { // Sequence finished. Write it. - dbcsCode = resCode; +const debug = __nccwpck_require__(30787)('extract-zip') +// eslint-disable-next-line node/no-unsupported-features/node-builtins +const { createWriteStream, promises: fs } = __nccwpck_require__(35747) +const getStream = __nccwpck_require__(63886) +const path = __nccwpck_require__(85622) +const { promisify } = __nccwpck_require__(31669) +const stream = __nccwpck_require__(92413) +const yauzl = __nccwpck_require__(8245) - } else if (resCode == undefined) { // Current character is not part of the sequence. +const openZip = promisify(yauzl.open) +const pipeline = promisify(stream.pipeline) - // Try default character for this sequence - resCode = seqObj[DEF_CHAR]; - if (resCode !== undefined) { - dbcsCode = resCode; // Found. Write it. - nextChar = uCode; // Current character will be written too in the next iteration. +class Extractor { + constructor (zipPath, opts) { + this.zipPath = zipPath + this.opts = opts + } - } else { - // TODO: What if we have no default? (resCode == undefined) - // Then, we should write first char of the sequence as-is and try the rest recursively. - // Didn't do it for now because no encoding has this situation yet. - // Currently, just skip the sequence and write current char. - } - } - seqObj = undefined; - } - else if (uCode >= 0) { // Regular character - var subtable = this.encodeTable[uCode >> 8]; - if (subtable !== undefined) - dbcsCode = subtable[uCode & 0xFF]; - - if (dbcsCode <= SEQ_START) { // Sequence start - seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; - continue; - } + async extract () { + debug('opening', this.zipPath, 'with opts', this.opts) - if (dbcsCode == UNASSIGNED && this.gb18030) { - // Use GB18030 algorithm to find character(s) to write. - var idx = findIdx(this.gb18030.uChars, uCode); - if (idx != -1) { - var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; - newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; - newBuf[j++] = 0x30 + dbcsCode; - continue; - } - } - } + this.zipfile = await openZip(this.zipPath, { lazyEntries: true }) + this.canceled = false - // 3. Write dbcsCode character. - if (dbcsCode === UNASSIGNED) - dbcsCode = this.defaultCharSingleByte; - - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode; + return new Promise((resolve, reject) => { + this.zipfile.on('error', err => { + this.canceled = true + reject(err) + }) + this.zipfile.readEntry() + + this.zipfile.on('close', () => { + if (!this.canceled) { + debug('zip extraction complete') + resolve() } - else if (dbcsCode < 0x10000) { - newBuf[j++] = dbcsCode >> 8; // high byte - newBuf[j++] = dbcsCode & 0xFF; // low byte + }) + + this.zipfile.on('entry', async entry => { + /* istanbul ignore if */ + if (this.canceled) { + debug('skipping entry', entry.fileName, { cancelled: this.canceled }) + return } - else if (dbcsCode < 0x1000000) { - newBuf[j++] = dbcsCode >> 16; - newBuf[j++] = (dbcsCode >> 8) & 0xFF; - newBuf[j++] = dbcsCode & 0xFF; - } else { - newBuf[j++] = dbcsCode >>> 24; - newBuf[j++] = (dbcsCode >>> 16) & 0xFF; - newBuf[j++] = (dbcsCode >>> 8) & 0xFF; - newBuf[j++] = dbcsCode & 0xFF; + + debug('zipfile entry', entry.fileName) + + if (entry.fileName.startsWith('__MACOSX/')) { + this.zipfile.readEntry() + return } - } - this.seqObj = seqObj; - this.leadSurrogate = leadSurrogate; - return newBuf.slice(0, j); -} + const destDir = path.dirname(path.join(this.opts.dir, entry.fileName)) -DBCSEncoder.prototype.end = function() { - if (this.leadSurrogate === -1 && this.seqObj === undefined) - return; // All clean. Most often case. + try { + await fs.mkdir(destDir, { recursive: true }) - var newBuf = Buffer.alloc(10), j = 0; + const canonicalDestDir = await fs.realpath(destDir) + const relativeDestDir = path.relative(this.opts.dir, canonicalDestDir) - if (this.seqObj) { // We're in the sequence. - var dbcsCode = this.seqObj[DEF_CHAR]; - if (dbcsCode !== undefined) { // Write beginning of the sequence. - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode; - } - else { - newBuf[j++] = dbcsCode >> 8; // high byte - newBuf[j++] = dbcsCode & 0xFF; // low byte - } - } else { - // See todo above. + if (relativeDestDir.split(path.sep).includes('..')) { + throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`) + } + + await this.extractEntry(entry) + debug('finished processing', entry.fileName) + this.zipfile.readEntry() + } catch (err) { + this.canceled = true + this.zipfile.close() + reject(err) } - this.seqObj = undefined; + }) + }) + } + + async extractEntry (entry) { + /* istanbul ignore if */ + if (this.canceled) { + debug('skipping entry extraction', entry.fileName, { cancelled: this.canceled }) + return } - if (this.leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - newBuf[j++] = this.defaultCharSingleByte; - this.leadSurrogate = -1; + if (this.opts.onEntry) { + this.opts.onEntry(entry, this.zipfile) } - - return newBuf.slice(0, j); -} -// Export for testing -DBCSEncoder.prototype.findIdx = findIdx; + const dest = path.join(this.opts.dir, entry.fileName) + // convert external file attr int into a fs stat mode int + const mode = (entry.externalFileAttributes >> 16) & 0xFFFF + // check if it's a symlink or dir (using stat mode constants) + const IFMT = 61440 + const IFDIR = 16384 + const IFLNK = 40960 + const symlink = (mode & IFMT) === IFLNK + let isDir = (mode & IFMT) === IFDIR -// == Decoder ================================================================== + // Failsafe, borrowed from jsZip + if (!isDir && entry.fileName.endsWith('/')) { + isDir = true + } -function DBCSDecoder(options, codec) { - // Decoder state - this.nodeIdx = 0; - this.prevBytes = []; + // check for windows weird way of specifying a directory + // https://github.com/maxogden/extract-zip/issues/13#issuecomment-154494566 + const madeBy = entry.versionMadeBy >> 8 + if (!isDir) isDir = (madeBy === 0 && entry.externalFileAttributes === 16) - // Static data - this.decodeTables = codec.decodeTables; - this.decodeTableSeq = codec.decodeTableSeq; - this.defaultCharUnicode = codec.defaultCharUnicode; - this.gb18030 = codec.gb18030; -} + debug('extracting entry', { filename: entry.fileName, isDir: isDir, isSymlink: symlink }) -DBCSDecoder.prototype.write = function(buf) { - var newBuf = Buffer.alloc(buf.length*2), - nodeIdx = this.nodeIdx, - prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, - seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. - uCode; + const procMode = this.getExtractedMode(mode, isDir) & 0o777 - for (var i = 0, j = 0; i < buf.length; i++) { - var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; + // always ensure folders are created + const destDir = isDir ? dest : path.dirname(dest) - // Lookup in current trie node. - var uCode = this.decodeTables[nodeIdx][curByte]; + const mkdirOptions = { recursive: true } + if (isDir) { + mkdirOptions.mode = procMode + } + debug('mkdir', { dir: destDir, ...mkdirOptions }) + await fs.mkdir(destDir, mkdirOptions) + if (isDir) return - if (uCode >= 0) { - // Normal character, just use it. - } - else if (uCode === UNASSIGNED) { // Unknown char. - // TODO: Callback with seq. - uCode = this.defaultCharUnicode.charCodeAt(0); - i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. + debug('opening read stream', dest) + const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry) + + if (symlink) { + const link = await getStream(readStream) + debug('creating symlink', link, dest) + await fs.symlink(link, dest) + } else { + await pipeline(readStream, createWriteStream(dest, { mode: procMode })) + } + } + + getExtractedMode (entryMode, isDir) { + let mode = entryMode + // Set defaults, if necessary + if (mode === 0) { + if (isDir) { + if (this.opts.defaultDirMode) { + mode = parseInt(this.opts.defaultDirMode, 10) } - else if (uCode === GB18030_CODE) { - if (i >= 3) { - var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); - } else { - var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + - (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + - (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + - (curByte-0x30); - } - var idx = findIdx(this.gb18030.gbChars, ptr); - uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; + + if (!mode) { + mode = 0o755 } - else if (uCode <= NODE_START) { // Go to next trie node. - nodeIdx = NODE_START - uCode; - continue; - } - else if (uCode <= SEQ_START) { // Output a sequence of chars. - var seq = this.decodeTableSeq[SEQ_START - uCode]; - for (var k = 0; k < seq.length - 1; k++) { - uCode = seq[k]; - newBuf[j++] = uCode & 0xFF; - newBuf[j++] = uCode >> 8; - } - uCode = seq[seq.length-1]; + } else { + if (this.opts.defaultFileMode) { + mode = parseInt(this.opts.defaultFileMode, 10) } - else - throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); - // Write the character to buffer, handling higher planes using surrogate pair. - if (uCode >= 0x10000) { - uCode -= 0x10000; - var uCodeLead = 0xD800 | (uCode >> 10); - newBuf[j++] = uCodeLead & 0xFF; - newBuf[j++] = uCodeLead >> 8; - - uCode = 0xDC00 | (uCode & 0x3FF); + if (!mode) { + mode = 0o644 } - newBuf[j++] = uCode & 0xFF; - newBuf[j++] = uCode >> 8; - - // Reset trie node. - nodeIdx = 0; seqStart = i+1; + } } - this.nodeIdx = nodeIdx; - this.prevBytes = (seqStart >= 0) - ? Array.prototype.slice.call(buf, seqStart) - : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); + return mode + } +} - return newBuf.slice(0, j).toString('ucs2'); +module.exports = async function (zipPath, opts) { + debug('creating target directory', opts.dir) + + if (!path.isAbsolute(opts.dir)) { + throw new Error('Target directory is expected to be absolute') + } + + await fs.mkdir(opts.dir, { recursive: true }) + opts.dir = await fs.realpath(opts.dir) + return new Extractor(zipPath, opts).extract() } -DBCSDecoder.prototype.end = function() { - var ret = ''; - // Try to parse all remaining chars. - while (this.prevBytes.length > 0) { - // Skip 1 character in the buffer. - ret += this.defaultCharUnicode; - var bytesArr = this.prevBytes.slice(1); +/***/ }), - // Parse remaining as usual. - this.prevBytes = []; - this.nodeIdx = 0; - if (bytesArr.length > 0) - ret += this.write(bytesArr); - } +/***/ 92104: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - this.prevBytes = []; - this.nodeIdx = 0; - return ret; -} +var fs = __nccwpck_require__(35747); +var util = __nccwpck_require__(31669); +var stream = __nccwpck_require__(92413); +var Readable = stream.Readable; +var Writable = stream.Writable; +var PassThrough = stream.PassThrough; +var Pend = __nccwpck_require__(71932); +var EventEmitter = __nccwpck_require__(28614).EventEmitter; -// Binary search for GB18030. Returns largest i such that table[i] <= val. -function findIdx(table, val) { - if (table[0] > val) - return -1; +exports.createFromBuffer = createFromBuffer; +exports.createFromFd = createFromFd; +exports.BufferSlicer = BufferSlicer; +exports.FdSlicer = FdSlicer; - var l = 0, r = table.length; - while (l < r-1) { // always table[l] <= val < table[r] - var mid = l + ((r-l+1) >> 1); - if (table[mid] <= val) - l = mid; - else - r = mid; - } - return l; +util.inherits(FdSlicer, EventEmitter); +function FdSlicer(fd, options) { + options = options || {}; + EventEmitter.call(this); + + this.fd = fd; + this.pend = new Pend(); + this.pend.max = 1; + this.refCount = 0; + this.autoClose = !!options.autoClose; } +FdSlicer.prototype.read = function(buffer, offset, length, position, callback) { + var self = this; + self.pend.go(function(cb) { + fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) { + cb(); + callback(err, bytesRead, buffer); + }); + }); +}; +FdSlicer.prototype.write = function(buffer, offset, length, position, callback) { + var self = this; + self.pend.go(function(cb) { + fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) { + cb(); + callback(err, written, buffer); + }); + }); +}; -/***/ }), +FdSlicer.prototype.createReadStream = function(options) { + return new ReadStream(this, options); +}; -/***/ 62241: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +FdSlicer.prototype.createWriteStream = function(options) { + return new WriteStream(this, options); +}; -"use strict"; +FdSlicer.prototype.ref = function() { + this.refCount += 1; +}; +FdSlicer.prototype.unref = function() { + var self = this; + self.refCount -= 1; -// Description of supported double byte encodings and aliases. -// Tables are not require()-d until they are needed to speed up library load. -// require()-s are direct to support Browserify. + if (self.refCount > 0) return; + if (self.refCount < 0) throw new Error("invalid unref"); -module.exports = { - - // == Japanese/ShiftJIS ==================================================== - // All japanese encodings are based on JIS X set of standards: - // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. - // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. - // Has several variations in 1978, 1983, 1990 and 1997. - // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. - // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. - // 2 planes, first is superset of 0208, second - revised 0212. - // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + if (self.autoClose) { + fs.close(self.fd, onCloseDone); + } - // Byte encodings are: - // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte - // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. - // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. - // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. - // 0x00-0x7F - lower part of 0201 - // 0x8E, 0xA1-0xDF - upper part of 0201 - // (0xA1-0xFE)x2 - 0208 plane (94x94). - // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). - // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. - // Used as-is in ISO2022 family. - // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, - // 0201-1976 Roman, 0208-1978, 0208-1983. - // * ISO2022-JP-1: Adds esc seq for 0212-1990. - // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. - // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. - // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. - // - // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. - // - // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html + function onCloseDone(err) { + if (err) { + self.emit('error', err); + } else { + self.emit('close'); + } + } +}; - 'shiftjis': { - type: '_dbcs', - table: function() { return __webpack_require__(24438) }, - encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, - encodeSkipVals: [{from: 0xED40, to: 0xF940}], - }, - 'csshiftjis': 'shiftjis', - 'mskanji': 'shiftjis', - 'sjis': 'shiftjis', - 'windows31j': 'shiftjis', - 'ms31j': 'shiftjis', - 'xsjis': 'shiftjis', - 'windows932': 'shiftjis', - 'ms932': 'shiftjis', - '932': 'shiftjis', - 'cp932': 'shiftjis', +util.inherits(ReadStream, Readable); +function ReadStream(context, options) { + options = options || {}; + Readable.call(this, options); - 'eucjp': { - type: '_dbcs', - table: function() { return __webpack_require__(34674) }, - encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, - }, + this.context = context; + this.context.ref(); - // TODO: KDDI extension to Shift_JIS - // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. - // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. + this.start = options.start || 0; + this.endOffset = options.end; + this.pos = this.start; + this.destroyed = false; +} +ReadStream.prototype._read = function(n) { + var self = this; + if (self.destroyed) return; - // == Chinese/GBK ========================================================== - // http://en.wikipedia.org/wiki/GBK - // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder + var toRead = Math.min(self._readableState.highWaterMark, n); + if (self.endOffset != null) { + toRead = Math.min(toRead, self.endOffset - self.pos); + } + if (toRead <= 0) { + self.destroyed = true; + self.push(null); + self.context.unref(); + return; + } + self.context.pend.go(function(cb) { + if (self.destroyed) return cb(); + var buffer = new Buffer(toRead); + fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) { + if (err) { + self.destroy(err); + } else if (bytesRead === 0) { + self.destroyed = true; + self.push(null); + self.context.unref(); + } else { + self.pos += bytesRead; + self.push(buffer.slice(0, bytesRead)); + } + cb(); + }); + }); +}; - // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 - 'gb2312': 'cp936', - 'gb231280': 'cp936', - 'gb23121980': 'cp936', - 'csgb2312': 'cp936', - 'csiso58gb231280': 'cp936', - 'euccn': 'cp936', +ReadStream.prototype.destroy = function(err) { + if (this.destroyed) return; + err = err || new Error("stream destroyed"); + this.destroyed = true; + this.emit('error', err); + this.context.unref(); +}; - // Microsoft's CP936 is a subset and approximation of GBK. - 'windows936': 'cp936', - 'ms936': 'cp936', - '936': 'cp936', - 'cp936': { - type: '_dbcs', - table: function() { return __webpack_require__(13768) }, - }, +util.inherits(WriteStream, Writable); +function WriteStream(context, options) { + options = options || {}; + Writable.call(this, options); - // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. - 'gbk': { - type: '_dbcs', - table: function() { return __webpack_require__(13768).concat(__webpack_require__(19416)) }, - }, - 'xgbk': 'gbk', - 'isoir58': 'gbk', + this.context = context; + this.context.ref(); - // GB18030 is an algorithmic extension of GBK. - // Main source: https://www.w3.org/TR/encoding/#gbk-encoder - // http://icu-project.org/docs/papers/gb18030.html - // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml - // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 - 'gb18030': { - type: '_dbcs', - table: function() { return __webpack_require__(13768).concat(__webpack_require__(19416)) }, - gb18030: function() { return __webpack_require__(80139) }, - encodeSkipVals: [0x80], - encodeAdd: {'€': 0xA2E3}, - }, + this.start = options.start || 0; + this.endOffset = (options.end == null) ? Infinity : +options.end; + this.bytesWritten = 0; + this.pos = this.start; + this.destroyed = false; - 'chinese': 'gb18030', + this.on('finish', this.destroy.bind(this)); +} +WriteStream.prototype._write = function(buffer, encoding, callback) { + var self = this; + if (self.destroyed) return; - // == Korean =============================================================== - // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. - 'windows949': 'cp949', - 'ms949': 'cp949', - '949': 'cp949', - 'cp949': { - type: '_dbcs', - table: function() { return __webpack_require__(67726) }, - }, + if (self.pos + buffer.length > self.endOffset) { + var err = new Error("maximum file length exceeded"); + err.code = 'ETOOBIG'; + self.destroy(); + callback(err); + return; + } + self.context.pend.go(function(cb) { + if (self.destroyed) return cb(); + fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) { + if (err) { + self.destroy(); + cb(); + callback(err); + } else { + self.bytesWritten += bytes; + self.pos += bytes; + self.emit('progress'); + cb(); + callback(); + } + }); + }); +}; - 'cseuckr': 'cp949', - 'csksc56011987': 'cp949', - 'euckr': 'cp949', - 'isoir149': 'cp949', - 'korean': 'cp949', - 'ksc56011987': 'cp949', - 'ksc56011989': 'cp949', - 'ksc5601': 'cp949', +WriteStream.prototype.destroy = function() { + if (this.destroyed) return; + this.destroyed = true; + this.context.unref(); +}; +util.inherits(BufferSlicer, EventEmitter); +function BufferSlicer(buffer, options) { + EventEmitter.call(this); - // == Big5/Taiwan/Hong Kong ================================================ - // There are lots of tables for Big5 and cp950. Please see the following links for history: - // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html - // Variations, in roughly number of defined chars: - // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT - // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ - // * Big5-2003 (Taiwan standard) almost superset of cp950. - // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. - // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. - // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. - // Plus, it has 4 combining sequences. - // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 - // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. - // Implementations are not consistent within browsers; sometimes labeled as just big5. - // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. - // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 - // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. - // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt - // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt - // - // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder - // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + options = options || {}; + this.refCount = 0; + this.buffer = buffer; + this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER; +} - 'windows950': 'cp950', - 'ms950': 'cp950', - '950': 'cp950', - 'cp950': { - type: '_dbcs', - table: function() { return __webpack_require__(47428) }, - }, +BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) { + var end = position + length; + var delta = end - this.buffer.length; + var written = (delta > 0) ? delta : length; + this.buffer.copy(buffer, offset, position, end); + setImmediate(function() { + callback(null, written); + }); +}; - // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. - 'big5': 'big5hkscs', - 'big5hkscs': { - type: '_dbcs', - table: function() { return __webpack_require__(47428).concat(__webpack_require__(50354)) }, - encodeSkipVals: [0xa2cc], - }, +BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) { + buffer.copy(this.buffer, position, offset, offset + length); + setImmediate(function() { + callback(null, length, buffer); + }); +}; - 'cnbig5': 'big5hkscs', - 'csbig5': 'big5hkscs', - 'xxbig5': 'big5hkscs', +BufferSlicer.prototype.createReadStream = function(options) { + options = options || {}; + var readStream = new PassThrough(options); + readStream.destroyed = false; + readStream.start = options.start || 0; + readStream.endOffset = options.end; + // by the time this function returns, we'll be done. + readStream.pos = readStream.endOffset || this.buffer.length; + + // respect the maxChunkSize option to slice up the chunk into smaller pieces. + var entireSlice = this.buffer.slice(readStream.start, readStream.pos); + var offset = 0; + while (true) { + var nextOffset = offset + this.maxChunkSize; + if (nextOffset >= entireSlice.length) { + // last chunk + if (offset < entireSlice.length) { + readStream.write(entireSlice.slice(offset, entireSlice.length)); + } + break; + } + readStream.write(entireSlice.slice(offset, nextOffset)); + offset = nextOffset; + } + + readStream.end(); + readStream.destroy = function() { + readStream.destroyed = true; + }; + return readStream; }; +BufferSlicer.prototype.createWriteStream = function(options) { + var bufferSlicer = this; + options = options || {}; + var writeStream = new Writable(options); + writeStream.start = options.start || 0; + writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end; + writeStream.bytesWritten = 0; + writeStream.pos = writeStream.start; + writeStream.destroyed = false; + writeStream._write = function(buffer, encoding, callback) { + if (writeStream.destroyed) return; -/***/ }), + var end = writeStream.pos + buffer.length; + if (end > writeStream.endOffset) { + var err = new Error("maximum file length exceeded"); + err.code = 'ETOOBIG'; + writeStream.destroyed = true; + callback(err); + return; + } + buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length); -/***/ 15761: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + writeStream.bytesWritten += buffer.length; + writeStream.pos = end; + writeStream.emit('progress'); + callback(); + }; + writeStream.destroy = function() { + writeStream.destroyed = true; + }; + return writeStream; +}; -"use strict"; +BufferSlicer.prototype.ref = function() { + this.refCount += 1; +}; +BufferSlicer.prototype.unref = function() { + this.refCount -= 1; -// Update this array if you add/rename/remove files in this directory. -// We support Browserify by skipping automatic module discovery and requiring modules directly. -var modules = [ - __webpack_require__(64644), - __webpack_require__(66042), - __webpack_require__(56918), - __webpack_require__(43769), - __webpack_require__(95379), - __webpack_require__(80002), - __webpack_require__(92746), - __webpack_require__(32773), - __webpack_require__(62241), -]; + if (this.refCount < 0) { + throw new Error("invalid unref"); + } +}; -// Put all encoding/alias/codec definitions to single object and export it. -for (var i = 0; i < modules.length; i++) { - var module = modules[i]; - for (var enc in module) - if (Object.prototype.hasOwnProperty.call(module, enc)) - exports[enc] = module[enc]; +function createFromBuffer(buffer, options) { + return new BufferSlicer(buffer, options); +} + +function createFromFd(fd, options) { + return new FdSlicer(fd, options); } /***/ }), -/***/ 64644: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 66521: +/***/ ((module) => { "use strict"; -var Buffer = __webpack_require__(52340).Buffer; +/* eslint-disable no-control-regex */ +// TODO: remove parens when Node.js 6 is targeted. Node.js 4 barfs at it. +module.exports = () => (/[<>:"\/\\|?*\x00-\x1F]/g); +module.exports.windowsNames = () => (/^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i); -// Export Node.js internal encodings. -module.exports = { - // Encodings - utf8: { type: "_internal", bomAware: true}, - cesu8: { type: "_internal", bomAware: true}, - unicode11utf8: "utf8", +/***/ }), - ucs2: { type: "_internal", bomAware: true}, - utf16le: "ucs2", +/***/ 47915: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - binary: { type: "_internal" }, - base64: { type: "_internal" }, - hex: { type: "_internal" }, +"use strict"; - // Codec. - _internal: InternalCodec, +const path = __nccwpck_require__(85622); +const filenamify = __nccwpck_require__(91631); + +const filenamifyPath = (filePath, options) => { + filePath = path.resolve(filePath); + return path.join(path.dirname(filePath), filenamify(path.basename(filePath), options)); }; -//------------------------------------------------------------------------------ +module.exports = filenamifyPath; -function InternalCodec(codecOptions, iconv) { - this.enc = codecOptions.encodingName; - this.bomAware = codecOptions.bomAware; - if (this.enc === "base64") - this.encoder = InternalEncoderBase64; - else if (this.enc === "cesu8") { - this.enc = "utf8"; // Use utf8 for decoding. - this.encoder = InternalEncoderCesu8; +/***/ }), - // Add decoder for versions of Node not supporting CESU-8 - if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { - this.decoder = InternalDecoderCesu8; - this.defaultCharUnicode = iconv.defaultCharUnicode; - } - } -} +/***/ 91631: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -InternalCodec.prototype.encoder = InternalEncoder; -InternalCodec.prototype.decoder = InternalDecoder; +"use strict"; -//------------------------------------------------------------------------------ +const trimRepeated = __nccwpck_require__(33533); +const filenameReservedRegex = __nccwpck_require__(66521); +const stripOuter = __nccwpck_require__(77901); -// We use node.js internal decoder. Its signature is the same as ours. -var StringDecoder = __webpack_require__(24304).StringDecoder; +// Doesn't make sense to have longer filenames +const MAX_FILENAME_LENGTH = 100; -if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. - StringDecoder.prototype.end = function() {}; +const reControlChars = /[\u0000-\u001f\u0080-\u009f]/g; // eslint-disable-line no-control-regex +const reRelativePath = /^\.+/; +const filenamify = (string, options = {}) => { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } -function InternalDecoder(options, codec) { - this.decoder = new StringDecoder(codec.enc); -} + const replacement = options.replacement === undefined ? '!' : options.replacement; -InternalDecoder.prototype.write = function(buf) { - if (!Buffer.isBuffer(buf)) { - buf = Buffer.from(buf); - } + if (filenameReservedRegex().test(replacement) && reControlChars.test(replacement)) { + throw new Error('Replacement string cannot contain reserved filename characters'); + } - return this.decoder.write(buf); -} + string = string.replace(filenameReservedRegex(), replacement); + string = string.replace(reControlChars, replacement); + string = string.replace(reRelativePath, replacement); -InternalDecoder.prototype.end = function() { - return this.decoder.end(); -} + if (replacement.length > 0) { + string = trimRepeated(string, replacement); + string = string.length > 1 ? stripOuter(string, replacement) : string; + } + string = filenameReservedRegex.windowsNames().test(string) ? string + replacement : string; + string = string.slice(0, typeof options.maxLength === 'number' ? options.maxLength : MAX_FILENAME_LENGTH); -//------------------------------------------------------------------------------ -// Encoder is mostly trivial + return string; +}; -function InternalEncoder(options, codec) { - this.enc = codec.enc; +module.exports = filenamify; + + +/***/ }), + +/***/ 25686: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const filenamify = __nccwpck_require__(91631); +const filenamifyPath = __nccwpck_require__(47915); + +const filenamifyCombined = filenamify; +filenamifyCombined.path = filenamifyPath; + +module.exports = filenamify; + + +/***/ }), + +/***/ 2885: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const path = __nccwpck_require__(85622); +const locatePath = __nccwpck_require__(30815); +const pathExists = __nccwpck_require__(89255); + +const stop = Symbol('findUp.stop'); + +module.exports = async (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = async locateOptions => { + if (typeof name !== 'function') { + return locatePath(paths, locateOptions); + } + + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + // eslint-disable-next-line no-await-in-loop + const foundPath = await runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.sync = (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = locateOptions => { + if (typeof name !== 'function') { + return locatePath.sync(paths, locateOptions); + } + + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath.sync([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + const foundPath = runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.exists = pathExists; + +module.exports.sync.exists = pathExists.sync; + +module.exports.stop = stop; + + +/***/ }), + +/***/ 89255: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const fs = __nccwpck_require__(35747); +const {promisify} = __nccwpck_require__(31669); + +const pAccess = promisify(fs.access); + +module.exports = async path => { + try { + await pAccess(path); + return true; + } catch (_) { + return false; + } +}; + +module.exports.sync = path => { + try { + fs.accessSync(path); + return true; + } catch (_) { + return false; + } +}; + + +/***/ }), + +/***/ 60123: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdirsSync = __nccwpck_require__(81881).mkdirsSync +const utimesMillisSync = __nccwpck_require__(64698).utimesMillisSync +const stat = __nccwpck_require__(66834) + +function copySync (src, dest, opts) { + if (typeof opts === 'function') { + opts = { filter: opts } + } + + opts = opts || {} + opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber + + // Warn about using preserveTimestamps on 32-bit node + if (opts.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy') + stat.checkParentPathsSync(src, srcStat, dest, 'copy') + return handleFilterAndCopy(destStat, src, dest, opts) } -InternalEncoder.prototype.write = function(str) { - return Buffer.from(str, this.enc); +function handleFilterAndCopy (destStat, src, dest, opts) { + if (opts.filter && !opts.filter(src, dest)) return + const destParent = path.dirname(dest) + if (!fs.existsSync(destParent)) mkdirsSync(destParent) + return startCopy(destStat, src, dest, opts) } -InternalEncoder.prototype.end = function() { +function startCopy (destStat, src, dest, opts) { + if (opts.filter && !opts.filter(src, dest)) return + return getStats(destStat, src, dest, opts) } +function getStats (destStat, src, dest, opts) { + const statSync = opts.dereference ? fs.statSync : fs.lstatSync + const srcStat = statSync(src) -//------------------------------------------------------------------------------ -// Except base64 encoder, which must keep its state. + if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) + else if (srcStat.isFile() || + srcStat.isCharacterDevice() || + srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) + else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) +} -function InternalEncoderBase64(options, codec) { - this.prevStr = ''; +function onFile (srcStat, destStat, src, dest, opts) { + if (!destStat) return copyFile(srcStat, src, dest, opts) + return mayCopyFile(srcStat, src, dest, opts) } -InternalEncoderBase64.prototype.write = function(str) { - str = this.prevStr + str; - var completeQuads = str.length - (str.length % 4); - this.prevStr = str.slice(completeQuads); - str = str.slice(0, completeQuads); +function mayCopyFile (srcStat, src, dest, opts) { + if (opts.overwrite) { + fs.unlinkSync(dest) + return copyFile(srcStat, src, dest, opts) + } else if (opts.errorOnExist) { + throw new Error(`'${dest}' already exists`) + } +} - return Buffer.from(str, "base64"); +function copyFile (srcStat, src, dest, opts) { + fs.copyFileSync(src, dest) + if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest) + return setDestMode(dest, srcStat.mode) } -InternalEncoderBase64.prototype.end = function() { - return Buffer.from(this.prevStr, "base64"); +function handleTimestamps (srcMode, src, dest) { + // Make sure the file is writable before setting the timestamp + // otherwise open fails with EPERM when invoked with 'r+' + // (through utimes call) + if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode) + return setDestTimestamps(src, dest) } +function fileIsNotWritable (srcMode) { + return (srcMode & 0o200) === 0 +} -//------------------------------------------------------------------------------ -// CESU-8 encoder is also special. +function makeFileWritable (dest, srcMode) { + return setDestMode(dest, srcMode | 0o200) +} -function InternalEncoderCesu8(options, codec) { +function setDestMode (dest, srcMode) { + return fs.chmodSync(dest, srcMode) } -InternalEncoderCesu8.prototype.write = function(str) { - var buf = Buffer.alloc(str.length * 3), bufIdx = 0; - for (var i = 0; i < str.length; i++) { - var charCode = str.charCodeAt(i); - // Naive implementation, but it works because CESU-8 is especially easy - // to convert from UTF-16 (which all JS strings are encoded in). - if (charCode < 0x80) - buf[bufIdx++] = charCode; - else if (charCode < 0x800) { - buf[bufIdx++] = 0xC0 + (charCode >>> 6); - buf[bufIdx++] = 0x80 + (charCode & 0x3f); - } - else { // charCode will always be < 0x10000 in javascript. - buf[bufIdx++] = 0xE0 + (charCode >>> 12); - buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); - buf[bufIdx++] = 0x80 + (charCode & 0x3f); - } - } - return buf.slice(0, bufIdx); +function setDestTimestamps (src, dest) { + // The initial srcStat.atime cannot be trusted + // because it is modified by the read(2) system call + // (See https://nodejs.org/api/fs.html#fs_stat_time_values) + const updatedSrcStat = fs.statSync(src) + return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime) } -InternalEncoderCesu8.prototype.end = function() { +function onDir (srcStat, destStat, src, dest, opts) { + if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts) + if (destStat && !destStat.isDirectory()) { + throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) + } + return copyDir(src, dest, opts) } -//------------------------------------------------------------------------------ -// CESU-8 decoder is not implemented in Node v4.0+ +function mkDirAndCopy (srcMode, src, dest, opts) { + fs.mkdirSync(dest) + copyDir(src, dest, opts) + return setDestMode(dest, srcMode) +} -function InternalDecoderCesu8(options, codec) { - this.acc = 0; - this.contBytes = 0; - this.accBytes = 0; - this.defaultCharUnicode = codec.defaultCharUnicode; +function copyDir (src, dest, opts) { + fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) } -InternalDecoderCesu8.prototype.write = function(buf) { - var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, - res = ''; - for (var i = 0; i < buf.length; i++) { - var curByte = buf[i]; - if ((curByte & 0xC0) !== 0x80) { // Leading byte - if (contBytes > 0) { // Previous code is invalid - res += this.defaultCharUnicode; - contBytes = 0; - } +function copyDirItem (item, src, dest, opts) { + const srcItem = path.join(src, item) + const destItem = path.join(dest, item) + const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy') + return startCopy(destStat, srcItem, destItem, opts) +} - if (curByte < 0x80) { // Single-byte code - res += String.fromCharCode(curByte); - } else if (curByte < 0xE0) { // Two-byte code - acc = curByte & 0x1F; - contBytes = 1; accBytes = 1; - } else if (curByte < 0xF0) { // Three-byte code - acc = curByte & 0x0F; - contBytes = 2; accBytes = 1; - } else { // Four or more are not supported for CESU-8. - res += this.defaultCharUnicode; - } - } else { // Continuation byte - if (contBytes > 0) { // We're waiting for it. - acc = (acc << 6) | (curByte & 0x3f); - contBytes--; accBytes++; - if (contBytes === 0) { - // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) - if (accBytes === 2 && acc < 0x80 && acc > 0) - res += this.defaultCharUnicode; - else if (accBytes === 3 && acc < 0x800) - res += this.defaultCharUnicode; - else - // Actually add character. - res += String.fromCharCode(acc); - } - } else { // Unexpected continuation byte - res += this.defaultCharUnicode; - } - } +function onLink (destStat, src, dest, opts) { + let resolvedSrc = fs.readlinkSync(src) + if (opts.dereference) { + resolvedSrc = path.resolve(process.cwd(), resolvedSrc) + } + + if (!destStat) { + return fs.symlinkSync(resolvedSrc, dest) + } else { + let resolvedDest + try { + resolvedDest = fs.readlinkSync(dest) + } catch (err) { + // dest exists and is a regular file or directory, + // Windows may throw UNKNOWN error. If dest already exists, + // fs throws error anyway, so no need to guard against it here. + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) + throw err } - this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; - return res; + if (opts.dereference) { + resolvedDest = path.resolve(process.cwd(), resolvedDest) + } + if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { + throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) + } + + // prevent copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { + throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) + } + return copyLink(resolvedSrc, dest) + } } -InternalDecoderCesu8.prototype.end = function() { - var res = 0; - if (this.contBytes > 0) - res += this.defaultCharUnicode; - return res; +function copyLink (resolvedSrc, dest) { + fs.unlinkSync(dest) + return fs.symlinkSync(resolvedSrc, dest) } +module.exports = copySync + /***/ }), -/***/ 95379: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ 6574: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var Buffer = __webpack_require__(52340).Buffer; -// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that -// correspond to encoded bytes (if 128 - then lower half is ASCII). +module.exports = { + copySync: __nccwpck_require__(60123) +} -exports._sbcs = SBCSCodec; -function SBCSCodec(codecOptions, iconv) { - if (!codecOptions) - throw new Error("SBCS codec is called without the data.") - - // Prepare char buffer for decoding. - if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) - throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); - - if (codecOptions.chars.length === 128) { - var asciiString = ""; - for (var i = 0; i < 128; i++) - asciiString += String.fromCharCode(i); - codecOptions.chars = asciiString + codecOptions.chars; - } - this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); - - // Encoding buffer. - var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); +/***/ }), - for (var i = 0; i < codecOptions.chars.length; i++) - encodeBuf[codecOptions.chars.charCodeAt(i)] = i; +/***/ 41132: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this.encodeBuf = encodeBuf; -} +"use strict"; -SBCSCodec.prototype.encoder = SBCSEncoder; -SBCSCodec.prototype.decoder = SBCSDecoder; +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdirs = __nccwpck_require__(81881).mkdirs +const pathExists = __nccwpck_require__(42176).pathExists +const utimesMillis = __nccwpck_require__(64698).utimesMillis +const stat = __nccwpck_require__(66834) -function SBCSEncoder(options, codec) { - this.encodeBuf = codec.encodeBuf; -} +function copy (src, dest, opts, cb) { + if (typeof opts === 'function' && !cb) { + cb = opts + opts = {} + } else if (typeof opts === 'function') { + opts = { filter: opts } + } -SBCSEncoder.prototype.write = function(str) { - var buf = Buffer.alloc(str.length); - for (var i = 0; i < str.length; i++) - buf[i] = this.encodeBuf[str.charCodeAt(i)]; - - return buf; -} + cb = cb || function () {} + opts = opts || {} -SBCSEncoder.prototype.end = function() { -} + opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber + // Warn about using preserveTimestamps on 32-bit node + if (opts.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } -function SBCSDecoder(options, codec) { - this.decodeBuf = codec.decodeBuf; + stat.checkPaths(src, dest, 'copy', (err, stats) => { + if (err) return cb(err) + const { srcStat, destStat } = stats + stat.checkParentPaths(src, srcStat, dest, 'copy', err => { + if (err) return cb(err) + if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb) + return checkParentDir(destStat, src, dest, opts, cb) + }) + }) } -SBCSDecoder.prototype.write = function(buf) { - // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. - var decodeBuf = this.decodeBuf; - var newBuf = Buffer.alloc(buf.length*2); - var idx1 = 0, idx2 = 0; - for (var i = 0; i < buf.length; i++) { - idx1 = buf[i]*2; idx2 = i*2; - newBuf[idx2] = decodeBuf[idx1]; - newBuf[idx2+1] = decodeBuf[idx1+1]; - } - return newBuf.toString('ucs2'); +function checkParentDir (destStat, src, dest, opts, cb) { + const destParent = path.dirname(dest) + pathExists(destParent, (err, dirExists) => { + if (err) return cb(err) + if (dirExists) return startCopy(destStat, src, dest, opts, cb) + mkdirs(destParent, err => { + if (err) return cb(err) + return startCopy(destStat, src, dest, opts, cb) + }) + }) } -SBCSDecoder.prototype.end = function() { +function handleFilter (onInclude, destStat, src, dest, opts, cb) { + Promise.resolve(opts.filter(src, dest)).then(include => { + if (include) return onInclude(destStat, src, dest, opts, cb) + return cb() + }, error => cb(error)) } +function startCopy (destStat, src, dest, opts, cb) { + if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb) + return getStats(destStat, src, dest, opts, cb) +} -/***/ }), - -/***/ 92746: -/***/ ((module) => { - -"use strict"; - - -// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. -module.exports = { - "437": "cp437", - "737": "cp737", - "775": "cp775", - "850": "cp850", - "852": "cp852", - "855": "cp855", - "856": "cp856", - "857": "cp857", - "858": "cp858", - "860": "cp860", - "861": "cp861", - "862": "cp862", - "863": "cp863", - "864": "cp864", - "865": "cp865", - "866": "cp866", - "869": "cp869", - "874": "windows874", - "922": "cp922", - "1046": "cp1046", - "1124": "cp1124", - "1125": "cp1125", - "1129": "cp1129", - "1133": "cp1133", - "1161": "cp1161", - "1162": "cp1162", - "1163": "cp1163", - "1250": "windows1250", - "1251": "windows1251", - "1252": "windows1252", - "1253": "windows1253", - "1254": "windows1254", - "1255": "windows1255", - "1256": "windows1256", - "1257": "windows1257", - "1258": "windows1258", - "28591": "iso88591", - "28592": "iso88592", - "28593": "iso88593", - "28594": "iso88594", - "28595": "iso88595", - "28596": "iso88596", - "28597": "iso88597", - "28598": "iso88598", - "28599": "iso88599", - "28600": "iso885910", - "28601": "iso885911", - "28603": "iso885913", - "28604": "iso885914", - "28605": "iso885915", - "28606": "iso885916", - "windows874": { - "type": "_sbcs", - "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "win874": "windows874", - "cp874": "windows874", - "windows1250": { - "type": "_sbcs", - "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "win1250": "windows1250", - "cp1250": "windows1250", - "windows1251": { - "type": "_sbcs", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "win1251": "windows1251", - "cp1251": "windows1251", - "windows1252": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "win1252": "windows1252", - "cp1252": "windows1252", - "windows1253": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "win1253": "windows1253", - "cp1253": "windows1253", - "windows1254": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "win1254": "windows1254", - "cp1254": "windows1254", - "windows1255": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "win1255": "windows1255", - "cp1255": "windows1255", - "windows1256": { - "type": "_sbcs", - "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" - }, - "win1256": "windows1256", - "cp1256": "windows1256", - "windows1257": { - "type": "_sbcs", - "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" - }, - "win1257": "windows1257", - "cp1257": "windows1257", - "windows1258": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "win1258": "windows1258", - "cp1258": "windows1258", - "iso88591": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28591": "iso88591", - "iso88592": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "cp28592": "iso88592", - "iso88593": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" - }, - "cp28593": "iso88593", - "iso88594": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" - }, - "cp28594": "iso88594", - "iso88595": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" - }, - "cp28595": "iso88595", - "iso88596": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" - }, - "cp28596": "iso88596", - "iso88597": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "cp28597": "iso88597", - "iso88598": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "cp28598": "iso88598", - "iso88599": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "cp28599": "iso88599", - "iso885910": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" - }, - "cp28600": "iso885910", - "iso885911": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "cp28601": "iso885911", - "iso885913": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" - }, - "cp28603": "iso885913", - "iso885914": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" - }, - "cp28604": "iso885914", - "iso885915": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28605": "iso885915", - "iso885916": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" - }, - "cp28606": "iso885916", - "cp437": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm437": "cp437", - "csibm437": "cp437", - "cp737": { - "type": "_sbcs", - "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " - }, - "ibm737": "cp737", - "csibm737": "cp737", - "cp775": { - "type": "_sbcs", - "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " - }, - "ibm775": "cp775", - "csibm775": "cp775", - "cp850": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm850": "cp850", - "csibm850": "cp850", - "cp852": { - "type": "_sbcs", - "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " - }, - "ibm852": "cp852", - "csibm852": "cp852", - "cp855": { - "type": "_sbcs", - "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " - }, - "ibm855": "cp855", - "csibm855": "cp855", - "cp856": { - "type": "_sbcs", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm856": "cp856", - "csibm856": "cp856", - "cp857": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " - }, - "ibm857": "cp857", - "csibm857": "cp857", - "cp858": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm858": "cp858", - "csibm858": "cp858", - "cp860": { - "type": "_sbcs", - "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm860": "cp860", - "csibm860": "cp860", - "cp861": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm861": "cp861", - "csibm861": "cp861", - "cp862": { - "type": "_sbcs", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm862": "cp862", - "csibm862": "cp862", - "cp863": { - "type": "_sbcs", - "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm863": "cp863", - "csibm863": "cp863", - "cp864": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" - }, - "ibm864": "cp864", - "csibm864": "cp864", - "cp865": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm865": "cp865", - "csibm865": "cp865", - "cp866": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " - }, - "ibm866": "cp866", - "csibm866": "cp866", - "cp869": { - "type": "_sbcs", - "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " - }, - "ibm869": "cp869", - "csibm869": "cp869", - "cp922": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" - }, - "ibm922": "cp922", - "csibm922": "cp922", - "cp1046": { - "type": "_sbcs", - "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" - }, - "ibm1046": "cp1046", - "csibm1046": "cp1046", - "cp1124": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" - }, - "ibm1124": "cp1124", - "csibm1124": "cp1124", - "cp1125": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " - }, - "ibm1125": "cp1125", - "csibm1125": "cp1125", - "cp1129": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "ibm1129": "cp1129", - "csibm1129": "cp1129", - "cp1133": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" - }, - "ibm1133": "cp1133", - "csibm1133": "cp1133", - "cp1161": { - "type": "_sbcs", - "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " - }, - "ibm1161": "cp1161", - "csibm1161": "cp1161", - "cp1162": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "ibm1162": "cp1162", - "csibm1162": "cp1162", - "cp1163": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "ibm1163": "cp1163", - "csibm1163": "cp1163", - "maccroatian": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" - }, - "maccyrillic": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "macgreek": { - "type": "_sbcs", - "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" - }, - "maciceland": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macroman": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macromania": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macthai": { - "type": "_sbcs", - "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" - }, - "macturkish": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macukraine": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "koi8r": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8u": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8ru": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8t": { - "type": "_sbcs", - "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "armscii8": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" - }, - "rk1048": { - "type": "_sbcs", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "tcvn": { - "type": "_sbcs", - "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" - }, - "georgianacademy": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "georgianps": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "pt154": { - "type": "_sbcs", - "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "viscii": { - "type": "_sbcs", - "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" - }, - "iso646cn": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" - }, - "iso646jp": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" - }, - "hproman8": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" - }, - "macintosh": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "ascii": { - "type": "_sbcs", - "chars": "��������������������������������������������������������������������������������������������������������������������������������" - }, - "tis620": { - "type": "_sbcs", - "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - } -} - -/***/ }), - -/***/ 80002: -/***/ ((module) => { - -"use strict"; - - -// Manually added data to be used by sbcs codec in addition to generated one. - -module.exports = { - // Not supported by iconv, not sure why. - "10029": "maccenteuro", - "maccenteuro": { - "type": "_sbcs", - "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" - }, - - "808": "cp808", - "ibm808": "cp808", - "cp808": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " - }, - - "mik": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - - "cp720": { - "type": "_sbcs", - "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" - }, - - // Aliases of generated encodings. - "ascii8bit": "ascii", - "usascii": "ascii", - "ansix34": "ascii", - "ansix341968": "ascii", - "ansix341986": "ascii", - "csascii": "ascii", - "cp367": "ascii", - "ibm367": "ascii", - "isoir6": "ascii", - "iso646us": "ascii", - "iso646irv": "ascii", - "us": "ascii", - - "latin1": "iso88591", - "latin2": "iso88592", - "latin3": "iso88593", - "latin4": "iso88594", - "latin5": "iso88599", - "latin6": "iso885910", - "latin7": "iso885913", - "latin8": "iso885914", - "latin9": "iso885915", - "latin10": "iso885916", - - "csisolatin1": "iso88591", - "csisolatin2": "iso88592", - "csisolatin3": "iso88593", - "csisolatin4": "iso88594", - "csisolatincyrillic": "iso88595", - "csisolatinarabic": "iso88596", - "csisolatingreek" : "iso88597", - "csisolatinhebrew": "iso88598", - "csisolatin5": "iso88599", - "csisolatin6": "iso885910", - - "l1": "iso88591", - "l2": "iso88592", - "l3": "iso88593", - "l4": "iso88594", - "l5": "iso88599", - "l6": "iso885910", - "l7": "iso885913", - "l8": "iso885914", - "l9": "iso885915", - "l10": "iso885916", - - "isoir14": "iso646jp", - "isoir57": "iso646cn", - "isoir100": "iso88591", - "isoir101": "iso88592", - "isoir109": "iso88593", - "isoir110": "iso88594", - "isoir144": "iso88595", - "isoir127": "iso88596", - "isoir126": "iso88597", - "isoir138": "iso88598", - "isoir148": "iso88599", - "isoir157": "iso885910", - "isoir166": "tis620", - "isoir179": "iso885913", - "isoir199": "iso885914", - "isoir203": "iso885915", - "isoir226": "iso885916", - - "cp819": "iso88591", - "ibm819": "iso88591", - - "cyrillic": "iso88595", - - "arabic": "iso88596", - "arabic8": "iso88596", - "ecma114": "iso88596", - "asmo708": "iso88596", - - "greek" : "iso88597", - "greek8" : "iso88597", - "ecma118" : "iso88597", - "elot928" : "iso88597", - - "hebrew": "iso88598", - "hebrew8": "iso88598", - - "turkish": "iso88599", - "turkish8": "iso88599", - - "thai": "iso885911", - "thai8": "iso885911", - - "celtic": "iso885914", - "celtic8": "iso885914", - "isoceltic": "iso885914", - - "tis6200": "tis620", - "tis62025291": "tis620", - "tis62025330": "tis620", - - "10000": "macroman", - "10006": "macgreek", - "10007": "maccyrillic", - "10079": "maciceland", - "10081": "macturkish", - - "cspc8codepage437": "cp437", - "cspc775baltic": "cp775", - "cspc850multilingual": "cp850", - "cspcp852": "cp852", - "cspc862latinhebrew": "cp862", - "cpgr": "cp869", - - "msee": "cp1250", - "mscyrl": "cp1251", - "msansi": "cp1252", - "msgreek": "cp1253", - "msturk": "cp1254", - "mshebr": "cp1255", - "msarab": "cp1256", - "winbaltrim": "cp1257", - - "cp20866": "koi8r", - "20866": "koi8r", - "ibm878": "koi8r", - "cskoi8r": "koi8r", - - "cp21866": "koi8u", - "21866": "koi8u", - "ibm1168": "koi8u", - - "strk10482002": "rk1048", - - "tcvn5712": "tcvn", - "tcvn57121": "tcvn", - - "gb198880": "iso646cn", - "cn": "iso646cn", - - "csiso14jisc6220ro": "iso646jp", - "jisc62201969ro": "iso646jp", - "jp": "iso646jp", - - "cshproman8": "hproman8", - "r8": "hproman8", - "roman8": "hproman8", - "xroman8": "hproman8", - "ibm1051": "hproman8", - - "mac": "macintosh", - "csmacintosh": "macintosh", -}; - - - -/***/ }), - -/***/ 56918: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var Buffer = __webpack_require__(52340).Buffer; - -// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js - -// == UTF16-BE codec. ========================================================== - -exports.utf16be = Utf16BECodec; -function Utf16BECodec() { -} - -Utf16BECodec.prototype.encoder = Utf16BEEncoder; -Utf16BECodec.prototype.decoder = Utf16BEDecoder; -Utf16BECodec.prototype.bomAware = true; - - -// -- Encoding - -function Utf16BEEncoder() { -} - -Utf16BEEncoder.prototype.write = function(str) { - var buf = Buffer.from(str, 'ucs2'); - for (var i = 0; i < buf.length; i += 2) { - var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; - } - return buf; -} - -Utf16BEEncoder.prototype.end = function() { -} - - -// -- Decoding - -function Utf16BEDecoder() { - this.overflowByte = -1; -} - -Utf16BEDecoder.prototype.write = function(buf) { - if (buf.length == 0) - return ''; - - var buf2 = Buffer.alloc(buf.length + 1), - i = 0, j = 0; - - if (this.overflowByte !== -1) { - buf2[0] = buf[0]; - buf2[1] = this.overflowByte; - i = 1; j = 2; - } - - for (; i < buf.length-1; i += 2, j+= 2) { - buf2[j] = buf[i+1]; - buf2[j+1] = buf[i]; - } - - this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; - - return buf2.slice(0, j).toString('ucs2'); -} - -Utf16BEDecoder.prototype.end = function() { - this.overflowByte = -1; -} - - -// == UTF-16 codec ============================================================= -// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. -// Defaults to UTF-16LE, as it's prevalent and default in Node. -// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le -// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); - -// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). - -exports.utf16 = Utf16Codec; -function Utf16Codec(codecOptions, iconv) { - this.iconv = iconv; -} - -Utf16Codec.prototype.encoder = Utf16Encoder; -Utf16Codec.prototype.decoder = Utf16Decoder; - - -// -- Encoding (pass-through) - -function Utf16Encoder(options, codec) { - options = options || {}; - if (options.addBOM === undefined) - options.addBOM = true; - this.encoder = codec.iconv.getEncoder('utf-16le', options); -} - -Utf16Encoder.prototype.write = function(str) { - return this.encoder.write(str); -} - -Utf16Encoder.prototype.end = function() { - return this.encoder.end(); -} - - -// -- Decoding - -function Utf16Decoder(options, codec) { - this.decoder = null; - this.initialBufs = []; - this.initialBufsLen = 0; - - this.options = options || {}; - this.iconv = codec.iconv; -} - -Utf16Decoder.prototype.write = function(buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf); - this.initialBufsLen += buf.length; - - if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) - return ''; - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - - return this.decoder.write(buf); -} - -Utf16Decoder.prototype.end = function() { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - var trail = this.decoder.end(); - if (trail) - resStr += trail; - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - return this.decoder.end(); -} - -function detectEncoding(bufs, defaultEncoding) { - var b = []; - var charsProcessed = 0; - var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. - - outer_loop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i]; - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]); - if (b.length === 2) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; - if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; - } - - if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; - if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; - - b.length = 0; - charsProcessed++; - - if (charsProcessed >= 100) { - break outer_loop; - } - } - } - } - - // Make decisions. - // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. - // So, we count ASCII as if it was LE or BE, and decide from that. - if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; - if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || 'utf-16le'; -} - - - - -/***/ }), - -/***/ 66042: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -var Buffer = __webpack_require__(52340).Buffer; - -// == UTF32-LE/BE codec. ========================================================== - -exports._utf32 = Utf32Codec; - -function Utf32Codec(codecOptions, iconv) { - this.iconv = iconv; - this.bomAware = true; - this.isLE = codecOptions.isLE; -} - -exports.utf32le = { type: '_utf32', isLE: true }; -exports.utf32be = { type: '_utf32', isLE: false }; - -// Aliases -exports.ucs4le = 'utf32le'; -exports.ucs4be = 'utf32be'; - -Utf32Codec.prototype.encoder = Utf32Encoder; -Utf32Codec.prototype.decoder = Utf32Decoder; - -// -- Encoding - -function Utf32Encoder(options, codec) { - this.isLE = codec.isLE; - this.highSurrogate = 0; -} - -Utf32Encoder.prototype.write = function(str) { - var src = Buffer.from(str, 'ucs2'); - var dst = Buffer.alloc(src.length * 2); - var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; - var offset = 0; - - for (var i = 0; i < src.length; i += 2) { - var code = src.readUInt16LE(i); - var isHighSurrogate = (0xD800 <= code && code < 0xDC00); - var isLowSurrogate = (0xDC00 <= code && code < 0xE000); - - if (this.highSurrogate) { - if (isHighSurrogate || !isLowSurrogate) { - // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low - // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character - // (technically wrong, but expected by some applications, like Windows file names). - write32.call(dst, this.highSurrogate, offset); - offset += 4; - } - else { - // Create 32-bit value from high and low surrogates; - var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; - - write32.call(dst, codepoint, offset); - offset += 4; - this.highSurrogate = 0; - - continue; - } - } - - if (isHighSurrogate) - this.highSurrogate = code; - else { - // Even if the current character is a low surrogate, with no previous high surrogate, we'll - // encode it as a semi-invalid stand-alone character for the same reasons expressed above for - // unpaired high surrogates. - write32.call(dst, code, offset); - offset += 4; - this.highSurrogate = 0; - } - } - - if (offset < dst.length) - dst = dst.slice(0, offset); - - return dst; -}; - -Utf32Encoder.prototype.end = function() { - // Treat any leftover high surrogate as a semi-valid independent character. - if (!this.highSurrogate) - return; - - var buf = Buffer.alloc(4); - - if (this.isLE) - buf.writeUInt32LE(this.highSurrogate, 0); - else - buf.writeUInt32BE(this.highSurrogate, 0); - - this.highSurrogate = 0; - - return buf; -}; - -// -- Decoding - -function Utf32Decoder(options, codec) { - this.isLE = codec.isLE; - this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); - this.overflow = []; -} - -Utf32Decoder.prototype.write = function(src) { - if (src.length === 0) - return ''; - - var i = 0; - var codepoint = 0; - var dst = Buffer.alloc(src.length + 4); - var offset = 0; - var isLE = this.isLE; - var overflow = this.overflow; - var badChar = this.badChar; - - if (overflow.length > 0) { - for (; i < src.length && overflow.length < 4; i++) - overflow.push(src[i]); - - if (overflow.length === 4) { - // NOTE: codepoint is a signed int32 and can be negative. - // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). - if (isLE) { - codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); - } else { - codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); - } - overflow.length = 0; - - offset = _writeCodepoint(dst, offset, codepoint, badChar); - } - } - - // Main loop. Should be as optimized as possible. - for (; i < src.length - 3; i += 4) { - // NOTE: codepoint is a signed int32 and can be negative. - if (isLE) { - codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); - } else { - codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); - } - offset = _writeCodepoint(dst, offset, codepoint, badChar); - } - - // Keep overflowing bytes. - for (; i < src.length; i++) { - overflow.push(src[i]); - } - - return dst.slice(0, offset).toString('ucs2'); -}; - -function _writeCodepoint(dst, offset, codepoint, badChar) { - // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. - if (codepoint < 0 || codepoint > 0x10FFFF) { - // Not a valid Unicode codepoint - codepoint = badChar; - } - - // Ephemeral Planes: Write high surrogate. - if (codepoint >= 0x10000) { - codepoint -= 0x10000; - - var high = 0xD800 | (codepoint >> 10); - dst[offset++] = high & 0xff; - dst[offset++] = high >> 8; - - // Low surrogate is written below. - var codepoint = 0xDC00 | (codepoint & 0x3FF); - } - - // Write BMP char or low surrogate. - dst[offset++] = codepoint & 0xff; - dst[offset++] = codepoint >> 8; - - return offset; -}; - -Utf32Decoder.prototype.end = function() { - this.overflow.length = 0; -}; - -// == UTF-32 Auto codec ============================================================= -// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. -// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 -// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); - -// Encoder prepends BOM (which can be overridden with (addBOM: false}). - -exports.utf32 = Utf32AutoCodec; -exports.ucs4 = 'utf32'; - -function Utf32AutoCodec(options, iconv) { - this.iconv = iconv; -} - -Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; -Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; - -// -- Encoding - -function Utf32AutoEncoder(options, codec) { - options = options || {}; - - if (options.addBOM === undefined) - options.addBOM = true; - - this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); -} - -Utf32AutoEncoder.prototype.write = function(str) { - return this.encoder.write(str); -}; - -Utf32AutoEncoder.prototype.end = function() { - return this.encoder.end(); -}; - -// -- Decoding - -function Utf32AutoDecoder(options, codec) { - this.decoder = null; - this.initialBufs = []; - this.initialBufsLen = 0; - this.options = options || {}; - this.iconv = codec.iconv; -} - -Utf32AutoDecoder.prototype.write = function(buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf); - this.initialBufsLen += buf.length; - - if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) - return ''; - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - - return this.decoder.write(buf); -}; - -Utf32AutoDecoder.prototype.end = function() { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - var trail = this.decoder.end(); - if (trail) - resStr += trail; - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - - return this.decoder.end(); -}; - -function detectEncoding(bufs, defaultEncoding) { - var b = []; - var charsProcessed = 0; - var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. - var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. - - outer_loop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i]; - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]); - if (b.length === 4) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { - return 'utf-32le'; - } - if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { - return 'utf-32be'; - } - } - - if (b[0] !== 0 || b[1] > 0x10) invalidBE++; - if (b[3] !== 0 || b[2] > 0x10) invalidLE++; - - if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; - if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; - - b.length = 0; - charsProcessed++; - - if (charsProcessed >= 100) { - break outer_loop; - } - } - } - } - - // Make decisions. - if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; - if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || 'utf-32le'; -} - - -/***/ }), - -/***/ 43769: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var Buffer = __webpack_require__(52340).Buffer; - -// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 -// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 - -exports.utf7 = Utf7Codec; -exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 -function Utf7Codec(codecOptions, iconv) { - this.iconv = iconv; -}; - -Utf7Codec.prototype.encoder = Utf7Encoder; -Utf7Codec.prototype.decoder = Utf7Decoder; -Utf7Codec.prototype.bomAware = true; - - -// -- Encoding - -var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; - -function Utf7Encoder(options, codec) { - this.iconv = codec.iconv; -} - -Utf7Encoder.prototype.write = function(str) { - // Naive implementation. - // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". - return Buffer.from(str.replace(nonDirectChars, function(chunk) { - return "+" + (chunk === '+' ? '' : - this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) - + "-"; - }.bind(this))); -} - -Utf7Encoder.prototype.end = function() { -} - - -// -- Decoding - -function Utf7Decoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = ''; -} - -var base64Regex = /[A-Za-z0-9\/+]/; -var base64Chars = []; -for (var i = 0; i < 256; i++) - base64Chars[i] = base64Regex.test(String.fromCharCode(i)); - -var plusChar = '+'.charCodeAt(0), - minusChar = '-'.charCodeAt(0), - andChar = '&'.charCodeAt(0); - -Utf7Decoder.prototype.write = function(buf) { - var res = "", lastI = 0, - inBase64 = this.inBase64, - base64Accum = this.base64Accum; - - // The decoder is more involved as we must handle chunks in stream. - - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '+' - if (buf[i] == plusChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. - lastI = i+1; - inBase64 = true; - } - } else { // We decode base64. - if (!base64Chars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" - res += "+"; - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - if (buf[i] != minusChar) // Minus is absorbed after base64. - i--; - - lastI = i+1; - inBase64 = false; - base64Accum = ''; - } - } - } - - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); - - var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded); - - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - this.inBase64 = inBase64; - this.base64Accum = base64Accum; - - return res; -} - -Utf7Decoder.prototype.end = function() { - var res = ""; - if (this.inBase64 && this.base64Accum.length > 0) - res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - - this.inBase64 = false; - this.base64Accum = ''; - return res; -} - - -// UTF-7-IMAP codec. -// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) -// Differences: -// * Base64 part is started by "&" instead of "+" -// * Direct characters are 0x20-0x7E, except "&" (0x26) -// * In Base64, "," is used instead of "/" -// * Base64 must not be used to represent direct characters. -// * No implicit shift back from Base64 (should always end with '-') -// * String must end in non-shifted position. -// * "-&" while in base64 is not allowed. - - -exports.utf7imap = Utf7IMAPCodec; -function Utf7IMAPCodec(codecOptions, iconv) { - this.iconv = iconv; -}; - -Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; -Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; -Utf7IMAPCodec.prototype.bomAware = true; - - -// -- Encoding - -function Utf7IMAPEncoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = Buffer.alloc(6); - this.base64AccumIdx = 0; -} - -Utf7IMAPEncoder.prototype.write = function(str) { - var inBase64 = this.inBase64, - base64Accum = this.base64Accum, - base64AccumIdx = this.base64AccumIdx, - buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; - - for (var i = 0; i < str.length; i++) { - var uChar = str.charCodeAt(i); - if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. - if (inBase64) { - if (base64AccumIdx > 0) { - bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); - base64AccumIdx = 0; - } - - buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. - inBase64 = false; - } - - if (!inBase64) { - buf[bufIdx++] = uChar; // Write direct character - - if (uChar === andChar) // Ampersand -> '&-' - buf[bufIdx++] = minusChar; - } - - } else { // Non-direct character - if (!inBase64) { - buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. - inBase64 = true; - } - if (inBase64) { - base64Accum[base64AccumIdx++] = uChar >> 8; - base64Accum[base64AccumIdx++] = uChar & 0xFF; - - if (base64AccumIdx == base64Accum.length) { - bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); - base64AccumIdx = 0; - } - } - } - } - - this.inBase64 = inBase64; - this.base64AccumIdx = base64AccumIdx; - - return buf.slice(0, bufIdx); -} - -Utf7IMAPEncoder.prototype.end = function() { - var buf = Buffer.alloc(10), bufIdx = 0; - if (this.inBase64) { - if (this.base64AccumIdx > 0) { - bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); - this.base64AccumIdx = 0; - } - - buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. - this.inBase64 = false; - } - - return buf.slice(0, bufIdx); -} - - -// -- Decoding - -function Utf7IMAPDecoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = ''; -} - -var base64IMAPChars = base64Chars.slice(); -base64IMAPChars[','.charCodeAt(0)] = true; - -Utf7IMAPDecoder.prototype.write = function(buf) { - var res = "", lastI = 0, - inBase64 = this.inBase64, - base64Accum = this.base64Accum; - - // The decoder is more involved as we must handle chunks in stream. - // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). - - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '&' - if (buf[i] == andChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. - lastI = i+1; - inBase64 = true; - } - } else { // We decode base64. - if (!base64IMAPChars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" - res += "&"; - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - if (buf[i] != minusChar) // Minus may be absorbed after base64. - i--; - - lastI = i+1; - inBase64 = false; - base64Accum = ''; - } - } - } - - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); - - var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded); - - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - this.inBase64 = inBase64; - this.base64Accum = base64Accum; - - return res; -} - -Utf7IMAPDecoder.prototype.end = function() { - var res = ""; - if (this.inBase64 && this.base64Accum.length > 0) - res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - - this.inBase64 = false; - this.base64Accum = ''; - return res; -} - - - - -/***/ }), - -/***/ 32223: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -var BOMChar = '\uFEFF'; - -exports.PrependBOM = PrependBOMWrapper -function PrependBOMWrapper(encoder, options) { - this.encoder = encoder; - this.addBOM = true; -} - -PrependBOMWrapper.prototype.write = function(str) { - if (this.addBOM) { - str = BOMChar + str; - this.addBOM = false; - } - - return this.encoder.write(str); -} - -PrependBOMWrapper.prototype.end = function() { - return this.encoder.end(); -} - - -//------------------------------------------------------------------------------ - -exports.StripBOM = StripBOMWrapper; -function StripBOMWrapper(decoder, options) { - this.decoder = decoder; - this.pass = false; - this.options = options || {}; -} - -StripBOMWrapper.prototype.write = function(buf) { - var res = this.decoder.write(buf); - if (this.pass || !res) - return res; - - if (res[0] === BOMChar) { - res = res.slice(1); - if (typeof this.options.stripBOM === 'function') - this.options.stripBOM(); - } - - this.pass = true; - return res; -} - -StripBOMWrapper.prototype.end = function() { - return this.decoder.end(); -} - - - -/***/ }), - -/***/ 24959: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var Buffer = __webpack_require__(52340).Buffer; - -var bomHandling = __webpack_require__(32223), - iconv = module.exports; - -// All codecs and aliases are kept here, keyed by encoding name/alias. -// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. -iconv.encodings = null; - -// Characters emitted in case of error. -iconv.defaultCharUnicode = '�'; -iconv.defaultCharSingleByte = '?'; - -// Public API. -iconv.encode = function encode(str, encoding, options) { - str = "" + (str || ""); // Ensure string. - - var encoder = iconv.getEncoder(encoding, options); - - var res = encoder.write(str); - var trail = encoder.end(); - - return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; -} - -iconv.decode = function decode(buf, encoding, options) { - if (typeof buf === 'string') { - if (!iconv.skipDecodeWarning) { - console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); - iconv.skipDecodeWarning = true; - } - - buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. - } - - var decoder = iconv.getDecoder(encoding, options); - - var res = decoder.write(buf); - var trail = decoder.end(); - - return trail ? (res + trail) : res; -} - -iconv.encodingExists = function encodingExists(enc) { - try { - iconv.getCodec(enc); - return true; - } catch (e) { - return false; - } -} - -// Legacy aliases to convert functions -iconv.toEncoding = iconv.encode; -iconv.fromEncoding = iconv.decode; - -// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. -iconv._codecDataCache = {}; -iconv.getCodec = function getCodec(encoding) { - if (!iconv.encodings) - iconv.encodings = __webpack_require__(15761); // Lazy load all encoding definitions. - - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - var enc = iconv._canonicalizeEncoding(encoding); - - // Traverse iconv.encodings to find actual codec. - var codecOptions = {}; - while (true) { - var codec = iconv._codecDataCache[enc]; - if (codec) - return codec; - - var codecDef = iconv.encodings[enc]; - - switch (typeof codecDef) { - case "string": // Direct alias to other encoding. - enc = codecDef; - break; - - case "object": // Alias with options. Can be layered. - for (var key in codecDef) - codecOptions[key] = codecDef[key]; - - if (!codecOptions.encodingName) - codecOptions.encodingName = enc; - - enc = codecDef.type; - break; - - case "function": // Codec itself. - if (!codecOptions.encodingName) - codecOptions.encodingName = enc; - - // The codec function must load all tables and return object with .encoder and .decoder methods. - // It'll be called only once (for each different options object). - codec = new codecDef(codecOptions, iconv); - - iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. - return codec; - - default: - throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); - } - } -} - -iconv._canonicalizeEncoding = function(encoding) { - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); -} - -iconv.getEncoder = function getEncoder(encoding, options) { - var codec = iconv.getCodec(encoding), - encoder = new codec.encoder(options, codec); - - if (codec.bomAware && options && options.addBOM) - encoder = new bomHandling.PrependBOM(encoder, options); - - return encoder; -} - -iconv.getDecoder = function getDecoder(encoding, options) { - var codec = iconv.getCodec(encoding), - decoder = new codec.decoder(options, codec); - - if (codec.bomAware && !(options && options.stripBOM === false)) - decoder = new bomHandling.StripBOM(decoder, options); - - return decoder; -} - -// Streaming API -// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add -// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. -// If you would like to enable it explicitly, please add the following code to your app: -// > iconv.enableStreamingAPI(require('stream')); -iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { - if (iconv.supportsStreams) - return; - - // Dependency-inject stream module to create IconvLite stream classes. - var streams = __webpack_require__(11900)(stream_module); - - // Not public API yet, but expose the stream classes. - iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; - iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; - - // Streaming API. - iconv.encodeStream = function encodeStream(encoding, options) { - return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); - } - - iconv.decodeStream = function decodeStream(encoding, options) { - return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); - } - - iconv.supportsStreams = true; -} - -// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). -var stream_module; -try { - stream_module = __webpack_require__(92413); -} catch (e) {} - -if (stream_module && stream_module.Transform) { - iconv.enableStreamingAPI(stream_module); - -} else { - // In rare cases where 'stream' module is not available by default, throw a helpful exception. - iconv.encodeStream = iconv.decodeStream = function() { - throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); - }; -} - -if (false) {} - - -/***/ }), - -/***/ 11900: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var Buffer = __webpack_require__(52340).Buffer; - -// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), -// we opt to dependency-inject it instead of creating a hard dependency. -module.exports = function(stream_module) { - var Transform = stream_module.Transform; - - // == Encoder stream ======================================================= - - function IconvLiteEncoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.decodeStrings = false; // We accept only strings, so we don't need to decode them. - Transform.call(this, options); - } - - IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteEncoderStream } - }); - - IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { - if (typeof chunk != 'string') - return done(new Error("Iconv encoding stream needs strings as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteEncoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteEncoderStream.prototype.collect = function(cb) { - var chunks = []; - this.on('error', cb); - this.on('data', function(chunk) { chunks.push(chunk); }); - this.on('end', function() { - cb(null, Buffer.concat(chunks)); - }); - return this; - } - - - // == Decoder stream ======================================================= - - function IconvLiteDecoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.encoding = this.encoding = 'utf8'; // We output strings. - Transform.call(this, options); - } - - IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteDecoderStream } - }); - - IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { - if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) - return done(new Error("Iconv decoding stream needs buffers as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteDecoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteDecoderStream.prototype.collect = function(cb) { - var res = ''; - this.on('error', cb); - this.on('data', function(chunk) { res += chunk; }); - this.on('end', function() { - cb(null, res); - }); - return this; - } - - return { - IconvLiteEncoderStream: IconvLiteEncoderStream, - IconvLiteDecoderStream: IconvLiteDecoderStream, - }; -}; - - -/***/ }), - -/***/ 11745: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var once = __webpack_require__(96754); - -var noop = function() {}; - -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -}; - -var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 -}; - -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - - callback = once(callback || noop); - - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - var cancelled = false; - - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; - - var onfinish = function() { - writable = false; - if (!readable) callback.call(stream); - }; - - var onend = function() { - readable = false; - if (!writable) callback.call(stream); - }; - - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); - }; - - var onerror = function(err) { - callback.call(stream, err); - }; - - var onclose = function() { - process.nextTick(onclosenexttick); - }; - - var onclosenexttick = function() { - if (cancelled) return; - if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); - if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); - }; - - var onrequest = function() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - if (isChildProcess(stream)) stream.on('exit', onexit); - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - - return function() { - cancelled = true; - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('exit', onexit); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -}; - -module.exports = eos; - - -/***/ }), - -/***/ 47727: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const path = __webpack_require__(85622); -const os = __webpack_require__(12087); - -const homedir = os.homedir(); -const tmpdir = os.tmpdir(); -const {env} = process; - -const macos = name => { - const library = path.join(homedir, 'Library'); - - return { - data: path.join(library, 'Application Support', name), - config: path.join(library, 'Preferences', name), - cache: path.join(library, 'Caches', name), - log: path.join(library, 'Logs', name), - temp: path.join(tmpdir, name) - }; -}; - -const windows = name => { - const appData = env.APPDATA || path.join(homedir, 'AppData', 'Roaming'); - const localAppData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local'); - - return { - // Data/config/cache/log are invented by me as Windows isn't opinionated about this - data: path.join(localAppData, name, 'Data'), - config: path.join(appData, name, 'Config'), - cache: path.join(localAppData, name, 'Cache'), - log: path.join(localAppData, name, 'Log'), - temp: path.join(tmpdir, name) - }; -}; - -// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -const linux = name => { - const username = path.basename(homedir); - - return { - data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name), - config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name), - cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name), - // https://wiki.debian.org/XDGBaseDirectorySpecification#state - log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name), - temp: path.join(tmpdir, username, name) - }; -}; - -const envPaths = (name, options) => { - if (typeof name !== 'string') { - throw new TypeError(`Expected string, got ${typeof name}`); - } - - options = Object.assign({suffix: 'nodejs'}, options); - - if (options.suffix) { - // Add suffix to prevent possible conflict with native apps - name += `-${options.suffix}`; - } - - if (process.platform === 'darwin') { - return macos(name); - } - - if (process.platform === 'win32') { - return windows(name); - } - - return linux(name); -}; - -module.exports = envPaths; -// TODO: Remove this for the next major release -module.exports.default = envPaths; - - -/***/ }), - -/***/ 98361: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var util = __webpack_require__(31669); -var isArrayish = __webpack_require__(30237); - -var errorEx = function errorEx(name, properties) { - if (!name || name.constructor !== String) { - properties = name || {}; - name = Error.name; - } - - var errorExError = function ErrorEXError(message) { - if (!this) { - return new ErrorEXError(message); - } - - message = message instanceof Error - ? message.message - : (message || this.message); - - Error.call(this, message); - Error.captureStackTrace(this, errorExError); - - this.name = name; - - Object.defineProperty(this, 'message', { - configurable: true, - enumerable: false, - get: function () { - var newMessage = message.split(/\r?\n/g); - - for (var key in properties) { - if (!properties.hasOwnProperty(key)) { - continue; - } - - var modifier = properties[key]; - - if ('message' in modifier) { - newMessage = modifier.message(this[key], newMessage) || newMessage; - if (!isArrayish(newMessage)) { - newMessage = [newMessage]; - } - } - } - - return newMessage.join('\n'); - }, - set: function (v) { - message = v; - } - }); - - var overwrittenStack = null; - - var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); - var stackGetter = stackDescriptor.get; - var stackValue = stackDescriptor.value; - delete stackDescriptor.value; - delete stackDescriptor.writable; - - stackDescriptor.set = function (newstack) { - overwrittenStack = newstack; - }; - - stackDescriptor.get = function () { - var stack = (overwrittenStack || ((stackGetter) - ? stackGetter.call(this) - : stackValue)).split(/\r?\n+/g); - - // starting in Node 7, the stack builder caches the message. - // just replace it. - if (!overwrittenStack) { - stack[0] = this.name + ': ' + this.message; - } - - var lineCount = 1; - for (var key in properties) { - if (!properties.hasOwnProperty(key)) { - continue; - } - - var modifier = properties[key]; - - if ('line' in modifier) { - var line = modifier.line(this[key]); - if (line) { - stack.splice(lineCount++, 0, ' ' + line); - } - } - - if ('stack' in modifier) { - modifier.stack(this[key], stack); - } - } - - return stack.join('\n'); - }; - - Object.defineProperty(this, 'stack', stackDescriptor); - }; - - if (Object.setPrototypeOf) { - Object.setPrototypeOf(errorExError.prototype, Error.prototype); - Object.setPrototypeOf(errorExError, Error); - } else { - util.inherits(errorExError, Error); - } - - return errorExError; -}; - -errorEx.append = function (str, def) { - return { - message: function (v, message) { - v = v || def; - - if (v) { - message[0] += ' ' + str.replace('%s', v.toString()); - } - - return message; - } - }; -}; - -errorEx.line = function (str, def) { - return { - line: function (v) { - v = v || def; - - if (v) { - return str.replace('%s', v.toString()); - } - - return null; - } - }; -}; - -module.exports = errorEx; - - -/***/ }), - -/***/ 65393: -/***/ ((module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -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) : subClass.__proto__ = superClass; } - -function _extendableBuiltin(cls) { - function ExtendableBuiltin() { - cls.apply(this, arguments); - } - - ExtendableBuiltin.prototype = Object.create(cls.prototype, { - constructor: { - value: cls, - enumerable: false, - writable: true, - configurable: true - } - }); - - if (Object.setPrototypeOf) { - Object.setPrototypeOf(ExtendableBuiltin, cls); - } else { - ExtendableBuiltin.__proto__ = cls; - } - - return ExtendableBuiltin; -} - -var ExtendableError = function (_extendableBuiltin2) { - _inherits(ExtendableError, _extendableBuiltin2); - - function ExtendableError() { - var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - - _classCallCheck(this, ExtendableError); - - // extending Error is weird and does not propagate `message` - var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message)); - - Object.defineProperty(_this, 'message', { - configurable: true, - enumerable: false, - value: message, - writable: true - }); - - Object.defineProperty(_this, 'name', { - configurable: true, - enumerable: false, - value: _this.constructor.name, - writable: true - }); - - if (Error.hasOwnProperty('captureStackTrace')) { - Error.captureStackTrace(_this, _this.constructor); - return _possibleConstructorReturn(_this); - } - - Object.defineProperty(_this, 'stack', { - configurable: true, - enumerable: false, - value: new Error(message).stack, - writable: true - }); - return _this; - } - - return ExtendableError; -}(_extendableBuiltin(Error)); - -exports.default = ExtendableError; -module.exports = exports['default']; - - -/***/ }), - -/***/ 5813: -/***/ ((module) => { - -"use strict"; - - -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(matchOperatorsRe, '\\$&'); -}; - - -/***/ }), - -/***/ 51737: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const path = __webpack_require__(85622); -const childProcess = __webpack_require__(63129); -const crossSpawn = __webpack_require__(23875); -const stripFinalNewline = __webpack_require__(50077); -const npmRunPath = __webpack_require__(79391); -const onetime = __webpack_require__(81053); -const makeError = __webpack_require__(35528); -const normalizeStdio = __webpack_require__(89816); -const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__(51134); -const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(15156); -const {mergePromise, getSpawnedPromise} = __webpack_require__(31045); -const {joinCommand, parseCommand} = __webpack_require__(36429); - -const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; - -const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { - const env = extendEnv ? {...process.env, ...envOption} : envOption; - - if (preferLocal) { - return npmRunPath.env({env, cwd: localDir, execPath}); - } - - return env; -}; - -const handleArguments = (file, args, options = {}) => { - const parsed = crossSpawn._parse(file, args, options); - file = parsed.command; - args = parsed.args; - options = parsed.options; - - options = { - maxBuffer: DEFAULT_MAX_BUFFER, - buffer: true, - stripFinalNewline: true, - extendEnv: true, - preferLocal: false, - localDir: options.cwd || process.cwd(), - execPath: process.execPath, - encoding: 'utf8', - reject: true, - cleanup: true, - all: false, - windowsHide: true, - ...options - }; - - options.env = getEnv(options); - - options.stdio = normalizeStdio(options); - - if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') { - // #116 - args.unshift('/q'); - } - - return {file, args, options, parsed}; -}; - -const handleOutput = (options, value, error) => { - if (typeof value !== 'string' && !Buffer.isBuffer(value)) { - // When `execa.sync()` errors, we normalize it to '' to mimic `execa()` - return error === undefined ? undefined : ''; - } - - if (options.stripFinalNewline) { - return stripFinalNewline(value); - } - - return value; -}; - -const execa = (file, args, options) => { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - - let spawned; - try { - spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); - } catch (error) { - // Ensure the returned error is always both a promise and a child process - const dummySpawned = new childProcess.ChildProcess(); - const errorPromise = Promise.reject(makeError({ - error, - stdout: '', - stderr: '', - all: '', - command, - parsed, - timedOut: false, - isCanceled: false, - killed: false - })); - return mergePromise(dummySpawned, errorPromise); - } - - const spawnedPromise = getSpawnedPromise(spawned); - const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); - const processDone = setExitHandler(spawned, parsed.options, timedPromise); - - const context = {isCanceled: false}; - - spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); - spawned.cancel = spawnedCancel.bind(null, spawned, context); - - const handlePromise = async () => { - const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); - const stdout = handleOutput(parsed.options, stdoutResult); - const stderr = handleOutput(parsed.options, stderrResult); - const all = handleOutput(parsed.options, allResult); - - if (error || exitCode !== 0 || signal !== null) { - const returnedError = makeError({ - error, - exitCode, - signal, - stdout, - stderr, - all, - command, - parsed, - timedOut, - isCanceled: context.isCanceled, - killed: spawned.killed - }); - - if (!parsed.options.reject) { - return returnedError; - } - - throw returnedError; - } - - return { - command, - exitCode: 0, - stdout, - stderr, - all, - failed: false, - timedOut: false, - isCanceled: false, - killed: false - }; - }; - - const handlePromiseOnce = onetime(handlePromise); - - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); - - handleInput(spawned, parsed.options.input); - - spawned.all = makeAllStream(spawned, parsed.options); - - return mergePromise(spawned, handlePromiseOnce); -}; - -module.exports = execa; - -module.exports.sync = (file, args, options) => { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - - validateInputSync(parsed.options); - - let result; - try { - result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); - } catch (error) { - throw makeError({ - error, - stdout: '', - stderr: '', - all: '', - command, - parsed, - timedOut: false, - isCanceled: false, - killed: false - }); - } - - const stdout = handleOutput(parsed.options, result.stdout, result.error); - const stderr = handleOutput(parsed.options, result.stderr, result.error); - - if (result.error || result.status !== 0 || result.signal !== null) { - const error = makeError({ - stdout, - stderr, - error: result.error, - signal: result.signal, - exitCode: result.status, - command, - parsed, - timedOut: result.error && result.error.code === 'ETIMEDOUT', - isCanceled: false, - killed: result.signal !== null - }); - - if (!parsed.options.reject) { - return error; - } - - throw error; - } - - return { - command, - exitCode: 0, - stdout, - stderr, - failed: false, - timedOut: false, - isCanceled: false, - killed: false - }; -}; - -module.exports.command = (command, options) => { - const [file, ...args] = parseCommand(command); - return execa(file, args, options); -}; - -module.exports.commandSync = (command, options) => { - const [file, ...args] = parseCommand(command); - return execa.sync(file, args, options); -}; - -module.exports.node = (scriptPath, args, options = {}) => { - if (args && !Array.isArray(args) && typeof args === 'object') { - options = args; - args = []; - } - - const stdio = normalizeStdio.node(options); - const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect')); - - const { - nodePath = process.execPath, - nodeOptions = defaultExecArgv - } = options; - - return execa( - nodePath, - [ - ...nodeOptions, - scriptPath, - ...(Array.isArray(args) ? args : []) - ], - { - ...options, - stdin: undefined, - stdout: undefined, - stderr: undefined, - stdio, - shell: false - } - ); -}; - - -/***/ }), - -/***/ 36429: -/***/ ((module) => { - -"use strict"; - -const SPACES_REGEXP = / +/g; - -const joinCommand = (file, args = []) => { - if (!Array.isArray(args)) { - return file; - } - - return [file, ...args].join(' '); -}; - -// Handle `execa.command()` -const parseCommand = command => { - const tokens = []; - for (const token of command.trim().split(SPACES_REGEXP)) { - // Allow spaces to be escaped by a backslash if not meant as a delimiter - const previousToken = tokens[tokens.length - 1]; - if (previousToken && previousToken.endsWith('\\')) { - // Merge previous token with current one - tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; - } else { - tokens.push(token); - } - } - - return tokens; -}; - -module.exports = { - joinCommand, - parseCommand -}; - - -/***/ }), - -/***/ 35528: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const {signalsByName} = __webpack_require__(18694); - -const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { - if (timedOut) { - return `timed out after ${timeout} milliseconds`; - } - - if (isCanceled) { - return 'was canceled'; - } - - if (errorCode !== undefined) { - return `failed with ${errorCode}`; - } - - if (signal !== undefined) { - return `was killed with ${signal} (${signalDescription})`; - } - - if (exitCode !== undefined) { - return `failed with exit code ${exitCode}`; - } - - return 'failed'; -}; - -const makeError = ({ - stdout, - stderr, - all, - error, - signal, - exitCode, - command, - timedOut, - isCanceled, - killed, - parsed: {options: {timeout}} -}) => { - // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`. - // We normalize them to `undefined` - exitCode = exitCode === null ? undefined : exitCode; - signal = signal === null ? undefined : signal; - const signalDescription = signal === undefined ? undefined : signalsByName[signal].description; - - const errorCode = error && error.code; - - const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}); - const execaMessage = `Command ${prefix}: ${command}`; - const isError = Object.prototype.toString.call(error) === '[object Error]'; - const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage; - const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n'); - - if (isError) { - error.originalMessage = error.message; - error.message = message; - } else { - error = new Error(message); - } - - error.shortMessage = shortMessage; - error.command = command; - error.exitCode = exitCode; - error.signal = signal; - error.signalDescription = signalDescription; - error.stdout = stdout; - error.stderr = stderr; - - if (all !== undefined) { - error.all = all; - } - - if ('bufferedData' in error) { - delete error.bufferedData; - } - - error.failed = true; - error.timedOut = Boolean(timedOut); - error.isCanceled = isCanceled; - error.killed = killed && !timedOut; - - return error; -}; - -module.exports = makeError; - - -/***/ }), - -/***/ 51134: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const os = __webpack_require__(12087); -const onExit = __webpack_require__(22317); - -const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; - -// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior -const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => { - const killResult = kill(signal); - setKillTimeout(kill, signal, options, killResult); - return killResult; -}; - -const setKillTimeout = (kill, signal, options, killResult) => { - if (!shouldForceKill(signal, options, killResult)) { - return; - } - - const timeout = getForceKillAfterTimeout(options); - const t = setTimeout(() => { - kill('SIGKILL'); - }, timeout); - - // Guarded because there's no `.unref()` when `execa` is used in the renderer - // process in Electron. This cannot be tested since we don't run tests in - // Electron. - // istanbul ignore else - if (t.unref) { - t.unref(); - } -}; - -const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => { - return isSigterm(signal) && forceKillAfterTimeout !== false && killResult; -}; - -const isSigterm = signal => { - return signal === os.constants.signals.SIGTERM || - (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM'); -}; - -const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => { - if (forceKillAfterTimeout === true) { - return DEFAULT_FORCE_KILL_TIMEOUT; - } - - if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { - throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); - } - - return forceKillAfterTimeout; -}; - -// `childProcess.cancel()` -const spawnedCancel = (spawned, context) => { - const killResult = spawned.kill(); - - if (killResult) { - context.isCanceled = true; - } -}; - -const timeoutKill = (spawned, signal, reject) => { - spawned.kill(signal); - reject(Object.assign(new Error('Timed out'), {timedOut: true, signal})); -}; - -// `timeout` option handling -const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => { - if (timeout === 0 || timeout === undefined) { - return spawnedPromise; - } - - if (!Number.isFinite(timeout) || timeout < 0) { - throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); - } - - let timeoutId; - const timeoutPromise = new Promise((resolve, reject) => { - timeoutId = setTimeout(() => { - timeoutKill(spawned, killSignal, reject); - }, timeout); - }); - - const safeSpawnedPromise = spawnedPromise.finally(() => { - clearTimeout(timeoutId); - }); - - return Promise.race([timeoutPromise, safeSpawnedPromise]); -}; - -// `cleanup` option handling -const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => { - if (!cleanup || detached) { - return timedPromise; - } - - const removeExitHandler = onExit(() => { - spawned.kill(); - }); - - return timedPromise.finally(() => { - removeExitHandler(); - }); -}; - -module.exports = { - spawnedKill, - spawnedCancel, - setupTimeout, - setExitHandler -}; - - -/***/ }), - -/***/ 31045: -/***/ ((module) => { - -"use strict"; - - -const nativePromisePrototype = (async () => {})().constructor.prototype; -const descriptors = ['then', 'catch', 'finally'].map(property => [ - property, - Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) -]); - -// The return value is a mixin of `childProcess` and `Promise` -const mergePromise = (spawned, promise) => { - for (const [property, descriptor] of descriptors) { - // Starting the main `promise` is deferred to avoid consuming streams - const value = typeof promise === 'function' ? - (...args) => Reflect.apply(descriptor.value, promise(), args) : - descriptor.value.bind(promise); - - Reflect.defineProperty(spawned, property, {...descriptor, value}); - } - - return spawned; -}; - -// Use promises instead of `child_process` events -const getSpawnedPromise = spawned => { - return new Promise((resolve, reject) => { - spawned.on('exit', (exitCode, signal) => { - resolve({exitCode, signal}); - }); - - spawned.on('error', error => { - reject(error); - }); - - if (spawned.stdin) { - spawned.stdin.on('error', error => { - reject(error); - }); - } - }); -}; - -module.exports = { - mergePromise, - getSpawnedPromise -}; - - - -/***/ }), - -/***/ 89816: -/***/ ((module) => { - -"use strict"; - -const aliases = ['stdin', 'stdout', 'stderr']; - -const hasAlias = opts => aliases.some(alias => opts[alias] !== undefined); - -const normalizeStdio = opts => { - if (!opts) { - return; - } - - const {stdio} = opts; - - if (stdio === undefined) { - return aliases.map(alias => opts[alias]); - } - - if (hasAlias(opts)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); - } - - if (typeof stdio === 'string') { - return stdio; - } - - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); - } - - const length = Math.max(stdio.length, aliases.length); - return Array.from({length}, (value, index) => stdio[index]); -}; - -module.exports = normalizeStdio; - -// `ipc` is pushed unless it is already present -module.exports.node = opts => { - const stdio = normalizeStdio(opts); - - if (stdio === 'ipc') { - return 'ipc'; - } - - if (stdio === undefined || typeof stdio === 'string') { - return [stdio, stdio, stdio, 'ipc']; - } - - if (stdio.includes('ipc')) { - return stdio; - } - - return [...stdio, 'ipc']; -}; - - -/***/ }), - -/***/ 15156: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const isStream = __webpack_require__(93458); -const getStream = __webpack_require__(63886); -const mergeStream = __webpack_require__(6020); - -// `input` option -const handleInput = (spawned, input) => { - // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 - // TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 - if (input === undefined || spawned.stdin === undefined) { - return; - } - - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); - } -}; - -// `all` interleaves `stdout` and `stderr` -const makeAllStream = (spawned, {all}) => { - if (!all || (!spawned.stdout && !spawned.stderr)) { - return; - } - - const mixed = mergeStream(); - - if (spawned.stdout) { - mixed.add(spawned.stdout); - } - - if (spawned.stderr) { - mixed.add(spawned.stderr); - } - - return mixed; -}; - -// On failure, `result.stdout|stderr|all` should contain the currently buffered stream -const getBufferedData = async (stream, streamPromise) => { - if (!stream) { - return; - } - - stream.destroy(); - - try { - return await streamPromise; - } catch (error) { - return error.bufferedData; - } -}; - -const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => { - if (!stream || !buffer) { - return; - } - - if (encoding) { - return getStream(stream, {encoding, maxBuffer}); - } - - return getStream.buffer(stream, {maxBuffer}); -}; - -// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) -const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => { - const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer}); - const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer}); - const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2}); - - try { - return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); - } catch (error) { - return Promise.all([ - {error, signal: error.signal, timedOut: error.timedOut}, - getBufferedData(stdout, stdoutPromise), - getBufferedData(stderr, stderrPromise), - getBufferedData(all, allPromise) - ]); - } -}; - -const validateInputSync = ({input}) => { - if (isStream(input)) { - throw new TypeError('The `input` option cannot be a stream in sync mode'); - } -}; - -module.exports = { - handleInput, - makeAllStream, - getSpawnedResult, - validateInputSync -}; - - - -/***/ }), - -/***/ 3718: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/*! - * expand-tilde - * - * Copyright (c) 2015 Jon Schlinkert. - * Licensed under the MIT license. - */ - -var homedir = __webpack_require__(56530); -var path = __webpack_require__(85622); - -module.exports = function expandTilde(filepath) { - var home = homedir(); - - if (filepath.charCodeAt(0) === 126 /* ~ */) { - if (filepath.charCodeAt(1) === 43 /* + */) { - return path.join(process.cwd(), filepath.slice(2)); - } - return home ? path.join(home, filepath.slice(1)) : filepath; - } - - return filepath; -}; - - -/***/ }), - -/***/ 2933: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const debug = __webpack_require__(30787)('extract-zip') -// eslint-disable-next-line node/no-unsupported-features/node-builtins -const { createWriteStream, promises: fs } = __webpack_require__(35747) -const getStream = __webpack_require__(63886) -const path = __webpack_require__(85622) -const { promisify } = __webpack_require__(31669) -const stream = __webpack_require__(92413) -const yauzl = __webpack_require__(8245) - -const openZip = promisify(yauzl.open) -const pipeline = promisify(stream.pipeline) - -class Extractor { - constructor (zipPath, opts) { - this.zipPath = zipPath - this.opts = opts - } - - async extract () { - debug('opening', this.zipPath, 'with opts', this.opts) - - this.zipfile = await openZip(this.zipPath, { lazyEntries: true }) - this.canceled = false - - return new Promise((resolve, reject) => { - this.zipfile.on('error', err => { - this.canceled = true - reject(err) - }) - this.zipfile.readEntry() - - this.zipfile.on('close', () => { - if (!this.canceled) { - debug('zip extraction complete') - resolve() - } - }) - - this.zipfile.on('entry', async entry => { - /* istanbul ignore if */ - if (this.canceled) { - debug('skipping entry', entry.fileName, { cancelled: this.canceled }) - return - } - - debug('zipfile entry', entry.fileName) - - if (entry.fileName.startsWith('__MACOSX/')) { - this.zipfile.readEntry() - return - } - - const destDir = path.dirname(path.join(this.opts.dir, entry.fileName)) - - try { - await fs.mkdir(destDir, { recursive: true }) - - const canonicalDestDir = await fs.realpath(destDir) - const relativeDestDir = path.relative(this.opts.dir, canonicalDestDir) - - if (relativeDestDir.split(path.sep).includes('..')) { - throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`) - } - - await this.extractEntry(entry) - debug('finished processing', entry.fileName) - this.zipfile.readEntry() - } catch (err) { - this.canceled = true - this.zipfile.close() - reject(err) - } - }) - }) - } - - async extractEntry (entry) { - /* istanbul ignore if */ - if (this.canceled) { - debug('skipping entry extraction', entry.fileName, { cancelled: this.canceled }) - return - } - - if (this.opts.onEntry) { - this.opts.onEntry(entry, this.zipfile) - } - - const dest = path.join(this.opts.dir, entry.fileName) - - // convert external file attr int into a fs stat mode int - const mode = (entry.externalFileAttributes >> 16) & 0xFFFF - // check if it's a symlink or dir (using stat mode constants) - const IFMT = 61440 - const IFDIR = 16384 - const IFLNK = 40960 - const symlink = (mode & IFMT) === IFLNK - let isDir = (mode & IFMT) === IFDIR - - // Failsafe, borrowed from jsZip - if (!isDir && entry.fileName.endsWith('/')) { - isDir = true - } - - // check for windows weird way of specifying a directory - // https://github.com/maxogden/extract-zip/issues/13#issuecomment-154494566 - const madeBy = entry.versionMadeBy >> 8 - if (!isDir) isDir = (madeBy === 0 && entry.externalFileAttributes === 16) - - debug('extracting entry', { filename: entry.fileName, isDir: isDir, isSymlink: symlink }) - - const procMode = this.getExtractedMode(mode, isDir) & 0o777 - - // always ensure folders are created - const destDir = isDir ? dest : path.dirname(dest) - - const mkdirOptions = { recursive: true } - if (isDir) { - mkdirOptions.mode = procMode - } - debug('mkdir', { dir: destDir, ...mkdirOptions }) - await fs.mkdir(destDir, mkdirOptions) - if (isDir) return - - debug('opening read stream', dest) - const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry) - - if (symlink) { - const link = await getStream(readStream) - debug('creating symlink', link, dest) - await fs.symlink(link, dest) - } else { - await pipeline(readStream, createWriteStream(dest, { mode: procMode })) - } - } - - getExtractedMode (entryMode, isDir) { - let mode = entryMode - // Set defaults, if necessary - if (mode === 0) { - if (isDir) { - if (this.opts.defaultDirMode) { - mode = parseInt(this.opts.defaultDirMode, 10) - } - - if (!mode) { - mode = 0o755 - } - } else { - if (this.opts.defaultFileMode) { - mode = parseInt(this.opts.defaultFileMode, 10) - } - - if (!mode) { - mode = 0o644 - } - } - } - - return mode - } -} - -module.exports = async function (zipPath, opts) { - debug('creating target directory', opts.dir) - - if (!path.isAbsolute(opts.dir)) { - throw new Error('Target directory is expected to be absolute') - } - - await fs.mkdir(opts.dir, { recursive: true }) - opts.dir = await fs.realpath(opts.dir) - return new Extractor(zipPath, opts).extract() -} - - -/***/ }), - -/***/ 92104: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -var fs = __webpack_require__(35747); -var util = __webpack_require__(31669); -var stream = __webpack_require__(92413); -var Readable = stream.Readable; -var Writable = stream.Writable; -var PassThrough = stream.PassThrough; -var Pend = __webpack_require__(71932); -var EventEmitter = __webpack_require__(28614).EventEmitter; - -exports.createFromBuffer = createFromBuffer; -exports.createFromFd = createFromFd; -exports.BufferSlicer = BufferSlicer; -exports.FdSlicer = FdSlicer; - -util.inherits(FdSlicer, EventEmitter); -function FdSlicer(fd, options) { - options = options || {}; - EventEmitter.call(this); - - this.fd = fd; - this.pend = new Pend(); - this.pend.max = 1; - this.refCount = 0; - this.autoClose = !!options.autoClose; -} - -FdSlicer.prototype.read = function(buffer, offset, length, position, callback) { - var self = this; - self.pend.go(function(cb) { - fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) { - cb(); - callback(err, bytesRead, buffer); - }); - }); -}; - -FdSlicer.prototype.write = function(buffer, offset, length, position, callback) { - var self = this; - self.pend.go(function(cb) { - fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) { - cb(); - callback(err, written, buffer); - }); - }); -}; - -FdSlicer.prototype.createReadStream = function(options) { - return new ReadStream(this, options); -}; - -FdSlicer.prototype.createWriteStream = function(options) { - return new WriteStream(this, options); -}; - -FdSlicer.prototype.ref = function() { - this.refCount += 1; -}; - -FdSlicer.prototype.unref = function() { - var self = this; - self.refCount -= 1; - - if (self.refCount > 0) return; - if (self.refCount < 0) throw new Error("invalid unref"); - - if (self.autoClose) { - fs.close(self.fd, onCloseDone); - } - - function onCloseDone(err) { - if (err) { - self.emit('error', err); - } else { - self.emit('close'); - } - } -}; - -util.inherits(ReadStream, Readable); -function ReadStream(context, options) { - options = options || {}; - Readable.call(this, options); - - this.context = context; - this.context.ref(); - - this.start = options.start || 0; - this.endOffset = options.end; - this.pos = this.start; - this.destroyed = false; -} - -ReadStream.prototype._read = function(n) { - var self = this; - if (self.destroyed) return; - - var toRead = Math.min(self._readableState.highWaterMark, n); - if (self.endOffset != null) { - toRead = Math.min(toRead, self.endOffset - self.pos); - } - if (toRead <= 0) { - self.destroyed = true; - self.push(null); - self.context.unref(); - return; - } - self.context.pend.go(function(cb) { - if (self.destroyed) return cb(); - var buffer = new Buffer(toRead); - fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) { - if (err) { - self.destroy(err); - } else if (bytesRead === 0) { - self.destroyed = true; - self.push(null); - self.context.unref(); - } else { - self.pos += bytesRead; - self.push(buffer.slice(0, bytesRead)); - } - cb(); - }); - }); -}; - -ReadStream.prototype.destroy = function(err) { - if (this.destroyed) return; - err = err || new Error("stream destroyed"); - this.destroyed = true; - this.emit('error', err); - this.context.unref(); -}; - -util.inherits(WriteStream, Writable); -function WriteStream(context, options) { - options = options || {}; - Writable.call(this, options); - - this.context = context; - this.context.ref(); - - this.start = options.start || 0; - this.endOffset = (options.end == null) ? Infinity : +options.end; - this.bytesWritten = 0; - this.pos = this.start; - this.destroyed = false; - - this.on('finish', this.destroy.bind(this)); -} - -WriteStream.prototype._write = function(buffer, encoding, callback) { - var self = this; - if (self.destroyed) return; - - if (self.pos + buffer.length > self.endOffset) { - var err = new Error("maximum file length exceeded"); - err.code = 'ETOOBIG'; - self.destroy(); - callback(err); - return; - } - self.context.pend.go(function(cb) { - if (self.destroyed) return cb(); - fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) { - if (err) { - self.destroy(); - cb(); - callback(err); - } else { - self.bytesWritten += bytes; - self.pos += bytes; - self.emit('progress'); - cb(); - callback(); - } - }); - }); -}; - -WriteStream.prototype.destroy = function() { - if (this.destroyed) return; - this.destroyed = true; - this.context.unref(); -}; - -util.inherits(BufferSlicer, EventEmitter); -function BufferSlicer(buffer, options) { - EventEmitter.call(this); - - options = options || {}; - this.refCount = 0; - this.buffer = buffer; - this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER; -} - -BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) { - var end = position + length; - var delta = end - this.buffer.length; - var written = (delta > 0) ? delta : length; - this.buffer.copy(buffer, offset, position, end); - setImmediate(function() { - callback(null, written); - }); -}; - -BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) { - buffer.copy(this.buffer, position, offset, offset + length); - setImmediate(function() { - callback(null, length, buffer); - }); -}; - -BufferSlicer.prototype.createReadStream = function(options) { - options = options || {}; - var readStream = new PassThrough(options); - readStream.destroyed = false; - readStream.start = options.start || 0; - readStream.endOffset = options.end; - // by the time this function returns, we'll be done. - readStream.pos = readStream.endOffset || this.buffer.length; - - // respect the maxChunkSize option to slice up the chunk into smaller pieces. - var entireSlice = this.buffer.slice(readStream.start, readStream.pos); - var offset = 0; - while (true) { - var nextOffset = offset + this.maxChunkSize; - if (nextOffset >= entireSlice.length) { - // last chunk - if (offset < entireSlice.length) { - readStream.write(entireSlice.slice(offset, entireSlice.length)); - } - break; - } - readStream.write(entireSlice.slice(offset, nextOffset)); - offset = nextOffset; - } - - readStream.end(); - readStream.destroy = function() { - readStream.destroyed = true; - }; - return readStream; -}; - -BufferSlicer.prototype.createWriteStream = function(options) { - var bufferSlicer = this; - options = options || {}; - var writeStream = new Writable(options); - writeStream.start = options.start || 0; - writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end; - writeStream.bytesWritten = 0; - writeStream.pos = writeStream.start; - writeStream.destroyed = false; - writeStream._write = function(buffer, encoding, callback) { - if (writeStream.destroyed) return; - - var end = writeStream.pos + buffer.length; - if (end > writeStream.endOffset) { - var err = new Error("maximum file length exceeded"); - err.code = 'ETOOBIG'; - writeStream.destroyed = true; - callback(err); - return; - } - buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length); - - writeStream.bytesWritten += buffer.length; - writeStream.pos = end; - writeStream.emit('progress'); - callback(); - }; - writeStream.destroy = function() { - writeStream.destroyed = true; - }; - return writeStream; -}; - -BufferSlicer.prototype.ref = function() { - this.refCount += 1; -}; - -BufferSlicer.prototype.unref = function() { - this.refCount -= 1; - - if (this.refCount < 0) { - throw new Error("invalid unref"); - } -}; - -function createFromBuffer(buffer, options) { - return new BufferSlicer(buffer, options); -} - -function createFromFd(fd, options) { - return new FdSlicer(fd, options); -} - - -/***/ }), - -/***/ 66521: -/***/ ((module) => { - -"use strict"; - -module.exports = function () { - return /[<>:"\/\\|?*]/g; -}; - - -/***/ }), - -/***/ 63088: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var filenamify = __webpack_require__(25686); -var humanizeUrl = __webpack_require__(52111); - -module.exports = function (str, opts) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return filenamify(humanizeUrl(str), opts); -}; - - -/***/ }), - -/***/ 25686: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var path = __webpack_require__(85622); -var trimRepeated = __webpack_require__(33533); -var filenameReservedRegex = __webpack_require__(66521); -var stripOuter = __webpack_require__(77901); - -// doesn't make sense to have longer filenames -var MAX_FILENAME_LENGTH = 100; - -var reControlChars = /[\x00-\x1f\x80-\x9f]/g; -var reRelativePath = /^\.+/; - -var fn = module.exports = function (str, opts) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - opts = opts || {}; - - var replacement = opts.replacement || '!'; - - if (filenameReservedRegex().test(replacement) && reControlChars.test(replacement)) { - throw new Error('Replacement string cannot contain reserved filename characters'); - } - - str = str.replace(filenameReservedRegex(), replacement); - str = str.replace(reControlChars, replacement); - str = str.replace(reRelativePath, replacement); - - if (replacement.length > 0) { - str = trimRepeated(str, replacement); - str = str.length > 1 ? stripOuter(str, replacement) : str; - } - - str = str.slice(0, MAX_FILENAME_LENGTH); - - return str; -}; - -fn.path = function (pth, opts) { - pth = path.resolve(pth); - return path.join(path.dirname(pth), fn(path.basename(pth), opts)); -}; - - -/***/ }), - -/***/ 35955: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/*! - * fill-range - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Licensed under the MIT License. - */ - - - -const util = __webpack_require__(31669); -const toRegexRange = __webpack_require__(1353); - -const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); - -const transform = toNumber => { - return value => toNumber === true ? Number(value) : String(value); -}; - -const isValidValue = value => { - return typeof value === 'number' || (typeof value === 'string' && value !== ''); -}; - -const isNumber = num => Number.isInteger(+num); - -const zeros = input => { - let value = `${input}`; - let index = -1; - if (value[0] === '-') value = value.slice(1); - if (value === '0') return false; - while (value[++index] === '0'); - return index > 0; -}; - -const stringify = (start, end, options) => { - if (typeof start === 'string' || typeof end === 'string') { - return true; - } - return options.stringify === true; -}; - -const pad = (input, maxLength, toNumber) => { - if (maxLength > 0) { - let dash = input[0] === '-' ? '-' : ''; - if (dash) input = input.slice(1); - input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); - } - if (toNumber === false) { - return String(input); - } - return input; -}; - -const toMaxLen = (input, maxLength) => { - let negative = input[0] === '-' ? '-' : ''; - if (negative) { - input = input.slice(1); - maxLength--; - } - while (input.length < maxLength) input = '0' + input; - return negative ? ('-' + input) : input; -}; - -const toSequence = (parts, options) => { - parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - - let prefix = options.capture ? '' : '?:'; - let positives = ''; - let negatives = ''; - let result; - - if (parts.positives.length) { - positives = parts.positives.join('|'); - } - - if (parts.negatives.length) { - negatives = `-(${prefix}${parts.negatives.join('|')})`; - } - - if (positives && negatives) { - result = `${positives}|${negatives}`; - } else { - result = positives || negatives; - } - - if (options.wrap) { - return `(${prefix}${result})`; - } - - return result; -}; - -const toRange = (a, b, isNumbers, options) => { - if (isNumbers) { - return toRegexRange(a, b, { wrap: false, ...options }); - } - - let start = String.fromCharCode(a); - if (a === b) return start; - - let stop = String.fromCharCode(b); - return `[${start}-${stop}]`; -}; - -const toRegex = (start, end, options) => { - if (Array.isArray(start)) { - let wrap = options.wrap === true; - let prefix = options.capture ? '' : '?:'; - return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); - } - return toRegexRange(start, end, options); -}; - -const rangeError = (...args) => { - return new RangeError('Invalid range arguments: ' + util.inspect(...args)); -}; - -const invalidRange = (start, end, options) => { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; -}; - -const invalidStep = (step, options) => { - if (options.strictRanges === true) { - throw new TypeError(`Expected step "${step}" to be a number`); - } - return []; -}; - -const fillNumbers = (start, end, step = 1, options = {}) => { - let a = Number(start); - let b = Number(end); - - if (!Number.isInteger(a) || !Number.isInteger(b)) { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; - } - - // fix negative zero - if (a === 0) a = 0; - if (b === 0) b = 0; - - let descending = a > b; - let startString = String(start); - let endString = String(end); - let stepString = String(step); - step = Math.max(Math.abs(step), 1); - - let padded = zeros(startString) || zeros(endString) || zeros(stepString); - let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; - let toNumber = padded === false && stringify(start, end, options) === false; - let format = options.transform || transform(toNumber); - - if (options.toRegex && step === 1) { - return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); - } - - let parts = { negatives: [], positives: [] }; - let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); - let range = []; - let index = 0; - - while (descending ? a >= b : a <= b) { - if (options.toRegex === true && step > 1) { - push(a); - } else { - range.push(pad(format(a, index), maxLen, toNumber)); - } - a = descending ? a - step : a + step; - index++; - } - - if (options.toRegex === true) { - return step > 1 - ? toSequence(parts, options) - : toRegex(range, null, { wrap: false, ...options }); - } - - return range; -}; - -const fillLetters = (start, end, step = 1, options = {}) => { - if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { - return invalidRange(start, end, options); - } - - - let format = options.transform || (val => String.fromCharCode(val)); - let a = `${start}`.charCodeAt(0); - let b = `${end}`.charCodeAt(0); - - let descending = a > b; - let min = Math.min(a, b); - let max = Math.max(a, b); - - if (options.toRegex && step === 1) { - return toRange(min, max, false, options); - } - - let range = []; - let index = 0; - - while (descending ? a >= b : a <= b) { - range.push(format(a, index)); - a = descending ? a - step : a + step; - index++; - } - - if (options.toRegex === true) { - return toRegex(range, null, { wrap: false, options }); - } - - return range; -}; - -const fill = (start, end, step, options = {}) => { - if (end == null && isValidValue(start)) { - return [start]; - } - - if (!isValidValue(start) || !isValidValue(end)) { - return invalidRange(start, end, options); - } - - if (typeof step === 'function') { - return fill(start, end, 1, { transform: step }); - } - - if (isObject(step)) { - return fill(start, end, 0, step); - } - - let opts = { ...options }; - if (opts.capture === true) opts.wrap = true; - step = step || opts.step || 1; - - if (!isNumber(step)) { - if (step != null && !isObject(step)) return invalidStep(step, opts); - return fill(start, end, 1, step); - } - - if (isNumber(start) && isNumber(end)) { - return fillNumbers(start, end, step, opts); - } - - return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); -}; - -module.exports = fill; - - -/***/ }), - -/***/ 2885: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const path = __webpack_require__(85622); -const locatePath = __webpack_require__(30815); -const pathExists = __webpack_require__(89255); - -const stop = Symbol('findUp.stop'); - -module.exports = async (name, options = {}) => { - let directory = path.resolve(options.cwd || ''); - const {root} = path.parse(directory); - const paths = [].concat(name); - - const runMatcher = async locateOptions => { - if (typeof name !== 'function') { - return locatePath(paths, locateOptions); - } - - const foundPath = await name(locateOptions.cwd); - if (typeof foundPath === 'string') { - return locatePath([foundPath], locateOptions); - } - - return foundPath; - }; - - // eslint-disable-next-line no-constant-condition - while (true) { - // eslint-disable-next-line no-await-in-loop - const foundPath = await runMatcher({...options, cwd: directory}); - - if (foundPath === stop) { - return; - } - - if (foundPath) { - return path.resolve(directory, foundPath); - } - - if (directory === root) { - return; - } - - directory = path.dirname(directory); - } -}; - -module.exports.sync = (name, options = {}) => { - let directory = path.resolve(options.cwd || ''); - const {root} = path.parse(directory); - const paths = [].concat(name); - - const runMatcher = locateOptions => { - if (typeof name !== 'function') { - return locatePath.sync(paths, locateOptions); - } - - const foundPath = name(locateOptions.cwd); - if (typeof foundPath === 'string') { - return locatePath.sync([foundPath], locateOptions); - } - - return foundPath; - }; - - // eslint-disable-next-line no-constant-condition - while (true) { - const foundPath = runMatcher({...options, cwd: directory}); - - if (foundPath === stop) { - return; - } - - if (foundPath) { - return path.resolve(directory, foundPath); - } - - if (directory === root) { - return; - } - - directory = path.dirname(directory); - } -}; - -module.exports.exists = pathExists; - -module.exports.sync.exists = pathExists.sync; - -module.exports.stop = stop; - - -/***/ }), - -/***/ 89255: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const fs = __webpack_require__(35747); -const {promisify} = __webpack_require__(31669); - -const pAccess = promisify(fs.access); - -module.exports = async path => { - try { - await pAccess(path); - return true; - } catch (_) { - return false; - } -}; - -module.exports.sync = path => { - try { - fs.accessSync(path); - return true; - } catch (_) { - return false; - } -}; - - -/***/ }), - -/***/ 20219: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -/** - * Module dependencies - */ - -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var isGlob = __webpack_require__(2182); -var resolveDir = __webpack_require__(20493); -var detect = __webpack_require__(3402); -var mm = __webpack_require__(78885); - -/** - * @param {String|Array} `pattern` Glob pattern or file path(s) to match against. - * @param {Object} `options` Options to pass to [micromatch]. Note that if you want to start in a different directory than the current working directory, specify the `options.cwd` property here. - * @return {String} Returns the first matching file. - * @api public - */ - -module.exports = function(patterns, options) { - options = options || {}; - var cwd = path.resolve(resolveDir(options.cwd || '')); - - if (typeof patterns === 'string') { - return lookup(cwd, [patterns], options); - } - - if (!Array.isArray(patterns)) { - throw new TypeError('findup-sync expects a string or array as the first argument.'); - } - - return lookup(cwd, patterns, options); -}; - -function lookup(cwd, patterns, options) { - var len = patterns.length; - var idx = -1; - var res; - - while (++idx < len) { - if (isGlob(patterns[idx])) { - res = matchFile(cwd, patterns[idx], options); - } else { - res = findFile(cwd, patterns[idx], options); - } - if (res) { - return res; - } - } - - var dir = path.dirname(cwd); - if (dir === cwd) { - return null; - } - return lookup(dir, patterns, options); -} - -function matchFile(cwd, pattern, opts) { - var isMatch = mm.matcher(pattern, opts); - var files = tryReaddirSync(cwd); - var len = files.length; - var idx = -1; - - while (++idx < len) { - var name = files[idx]; - var fp = path.join(cwd, name); - if (isMatch(name) || isMatch(fp)) { - return fp; - } - } - return null; -} - -function findFile(cwd, filename, options) { - var fp = cwd ? path.resolve(cwd, filename) : filename; - return detect(fp, options); -} - -function tryReaddirSync(fp) { - try { - return fs.readdirSync(fp); - } catch (err) { - // Ignore error - } - return []; -} - - -/***/ }), - -/***/ 78885: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const util = __webpack_require__(31669); -const braces = __webpack_require__(22706); -const picomatch = __webpack_require__(5669); -const utils = __webpack_require__(86444); -const isEmptyString = val => typeof val === 'string' && (val === '' || val === './'); - -/** - * Returns an array of strings that match one or more glob patterns. - * - * ```js - * const mm = require('micromatch'); - * // mm(list, patterns[, options]); - * - * console.log(mm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {String|Array} list List of strings to match. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} options See available [options](#options) - * @return {Array} Returns an array of matches - * @summary false - * @api public - */ - -const micromatch = (list, patterns, options) => { - patterns = [].concat(patterns); - list = [].concat(list); - - let omit = new Set(); - let keep = new Set(); - let items = new Set(); - let negatives = 0; - - let onResult = state => { - items.add(state.output); - if (options && options.onResult) { - options.onResult(state); - } - }; - - for (let i = 0; i < patterns.length; i++) { - let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); - let negated = isMatch.state.negated || isMatch.state.negatedExtglob; - if (negated) negatives++; - - for (let item of list) { - let matched = isMatch(item, true); - - let match = negated ? !matched.isMatch : matched.isMatch; - if (!match) continue; - - if (negated) { - omit.add(matched.output); - } else { - omit.delete(matched.output); - keep.add(matched.output); - } - } - } - - let result = negatives === patterns.length ? [...items] : [...keep]; - let matches = result.filter(item => !omit.has(item)); - - if (options && matches.length === 0) { - if (options.failglob === true) { - throw new Error(`No matches found for "${patterns.join(', ')}"`); - } - - if (options.nonull === true || options.nullglob === true) { - return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; - } - } - - return matches; -}; - -/** - * Backwards compatibility - */ - -micromatch.match = micromatch; - -/** - * Returns a matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * const mm = require('micromatch'); - * // mm.matcher(pattern[, options]); - * - * const isMatch = mm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` - * @return {Function} Returns a matcher function. - * @api public - */ - -micromatch.matcher = (pattern, options) => picomatch(pattern, options); - -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const mm = require('micromatch'); - * // mm.isMatch(string, patterns[, options]); - * - * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(mm.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String} str The string to test. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} [options] See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); - -/** - * Backwards compatibility - */ - -micromatch.any = micromatch.isMatch; - -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.not(list, patterns[, options]); - * - * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ - -micromatch.not = (list, patterns, options = {}) => { - patterns = [].concat(patterns).map(String); - let result = new Set(); - let items = []; - - let onResult = state => { - if (options.onResult) options.onResult(state); - items.push(state.output); - }; - - let matches = micromatch(list, patterns, { ...options, onResult }); - - for (let item of items) { - if (!matches.includes(item)) { - result.add(item); - } - } - return [...result]; -}; - -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var mm = require('micromatch'); - * // mm.contains(string, pattern[, options]); - * - * console.log(mm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(mm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if the patter matches any part of `str`. - * @api public - */ - -micromatch.contains = (str, pattern, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } - - if (Array.isArray(pattern)) { - return pattern.some(p => micromatch.contains(str, p, options)); - } - - if (typeof pattern === 'string') { - if (isEmptyString(str) || isEmptyString(pattern)) { - return false; - } - - if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { - return true; - } - } - - return micromatch.isMatch(str, pattern, { ...options, contains: true }); -}; - -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * const mm = require('micromatch'); - * // mm.matchKeys(object, patterns[, options]); - * - * const obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(mm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ - -micromatch.matchKeys = (obj, patterns, options) => { - if (!utils.isObject(obj)) { - throw new TypeError('Expected the first argument to be an object'); - } - let keys = micromatch(Object.keys(obj), patterns, options); - let res = {}; - for (let key of keys) res[key] = obj[key]; - return res; -}; - -/** - * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.some(list, patterns[, options]); - * - * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.some = (list, patterns, options) => { - let items = [].concat(list); - - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (items.some(item => isMatch(item))) { - return true; - } - } - return false; -}; - -/** - * Returns true if every string in the given `list` matches - * any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.every(list, patterns[, options]); - * - * console.log(mm.every('foo.js', ['foo.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.every = (list, patterns, options) => { - let items = [].concat(list); - - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (!items.every(item => isMatch(item))) { - return false; - } - } - return true; -}; - -/** - * Returns true if **all** of the given `patterns` match - * the specified string. - * - * ```js - * const mm = require('micromatch'); - * // mm.all(string, patterns[, options]); - * - * console.log(mm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.all = (str, patterns, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } - - return [].concat(patterns).every(p => picomatch(p, options)(str)); -}; - -/** - * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. - * - * ```js - * const mm = require('micromatch'); - * // mm.capture(pattern, string[, options]); - * - * console.log(mm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(mm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `glob` Glob pattern to use for matching. - * @param {String} `input` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns an array of captures if the input matches the glob pattern, otherwise `null`. - * @api public - */ - -micromatch.capture = (glob, input, options) => { - let posix = utils.isWindows(options); - let regex = picomatch.makeRe(String(glob), { ...options, capture: true }); - let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); - - if (match) { - return match.slice(1).map(v => v === void 0 ? '' : v); - } -}; - -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * const mm = require('micromatch'); - * // mm.makeRe(pattern[, options]); - * - * console.log(mm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ - -micromatch.makeRe = (...args) => picomatch.makeRe(...args); - -/** - * Scan a glob pattern to separate the pattern into segments. Used - * by the [split](#split) method. - * - * ```js - * const mm = require('micromatch'); - * const state = mm.scan(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ - -micromatch.scan = (...args) => picomatch.scan(...args); - -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const mm = require('micromatch'); - * const state = mm(pattern[, options]); - * ``` - * @param {String} `glob` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as regex source string. - * @api public - */ - -micromatch.parse = (patterns, options) => { - let res = []; - for (let pattern of [].concat(patterns || [])) { - for (let str of braces(String(pattern), options)) { - res.push(picomatch.parse(str, options)); - } - } - return res; -}; - -/** - * Process the given brace `pattern`. - * - * ```js - * const { braces } = require('micromatch'); - * console.log(braces('foo/{a,b,c}/bar')); - * //=> [ 'foo/(a|b|c)/bar' ] - * - * console.log(braces('foo/{a,b,c}/bar', { expand: true })); - * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] - * ``` - * @param {String} `pattern` String with brace pattern to process. - * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. - * @return {Array} - * @api public - */ - -micromatch.braces = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { - return [pattern]; - } - return braces(pattern, options); -}; - -/** - * Expand braces - */ - -micromatch.braceExpand = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - return micromatch.braces(pattern, { ...options, expand: true }); -}; - -/** - * Expose micromatch - */ - -module.exports = micromatch; - - -/***/ }), - -/***/ 60123: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirsSync = __webpack_require__(81881).mkdirsSync -const utimesMillisSync = __webpack_require__(64698).utimesMillisSync -const stat = __webpack_require__(66834) - -function copySync (src, dest, opts) { - if (typeof opts === 'function') { - opts = { filter: opts } - } - - opts = opts || {} - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n - see https://github.com/jprichardson/node-fs-extra/issues/269`) - } - - const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy') - stat.checkParentPathsSync(src, srcStat, dest, 'copy') - return handleFilterAndCopy(destStat, src, dest, opts) -} - -function handleFilterAndCopy (destStat, src, dest, opts) { - if (opts.filter && !opts.filter(src, dest)) return - const destParent = path.dirname(dest) - if (!fs.existsSync(destParent)) mkdirsSync(destParent) - return startCopy(destStat, src, dest, opts) -} - -function startCopy (destStat, src, dest, opts) { - if (opts.filter && !opts.filter(src, dest)) return - return getStats(destStat, src, dest, opts) -} - -function getStats (destStat, src, dest, opts) { - const statSync = opts.dereference ? fs.statSync : fs.lstatSync - const srcStat = statSync(src) - - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) -} - -function onFile (srcStat, destStat, src, dest, opts) { - if (!destStat) return copyFile(srcStat, src, dest, opts) - return mayCopyFile(srcStat, src, dest, opts) -} - -function mayCopyFile (srcStat, src, dest, opts) { - if (opts.overwrite) { - fs.unlinkSync(dest) - return copyFile(srcStat, src, dest, opts) - } else if (opts.errorOnExist) { - throw new Error(`'${dest}' already exists`) - } -} - -function copyFile (srcStat, src, dest, opts) { - fs.copyFileSync(src, dest) - if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest) - return setDestMode(dest, srcStat.mode) -} - -function handleTimestamps (srcMode, src, dest) { - // Make sure the file is writable before setting the timestamp - // otherwise open fails with EPERM when invoked with 'r+' - // (through utimes call) - if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode) - return setDestTimestamps(src, dest) -} - -function fileIsNotWritable (srcMode) { - return (srcMode & 0o200) === 0 -} - -function makeFileWritable (dest, srcMode) { - return setDestMode(dest, srcMode | 0o200) -} - -function setDestMode (dest, srcMode) { - return fs.chmodSync(dest, srcMode) -} - -function setDestTimestamps (src, dest) { - // The initial srcStat.atime cannot be trusted - // because it is modified by the read(2) system call - // (See https://nodejs.org/api/fs.html#fs_stat_time_values) - const updatedSrcStat = fs.statSync(src) - return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime) -} - -function onDir (srcStat, destStat, src, dest, opts) { - if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts) - if (destStat && !destStat.isDirectory()) { - throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) - } - return copyDir(src, dest, opts) -} - -function mkDirAndCopy (srcMode, src, dest, opts) { - fs.mkdirSync(dest) - copyDir(src, dest, opts) - return setDestMode(dest, srcMode) -} - -function copyDir (src, dest, opts) { - fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) -} - -function copyDirItem (item, src, dest, opts) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy') - return startCopy(destStat, srcItem, destItem, opts) -} - -function onLink (destStat, src, dest, opts) { - let resolvedSrc = fs.readlinkSync(src) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } - - if (!destStat) { - return fs.symlinkSync(resolvedSrc, dest) - } else { - let resolvedDest - try { - resolvedDest = fs.readlinkSync(dest) - } catch (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) - throw err - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) - } - - // prevent copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) - } - return copyLink(resolvedSrc, dest) - } -} - -function copyLink (resolvedSrc, dest) { - fs.unlinkSync(dest) - return fs.symlinkSync(resolvedSrc, dest) -} - -module.exports = copySync - - -/***/ }), - -/***/ 6574: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = { - copySync: __webpack_require__(60123) -} - - -/***/ }), - -/***/ 41132: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirs = __webpack_require__(81881).mkdirs -const pathExists = __webpack_require__(42176).pathExists -const utimesMillis = __webpack_require__(64698).utimesMillis -const stat = __webpack_require__(66834) - -function copy (src, dest, opts, cb) { - if (typeof opts === 'function' && !cb) { - cb = opts - opts = {} - } else if (typeof opts === 'function') { - opts = { filter: opts } - } - - cb = cb || function () {} - opts = opts || {} - - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n - see https://github.com/jprichardson/node-fs-extra/issues/269`) - } - - stat.checkPaths(src, dest, 'copy', (err, stats) => { - if (err) return cb(err) - const { srcStat, destStat } = stats - stat.checkParentPaths(src, srcStat, dest, 'copy', err => { - if (err) return cb(err) - if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb) - return checkParentDir(destStat, src, dest, opts, cb) - }) - }) -} - -function checkParentDir (destStat, src, dest, opts, cb) { - const destParent = path.dirname(dest) - pathExists(destParent, (err, dirExists) => { - if (err) return cb(err) - if (dirExists) return startCopy(destStat, src, dest, opts, cb) - mkdirs(destParent, err => { - if (err) return cb(err) - return startCopy(destStat, src, dest, opts, cb) - }) - }) -} - -function handleFilter (onInclude, destStat, src, dest, opts, cb) { - Promise.resolve(opts.filter(src, dest)).then(include => { - if (include) return onInclude(destStat, src, dest, opts, cb) - return cb() - }, error => cb(error)) -} - -function startCopy (destStat, src, dest, opts, cb) { - if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb) - return getStats(destStat, src, dest, opts, cb) -} - -function getStats (destStat, src, dest, opts, cb) { - const stat = opts.dereference ? fs.stat : fs.lstat - stat(src, (err, srcStat) => { - if (err) return cb(err) - - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb) - }) -} - -function onFile (srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return copyFile(srcStat, src, dest, opts, cb) - return mayCopyFile(srcStat, src, dest, opts, cb) -} - -function mayCopyFile (srcStat, src, dest, opts, cb) { - if (opts.overwrite) { - fs.unlink(dest, err => { - if (err) return cb(err) - return copyFile(srcStat, src, dest, opts, cb) - }) - } else if (opts.errorOnExist) { - return cb(new Error(`'${dest}' already exists`)) - } else return cb() -} - -function copyFile (srcStat, src, dest, opts, cb) { - fs.copyFile(src, dest, err => { - if (err) return cb(err) - if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb) - return setDestMode(dest, srcStat.mode, cb) - }) -} - -function handleTimestampsAndMode (srcMode, src, dest, cb) { - // Make sure the file is writable before setting the timestamp - // otherwise open fails with EPERM when invoked with 'r+' - // (through utimes call) - if (fileIsNotWritable(srcMode)) { - return makeFileWritable(dest, srcMode, err => { - if (err) return cb(err) - return setDestTimestampsAndMode(srcMode, src, dest, cb) - }) - } - return setDestTimestampsAndMode(srcMode, src, dest, cb) -} - -function fileIsNotWritable (srcMode) { - return (srcMode & 0o200) === 0 -} - -function makeFileWritable (dest, srcMode, cb) { - return setDestMode(dest, srcMode | 0o200, cb) -} - -function setDestTimestampsAndMode (srcMode, src, dest, cb) { - setDestTimestamps(src, dest, err => { - if (err) return cb(err) - return setDestMode(dest, srcMode, cb) - }) -} - -function setDestMode (dest, srcMode, cb) { - return fs.chmod(dest, srcMode, cb) -} - -function setDestTimestamps (src, dest, cb) { - // The initial srcStat.atime cannot be trusted - // because it is modified by the read(2) system call - // (See https://nodejs.org/api/fs.html#fs_stat_time_values) - fs.stat(src, (err, updatedSrcStat) => { - if (err) return cb(err) - return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb) - }) -} - -function onDir (srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb) - if (destStat && !destStat.isDirectory()) { - return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) - } - return copyDir(src, dest, opts, cb) -} - -function mkDirAndCopy (srcMode, src, dest, opts, cb) { - fs.mkdir(dest, err => { - if (err) return cb(err) - copyDir(src, dest, opts, err => { - if (err) return cb(err) - return setDestMode(dest, srcMode, cb) - }) - }) -} - -function copyDir (src, dest, opts, cb) { - fs.readdir(src, (err, items) => { - if (err) return cb(err) - return copyDirItems(items, src, dest, opts, cb) - }) -} - -function copyDirItems (items, src, dest, opts, cb) { - const item = items.pop() - if (!item) return cb() - return copyDirItem(items, item, src, dest, opts, cb) -} - -function copyDirItem (items, item, src, dest, opts, cb) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => { - if (err) return cb(err) - const { destStat } = stats - startCopy(destStat, srcItem, destItem, opts, err => { - if (err) return cb(err) - return copyDirItems(items, src, dest, opts, cb) - }) - }) -} - -function onLink (destStat, src, dest, opts, cb) { - fs.readlink(src, (err, resolvedSrc) => { - if (err) return cb(err) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } - - if (!destStat) { - return fs.symlink(resolvedSrc, dest, cb) - } else { - fs.readlink(dest, (err, resolvedDest) => { - if (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb) - return cb(err) - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)) - } - - // do not copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) - } - return copyLink(resolvedSrc, dest, cb) - }) - } - }) -} - -function copyLink (resolvedSrc, dest, cb) { - fs.unlink(dest, err => { - if (err) return cb(err) - return fs.symlink(resolvedSrc, dest, cb) - }) -} - -module.exports = copy - - -/***/ }), - -/***/ 11647: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -module.exports = { - copy: u(__webpack_require__(41132)) -} - - -/***/ }), - -/***/ 81896: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(81881) -const remove = __webpack_require__(71703) - -const emptyDir = u(function emptyDir (dir, callback) { - callback = callback || function () {} - fs.readdir(dir, (err, items) => { - if (err) return mkdir.mkdirs(dir, callback) - - items = items.map(item => path.join(dir, item)) - - deleteItem() - - function deleteItem () { - const item = items.pop() - if (!item) return callback() - remove.remove(item, err => { - if (err) return callback(err) - deleteItem() - }) - } - }) -}) - -function emptyDirSync (dir) { - let items - try { - items = fs.readdirSync(dir) - } catch { - return mkdir.mkdirsSync(dir) - } - - items.forEach(item => { - item = path.join(dir, item) - remove.removeSync(item) - }) -} - -module.exports = { - emptyDirSync, - emptydirSync: emptyDirSync, - emptyDir, - emptydir: emptyDir -} - - -/***/ }), - -/***/ 6039: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(81881) - -function createFile (file, callback) { - function makeFile () { - fs.writeFile(file, '', err => { - if (err) return callback(err) - callback() - }) - } - - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err - if (!err && stats.isFile()) return callback() - const dir = path.dirname(file) - fs.stat(dir, (err, stats) => { - if (err) { - // if the directory doesn't exist, make it - if (err.code === 'ENOENT') { - return mkdir.mkdirs(dir, err => { - if (err) return callback(err) - makeFile() - }) - } - return callback(err) - } - - if (stats.isDirectory()) makeFile() - else { - // parent is not a directory - // This is just to cause an internal ENOTDIR error to be thrown - fs.readdir(dir, err => { - if (err) return callback(err) - }) - } - }) - }) -} - -function createFileSync (file) { - let stats - try { - stats = fs.statSync(file) - } catch {} - if (stats && stats.isFile()) return - - const dir = path.dirname(file) - try { - if (!fs.statSync(dir).isDirectory()) { - // parent is not a directory - // This is just to cause an internal ENOTDIR error to be thrown - fs.readdirSync(dir) - } - } catch (err) { - // If the stat call above failed because the directory doesn't exist, create it - if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir) - else throw err - } - - fs.writeFileSync(file, '') -} - -module.exports = { - createFile: u(createFile), - createFileSync -} - - -/***/ }), - -/***/ 60151: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const file = __webpack_require__(6039) -const link = __webpack_require__(55914) -const symlink = __webpack_require__(98894) - -module.exports = { - // file - createFile: file.createFile, - createFileSync: file.createFileSync, - ensureFile: file.createFile, - ensureFileSync: file.createFileSync, - // link - createLink: link.createLink, - createLinkSync: link.createLinkSync, - ensureLink: link.createLink, - ensureLinkSync: link.createLinkSync, - // symlink - createSymlink: symlink.createSymlink, - createSymlinkSync: symlink.createSymlinkSync, - ensureSymlink: symlink.createSymlink, - ensureSymlinkSync: symlink.createSymlinkSync -} - - -/***/ }), - -/***/ 55914: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(81881) -const pathExists = __webpack_require__(42176).pathExists - -function createLink (srcpath, dstpath, callback) { - function makeLink (srcpath, dstpath) { - fs.link(srcpath, dstpath, err => { - if (err) return callback(err) - callback(null) - }) - } - - pathExists(dstpath, (err, destinationExists) => { - if (err) return callback(err) - if (destinationExists) return callback(null) - fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureLink') - return callback(err) - } - - const dir = path.dirname(dstpath) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return makeLink(srcpath, dstpath) - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - makeLink(srcpath, dstpath) - }) - }) - }) - }) -} - -function createLinkSync (srcpath, dstpath) { - const destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - try { - fs.lstatSync(srcpath) - } catch (err) { - err.message = err.message.replace('lstat', 'ensureLink') - throw err - } - - const dir = path.dirname(dstpath) - const dirExists = fs.existsSync(dir) - if (dirExists) return fs.linkSync(srcpath, dstpath) - mkdir.mkdirsSync(dir) - - return fs.linkSync(srcpath, dstpath) -} - -module.exports = { - createLink: u(createLink), - createLinkSync -} - - -/***/ }), - -/***/ 68917: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const pathExists = __webpack_require__(42176).pathExists - -/** - * Function that returns two types of paths, one relative to symlink, and one - * relative to the current working directory. Checks if path is absolute or - * relative. If the path is relative, this function checks if the path is - * relative to symlink or relative to current working directory. This is an - * initiative to find a smarter `srcpath` to supply when building symlinks. - * This allows you to determine which path to use out of one of three possible - * types of source paths. The first is an absolute path. This is detected by - * `path.isAbsolute()`. When an absolute path is provided, it is checked to - * see if it exists. If it does it's used, if not an error is returned - * (callback)/ thrown (sync). The other two options for `srcpath` are a - * relative url. By default Node's `fs.symlink` works by creating a symlink - * using `dstpath` and expects the `srcpath` to be relative to the newly - * created symlink. If you provide a `srcpath` that does not exist on the file - * system it results in a broken symlink. To minimize this, the function - * checks to see if the 'relative to symlink' source file exists, and if it - * does it will use it. If it does not, it checks if there's a file that - * exists that is relative to the current working directory, if does its used. - * This preserves the expectations of the original fs.symlink spec and adds - * the ability to pass in `relative to current working direcotry` paths. - */ - -function symlinkPaths (srcpath, dstpath, callback) { - if (path.isAbsolute(srcpath)) { - return fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - toCwd: srcpath, - toDst: srcpath - }) - }) - } else { - const dstdir = path.dirname(dstpath) - const relativeToDst = path.join(dstdir, srcpath) - return pathExists(relativeToDst, (err, exists) => { - if (err) return callback(err) - if (exists) { - return callback(null, { - toCwd: relativeToDst, - toDst: srcpath - }) - } else { - return fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - toCwd: srcpath, - toDst: path.relative(dstdir, srcpath) - }) - }) - } - }) - } -} - -function symlinkPathsSync (srcpath, dstpath) { - let exists - if (path.isAbsolute(srcpath)) { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('absolute srcpath does not exist') - return { - toCwd: srcpath, - toDst: srcpath - } - } else { - const dstdir = path.dirname(dstpath) - const relativeToDst = path.join(dstdir, srcpath) - exists = fs.existsSync(relativeToDst) - if (exists) { - return { - toCwd: relativeToDst, - toDst: srcpath - } - } else { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('relative srcpath does not exist') - return { - toCwd: srcpath, - toDst: path.relative(dstdir, srcpath) - } - } - } -} - -module.exports = { - symlinkPaths, - symlinkPathsSync -} - - -/***/ }), - -/***/ 19358: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) - -function symlinkType (srcpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - if (type) return callback(null, type) - fs.lstat(srcpath, (err, stats) => { - if (err) return callback(null, 'file') - type = (stats && stats.isDirectory()) ? 'dir' : 'file' - callback(null, type) - }) -} - -function symlinkTypeSync (srcpath, type) { - let stats - - if (type) return type - try { - stats = fs.lstatSync(srcpath) - } catch { - return 'file' - } - return (stats && stats.isDirectory()) ? 'dir' : 'file' -} - -module.exports = { - symlinkType, - symlinkTypeSync -} - - -/***/ }), - -/***/ 98894: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const _mkdirs = __webpack_require__(81881) -const mkdirs = _mkdirs.mkdirs -const mkdirsSync = _mkdirs.mkdirsSync - -const _symlinkPaths = __webpack_require__(68917) -const symlinkPaths = _symlinkPaths.symlinkPaths -const symlinkPathsSync = _symlinkPaths.symlinkPathsSync - -const _symlinkType = __webpack_require__(19358) -const symlinkType = _symlinkType.symlinkType -const symlinkTypeSync = _symlinkType.symlinkTypeSync - -const pathExists = __webpack_require__(42176).pathExists - -function createSymlink (srcpath, dstpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - - pathExists(dstpath, (err, destinationExists) => { - if (err) return callback(err) - if (destinationExists) return callback(null) - symlinkPaths(srcpath, dstpath, (err, relative) => { - if (err) return callback(err) - srcpath = relative.toDst - symlinkType(relative.toCwd, type, (err, type) => { - if (err) return callback(err) - const dir = path.dirname(dstpath) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) - mkdirs(dir, err => { - if (err) return callback(err) - fs.symlink(srcpath, dstpath, type, callback) - }) - }) - }) - }) - }) -} - -function createSymlinkSync (srcpath, dstpath, type) { - const destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - const relative = symlinkPathsSync(srcpath, dstpath) - srcpath = relative.toDst - type = symlinkTypeSync(relative.toCwd, type) - const dir = path.dirname(dstpath) - const exists = fs.existsSync(dir) - if (exists) return fs.symlinkSync(srcpath, dstpath, type) - mkdirsSync(dir) - return fs.symlinkSync(srcpath, dstpath, type) -} - -module.exports = { - createSymlink: u(createSymlink), - createSymlinkSync -} - - -/***/ }), - -/***/ 82998: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -// This is adapted from https://github.com/normalize/mz -// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors -const u = __webpack_require__(92178).fromCallback -const fs = __webpack_require__(82161) - -const api = [ - 'access', - 'appendFile', - 'chmod', - 'chown', - 'close', - 'copyFile', - 'fchmod', - 'fchown', - 'fdatasync', - 'fstat', - 'fsync', - 'ftruncate', - 'futimes', - 'lchmod', - 'lchown', - 'link', - 'lstat', - 'mkdir', - 'mkdtemp', - 'open', - 'opendir', - 'readdir', - 'readFile', - 'readlink', - 'realpath', - 'rename', - 'rmdir', - 'stat', - 'symlink', - 'truncate', - 'unlink', - 'utimes', - 'writeFile' -].filter(key => { - // Some commands are not available on some systems. Ex: - // fs.opendir was added in Node.js v12.12.0 - // fs.lchown is not available on at least some Linux - return typeof fs[key] === 'function' -}) - -// Export all keys: -Object.keys(fs).forEach(key => { - if (key === 'promises') { - // fs.promises is a getter property that triggers ExperimentalWarning - // Don't re-export it here, the getter is defined in "lib/index.js" - return - } - exports[key] = fs[key] -}) - -// Universalify async methods: -api.forEach(method => { - exports[method] = u(fs[method]) -}) - -// We differ from mz/fs in that we still ship the old, broken, fs.exists() -// since we are a drop-in replacement for the native module -exports.exists = function (filename, callback) { - if (typeof callback === 'function') { - return fs.exists(filename, callback) - } - return new Promise(resolve => { - return fs.exists(filename, resolve) - }) -} - -// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args - -exports.read = function (fd, buffer, offset, length, position, callback) { - if (typeof callback === 'function') { - return fs.read(fd, buffer, offset, length, position, callback) - } - return new Promise((resolve, reject) => { - fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { - if (err) return reject(err) - resolve({ bytesRead, buffer }) - }) - }) -} - -// Function signature can be -// fs.write(fd, buffer[, offset[, length[, position]]], callback) -// OR -// fs.write(fd, string[, position[, encoding]], callback) -// We need to handle both cases, so we use ...args -exports.write = function (fd, buffer, ...args) { - if (typeof args[args.length - 1] === 'function') { - return fs.write(fd, buffer, ...args) - } - - return new Promise((resolve, reject) => { - fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { - if (err) return reject(err) - resolve({ bytesWritten, buffer }) - }) - }) -} - -// fs.writev only available in Node v12.9.0+ -if (typeof fs.writev === 'function') { - // Function signature is - // s.writev(fd, buffers[, position], callback) - // We need to handle the optional arg, so we use ...args - exports.writev = function (fd, buffers, ...args) { - if (typeof args[args.length - 1] === 'function') { - return fs.writev(fd, buffers, ...args) - } - - return new Promise((resolve, reject) => { - fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => { - if (err) return reject(err) - resolve({ bytesWritten, buffers }) - }) - }) - } -} - -// fs.realpath.native only available in Node v9.2+ -if (typeof fs.realpath.native === 'function') { - exports.realpath.native = u(fs.realpath.native) -} - - -/***/ }), - -/***/ 66272: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = { - // Export promiseified graceful-fs: - ...__webpack_require__(82998), - // Export extra methods: - ...__webpack_require__(6574), - ...__webpack_require__(11647), - ...__webpack_require__(81896), - ...__webpack_require__(60151), - ...__webpack_require__(16047), - ...__webpack_require__(81881), - ...__webpack_require__(58611), - ...__webpack_require__(96489), - ...__webpack_require__(81192), - ...__webpack_require__(42176), - ...__webpack_require__(71703) -} - -// Export fs.promises as a getter property so that we don't trigger -// ExperimentalWarning before fs.promises is actually accessed. -const fs = __webpack_require__(35747) -if (Object.getOwnPropertyDescriptor(fs, 'promises')) { - Object.defineProperty(module.exports, "promises", ({ - get () { return fs.promises } - })) -} - - -/***/ }), - -/***/ 16047: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromPromise -const jsonFile = __webpack_require__(53118) - -jsonFile.outputJson = u(__webpack_require__(80690)) -jsonFile.outputJsonSync = __webpack_require__(66704) -// aliases -jsonFile.outputJSON = jsonFile.outputJson -jsonFile.outputJSONSync = jsonFile.outputJsonSync -jsonFile.writeJSON = jsonFile.writeJson -jsonFile.writeJSONSync = jsonFile.writeJsonSync -jsonFile.readJSON = jsonFile.readJson -jsonFile.readJSONSync = jsonFile.readJsonSync - -module.exports = jsonFile - - -/***/ }), - -/***/ 53118: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const jsonFile = __webpack_require__(91393) - -module.exports = { - // jsonfile exports - readJson: jsonFile.readFile, - readJsonSync: jsonFile.readFileSync, - writeJson: jsonFile.writeFile, - writeJsonSync: jsonFile.writeFileSync -} - - -/***/ }), - -/***/ 66704: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const { stringify } = __webpack_require__(24401) -const { outputFileSync } = __webpack_require__(81192) - -function outputJsonSync (file, data, options) { - const str = stringify(data, options) - - outputFileSync(file, str, options) -} - -module.exports = outputJsonSync - - -/***/ }), - -/***/ 80690: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const { stringify } = __webpack_require__(24401) -const { outputFile } = __webpack_require__(81192) - -async function outputJson (file, data, options = {}) { - const str = stringify(data, options) - - await outputFile(file, str, options) -} - -module.exports = outputJson - - -/***/ }), - -/***/ 81881: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const u = __webpack_require__(92178).fromPromise -const { makeDir: _makeDir, makeDirSync } = __webpack_require__(970) -const makeDir = u(_makeDir) - -module.exports = { - mkdirs: makeDir, - mkdirsSync: makeDirSync, - // alias - mkdirp: makeDir, - mkdirpSync: makeDirSync, - ensureDir: makeDir, - ensureDirSync: makeDirSync -} - - -/***/ }), - -/***/ 970: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -// Adapted from https://github.com/sindresorhus/make-dir -// Copyright (c) Sindre Sorhus (sindresorhus.com) -// 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. - -const fs = __webpack_require__(82998) -const path = __webpack_require__(85622) -const atLeastNode = __webpack_require__(898) - -const useNativeRecursiveOption = atLeastNode('10.12.0') - -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')) - - if (pathHasInvalidWinCharacters) { - const error = new Error(`Path contains invalid characters: ${pth}`) - error.code = 'EINVAL' - throw error - } - } -} - -const processOptions = options => { - const defaults = { mode: 0o777 } - if (typeof options === 'number') options = { mode: options } - return { ...defaults, ...options } -} - -const permissionError = pth => { - // This replicates the exception of `fs.mkdir` with native the - // `recusive` option when run on an invalid drive under Windows. - const error = new Error(`operation not permitted, mkdir '${pth}'`) - error.code = 'EPERM' - error.errno = -4048 - error.path = pth - error.syscall = 'mkdir' - return error -} - -module.exports.makeDir = async (input, options) => { - checkPath(input) - options = processOptions(options) - - if (useNativeRecursiveOption) { - const pth = path.resolve(input) - - return fs.mkdir(pth, { - mode: options.mode, - recursive: true - }) - } - - const make = async pth => { - try { - await fs.mkdir(pth, options.mode) - } catch (error) { - if (error.code === 'EPERM') { - throw error - } - - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw permissionError(pth) - } - - if (error.message.includes('null bytes')) { - throw error - } - - await make(path.dirname(pth)) - return make(pth) - } - - try { - const stats = await fs.stat(pth) - if (!stats.isDirectory()) { - // This error is never exposed to the user - // it is caught below, and the original error is thrown - throw new Error('The path is not a directory') - } - } catch { - throw error - } - } - } - - return make(path.resolve(input)) -} - -module.exports.makeDirSync = (input, options) => { - checkPath(input) - options = processOptions(options) - - if (useNativeRecursiveOption) { - const pth = path.resolve(input) - - return fs.mkdirSync(pth, { - mode: options.mode, - recursive: true - }) - } - - const make = pth => { - try { - fs.mkdirSync(pth, options.mode) - } catch (error) { - if (error.code === 'EPERM') { - throw error - } - - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw permissionError(pth) - } - - if (error.message.includes('null bytes')) { - throw error - } - - make(path.dirname(pth)) - return make(pth) - } - - try { - if (!fs.statSync(pth).isDirectory()) { - // This error is never exposed to the user - // it is caught below, and the original error is thrown - throw new Error('The path is not a directory') - } - } catch { - throw error - } - } - } - - return make(path.resolve(input)) -} - - -/***/ }), - -/***/ 58611: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = { - moveSync: __webpack_require__(18178) -} - - -/***/ }), - -/***/ 18178: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copySync = __webpack_require__(6574).copySync -const removeSync = __webpack_require__(71703).removeSync -const mkdirpSync = __webpack_require__(81881).mkdirpSync -const stat = __webpack_require__(66834) - -function moveSync (src, dest, opts) { - opts = opts || {} - const overwrite = opts.overwrite || opts.clobber || false - - const { srcStat } = stat.checkPathsSync(src, dest, 'move') - stat.checkParentPathsSync(src, srcStat, dest, 'move') - mkdirpSync(path.dirname(dest)) - return doRename(src, dest, overwrite) -} - -function doRename (src, dest, overwrite) { - if (overwrite) { - removeSync(dest) - return rename(src, dest, overwrite) - } - if (fs.existsSync(dest)) throw new Error('dest already exists.') - return rename(src, dest, overwrite) -} - -function rename (src, dest, overwrite) { - try { - fs.renameSync(src, dest) - } catch (err) { - if (err.code !== 'EXDEV') throw err - return moveAcrossDevice(src, dest, overwrite) - } -} - -function moveAcrossDevice (src, dest, overwrite) { - const opts = { - overwrite, - errorOnExist: true - } - copySync(src, dest, opts) - return removeSync(src) -} - -module.exports = moveSync - - -/***/ }), - -/***/ 96489: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -module.exports = { - move: u(__webpack_require__(71294)) -} - - -/***/ }), - -/***/ 71294: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copy = __webpack_require__(11647).copy -const remove = __webpack_require__(71703).remove -const mkdirp = __webpack_require__(81881).mkdirp -const pathExists = __webpack_require__(42176).pathExists -const stat = __webpack_require__(66834) - -function move (src, dest, opts, cb) { - if (typeof opts === 'function') { - cb = opts - opts = {} - } - - const overwrite = opts.overwrite || opts.clobber || false - - stat.checkPaths(src, dest, 'move', (err, stats) => { - if (err) return cb(err) - const { srcStat } = stats - stat.checkParentPaths(src, srcStat, dest, 'move', err => { - if (err) return cb(err) - mkdirp(path.dirname(dest), err => { - if (err) return cb(err) - return doRename(src, dest, overwrite, cb) - }) - }) - }) -} - -function doRename (src, dest, overwrite, cb) { - if (overwrite) { - return remove(dest, err => { - if (err) return cb(err) - return rename(src, dest, overwrite, cb) - }) - } - pathExists(dest, (err, destExists) => { - if (err) return cb(err) - if (destExists) return cb(new Error('dest already exists.')) - return rename(src, dest, overwrite, cb) - }) -} - -function rename (src, dest, overwrite, cb) { - fs.rename(src, dest, err => { - if (!err) return cb() - if (err.code !== 'EXDEV') return cb(err) - return moveAcrossDevice(src, dest, overwrite, cb) - }) -} - -function moveAcrossDevice (src, dest, overwrite, cb) { - const opts = { - overwrite, - errorOnExist: true - } - copy(src, dest, opts, err => { - if (err) return cb(err) - return remove(src, cb) - }) -} - -module.exports = move - - -/***/ }), - -/***/ 81192: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(81881) -const pathExists = __webpack_require__(42176).pathExists - -function outputFile (file, data, encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding - encoding = 'utf8' - } - - const dir = path.dirname(file) - pathExists(dir, (err, itDoes) => { - if (err) return callback(err) - if (itDoes) return fs.writeFile(file, data, encoding, callback) - - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - - fs.writeFile(file, data, encoding, callback) - }) - }) -} - -function outputFileSync (file, ...args) { - const dir = path.dirname(file) - if (fs.existsSync(dir)) { - return fs.writeFileSync(file, ...args) - } - mkdir.mkdirsSync(dir) - fs.writeFileSync(file, ...args) -} - -module.exports = { - outputFile: u(outputFile), - outputFileSync -} - - -/***/ }), - -/***/ 42176: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const u = __webpack_require__(92178).fromPromise -const fs = __webpack_require__(82998) - -function pathExists (path) { - return fs.access(path).then(() => true).catch(() => false) -} - -module.exports = { - pathExists: u(pathExists), - pathExistsSync: fs.existsSync -} - - -/***/ }), - -/***/ 71703: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const rimraf = __webpack_require__(90065) - -module.exports = { - remove: u(rimraf), - removeSync: rimraf.sync -} - - -/***/ }), - -/***/ 90065: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const assert = __webpack_require__(42357) - -const isWindows = (process.platform === 'win32') - -function defaults (options) { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 -} - -function rimraf (p, options, cb) { - let busyTries = 0 - - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') - assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - rimraf_(p, options, function CB (er) { - if (er) { - if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && - busyTries < options.maxBusyTries) { - busyTries++ - const time = busyTries * 100 - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), time) - } - - // already gone - if (er.code === 'ENOENT') er = null - } - - cb(er) - }) -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === 'ENOENT') { - return cb(null) - } - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === 'EPERM' && isWindows) { - return fixWinEPERM(p, options, er, cb) - } - - if (st && st.isDirectory()) { - return rmdir(p, options, er, cb) - } - - options.unlink(p, er => { - if (er) { - if (er.code === 'ENOENT') { - return cb(null) - } - if (er.code === 'EPERM') { - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - } - if (er.code === 'EISDIR') { - return rmdir(p, options, er, cb) - } - } - return cb(er) - }) - }) -} - -function fixWinEPERM (p, options, er, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.chmod(p, 0o666, er2 => { - if (er2) { - cb(er2.code === 'ENOENT' ? null : er) - } else { - options.stat(p, (er3, stats) => { - if (er3) { - cb(er3.code === 'ENOENT' ? null : er) - } else if (stats.isDirectory()) { - rmdir(p, options, er, cb) - } else { - options.unlink(p, cb) - } - }) - } - }) -} - -function fixWinEPERMSync (p, options, er) { - let stats - - assert(p) - assert(options) - - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === 'ENOENT') { - return - } else { - throw er - } - } - - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === 'ENOENT') { - return - } else { - throw er - } - } - - if (stats.isDirectory()) { - rmdirSync(p, options, er) - } else { - options.unlinkSync(p) - } -} - -function rmdir (p, options, originalEr, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { - rmkids(p, options, cb) - } else if (er && er.code === 'ENOTDIR') { - cb(originalEr) - } else { - cb(er) - } - }) -} - -function rmkids (p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, (er, files) => { - if (er) return cb(er) - - let n = files.length - let errState - - if (n === 0) return options.rmdir(p, cb) - - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) { - return - } - if (er) return cb(errState = er) - if (--n === 0) { - options.rmdir(p, cb) - } - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -function rimrafSync (p, options) { - let st - - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') - - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === 'ENOENT') { - return - } - - // Windows can EPERM on stat. Life is suffering. - if (er.code === 'EPERM' && isWindows) { - fixWinEPERMSync(p, options, er) - } - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) { - rmdirSync(p, options, null) - } else { - options.unlinkSync(p) - } - } catch (er) { - if (er.code === 'ENOENT') { - return - } else if (er.code === 'EPERM') { - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - } else if (er.code !== 'EISDIR') { - throw er - } - rmdirSync(p, options, er) - } -} - -function rmdirSync (p, options, originalEr) { - assert(p) - assert(options) - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === 'ENOTDIR') { - throw originalEr - } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { - rmkidsSync(p, options) - } else if (er.code !== 'ENOENT') { - throw er - } - } -} - -function rmkidsSync (p, options) { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - - if (isWindows) { - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const startTime = Date.now() - do { - try { - const ret = options.rmdirSync(p, options) - return ret - } catch {} - } while (Date.now() - startTime < 500) // give up after 500ms - } else { - const ret = options.rmdirSync(p, options) - return ret - } -} - -module.exports = rimraf -rimraf.sync = rimrafSync - - -/***/ }), - -/***/ 66834: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82998) -const path = __webpack_require__(85622) -const util = __webpack_require__(31669) -const atLeastNode = __webpack_require__(898) - -const nodeSupportsBigInt = atLeastNode('10.5.0') -const stat = (file) => nodeSupportsBigInt ? fs.stat(file, { bigint: true }) : fs.stat(file) -const statSync = (file) => nodeSupportsBigInt ? fs.statSync(file, { bigint: true }) : fs.statSync(file) - -function getStats (src, dest) { - return Promise.all([ - stat(src), - stat(dest).catch(err => { - if (err.code === 'ENOENT') return null - throw err - }) - ]).then(([srcStat, destStat]) => ({ srcStat, destStat })) -} - -function getStatsSync (src, dest) { - let destStat - const srcStat = statSync(src) - try { - destStat = statSync(dest) - } catch (err) { - if (err.code === 'ENOENT') return { srcStat, destStat: null } - throw err - } - return { srcStat, destStat } -} - -function checkPaths (src, dest, funcName, cb) { - util.callbackify(getStats)(src, dest, (err, stats) => { - if (err) return cb(err) - const { srcStat, destStat } = stats - if (destStat && areIdentical(srcStat, destStat)) { - return cb(new Error('Source and destination must not be the same.')) - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return cb(null, { srcStat, destStat }) - }) -} - -function checkPathsSync (src, dest, funcName) { - const { srcStat, destStat } = getStatsSync(src, dest) - if (destStat && areIdentical(srcStat, destStat)) { - throw new Error('Source and destination must not be the same.') - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - throw new Error(errMsg(src, dest, funcName)) - } - return { srcStat, destStat } -} - -// recursively check if dest parent is a subdirectory of src. -// It works for all file types including symlinks since it -// checks the src and dest inodes. It starts from the deepest -// parent and stops once it reaches the src parent or the root path. -function checkParentPaths (src, srcStat, dest, funcName, cb) { - const srcParent = path.resolve(path.dirname(src)) - const destParent = path.resolve(path.dirname(dest)) - if (destParent === srcParent || destParent === path.parse(destParent).root) return cb() - const callback = (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb() - return cb(err) - } - if (areIdentical(srcStat, destStat)) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return checkParentPaths(src, srcStat, destParent, funcName, cb) - } - if (nodeSupportsBigInt) fs.stat(destParent, { bigint: true }, callback) - else fs.stat(destParent, callback) -} - -function checkParentPathsSync (src, srcStat, dest, funcName) { - const srcParent = path.resolve(path.dirname(src)) - const destParent = path.resolve(path.dirname(dest)) - if (destParent === srcParent || destParent === path.parse(destParent).root) return - let destStat - try { - destStat = statSync(destParent) - } catch (err) { - if (err.code === 'ENOENT') return - throw err - } - if (areIdentical(srcStat, destStat)) { - throw new Error(errMsg(src, dest, funcName)) - } - return checkParentPathsSync(src, srcStat, destParent, funcName) -} - -function areIdentical (srcStat, destStat) { - if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - if (nodeSupportsBigInt || destStat.ino < Number.MAX_SAFE_INTEGER) { - // definitive answer - return true - } - // Use additional heuristics if we can't use 'bigint'. - // Different 'ino' could be represented the same if they are >= Number.MAX_SAFE_INTEGER - // See issue 657 - if (destStat.size === srcStat.size && - destStat.mode === srcStat.mode && - destStat.nlink === srcStat.nlink && - destStat.atimeMs === srcStat.atimeMs && - destStat.mtimeMs === srcStat.mtimeMs && - destStat.ctimeMs === srcStat.ctimeMs && - destStat.birthtimeMs === srcStat.birthtimeMs) { - // heuristic answer - return true - } - } - return false -} - -// return true if dest is a subdir of src, otherwise false. -// It only checks the path strings. -function isSrcSubdir (src, dest) { - const srcArr = path.resolve(src).split(path.sep).filter(i => i) - const destArr = path.resolve(dest).split(path.sep).filter(i => i) - return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) -} - -function errMsg (src, dest, funcName) { - return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.` -} - -module.exports = { - checkPaths, - checkPathsSync, - checkParentPaths, - checkParentPathsSync, - isSrcSubdir -} - - -/***/ }), - -/***/ 64698: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) - -function utimesMillis (path, atime, mtime, callback) { - // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) - fs.open(path, 'r+', (err, fd) => { - if (err) return callback(err) - fs.futimes(fd, atime, mtime, futimesErr => { - fs.close(fd, closeErr => { - if (callback) callback(futimesErr || closeErr) - }) - }) - }) -} - -function utimesMillisSync (path, atime, mtime) { - const fd = fs.openSync(path, 'r+') - fs.futimesSync(fd, atime, mtime) - return fs.closeSync(fd) -} - -module.exports = { - utimesMillis, - utimesMillisSync -} - - -/***/ }), - -/***/ 54082: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = realpath -realpath.realpath = realpath -realpath.sync = realpathSync -realpath.realpathSync = realpathSync -realpath.monkeypatch = monkeypatch -realpath.unmonkeypatch = unmonkeypatch - -var fs = __webpack_require__(35747) -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync - -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__(42145) - -function newError (er) { - return er && er.syscall === 'realpath' && ( - er.code === 'ELOOP' || - er.code === 'ENOMEM' || - er.code === 'ENAMETOOLONG' - ) -} - -function realpath (p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb) - } - - if (typeof cache === 'function') { - cb = cache - cache = null - } - origRealpath(p, cache, function (er, result) { - if (newError(er)) { - old.realpath(p, cache, cb) - } else { - cb(er, result) - } - }) -} - -function realpathSync (p, cache) { - if (ok) { - return origRealpathSync(p, cache) - } - - try { - return origRealpathSync(p, cache) - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache) - } else { - throw er - } - } -} - -function monkeypatch () { - fs.realpath = realpath - fs.realpathSync = realpathSync -} - -function unmonkeypatch () { - fs.realpath = origRealpath - fs.realpathSync = origRealpathSync -} - - -/***/ }), - -/***/ 42145: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -// 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 pathModule = __webpack_require__(85622); -var isWindows = process.platform === 'win32'; -var fs = __webpack_require__(35747); - -// JavaScript implementation of realpath, ported from node pre-v6 - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; - - return callback; - - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; - - -/***/ }), - -/***/ 5882: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const {PassThrough: PassThroughStream} = __webpack_require__(92413); - -module.exports = options => { - options = {...options}; - - const {array} = options; - let {encoding} = options; - const isBuffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || 'utf8'; - } - - if (isBuffer) { - encoding = null; - } - - const stream = new PassThroughStream({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - let length = 0; - const chunks = []; - - stream.on('data', chunk => { - chunks.push(chunk); - - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return chunks; - } - - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); - }; - - stream.getBufferedLength = () => length; - - return stream; -}; - - -/***/ }), - -/***/ 63886: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const pump = __webpack_require__(20113); -const bufferStream = __webpack_require__(5882); - -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} - -async function getStream(inputStream, options) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } - - options = { - maxBuffer: Infinity, - ...options - }; - - const {maxBuffer} = options; - - let stream; - await new Promise((resolve, reject) => { - const rejectPromise = error => { - if (error) { // A null check - error.bufferedData = stream.getBufferedValue(); - } - - reject(error); - }; - - stream = pump(inputStream, bufferStream(options), error => { - if (error) { - rejectPromise(error); - return; - } - - resolve(); - }); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); - - return stream.getBufferedValue(); -} - -module.exports = getStream; -// TODO: Remove this for the next major release -module.exports.default = getStream; -module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); -module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); -module.exports.MaxBufferError = MaxBufferError; - - -/***/ }), - -/***/ 20429: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const cp = __webpack_require__(63129); -const fs = __webpack_require__(35296); -const path = __webpack_require__(85622); -const util = __webpack_require__(31669); - -/** - * @constructor - * @param {number} code Error code. - * @param {string} message Error message. - */ -function ProcessError(code, message) { - const callee = arguments.callee; - Error.apply(this, [message]); - Error.captureStackTrace(this, callee); - this.code = code; - this.message = message; - this.name = callee.name; -} -util.inherits(ProcessError, Error); - -/** - * Util function for handling spawned processes as promises. - * @param {string} exe Executable. - * @param {Array.} args Arguments. - * @param {string} cwd Working directory. - * @return {Promise} A promise. - */ -function spawn(exe, args, cwd) { - return new Promise((resolve, reject) => { - const child = cp.spawn(exe, args, {cwd: cwd || process.cwd()}); - const buffer = []; - child.stderr.on('data', chunk => { - buffer.push(chunk.toString()); - }); - child.stdout.on('data', chunk => { - buffer.push(chunk.toString()); - }); - child.on('close', code => { - const output = buffer.join(''); - if (code) { - const msg = output || 'Process failed: ' + code; - reject(new ProcessError(code, msg)); - } else { - resolve(output); - } - }); - }); -} - -/** - * Create an object for executing git commands. - * @param {string} cwd Repository directory. - * @param {string} exe Git executable (full path if not already on path). - * @constructor - */ -function Git(cwd, cmd) { - this.cwd = cwd; - this.cmd = cmd || 'git'; - this.output = ''; -} - -/** - * Execute an arbitrary git command. - * @param {string} var_args Arguments (e.g. 'remote', 'update'). - * @return {Promise} A promise. The promise will be resolved with this instance - * or rejected with an error. - */ -Git.prototype.exec = function() { - return spawn(this.cmd, [...arguments], this.cwd).then(output => { - this.output = output; - return this; - }); -}; - -/** - * Initialize repository. - * @return {Promise} A promise. - */ -Git.prototype.init = function() { - return this.exec('init'); -}; - -/** - * Clean up unversioned files. - * @return {Promise} A promise. - */ -Git.prototype.clean = function() { - return this.exec('clean', '-f', '-d'); -}; - -/** - * Hard reset to remote/branch - * @param {string} remote Remote alias. - * @param {string} branch Branch name. - * @return {Promise} A promise. - */ -Git.prototype.reset = function(remote, branch) { - return this.exec('reset', '--hard', remote + '/' + branch); -}; - -/** - * Fetch from a remote. - * @param {string} remote Remote alias. - * @return {Promise} A promise. - */ -Git.prototype.fetch = function(remote) { - return this.exec('fetch', remote); -}; - -/** - * Checkout a branch (create an orphan if it doesn't exist on the remote). - * @param {string} remote Remote alias. - * @param {string} branch Branch name. - * @return {Promise} A promise. - */ -Git.prototype.checkout = function(remote, branch) { - const treeish = remote + '/' + branch; - return this.exec('ls-remote', '--exit-code', '.', treeish).then( - () => { - // branch exists on remote, hard reset - return this.exec('checkout', branch) - .then(() => this.clean()) - .then(() => this.reset(remote, branch)); - }, - error => { - if (error instanceof ProcessError && error.code === 2) { - // branch doesn't exist, create an orphan - return this.exec('checkout', '--orphan', branch); - } else { - // unhandled error - throw error; - } - } - ); -}; - -/** - * Remove all unversioned files. - * @param {string|string[]} files Files argument. - * @return {Promise} A promise. - */ -Git.prototype.rm = function(files) { - if (!Array.isArray(files)) { - files = [files]; - } - return this.exec('rm', '--ignore-unmatch', '-r', '-f', ...files); -}; - -/** - * Add files. - * @param {string|string[]} files Files argument. - * @return {Promise} A promise. - */ -Git.prototype.add = function(files) { - if (!Array.isArray(files)) { - files = [files]; - } - return this.exec('add', ...files); -}; - -/** - * Commit (if there are any changes). - * @param {string} message Commit message. - * @return {Promise} A promise. - */ -Git.prototype.commit = function(message) { - return this.exec('diff-index', '--quiet', 'HEAD').catch(() => - this.exec('commit', '-m', message) - ); -}; - -/** - * Add tag - * @param {string} name Name of tag. - * @return {Promise} A promise. - */ -Git.prototype.tag = function(name) { - return this.exec('tag', name); -}; - -/** - * Push a branch. - * @param {string} remote Remote alias. - * @param {string} branch Branch name. - * @param {boolean} force Force push. - * @return {Promise} A promise. - */ -Git.prototype.push = function(remote, branch, force) { - const args = ['push', '--tags', remote, branch]; - if (force) { - args.push('--force'); - } - return this.exec.apply(this, args); -}; - -/** - * Get the URL for a remote. - * @param {string} remote Remote alias. - * @return {Promise} A promise for the remote URL. - */ -Git.prototype.getRemoteUrl = function(remote) { - return this.exec('config', '--get', 'remote.' + remote + '.url') - .then(git => { - const repo = git.output && git.output.split(/[\n\r]/).shift(); - if (repo) { - return repo; - } else { - throw new Error( - 'Failed to get repo URL from options or current directory.' - ); - } - }) - .catch(err => { - throw new Error( - 'Failed to get remote.' + - remote + - '.url (task must either be ' + - 'run in a git repository with a configured ' + - remote + - ' remote ' + - 'or must be configured with the "repo" option).' - ); - }); -}; - -/** - * Delete ref to remove branch history - * @param {string} branch - */ -Git.prototype.deleteRef = function(branch) { - return this.exec('update-ref', '-d', 'refs/heads/' + branch); -}; - -/** - * Clone a repo into the given dir if it doesn't already exist. - * @param {string} repo Repository URL. - * @param {string} dir Target directory. - * @param {string} branch Branch name. - * @param {options} options All options. - * @return {Promise} A promise. - */ -Git.clone = function clone(repo, dir, branch, options) { - return fs.exists(dir).then(exists => { - if (exists) { - return Promise.resolve(new Git(dir, options.git)); - } else { - return fs.mkdirp(path.dirname(path.resolve(dir))).then(() => { - const args = [ - 'clone', - repo, - dir, - '--branch', - branch, - '--single-branch', - '--origin', - options.remote, - '--depth', - options.depth - ]; - return spawn(options.git, args) - .catch(err => { - // try again without branch or depth options - return spawn(options.git, [ - 'clone', - repo, - dir, - '--origin', - options.remote - ]); - }) - .then(() => new Git(dir, options.git)); - }); - } - }); -}; - -module.exports = Git; - - -/***/ }), - -/***/ 56179: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -const findCacheDir = __webpack_require__(1351); -const Git = __webpack_require__(20429); -const filenamify = __webpack_require__(63088); -const copy = __webpack_require__(70160)/* .copy */ .JG; -const getUser = __webpack_require__(70160)/* .getUser */ .PR; -const fs = __webpack_require__(35296); -const globby = __webpack_require__(97375); -const path = __webpack_require__(85622); -const util = __webpack_require__(31669); - -const log = util.debuglog('gh-pages'); - -function getCacheDir() { - return findCacheDir({name: 'gh-pages'}); -} - -function getRepo(options) { - if (options.repo) { - return Promise.resolve(options.repo); - } else { - const git = new Git(process.cwd(), options.git); - return git.getRemoteUrl(options.remote); - } -} - -exports.defaults = { - dest: '.', - add: false, - git: 'git', - depth: 1, - dotfiles: false, - branch: 'gh-pages', - remote: 'origin', - src: '**/*', - remove: '.', - push: true, - history: true, - message: 'Updates', - silent: false -}; - -/** - * Push a git branch to a remote (pushes gh-pages by default). - * @param {string} basePath The base path. - * @param {Object} config Publish options. - * @param {Function} callback Callback. - */ -exports.publish = function publish(basePath, config, callback) { - if (typeof config === 'function') { - callback = config; - config = {}; - } - - const options = Object.assign({}, exports.defaults, config); - - // For backward compatibility before fixing #334 - if (options.only) { - options.remove = options.only; - } - - if (!callback) { - callback = function(err) { - if (err) { - log(err.message); - } - }; - } - - function done(err) { - try { - callback(err); - } catch (err2) { - log('Publish callback threw: %s', err2.message); - } - } - - try { - if (!fs.statSync(basePath).isDirectory()) { - done(new Error('The "base" option must be an existing directory')); - return; - } - } catch (err) { - done(err); - return; - } - - const files = globby - .sync(options.src, { - cwd: basePath, - dot: options.dotfiles - }) - .filter(file => { - return !fs.statSync(path.join(basePath, file)).isDirectory(); - }); - - if (!Array.isArray(files) || files.length === 0) { - done( - new Error('The pattern in the "src" property didn\'t match any files.') - ); - return; - } - - let repoUrl; - let userPromise; - if (options.user) { - userPromise = Promise.resolve(options.user); - } else { - userPromise = getUser(); - } - return userPromise.then(user => - getRepo(options) - .then(repo => { - repoUrl = repo; - const clone = path.join(getCacheDir(), filenamify(repo)); - log('Cloning %s into %s', repo, clone); - return Git.clone(repo, clone, options.branch, options); - }) - .then(git => { - return git.getRemoteUrl(options.remote).then(url => { - if (url !== repoUrl) { - const message = - 'Remote url mismatch. Got "' + - url + - '" ' + - 'but expected "' + - repoUrl + - '" in ' + - git.cwd + - '. Try running the `gh-pages-clean` script first.'; - throw new Error(message); - } - return git; - }); - }) - .then(git => { - // only required if someone mucks with the checkout between builds - log('Cleaning'); - return git.clean(); - }) - .then(git => { - log('Fetching %s', options.remote); - return git.fetch(options.remote); - }) - .then(git => { - log('Checking out %s/%s ', options.remote, options.branch); - return git.checkout(options.remote, options.branch); - }) - .then(git => { - if (!options.history) { - return git.deleteRef(options.branch); - } else { - return git; - } - }) - .then(git => { - if (options.add) { - return git; - } - - log('Removing files'); - const files = globby - .sync(options.remove, { - cwd: path.join(git.cwd, options.dest) - }) - .map(file => path.join(options.dest, file)); - if (files.length > 0) { - return git.rm(files); - } else { - return git; - } - }) - .then(git => { - log('Copying files'); - return copy(files, basePath, path.join(git.cwd, options.dest)).then( - function() { - return git; - } - ); - }) - .then(git => { - return Promise.resolve( - options.beforeAdd && options.beforeAdd(git) - ).then(() => git); - }) - .then(git => { - log('Adding all'); - return git.add('.'); - }) - .then(git => { - if (!user) { - return git; - } - return git.exec('config', 'user.email', user.email).then(() => { - if (!user.name) { - return git; - } - return git.exec('config', 'user.name', user.name); - }); - }) - .then(git => { - log('Committing'); - return git.commit(options.message); - }) - .then(git => { - if (options.tag) { - log('Tagging'); - return git.tag(options.tag).catch(error => { - // tagging failed probably because this tag alredy exists - log(error); - log('Tagging failed, continuing'); - return git; - }); - } else { - return git; - } - }) - .then(git => { - if (options.push) { - log('Pushing'); - return git.push(options.remote, options.branch, !options.history); - } else { - return git; - } - }) - .then( - () => done(), - error => { - if (options.silent) { - error = new Error( - 'Unspecified error (run without silent option for detail)' - ); - } - done(error); - } - ) - ); -}; - -/** - * Clean the cache directory. - */ -exports.clean = function clean() { - fs.removeSync(getCacheDir()); -}; - - -/***/ }), - -/***/ 70160: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -var __webpack_unused_export__; -const path = __webpack_require__(85622); -const Git = __webpack_require__(20429); -const async = __webpack_require__(84653); -const fs = __webpack_require__(35296); - -/** - * Generate a list of unique directory paths given a list of file paths. - * @param {Array.} files List of file paths. - * @return {Array.} List of directory paths. - */ -const uniqueDirs = (__webpack_unused_export__ = function(files) { - const dirs = {}; - files.forEach(filepath => { - const parts = path.dirname(filepath).split(path.sep); - let partial = parts[0] || '/'; - dirs[partial] = true; - for (let i = 1, ii = parts.length; i < ii; ++i) { - partial = path.join(partial, parts[i]); - dirs[partial] = true; - } - }); - return Object.keys(dirs); -}); - -/** - * Sort function for paths. Sorter paths come first. Paths of equal length are - * sorted alphanumerically in path segment order. - * @param {string} a First path. - * @param {string} b Second path. - * @return {number} Comparison. - */ -const byShortPath = (__webpack_unused_export__ = (a, b) => { - const aParts = a.split(path.sep); - const bParts = b.split(path.sep); - const aLength = aParts.length; - const bLength = bParts.length; - let cmp = 0; - if (aLength < bLength) { - cmp = -1; - } else if (aLength > bLength) { - cmp = 1; - } else { - let aPart, bPart; - for (let i = 0; i < aLength; ++i) { - aPart = aParts[i]; - bPart = bParts[i]; - if (aPart < bPart) { - cmp = -1; - break; - } else if (aPart > bPart) { - cmp = 1; - break; - } - } - } - return cmp; -}); - -/** - * Generate a list of directories to create given a list of file paths. - * @param {Array.} files List of file paths. - * @return {Array.} List of directory paths ordered by path length. - */ -const dirsToCreate = (__webpack_unused_export__ = function(files) { - return uniqueDirs(files).sort(byShortPath); -}); - -/** - * Copy a file. - * @param {Object} obj Object with src and dest properties. - * @param {function(Error)} callback Callback - */ -const copyFile = (__webpack_unused_export__ = function(obj, callback) { - let called = false; - function done(err) { - if (!called) { - called = true; - callback(err); - } - } - - const read = fs.createReadStream(obj.src); - read.on('error', err => { - done(err); - }); - - const write = fs.createWriteStream(obj.dest); - write.on('error', err => { - done(err); - }); - write.on('close', () => { - done(); - }); - - read.pipe(write); -}); - -/** - * Make directory, ignoring errors if directory already exists. - * @param {string} path Directory path. - * @param {function(Error)} callback Callback. - */ -function makeDir(path, callback) { - fs.mkdir(path, err => { - if (err) { - // check if directory exists - fs.stat(path, (err2, stat) => { - if (err2 || !stat.isDirectory()) { - callback(err); - } else { - callback(); - } - }); - } else { - callback(); - } - }); -} - -/** - * Copy a list of files. - * @param {Array.} files Files to copy. - * @param {string} base Base directory. - * @param {string} dest Destination directory. - * @return {Promise} A promise. - */ -exports.JG = function(files, base, dest) { - return new Promise((resolve, reject) => { - const pairs = []; - const destFiles = []; - files.forEach(file => { - const src = path.resolve(base, file); - const relative = path.relative(base, src); - const target = path.join(dest, relative); - pairs.push({ - src: src, - dest: target - }); - destFiles.push(target); - }); - - async.eachSeries(dirsToCreate(destFiles), makeDir, err => { - if (err) { - return reject(err); - } - async.each(pairs, copyFile, err => { - if (err) { - return reject(err); - } else { - return resolve(); - } - }); - }); - }); -}; - -exports.PR = function(cwd) { - return Promise.all([ - new Git(cwd).exec('config', 'user.name'), - new Git(cwd).exec('config', 'user.email') - ]) - .then(results => { - return {name: results[0].output.trim(), email: results[1].output.trim()}; - }) - .catch(err => { - // git config exits with 1 if name or email is not set - return null; - }); -}; - - -/***/ }), - -/***/ 39849: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var arrayUniq = __webpack_require__(52357); - -module.exports = function () { - return arrayUniq([].concat.apply([], arguments)); -}; - - -/***/ }), - -/***/ 1351: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const path = __webpack_require__(85622); -const fs = __webpack_require__(35747); -const commonDir = __webpack_require__(28192); -const pkgDir = __webpack_require__(8989); -const makeDir = __webpack_require__(90293); - -const {env, cwd} = process; - -const isWritable = path => { - try { - fs.accessSync(path, fs.constants.W_OK); - return true; - } catch (_) { - return false; - } -}; - -function useDirectory(directory, options) { - if (options.create) { - makeDir.sync(directory); - } - - if (options.thunk) { - return (...arguments_) => path.join(directory, ...arguments_); - } - - return directory; -} - -function getNodeModuleDirectory(directory) { - const nodeModules = path.join(directory, 'node_modules'); - - if ( - !isWritable(nodeModules) && - (fs.existsSync(nodeModules) || !isWritable(path.join(directory))) - ) { - return; - } - - return nodeModules; -} - -module.exports = (options = {}) => { - if (env.CACHE_DIR && !['true', 'false', '1', '0'].includes(env.CACHE_DIR)) { - return useDirectory(path.join(env.CACHE_DIR, 'find-cache-dir'), options); - } - - let {cwd: directory = cwd()} = options; - - if (options.files) { - directory = commonDir(directory, options.files); - } - - directory = pkgDir.sync(directory); - - if (!directory) { - return; - } - - const nodeModules = getNodeModuleDirectory(directory); - if (!nodeModules) { - return undefined; - } - - return useDirectory(path.join(directory, 'node_modules', '.cache', options.name), options); -}; - - -/***/ }), - -/***/ 72574: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirpSync = __webpack_require__(89715).mkdirsSync -const utimesSync = __webpack_require__(20629).utimesMillisSync -const stat = __webpack_require__(68755) - -function copySync (src, dest, opts) { - if (typeof opts === 'function') { - opts = { filter: opts } - } - - opts = opts || {} - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n - see https://github.com/jprichardson/node-fs-extra/issues/269`) - } - - const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy') - stat.checkParentPathsSync(src, srcStat, dest, 'copy') - return handleFilterAndCopy(destStat, src, dest, opts) -} - -function handleFilterAndCopy (destStat, src, dest, opts) { - if (opts.filter && !opts.filter(src, dest)) return - const destParent = path.dirname(dest) - if (!fs.existsSync(destParent)) mkdirpSync(destParent) - return startCopy(destStat, src, dest, opts) -} - -function startCopy (destStat, src, dest, opts) { - if (opts.filter && !opts.filter(src, dest)) return - return getStats(destStat, src, dest, opts) -} - -function getStats (destStat, src, dest, opts) { - const statSync = opts.dereference ? fs.statSync : fs.lstatSync - const srcStat = statSync(src) - - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) -} - -function onFile (srcStat, destStat, src, dest, opts) { - if (!destStat) return copyFile(srcStat, src, dest, opts) - return mayCopyFile(srcStat, src, dest, opts) -} - -function mayCopyFile (srcStat, src, dest, opts) { - if (opts.overwrite) { - fs.unlinkSync(dest) - return copyFile(srcStat, src, dest, opts) - } else if (opts.errorOnExist) { - throw new Error(`'${dest}' already exists`) - } -} - -function copyFile (srcStat, src, dest, opts) { - if (typeof fs.copyFileSync === 'function') { - fs.copyFileSync(src, dest) - fs.chmodSync(dest, srcStat.mode) - if (opts.preserveTimestamps) { - return utimesSync(dest, srcStat.atime, srcStat.mtime) - } - return - } - return copyFileFallback(srcStat, src, dest, opts) -} - -function copyFileFallback (srcStat, src, dest, opts) { - const BUF_LENGTH = 64 * 1024 - const _buff = __webpack_require__(57981)(BUF_LENGTH) - - const fdr = fs.openSync(src, 'r') - const fdw = fs.openSync(dest, 'w', srcStat.mode) - let pos = 0 - - while (pos < srcStat.size) { - const bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) - fs.writeSync(fdw, _buff, 0, bytesRead) - pos += bytesRead - } - - if (opts.preserveTimestamps) fs.futimesSync(fdw, srcStat.atime, srcStat.mtime) - - fs.closeSync(fdr) - fs.closeSync(fdw) -} - -function onDir (srcStat, destStat, src, dest, opts) { - if (!destStat) return mkDirAndCopy(srcStat, src, dest, opts) - if (destStat && !destStat.isDirectory()) { - throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) - } - return copyDir(src, dest, opts) -} - -function mkDirAndCopy (srcStat, src, dest, opts) { - fs.mkdirSync(dest) - copyDir(src, dest, opts) - return fs.chmodSync(dest, srcStat.mode) -} - -function copyDir (src, dest, opts) { - fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) -} - -function copyDirItem (item, src, dest, opts) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy') - return startCopy(destStat, srcItem, destItem, opts) -} - -function onLink (destStat, src, dest, opts) { - let resolvedSrc = fs.readlinkSync(src) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } - - if (!destStat) { - return fs.symlinkSync(resolvedSrc, dest) - } else { - let resolvedDest - try { - resolvedDest = fs.readlinkSync(dest) - } catch (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) - throw err - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) - } - - // prevent copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) - } - return copyLink(resolvedSrc, dest) - } -} - -function copyLink (resolvedSrc, dest) { - fs.unlinkSync(dest) - return fs.symlinkSync(resolvedSrc, dest) -} - -module.exports = copySync - - -/***/ }), - -/***/ 78777: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = { - copySync: __webpack_require__(72574) -} - - -/***/ }), - -/***/ 77521: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirp = __webpack_require__(89715).mkdirs -const pathExists = __webpack_require__(63033).pathExists -const utimes = __webpack_require__(20629).utimesMillis -const stat = __webpack_require__(68755) - -function copy (src, dest, opts, cb) { - if (typeof opts === 'function' && !cb) { - cb = opts - opts = {} - } else if (typeof opts === 'function') { - opts = { filter: opts } - } - - cb = cb || function () {} - opts = opts || {} - - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n - see https://github.com/jprichardson/node-fs-extra/issues/269`) - } - - stat.checkPaths(src, dest, 'copy', (err, stats) => { - if (err) return cb(err) - const { srcStat, destStat } = stats - stat.checkParentPaths(src, srcStat, dest, 'copy', err => { - if (err) return cb(err) - if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb) - return checkParentDir(destStat, src, dest, opts, cb) - }) - }) -} - -function checkParentDir (destStat, src, dest, opts, cb) { - const destParent = path.dirname(dest) - pathExists(destParent, (err, dirExists) => { - if (err) return cb(err) - if (dirExists) return startCopy(destStat, src, dest, opts, cb) - mkdirp(destParent, err => { - if (err) return cb(err) - return startCopy(destStat, src, dest, opts, cb) - }) - }) -} - -function handleFilter (onInclude, destStat, src, dest, opts, cb) { - Promise.resolve(opts.filter(src, dest)).then(include => { - if (include) return onInclude(destStat, src, dest, opts, cb) - return cb() - }, error => cb(error)) -} - -function startCopy (destStat, src, dest, opts, cb) { - if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb) - return getStats(destStat, src, dest, opts, cb) -} - -function getStats (destStat, src, dest, opts, cb) { - const stat = opts.dereference ? fs.stat : fs.lstat - stat(src, (err, srcStat) => { - if (err) return cb(err) - - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb) - }) -} - -function onFile (srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return copyFile(srcStat, src, dest, opts, cb) - return mayCopyFile(srcStat, src, dest, opts, cb) -} - -function mayCopyFile (srcStat, src, dest, opts, cb) { - if (opts.overwrite) { - fs.unlink(dest, err => { - if (err) return cb(err) - return copyFile(srcStat, src, dest, opts, cb) - }) - } else if (opts.errorOnExist) { - return cb(new Error(`'${dest}' already exists`)) - } else return cb() -} - -function copyFile (srcStat, src, dest, opts, cb) { - if (typeof fs.copyFile === 'function') { - return fs.copyFile(src, dest, err => { - if (err) return cb(err) - return setDestModeAndTimestamps(srcStat, dest, opts, cb) - }) - } - return copyFileFallback(srcStat, src, dest, opts, cb) -} - -function copyFileFallback (srcStat, src, dest, opts, cb) { - const rs = fs.createReadStream(src) - rs.on('error', err => cb(err)).once('open', () => { - const ws = fs.createWriteStream(dest, { mode: srcStat.mode }) - ws.on('error', err => cb(err)) - .on('open', () => rs.pipe(ws)) - .once('close', () => setDestModeAndTimestamps(srcStat, dest, opts, cb)) - }) -} - -function setDestModeAndTimestamps (srcStat, dest, opts, cb) { - fs.chmod(dest, srcStat.mode, err => { - if (err) return cb(err) - if (opts.preserveTimestamps) { - return utimes(dest, srcStat.atime, srcStat.mtime, cb) - } - return cb() - }) -} - -function onDir (srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return mkDirAndCopy(srcStat, src, dest, opts, cb) - if (destStat && !destStat.isDirectory()) { - return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) - } - return copyDir(src, dest, opts, cb) -} - -function mkDirAndCopy (srcStat, src, dest, opts, cb) { - fs.mkdir(dest, err => { - if (err) return cb(err) - copyDir(src, dest, opts, err => { - if (err) return cb(err) - return fs.chmod(dest, srcStat.mode, cb) - }) - }) -} - -function copyDir (src, dest, opts, cb) { - fs.readdir(src, (err, items) => { - if (err) return cb(err) - return copyDirItems(items, src, dest, opts, cb) - }) -} - -function copyDirItems (items, src, dest, opts, cb) { - const item = items.pop() - if (!item) return cb() - return copyDirItem(items, item, src, dest, opts, cb) -} - -function copyDirItem (items, item, src, dest, opts, cb) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => { - if (err) return cb(err) - const { destStat } = stats - startCopy(destStat, srcItem, destItem, opts, err => { - if (err) return cb(err) - return copyDirItems(items, src, dest, opts, cb) - }) - }) -} - -function onLink (destStat, src, dest, opts, cb) { - fs.readlink(src, (err, resolvedSrc) => { - if (err) return cb(err) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } - - if (!destStat) { - return fs.symlink(resolvedSrc, dest, cb) - } else { - fs.readlink(dest, (err, resolvedDest) => { - if (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb) - return cb(err) - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)) - } - - // do not copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) - } - return copyLink(resolvedSrc, dest, cb) - }) - } - }) -} - -function copyLink (resolvedSrc, dest, cb) { - fs.unlink(dest, err => { - if (err) return cb(err) - return fs.symlink(resolvedSrc, dest, cb) - }) -} - -module.exports = copy - - -/***/ }), - -/***/ 30394: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -module.exports = { - copy: u(__webpack_require__(77521)) -} - - -/***/ }), - -/***/ 89693: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(89715) -const remove = __webpack_require__(16487) - -const emptyDir = u(function emptyDir (dir, callback) { - callback = callback || function () {} - fs.readdir(dir, (err, items) => { - if (err) return mkdir.mkdirs(dir, callback) - - items = items.map(item => path.join(dir, item)) - - deleteItem() - - function deleteItem () { - const item = items.pop() - if (!item) return callback() - remove.remove(item, err => { - if (err) return callback(err) - deleteItem() - }) - } - }) -}) - -function emptyDirSync (dir) { - let items - try { - items = fs.readdirSync(dir) - } catch (err) { - return mkdir.mkdirsSync(dir) - } - - items.forEach(item => { - item = path.join(dir, item) - remove.removeSync(item) - }) -} - -module.exports = { - emptyDirSync, - emptydirSync: emptyDirSync, - emptyDir, - emptydir: emptyDir -} - - -/***/ }), - -/***/ 41572: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(89715) -const pathExists = __webpack_require__(63033).pathExists - -function createFile (file, callback) { - function makeFile () { - fs.writeFile(file, '', err => { - if (err) return callback(err) - callback() - }) - } - - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err - if (!err && stats.isFile()) return callback() - const dir = path.dirname(file) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return makeFile() - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - makeFile() - }) - }) - }) -} - -function createFileSync (file) { - let stats - try { - stats = fs.statSync(file) - } catch (e) {} - if (stats && stats.isFile()) return - - const dir = path.dirname(file) - if (!fs.existsSync(dir)) { - mkdir.mkdirsSync(dir) - } - - fs.writeFileSync(file, '') -} - -module.exports = { - createFile: u(createFile), - createFileSync -} - - -/***/ }), - -/***/ 56542: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const file = __webpack_require__(41572) -const link = __webpack_require__(17380) -const symlink = __webpack_require__(85014) - -module.exports = { - // file - createFile: file.createFile, - createFileSync: file.createFileSync, - ensureFile: file.createFile, - ensureFileSync: file.createFileSync, - // link - createLink: link.createLink, - createLinkSync: link.createLinkSync, - ensureLink: link.createLink, - ensureLinkSync: link.createLinkSync, - // symlink - createSymlink: symlink.createSymlink, - createSymlinkSync: symlink.createSymlinkSync, - ensureSymlink: symlink.createSymlink, - ensureSymlinkSync: symlink.createSymlinkSync -} - - -/***/ }), - -/***/ 17380: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(89715) -const pathExists = __webpack_require__(63033).pathExists - -function createLink (srcpath, dstpath, callback) { - function makeLink (srcpath, dstpath) { - fs.link(srcpath, dstpath, err => { - if (err) return callback(err) - callback(null) - }) - } - - pathExists(dstpath, (err, destinationExists) => { - if (err) return callback(err) - if (destinationExists) return callback(null) - fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureLink') - return callback(err) - } - - const dir = path.dirname(dstpath) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return makeLink(srcpath, dstpath) - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - makeLink(srcpath, dstpath) - }) - }) - }) - }) -} - -function createLinkSync (srcpath, dstpath) { - const destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - try { - fs.lstatSync(srcpath) - } catch (err) { - err.message = err.message.replace('lstat', 'ensureLink') - throw err - } - - const dir = path.dirname(dstpath) - const dirExists = fs.existsSync(dir) - if (dirExists) return fs.linkSync(srcpath, dstpath) - mkdir.mkdirsSync(dir) - - return fs.linkSync(srcpath, dstpath) -} - -module.exports = { - createLink: u(createLink), - createLinkSync -} - - -/***/ }), - -/***/ 42738: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const pathExists = __webpack_require__(63033).pathExists - -/** - * Function that returns two types of paths, one relative to symlink, and one - * relative to the current working directory. Checks if path is absolute or - * relative. If the path is relative, this function checks if the path is - * relative to symlink or relative to current working directory. This is an - * initiative to find a smarter `srcpath` to supply when building symlinks. - * This allows you to determine which path to use out of one of three possible - * types of source paths. The first is an absolute path. This is detected by - * `path.isAbsolute()`. When an absolute path is provided, it is checked to - * see if it exists. If it does it's used, if not an error is returned - * (callback)/ thrown (sync). The other two options for `srcpath` are a - * relative url. By default Node's `fs.symlink` works by creating a symlink - * using `dstpath` and expects the `srcpath` to be relative to the newly - * created symlink. If you provide a `srcpath` that does not exist on the file - * system it results in a broken symlink. To minimize this, the function - * checks to see if the 'relative to symlink' source file exists, and if it - * does it will use it. If it does not, it checks if there's a file that - * exists that is relative to the current working directory, if does its used. - * This preserves the expectations of the original fs.symlink spec and adds - * the ability to pass in `relative to current working direcotry` paths. - */ - -function symlinkPaths (srcpath, dstpath, callback) { - if (path.isAbsolute(srcpath)) { - return fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - 'toCwd': srcpath, - 'toDst': srcpath - }) - }) - } else { - const dstdir = path.dirname(dstpath) - const relativeToDst = path.join(dstdir, srcpath) - return pathExists(relativeToDst, (err, exists) => { - if (err) return callback(err) - if (exists) { - return callback(null, { - 'toCwd': relativeToDst, - 'toDst': srcpath - }) - } else { - return fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - 'toCwd': srcpath, - 'toDst': path.relative(dstdir, srcpath) - }) - }) - } - }) - } -} - -function symlinkPathsSync (srcpath, dstpath) { - let exists - if (path.isAbsolute(srcpath)) { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('absolute srcpath does not exist') - return { - 'toCwd': srcpath, - 'toDst': srcpath - } - } else { - const dstdir = path.dirname(dstpath) - const relativeToDst = path.join(dstdir, srcpath) - exists = fs.existsSync(relativeToDst) - if (exists) { - return { - 'toCwd': relativeToDst, - 'toDst': srcpath - } - } else { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('relative srcpath does not exist') - return { - 'toCwd': srcpath, - 'toDst': path.relative(dstdir, srcpath) - } - } - } -} - -module.exports = { - symlinkPaths, - symlinkPathsSync -} - - -/***/ }), - -/***/ 43874: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) - -function symlinkType (srcpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - if (type) return callback(null, type) - fs.lstat(srcpath, (err, stats) => { - if (err) return callback(null, 'file') - type = (stats && stats.isDirectory()) ? 'dir' : 'file' - callback(null, type) - }) -} - -function symlinkTypeSync (srcpath, type) { - let stats - - if (type) return type - try { - stats = fs.lstatSync(srcpath) - } catch (e) { - return 'file' - } - return (stats && stats.isDirectory()) ? 'dir' : 'file' -} - -module.exports = { - symlinkType, - symlinkTypeSync -} - - -/***/ }), - -/***/ 85014: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const _mkdirs = __webpack_require__(89715) -const mkdirs = _mkdirs.mkdirs -const mkdirsSync = _mkdirs.mkdirsSync - -const _symlinkPaths = __webpack_require__(42738) -const symlinkPaths = _symlinkPaths.symlinkPaths -const symlinkPathsSync = _symlinkPaths.symlinkPathsSync - -const _symlinkType = __webpack_require__(43874) -const symlinkType = _symlinkType.symlinkType -const symlinkTypeSync = _symlinkType.symlinkTypeSync - -const pathExists = __webpack_require__(63033).pathExists - -function createSymlink (srcpath, dstpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - - pathExists(dstpath, (err, destinationExists) => { - if (err) return callback(err) - if (destinationExists) return callback(null) - symlinkPaths(srcpath, dstpath, (err, relative) => { - if (err) return callback(err) - srcpath = relative.toDst - symlinkType(relative.toCwd, type, (err, type) => { - if (err) return callback(err) - const dir = path.dirname(dstpath) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) - mkdirs(dir, err => { - if (err) return callback(err) - fs.symlink(srcpath, dstpath, type, callback) - }) - }) - }) - }) - }) -} - -function createSymlinkSync (srcpath, dstpath, type) { - const destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - const relative = symlinkPathsSync(srcpath, dstpath) - srcpath = relative.toDst - type = symlinkTypeSync(relative.toCwd, type) - const dir = path.dirname(dstpath) - const exists = fs.existsSync(dir) - if (exists) return fs.symlinkSync(srcpath, dstpath, type) - mkdirsSync(dir) - return fs.symlinkSync(srcpath, dstpath, type) -} - -module.exports = { - createSymlink: u(createSymlink), - createSymlinkSync -} - - -/***/ }), - -/***/ 89372: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -// This is adapted from https://github.com/normalize/mz -// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors -const u = __webpack_require__(57258)/* .fromCallback */ .E -const fs = __webpack_require__(82161) - -const api = [ - 'access', - 'appendFile', - 'chmod', - 'chown', - 'close', - 'copyFile', - 'fchmod', - 'fchown', - 'fdatasync', - 'fstat', - 'fsync', - 'ftruncate', - 'futimes', - 'lchown', - 'lchmod', - 'link', - 'lstat', - 'mkdir', - 'mkdtemp', - 'open', - 'readFile', - 'readdir', - 'readlink', - 'realpath', - 'rename', - 'rmdir', - 'stat', - 'symlink', - 'truncate', - 'unlink', - 'utimes', - 'writeFile' -].filter(key => { - // Some commands are not available on some systems. Ex: - // fs.copyFile was added in Node.js v8.5.0 - // fs.mkdtemp was added in Node.js v5.10.0 - // fs.lchown is not available on at least some Linux - return typeof fs[key] === 'function' -}) - -// Export all keys: -Object.keys(fs).forEach(key => { - if (key === 'promises') { - // fs.promises is a getter property that triggers ExperimentalWarning - // Don't re-export it here, the getter is defined in "lib/index.js" - return - } - exports[key] = fs[key] -}) - -// Universalify async methods: -api.forEach(method => { - exports[method] = u(fs[method]) -}) - -// We differ from mz/fs in that we still ship the old, broken, fs.exists() -// since we are a drop-in replacement for the native module -exports.exists = function (filename, callback) { - if (typeof callback === 'function') { - return fs.exists(filename, callback) - } - return new Promise(resolve => { - return fs.exists(filename, resolve) - }) -} - -// fs.read() & fs.write need special treatment due to multiple callback args - -exports.read = function (fd, buffer, offset, length, position, callback) { - if (typeof callback === 'function') { - return fs.read(fd, buffer, offset, length, position, callback) - } - return new Promise((resolve, reject) => { - fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { - if (err) return reject(err) - resolve({ bytesRead, buffer }) - }) - }) -} - -// Function signature can be -// fs.write(fd, buffer[, offset[, length[, position]]], callback) -// OR -// fs.write(fd, string[, position[, encoding]], callback) -// We need to handle both cases, so we use ...args -exports.write = function (fd, buffer, ...args) { - if (typeof args[args.length - 1] === 'function') { - return fs.write(fd, buffer, ...args) - } - - return new Promise((resolve, reject) => { - fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { - if (err) return reject(err) - resolve({ bytesWritten, buffer }) - }) - }) -} - -// fs.realpath.native only available in Node v9.2+ -if (typeof fs.realpath.native === 'function') { - exports.realpath.native = u(fs.realpath.native) -} - - -/***/ }), - -/***/ 35296: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = Object.assign( - {}, - // Export promiseified graceful-fs: - __webpack_require__(89372), - // Export extra methods: - __webpack_require__(78777), - __webpack_require__(30394), - __webpack_require__(89693), - __webpack_require__(56542), - __webpack_require__(92279), - __webpack_require__(89715), - __webpack_require__(3156), - __webpack_require__(85713), - __webpack_require__(71995), - __webpack_require__(63033), - __webpack_require__(16487) -) - -// Export fs.promises as a getter property so that we don't trigger -// ExperimentalWarning before fs.promises is actually accessed. -const fs = __webpack_require__(35747) -if (Object.getOwnPropertyDescriptor(fs, 'promises')) { - Object.defineProperty(module.exports, "promises", ({ - get () { return fs.promises } - })) -} - - -/***/ }), - -/***/ 92279: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const jsonFile = __webpack_require__(66669) - -jsonFile.outputJson = u(__webpack_require__(95343)) -jsonFile.outputJsonSync = __webpack_require__(47716) -// aliases -jsonFile.outputJSON = jsonFile.outputJson -jsonFile.outputJSONSync = jsonFile.outputJsonSync -jsonFile.writeJSON = jsonFile.writeJson -jsonFile.writeJSONSync = jsonFile.writeJsonSync -jsonFile.readJSON = jsonFile.readJson -jsonFile.readJSONSync = jsonFile.readJsonSync - -module.exports = jsonFile - - -/***/ }), - -/***/ 66669: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const jsonFile = __webpack_require__(75362) - -module.exports = { - // jsonfile exports - readJson: u(jsonFile.readFile), - readJsonSync: jsonFile.readFileSync, - writeJson: u(jsonFile.writeFile), - writeJsonSync: jsonFile.writeFileSync -} - - -/***/ }), - -/***/ 47716: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(89715) -const jsonFile = __webpack_require__(66669) - -function outputJsonSync (file, data, options) { - const dir = path.dirname(file) - - if (!fs.existsSync(dir)) { - mkdir.mkdirsSync(dir) - } - - jsonFile.writeJsonSync(file, data, options) -} - -module.exports = outputJsonSync - - -/***/ }), - -/***/ 95343: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(89715) -const pathExists = __webpack_require__(63033).pathExists -const jsonFile = __webpack_require__(66669) - -function outputJson (file, data, options, callback) { - if (typeof options === 'function') { - callback = options - options = {} - } - - const dir = path.dirname(file) - - pathExists(dir, (err, itDoes) => { - if (err) return callback(err) - if (itDoes) return jsonFile.writeJson(file, data, options, callback) - - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - jsonFile.writeJson(file, data, options, callback) - }) - }) -} - -module.exports = outputJson - - -/***/ }), - -/***/ 89715: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const mkdirs = u(__webpack_require__(55065)) -const mkdirsSync = __webpack_require__(37105) - -module.exports = { - mkdirs, - mkdirsSync, - // alias - mkdirp: mkdirs, - mkdirpSync: mkdirsSync, - ensureDir: mkdirs, - ensureDirSync: mkdirsSync -} - - -/***/ }), - -/***/ 37105: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const invalidWin32Path = __webpack_require__(30152).invalidWin32Path - -const o777 = parseInt('0777', 8) - -function mkdirsSync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts } - } - - let mode = opts.mode - const xfs = opts.fs || fs - - if (process.platform === 'win32' && invalidWin32Path(p)) { - const errInval = new Error(p + ' contains invalid WIN32 path characters.') - errInval.code = 'EINVAL' - throw errInval - } - - if (mode === undefined) { - mode = o777 & (~process.umask()) - } - if (!made) made = null - - p = path.resolve(p) - - try { - xfs.mkdirSync(p, mode) - made = made || p - } catch (err0) { - if (err0.code === 'ENOENT') { - if (path.dirname(p) === p) throw err0 - made = mkdirsSync(path.dirname(p), opts, made) - mkdirsSync(p, opts, made) - } else { - // In the case of any other error, just see if there's a dir there - // already. If so, then hooray! If not, then something is borked. - let stat - try { - stat = xfs.statSync(p) - } catch (err1) { - throw err0 - } - if (!stat.isDirectory()) throw err0 - } - } - - return made -} - -module.exports = mkdirsSync - - -/***/ }), - -/***/ 55065: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const invalidWin32Path = __webpack_require__(30152).invalidWin32Path - -const o777 = parseInt('0777', 8) - -function mkdirs (p, opts, callback, made) { - if (typeof opts === 'function') { - callback = opts - opts = {} - } else if (!opts || typeof opts !== 'object') { - opts = { mode: opts } - } - - if (process.platform === 'win32' && invalidWin32Path(p)) { - const errInval = new Error(p + ' contains invalid WIN32 path characters.') - errInval.code = 'EINVAL' - return callback(errInval) - } - - let mode = opts.mode - const xfs = opts.fs || fs - - if (mode === undefined) { - mode = o777 & (~process.umask()) - } - if (!made) made = null - - callback = callback || function () {} - p = path.resolve(p) - - xfs.mkdir(p, mode, er => { - if (!er) { - made = made || p - return callback(null, made) - } - switch (er.code) { - case 'ENOENT': - if (path.dirname(p) === p) return callback(er) - mkdirs(path.dirname(p), opts, (er, made) => { - if (er) callback(er, made) - else mkdirs(p, opts, callback, made) - }) - break - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, (er2, stat) => { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) callback(er, made) - else callback(null, made) - }) - break - } - }) -} - -module.exports = mkdirs - - -/***/ }), - -/***/ 30152: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(85622) - -// get drive on windows -function getRootPath (p) { - p = path.normalize(path.resolve(p)).split(path.sep) - if (p.length > 0) return p[0] - return null -} - -// http://stackoverflow.com/a/62888/10333 contains more accurate -// TODO: expand to include the rest -const INVALID_PATH_CHARS = /[<>:"|?*]/ - -function invalidWin32Path (p) { - const rp = getRootPath(p) - p = p.replace(rp, '') - return INVALID_PATH_CHARS.test(p) -} - -module.exports = { - getRootPath, - invalidWin32Path -} - - -/***/ }), - -/***/ 3156: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = { - moveSync: __webpack_require__(23471) -} - - -/***/ }), - -/***/ 23471: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copySync = __webpack_require__(78777).copySync -const removeSync = __webpack_require__(16487).removeSync -const mkdirpSync = __webpack_require__(89715).mkdirpSync -const stat = __webpack_require__(68755) - -function moveSync (src, dest, opts) { - opts = opts || {} - const overwrite = opts.overwrite || opts.clobber || false - - const { srcStat } = stat.checkPathsSync(src, dest, 'move') - stat.checkParentPathsSync(src, srcStat, dest, 'move') - mkdirpSync(path.dirname(dest)) - return doRename(src, dest, overwrite) -} - -function doRename (src, dest, overwrite) { - if (overwrite) { - removeSync(dest) - return rename(src, dest, overwrite) - } - if (fs.existsSync(dest)) throw new Error('dest already exists.') - return rename(src, dest, overwrite) -} - -function rename (src, dest, overwrite) { - try { - fs.renameSync(src, dest) - } catch (err) { - if (err.code !== 'EXDEV') throw err - return moveAcrossDevice(src, dest, overwrite) - } -} - -function moveAcrossDevice (src, dest, overwrite) { - const opts = { - overwrite, - errorOnExist: true - } - copySync(src, dest, opts) - return removeSync(src) -} - -module.exports = moveSync - - -/***/ }), - -/***/ 85713: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -module.exports = { - move: u(__webpack_require__(40296)) -} - - -/***/ }), - -/***/ 40296: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copy = __webpack_require__(30394).copy -const remove = __webpack_require__(16487).remove -const mkdirp = __webpack_require__(89715).mkdirp -const pathExists = __webpack_require__(63033).pathExists -const stat = __webpack_require__(68755) - -function move (src, dest, opts, cb) { - if (typeof opts === 'function') { - cb = opts - opts = {} - } - - const overwrite = opts.overwrite || opts.clobber || false - - stat.checkPaths(src, dest, 'move', (err, stats) => { - if (err) return cb(err) - const { srcStat } = stats - stat.checkParentPaths(src, srcStat, dest, 'move', err => { - if (err) return cb(err) - mkdirp(path.dirname(dest), err => { - if (err) return cb(err) - return doRename(src, dest, overwrite, cb) - }) - }) - }) -} - -function doRename (src, dest, overwrite, cb) { - if (overwrite) { - return remove(dest, err => { - if (err) return cb(err) - return rename(src, dest, overwrite, cb) - }) - } - pathExists(dest, (err, destExists) => { - if (err) return cb(err) - if (destExists) return cb(new Error('dest already exists.')) - return rename(src, dest, overwrite, cb) - }) -} - -function rename (src, dest, overwrite, cb) { - fs.rename(src, dest, err => { - if (!err) return cb() - if (err.code !== 'EXDEV') return cb(err) - return moveAcrossDevice(src, dest, overwrite, cb) - }) -} - -function moveAcrossDevice (src, dest, overwrite, cb) { - const opts = { - overwrite, - errorOnExist: true - } - copy(src, dest, opts, err => { - if (err) return cb(err) - return remove(src, cb) - }) -} - -module.exports = move - - -/***/ }), - -/***/ 71995: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(89715) -const pathExists = __webpack_require__(63033).pathExists - -function outputFile (file, data, encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding - encoding = 'utf8' - } - - const dir = path.dirname(file) - pathExists(dir, (err, itDoes) => { - if (err) return callback(err) - if (itDoes) return fs.writeFile(file, data, encoding, callback) - - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - - fs.writeFile(file, data, encoding, callback) - }) - }) -} - -function outputFileSync (file, ...args) { - const dir = path.dirname(file) - if (fs.existsSync(dir)) { - return fs.writeFileSync(file, ...args) - } - mkdir.mkdirsSync(dir) - fs.writeFileSync(file, ...args) -} - -module.exports = { - outputFile: u(outputFile), - outputFileSync -} - - -/***/ }), - -/***/ 63033: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const u = __webpack_require__(57258)/* .fromPromise */ .p -const fs = __webpack_require__(89372) - -function pathExists (path) { - return fs.access(path).then(() => true).catch(() => false) -} - -module.exports = { - pathExists: u(pathExists), - pathExistsSync: fs.existsSync -} - - -/***/ }), - -/***/ 16487: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const rimraf = __webpack_require__(11098) - -module.exports = { - remove: u(rimraf), - removeSync: rimraf.sync -} - - -/***/ }), - -/***/ 11098: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const assert = __webpack_require__(42357) - -const isWindows = (process.platform === 'win32') - -function defaults (options) { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 -} - -function rimraf (p, options, cb) { - let busyTries = 0 - - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') - assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - rimraf_(p, options, function CB (er) { - if (er) { - if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && - busyTries < options.maxBusyTries) { - busyTries++ - const time = busyTries * 100 - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), time) - } - - // already gone - if (er.code === 'ENOENT') er = null - } - - cb(er) - }) -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === 'ENOENT') { - return cb(null) - } - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === 'EPERM' && isWindows) { - return fixWinEPERM(p, options, er, cb) - } - - if (st && st.isDirectory()) { - return rmdir(p, options, er, cb) - } - - options.unlink(p, er => { - if (er) { - if (er.code === 'ENOENT') { - return cb(null) - } - if (er.code === 'EPERM') { - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - } - if (er.code === 'EISDIR') { - return rmdir(p, options, er, cb) - } - } - return cb(er) - }) - }) -} - -function fixWinEPERM (p, options, er, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - if (er) { - assert(er instanceof Error) - } - - options.chmod(p, 0o666, er2 => { - if (er2) { - cb(er2.code === 'ENOENT' ? null : er) - } else { - options.stat(p, (er3, stats) => { - if (er3) { - cb(er3.code === 'ENOENT' ? null : er) - } else if (stats.isDirectory()) { - rmdir(p, options, er, cb) - } else { - options.unlink(p, cb) - } - }) - } - }) -} - -function fixWinEPERMSync (p, options, er) { - let stats - - assert(p) - assert(options) - if (er) { - assert(er instanceof Error) - } - - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === 'ENOENT') { - return - } else { - throw er - } - } - - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === 'ENOENT') { - return - } else { - throw er - } - } - - if (stats.isDirectory()) { - rmdirSync(p, options, er) - } else { - options.unlinkSync(p) - } -} - -function rmdir (p, options, originalEr, cb) { - assert(p) - assert(options) - if (originalEr) { - assert(originalEr instanceof Error) - } - assert(typeof cb === 'function') - - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { - rmkids(p, options, cb) - } else if (er && er.code === 'ENOTDIR') { - cb(originalEr) - } else { - cb(er) - } - }) -} - -function rmkids (p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, (er, files) => { - if (er) return cb(er) - - let n = files.length - let errState - - if (n === 0) return options.rmdir(p, cb) - - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) { - return - } - if (er) return cb(errState = er) - if (--n === 0) { - options.rmdir(p, cb) - } - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -function rimrafSync (p, options) { - let st - - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') - - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === 'ENOENT') { - return - } - - // Windows can EPERM on stat. Life is suffering. - if (er.code === 'EPERM' && isWindows) { - fixWinEPERMSync(p, options, er) - } - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) { - rmdirSync(p, options, null) - } else { - options.unlinkSync(p) - } - } catch (er) { - if (er.code === 'ENOENT') { - return - } else if (er.code === 'EPERM') { - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - } else if (er.code !== 'EISDIR') { - throw er - } - rmdirSync(p, options, er) - } -} - -function rmdirSync (p, options, originalEr) { - assert(p) - assert(options) - if (originalEr) { - assert(originalEr instanceof Error) - } - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === 'ENOTDIR') { - throw originalEr - } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { - rmkidsSync(p, options) - } else if (er.code !== 'ENOENT') { - throw er - } - } -} - -function rmkidsSync (p, options) { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - - if (isWindows) { - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const startTime = Date.now() - do { - try { - const ret = options.rmdirSync(p, options) - return ret - } catch (er) { } - } while (Date.now() - startTime < 500) // give up after 500ms - } else { - const ret = options.rmdirSync(p, options) - return ret - } -} - -module.exports = rimraf -rimraf.sync = rimrafSync - - -/***/ }), - -/***/ 57981: -/***/ ((module) => { - -"use strict"; +function getStats (destStat, src, dest, opts, cb) { + const stat = opts.dereference ? fs.stat : fs.lstat + stat(src, (err, srcStat) => { + if (err) return cb(err) -/* eslint-disable node/no-deprecated-api */ -module.exports = function (size) { - if (typeof Buffer.allocUnsafe === 'function') { - try { - return Buffer.allocUnsafe(size) - } catch (e) { - return new Buffer(size) - } - } - return new Buffer(size) + if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb) + else if (srcStat.isFile() || + srcStat.isCharacterDevice() || + srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb) + else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb) + }) } - -/***/ }), - -/***/ 68755: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) - -const NODE_VERSION_MAJOR_WITH_BIGINT = 10 -const NODE_VERSION_MINOR_WITH_BIGINT = 5 -const NODE_VERSION_PATCH_WITH_BIGINT = 0 -const nodeVersion = process.versions.node.split('.') -const nodeVersionMajor = Number.parseInt(nodeVersion[0], 10) -const nodeVersionMinor = Number.parseInt(nodeVersion[1], 10) -const nodeVersionPatch = Number.parseInt(nodeVersion[2], 10) - -function nodeSupportsBigInt () { - if (nodeVersionMajor > NODE_VERSION_MAJOR_WITH_BIGINT) { - return true - } else if (nodeVersionMajor === NODE_VERSION_MAJOR_WITH_BIGINT) { - if (nodeVersionMinor > NODE_VERSION_MINOR_WITH_BIGINT) { - return true - } else if (nodeVersionMinor === NODE_VERSION_MINOR_WITH_BIGINT) { - if (nodeVersionPatch >= NODE_VERSION_PATCH_WITH_BIGINT) { - return true - } - } - } - return false +function onFile (srcStat, destStat, src, dest, opts, cb) { + if (!destStat) return copyFile(srcStat, src, dest, opts, cb) + return mayCopyFile(srcStat, src, dest, opts, cb) } -function getStats (src, dest, cb) { - if (nodeSupportsBigInt()) { - fs.stat(src, { bigint: true }, (err, srcStat) => { - if (err) return cb(err) - fs.stat(dest, { bigint: true }, (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb(null, { srcStat, destStat: null }) - return cb(err) - } - return cb(null, { srcStat, destStat }) - }) - }) - } else { - fs.stat(src, (err, srcStat) => { +function mayCopyFile (srcStat, src, dest, opts, cb) { + if (opts.overwrite) { + fs.unlink(dest, err => { if (err) return cb(err) - fs.stat(dest, (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb(null, { srcStat, destStat: null }) - return cb(err) - } - return cb(null, { srcStat, destStat }) - }) + return copyFile(srcStat, src, dest, opts, cb) }) - } -} - -function getStatsSync (src, dest) { - let srcStat, destStat - if (nodeSupportsBigInt()) { - srcStat = fs.statSync(src, { bigint: true }) - } else { - srcStat = fs.statSync(src) - } - try { - if (nodeSupportsBigInt()) { - destStat = fs.statSync(dest, { bigint: true }) - } else { - destStat = fs.statSync(dest) - } - } catch (err) { - if (err.code === 'ENOENT') return { srcStat, destStat: null } - throw err - } - return { srcStat, destStat } + } else if (opts.errorOnExist) { + return cb(new Error(`'${dest}' already exists`)) + } else return cb() } -function checkPaths (src, dest, funcName, cb) { - getStats(src, dest, (err, stats) => { +function copyFile (srcStat, src, dest, opts, cb) { + fs.copyFile(src, dest, err => { if (err) return cb(err) - const { srcStat, destStat } = stats - if (destStat && destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - return cb(new Error('Source and destination must not be the same.')) - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return cb(null, { srcStat, destStat }) + if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb) + return setDestMode(dest, srcStat.mode, cb) }) } -function checkPathsSync (src, dest, funcName) { - const { srcStat, destStat } = getStatsSync(src, dest) - if (destStat && destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - throw new Error('Source and destination must not be the same.') - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - throw new Error(errMsg(src, dest, funcName)) - } - return { srcStat, destStat } -} - -// recursively check if dest parent is a subdirectory of src. -// It works for all file types including symlinks since it -// checks the src and dest inodes. It starts from the deepest -// parent and stops once it reaches the src parent or the root path. -function checkParentPaths (src, srcStat, dest, funcName, cb) { - const srcParent = path.resolve(path.dirname(src)) - const destParent = path.resolve(path.dirname(dest)) - if (destParent === srcParent || destParent === path.parse(destParent).root) return cb() - if (nodeSupportsBigInt()) { - fs.stat(destParent, { bigint: true }, (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb() - return cb(err) - } - if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return checkParentPaths(src, srcStat, destParent, funcName, cb) - }) - } else { - fs.stat(destParent, (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb() - return cb(err) - } - if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return checkParentPaths(src, srcStat, destParent, funcName, cb) +function handleTimestampsAndMode (srcMode, src, dest, cb) { + // Make sure the file is writable before setting the timestamp + // otherwise open fails with EPERM when invoked with 'r+' + // (through utimes call) + if (fileIsNotWritable(srcMode)) { + return makeFileWritable(dest, srcMode, err => { + if (err) return cb(err) + return setDestTimestampsAndMode(srcMode, src, dest, cb) }) } + return setDestTimestampsAndMode(srcMode, src, dest, cb) } -function checkParentPathsSync (src, srcStat, dest, funcName) { - const srcParent = path.resolve(path.dirname(src)) - const destParent = path.resolve(path.dirname(dest)) - if (destParent === srcParent || destParent === path.parse(destParent).root) return - let destStat - try { - if (nodeSupportsBigInt()) { - destStat = fs.statSync(destParent, { bigint: true }) - } else { - destStat = fs.statSync(destParent) - } - } catch (err) { - if (err.code === 'ENOENT') return - throw err - } - if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - throw new Error(errMsg(src, dest, funcName)) - } - return checkParentPathsSync(src, srcStat, destParent, funcName) -} - -// return true if dest is a subdir of src, otherwise false. -// It only checks the path strings. -function isSrcSubdir (src, dest) { - const srcArr = path.resolve(src).split(path.sep).filter(i => i) - const destArr = path.resolve(dest).split(path.sep).filter(i => i) - return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) +function fileIsNotWritable (srcMode) { + return (srcMode & 0o200) === 0 } -function errMsg (src, dest, funcName) { - return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.` +function makeFileWritable (dest, srcMode, cb) { + return setDestMode(dest, srcMode | 0o200, cb) } -module.exports = { - checkPaths, - checkPathsSync, - checkParentPaths, - checkParentPathsSync, - isSrcSubdir +function setDestTimestampsAndMode (srcMode, src, dest, cb) { + setDestTimestamps(src, dest, err => { + if (err) return cb(err) + return setDestMode(dest, srcMode, cb) + }) } - -/***/ }), - -/***/ 20629: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const os = __webpack_require__(12087) -const path = __webpack_require__(85622) - -// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not -function hasMillisResSync () { - let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) - tmpfile = path.join(os.tmpdir(), tmpfile) - - // 550 millis past UNIX epoch - const d = new Date(1435410243862) - fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') - const fd = fs.openSync(tmpfile, 'r+') - fs.futimesSync(fd, d, d) - fs.closeSync(fd) - return fs.statSync(tmpfile).mtime > 1435410243000 +function setDestMode (dest, srcMode, cb) { + return fs.chmod(dest, srcMode, cb) } -function hasMillisRes (callback) { - let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) - tmpfile = path.join(os.tmpdir(), tmpfile) - - // 550 millis past UNIX epoch - const d = new Date(1435410243862) - fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => { - if (err) return callback(err) - fs.open(tmpfile, 'r+', (err, fd) => { - if (err) return callback(err) - fs.futimes(fd, d, d, err => { - if (err) return callback(err) - fs.close(fd, err => { - if (err) return callback(err) - fs.stat(tmpfile, (err, stats) => { - if (err) return callback(err) - callback(null, stats.mtime > 1435410243000) - }) - }) - }) - }) +function setDestTimestamps (src, dest, cb) { + // The initial srcStat.atime cannot be trusted + // because it is modified by the read(2) system call + // (See https://nodejs.org/api/fs.html#fs_stat_time_values) + fs.stat(src, (err, updatedSrcStat) => { + if (err) return cb(err) + return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb) }) } -function timeRemoveMillis (timestamp) { - if (typeof timestamp === 'number') { - return Math.floor(timestamp / 1000) * 1000 - } else if (timestamp instanceof Date) { - return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) - } else { - throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') +function onDir (srcStat, destStat, src, dest, opts, cb) { + if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb) + if (destStat && !destStat.isDirectory()) { + return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) } + return copyDir(src, dest, opts, cb) } -function utimesMillis (path, atime, mtime, callback) { - // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) - fs.open(path, 'r+', (err, fd) => { - if (err) return callback(err) - fs.futimes(fd, atime, mtime, futimesErr => { - fs.close(fd, closeErr => { - if (callback) callback(futimesErr || closeErr) - }) +function mkDirAndCopy (srcMode, src, dest, opts, cb) { + fs.mkdir(dest, err => { + if (err) return cb(err) + copyDir(src, dest, opts, err => { + if (err) return cb(err) + return setDestMode(dest, srcMode, cb) }) }) } -function utimesMillisSync (path, atime, mtime) { - const fd = fs.openSync(path, 'r+') - fs.futimesSync(fd, atime, mtime) - return fs.closeSync(fd) +function copyDir (src, dest, opts, cb) { + fs.readdir(src, (err, items) => { + if (err) return cb(err) + return copyDirItems(items, src, dest, opts, cb) + }) } -module.exports = { - hasMillisRes, - hasMillisResSync, - timeRemoveMillis, - utimesMillis, - utimesMillisSync +function copyDirItems (items, src, dest, opts, cb) { + const item = items.pop() + if (!item) return cb() + return copyDirItem(items, item, src, dest, opts, cb) } +function copyDirItem (items, item, src, dest, opts, cb) { + const srcItem = path.join(src, item) + const destItem = path.join(dest, item) + stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => { + if (err) return cb(err) + const { destStat } = stats + startCopy(destStat, srcItem, destItem, opts, err => { + if (err) return cb(err) + return copyDirItems(items, src, dest, opts, cb) + }) + }) +} -/***/ }), - -/***/ 97375: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var Promise = __webpack_require__(4548); -var arrayUnion = __webpack_require__(39849); -var objectAssign = __webpack_require__(14594); -var glob = __webpack_require__(37966); -var pify = __webpack_require__(39160); - -var globP = pify(glob, Promise).bind(glob); +function onLink (destStat, src, dest, opts, cb) { + fs.readlink(src, (err, resolvedSrc) => { + if (err) return cb(err) + if (opts.dereference) { + resolvedSrc = path.resolve(process.cwd(), resolvedSrc) + } -function isNegative(pattern) { - return pattern[0] === '!'; -} + if (!destStat) { + return fs.symlink(resolvedSrc, dest, cb) + } else { + fs.readlink(dest, (err, resolvedDest) => { + if (err) { + // dest exists and is a regular file or directory, + // Windows may throw UNKNOWN error. If dest already exists, + // fs throws error anyway, so no need to guard against it here. + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb) + return cb(err) + } + if (opts.dereference) { + resolvedDest = path.resolve(process.cwd(), resolvedDest) + } + if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { + return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)) + } -function isString(value) { - return typeof value === 'string'; + // do not copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { + return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) + } + return copyLink(resolvedSrc, dest, cb) + }) + } + }) } -function assertPatternsInput(patterns) { - if (!patterns.every(isString)) { - throw new TypeError('patterns must be a string or an array of strings'); - } +function copyLink (resolvedSrc, dest, cb) { + fs.unlink(dest, err => { + if (err) return cb(err) + return fs.symlink(resolvedSrc, dest, cb) + }) } -function generateGlobTasks(patterns, opts) { - patterns = [].concat(patterns); - assertPatternsInput(patterns); +module.exports = copy - var globTasks = []; - opts = objectAssign({ - cache: Object.create(null), - statCache: Object.create(null), - realpathCache: Object.create(null), - symlinks: Object.create(null), - ignore: [] - }, opts); +/***/ }), - patterns.forEach(function (pattern, i) { - if (isNegative(pattern)) { - return; - } +/***/ 11647: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var ignore = patterns.slice(i).filter(isNegative).map(function (pattern) { - return pattern.slice(1); - }); +"use strict"; - globTasks.push({ - pattern: pattern, - opts: objectAssign({}, opts, { - ignore: opts.ignore.concat(ignore) - }) - }); - }); - return globTasks; +const u = __nccwpck_require__(92178).fromCallback +module.exports = { + copy: u(__nccwpck_require__(41132)) } -module.exports = function (patterns, opts) { - var globTasks; - - try { - globTasks = generateGlobTasks(patterns, opts); - } catch (err) { - return Promise.reject(err); - } - - return Promise.all(globTasks.map(function (task) { - return globP(task.pattern, task.opts); - })).then(function (paths) { - return arrayUnion.apply(null, paths); - }); -}; - -module.exports.sync = function (patterns, opts) { - var globTasks = generateGlobTasks(patterns, opts); - - return globTasks.reduce(function (matches, task) { - return arrayUnion(matches, glob.sync(task.pattern, task.opts)); - }, []); -}; -module.exports.generateGlobTasks = generateGlobTasks; +/***/ }), -module.exports.hasMagic = function (patterns, opts) { - return [].concat(patterns).some(function (pattern) { - return glob.hasMagic(pattern, opts); - }); -}; +/***/ 81896: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; -/***/ }), -/***/ 75362: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +const u = __nccwpck_require__(92178).fromCallback +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(81881) +const remove = __nccwpck_require__(71703) -var _fs -try { - _fs = __webpack_require__(82161) -} catch (_) { - _fs = __webpack_require__(35747) -} +const emptyDir = u(function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, (err, items) => { + if (err) return mkdir.mkdirs(dir, callback) -function readFile (file, options, callback) { - if (callback == null) { - callback = options - options = {} - } + items = items.map(item => path.join(dir, item)) - if (typeof options === 'string') { - options = {encoding: options} - } + deleteItem() - options = options || {} - var fs = options.fs || _fs + function deleteItem () { + const item = items.pop() + if (!item) return callback() + remove.remove(item, err => { + if (err) return callback(err) + deleteItem() + }) + } + }) +}) - var shouldThrow = true - if ('throws' in options) { - shouldThrow = options.throws +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch { + return mkdir.mkdirsSync(dir) } - fs.readFile(file, options, function (err, data) { - if (err) return callback(err) + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) + }) +} - data = stripBom(data) +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} - var obj - try { - obj = JSON.parse(data, options ? options.reviver : null) - } catch (err2) { - if (shouldThrow) { - err2.message = file + ': ' + err2.message - return callback(err2) - } else { - return callback(null, null) - } - } - callback(null, obj) - }) -} +/***/ }), -function readFileSync (file, options) { - options = options || {} - if (typeof options === 'string') { - options = {encoding: options} - } +/***/ 6039: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var fs = options.fs || _fs +"use strict"; - var shouldThrow = true - if ('throws' in options) { - shouldThrow = options.throws - } - try { - var content = fs.readFileSync(file, options) - content = stripBom(content) - return JSON.parse(content, options.reviver) - } catch (err) { - if (shouldThrow) { - err.message = file + ': ' + err.message - throw err - } else { - return null - } - } -} +const u = __nccwpck_require__(92178).fromCallback +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const mkdir = __nccwpck_require__(81881) -function stringify (obj, options) { - var spaces - var EOL = '\n' - if (typeof options === 'object' && options !== null) { - if (options.spaces) { - spaces = options.spaces - } - if (options.EOL) { - EOL = options.EOL - } +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) } - var str = JSON.stringify(obj, options ? options.replacer : null, spaces) + fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err + if (!err && stats.isFile()) return callback() + const dir = path.dirname(file) + fs.stat(dir, (err, stats) => { + if (err) { + // if the directory doesn't exist, make it + if (err.code === 'ENOENT') { + return mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + } + return callback(err) + } - return str.replace(/\n/g, EOL) + EOL + if (stats.isDirectory()) makeFile() + else { + // parent is not a directory + // This is just to cause an internal ENOTDIR error to be thrown + fs.readdir(dir, err => { + if (err) return callback(err) + }) + } + }) + }) } -function writeFile (file, obj, options, callback) { - if (callback == null) { - callback = options - options = {} - } - options = options || {} - var fs = options.fs || _fs +function createFileSync (file) { + let stats + try { + stats = fs.statSync(file) + } catch {} + if (stats && stats.isFile()) return - var str = '' + const dir = path.dirname(file) try { - str = stringify(obj, options) + if (!fs.statSync(dir).isDirectory()) { + // parent is not a directory + // This is just to cause an internal ENOTDIR error to be thrown + fs.readdirSync(dir) + } } catch (err) { - // Need to return whether a callback was passed or not - if (callback) callback(err, null) - return + // If the stat call above failed because the directory doesn't exist, create it + if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir) + else throw err } - fs.writeFile(file, str, options, callback) -} - -function writeFileSync (file, obj, options) { - options = options || {} - var fs = options.fs || _fs - - var str = stringify(obj, options) - // not sure if fs.writeFileSync returns anything, but just in case - return fs.writeFileSync(file, str, options) -} - -function stripBom (content) { - // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified - if (Buffer.isBuffer(content)) content = content.toString('utf8') - content = content.replace(/^\uFEFF/, '') - return content + fs.writeFileSync(file, '') } -var jsonfile = { - readFile: readFile, - readFileSync: readFileSync, - writeFile: writeFile, - writeFileSync: writeFileSync +module.exports = { + createFile: u(createFile), + createFileSync } -module.exports = jsonfile - /***/ }), -/***/ 39160: -/***/ ((module) => { +/***/ 60151: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var processFn = function (fn, P, opts) { - return function () { - var that = this; - var args = new Array(arguments.length); +const file = __nccwpck_require__(6039) +const link = __nccwpck_require__(55914) +const symlink = __nccwpck_require__(98894) - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} - return new P(function (resolve, reject) { - args.push(function (err, result) { - if (err) { - reject(err); - } else if (opts.multiArgs) { - var results = new Array(arguments.length - 1); - for (var i = 1; i < arguments.length; i++) { - results[i - 1] = arguments[i]; - } +/***/ }), - resolve(results); - } else { - resolve(result); - } - }); +/***/ 55914: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - fn.apply(that, args); - }); - }; -}; +"use strict"; -var pify = module.exports = function (obj, P, opts) { - if (typeof P !== 'function') { - opts = P; - P = Promise; - } - opts = opts || {}; - opts.exclude = opts.exclude || [/.+Sync$/]; +const u = __nccwpck_require__(92178).fromCallback +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const mkdir = __nccwpck_require__(81881) +const pathExists = __nccwpck_require__(42176).pathExists - var filter = function (key) { - var match = function (pattern) { - return typeof pattern === 'string' ? key === pattern : pattern.test(key); - }; +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } - return opts.include ? opts.include.some(match) : !opts.exclude.some(match); - }; + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + fs.lstat(srcpath, (err) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } - var ret = typeof obj === 'function' ? function () { - if (opts.excludeMain) { - return obj.apply(this, arguments); - } + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} - return processFn(obj, P, opts).apply(this, arguments); - } : {}; +function createLinkSync (srcpath, dstpath) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined - return Object.keys(obj).reduce(function (ret, key) { - var x = obj[key]; + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } - ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) - return ret; - }, ret); -}; + return fs.linkSync(srcpath, dstpath) +} -pify.all = pify; +module.exports = { + createLink: u(createLink), + createLinkSync +} /***/ }), -/***/ 8989: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 68917: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const findUp = __webpack_require__(2885); -const pkgDir = async cwd => { - const filePath = await findUp('package.json', {cwd}); - return filePath && path.dirname(filePath); -}; +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const pathExists = __nccwpck_require__(42176).pathExists -module.exports = pkgDir; -// TODO: Remove this for the next major release -module.exports.default = pkgDir; +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ -module.exports.sync = cwd => { - const filePath = findUp.sync('package.json', {cwd}); - return filePath && path.dirname(filePath); -}; +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + toCwd: srcpath, + toDst: srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return pathExists(relativeToDst, (err, exists) => { + if (err) return callback(err) + if (exists) { + return callback(null, { + toCwd: relativeToDst, + toDst: srcpath + }) + } else { + return fs.lstat(srcpath, (err) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + toCwd: srcpath, + toDst: path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + toCwd: srcpath, + toDst: srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + toCwd: relativeToDst, + toDst: srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + toCwd: srcpath, + toDst: path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} /***/ }), -/***/ 57258: -/***/ ((__unused_webpack_module, exports) => { +/***/ 19358: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -exports.E = function (fn) { - return Object.defineProperty(function () { - if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments) - else { - return new Promise((resolve, reject) => { - arguments[arguments.length] = (err, res) => { - if (err) return reject(err) - resolve(res) - } - arguments.length++ - fn.apply(this, arguments) - }) - } - }, 'name', { value: fn.name }) +const fs = __nccwpck_require__(82161) + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) } -exports.p = function (fn) { - return Object.defineProperty(function () { - const cb = arguments[arguments.length - 1] - if (typeof cb !== 'function') return fn.apply(this, arguments) - else fn.apply(this, arguments).then(r => cb(null, r), cb) - }, 'name', { value: fn.name }) +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync } /***/ }), -/***/ 30357: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ 98894: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored +"use strict"; -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} -var path = __webpack_require__(85622) -var minimatch = __webpack_require__(26944) -var isAbsolute = __webpack_require__(36540) -var Minimatch = minimatch.Minimatch +const u = __nccwpck_require__(92178).fromCallback +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const _mkdirs = __nccwpck_require__(81881) +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} +const _symlinkPaths = __nccwpck_require__(68917) +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync -function alphasort (a, b) { - return a.localeCompare(b) -} +const _symlinkType = __nccwpck_require__(19358) +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync -function setupIgnores (self, options) { - self.ignore = options.ignore || [] +const pathExists = __nccwpck_require__(42176).pathExists - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) } -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } +function createSymlinkSync (srcpath, dstpath, type) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) } -function setopts (self, pattern, options) { - if (!options) - options = {} +module.exports = { + createSymlink: u(createSymlink), + createSymlinkSync +} - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute +/***/ }), - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) +/***/ 82998: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - setupIgnores(self, options) +"use strict"; - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } +// This is adapted from https://github.com/normalize/mz +// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors +const u = __nccwpck_require__(92178).fromCallback +const fs = __nccwpck_require__(82161) - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") +const api = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchmod', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'opendir', + 'readdir', + 'readFile', + 'readlink', + 'realpath', + 'rename', + 'rm', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile' +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.opendir was added in Node.js v12.12.0 + // fs.rm was added in Node.js v14.14.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount +// Export all keys: +Object.keys(fs).forEach(key => { + if (key === 'promises') { + // fs.promises is a getter property that triggers ExperimentalWarning + // Don't re-export it here, the getter is defined in "lib/index.js" + return + } + exports[key] = fs[key] +}) - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true +// Universalify async methods: +api.forEach(method => { + exports[method] = u(fs[method]) +}) - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options +// We differ from mz/fs in that we still ship the old, broken, fs.exists() +// since we are a drop-in replacement for the native module +exports.exists = function (filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback) + } + return new Promise(resolve => { + return fs.exists(filename, resolve) + }) } -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) +// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } +exports.read = function (fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback) } + return new Promise((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { + if (err) return reject(err) + resolve({ bytesRead, buffer }) + }) + }) +} - if (!nou) - all = Object.keys(all) +// Function signature can be +// fs.write(fd, buffer[, offset[, length[, position]]], callback) +// OR +// fs.write(fd, string[, position[, encoding]], callback) +// We need to handle both cases, so we use ...args +exports.write = function (fd, buffer, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.write(fd, buffer, ...args) + } - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) + return new Promise((resolve, reject) => { + fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) +} - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) +// fs.writev only available in Node v12.9.0+ +if (typeof fs.writev === 'function') { + // Function signature is + // s.writev(fd, buffers[, position], callback) + // We need to handle the optional arg, so we use ...args + exports.writev = function (fd, buffers, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.writev(fd, buffers, ...args) } - } - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) + return new Promise((resolve, reject) => { + fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => { + if (err) return reject(err) + resolve({ bytesWritten, buffers }) + }) }) + } +} - self.found = all +// fs.realpath.native only available in Node v9.2+ +if (typeof fs.realpath.native === 'function') { + exports.realpath.native = u(fs.realpath.native) } -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) +/***/ }), - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } +/***/ 66272: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return m -} +"use strict"; -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') +module.exports = { + // Export promiseified graceful-fs: + ...__nccwpck_require__(82998), + // Export extra methods: + ...__nccwpck_require__(6574), + ...__nccwpck_require__(11647), + ...__nccwpck_require__(81896), + ...__nccwpck_require__(60151), + ...__nccwpck_require__(16047), + ...__nccwpck_require__(81881), + ...__nccwpck_require__(58611), + ...__nccwpck_require__(96489), + ...__nccwpck_require__(81192), + ...__nccwpck_require__(42176), + ...__nccwpck_require__(71703) +} - return abs +// Export fs.promises as a getter property so that we don't trigger +// ExperimentalWarning before fs.promises is actually accessed. +const fs = __nccwpck_require__(35747) +if (Object.getOwnPropertyDescriptor(fs, 'promises')) { + Object.defineProperty(module.exports, "promises", ({ + get () { return fs.promises } + })) } -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false +/***/ }), - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} +/***/ 16047: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false +"use strict"; - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} +const u = __nccwpck_require__(92178).fromPromise +const jsonFile = __nccwpck_require__(53118) -/***/ }), +jsonFile.outputJson = u(__nccwpck_require__(80690)) +jsonFile.outputJsonSync = __nccwpck_require__(66704) +// aliases +jsonFile.outputJSON = jsonFile.outputJson +jsonFile.outputJSONSync = jsonFile.outputJsonSync +jsonFile.writeJSON = jsonFile.writeJson +jsonFile.writeJSONSync = jsonFile.writeJsonSync +jsonFile.readJSON = jsonFile.readJson +jsonFile.readJSONSync = jsonFile.readJsonSync -/***/ 37966: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +module.exports = jsonFile -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. -module.exports = glob +/***/ }), -var fs = __webpack_require__(35747) -var rp = __webpack_require__(54082) -var minimatch = __webpack_require__(26944) -var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(2989) -var EE = __webpack_require__(28614).EventEmitter -var path = __webpack_require__(85622) -var assert = __webpack_require__(42357) -var isAbsolute = __webpack_require__(36540) -var globSync = __webpack_require__(28427) -var common = __webpack_require__(30357) -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = __webpack_require__(94889) -var util = __webpack_require__(31669) -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored +/***/ 53118: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var once = __webpack_require__(96754) +"use strict"; -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } +const jsonFile = __nccwpck_require__(91393) - return new Glob(pattern, options, cb) +module.exports = { + // jsonfile exports + readJson: jsonFile.readFile, + readJsonSync: jsonFile.readFileSync, + writeJson: jsonFile.writeFile, + writeJsonSync: jsonFile.writeFileSync } -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync -// old api surface -glob.glob = glob +/***/ }), -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } +/***/ 66704: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin +"use strict"; + + +const { stringify } = __nccwpck_require__(24401) +const { outputFileSync } = __nccwpck_require__(81192) + +function outputJsonSync (file, data, options) { + const str = stringify(data, options) + + outputFileSync(file, str, options) } -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true +module.exports = outputJsonSync - var g = new Glob(pattern, options) - var set = g.minimatch.set - if (!pattern) - return false +/***/ }), - if (set.length > 1) - return true +/***/ 80690: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } +"use strict"; - return false + +const { stringify } = __nccwpck_require__(24401) +const { outputFile } = __nccwpck_require__(81192) + +async function outputJson (file, data, options = {}) { + const str = stringify(data, options) + + await outputFile(file, str, options) } -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } +module.exports = outputJson - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) +/***/ }), - setopts(this, pattern, options) - this._didRealPath = false +/***/ 81881: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // process each pattern in the minimatch set - var n = this.minimatch.set.length +"use strict"; - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) +const u = __nccwpck_require__(92178).fromPromise +const { makeDir: _makeDir, makeDirSync } = __nccwpck_require__(970) +const makeDir = u(_makeDir) - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } +module.exports = { + mkdirs: makeDir, + mkdirsSync: makeDirSync, + // alias + mkdirp: makeDir, + mkdirpSync: makeDirSync, + ensureDir: makeDir, + ensureDirSync: makeDirSync +} - var self = this - this._processing = 0 - this._emitQueue = [] - this._processQueue = [] - this.paused = false +/***/ }), - if (this.noprocess) - return this +/***/ 970: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (n === 0) - return done() +"use strict"; +// Adapted from https://github.com/sindresorhus/make-dir +// Copyright (c) Sindre Sorhus (sindresorhus.com) +// 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 sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false +const fs = __nccwpck_require__(82998) +const path = __nccwpck_require__(85622) +const atLeastNode = __nccwpck_require__(898) - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } +const useNativeRecursiveOption = atLeastNode('10.12.0') + +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +const checkPath = pth => { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')) + + if (pathHasInvalidWinCharacters) { + const error = new Error(`Path contains invalid characters: ${pth}`) + error.code = 'EINVAL' + throw error } } } -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) +const processOptions = options => { + const defaults = { mode: 0o777 } + if (typeof options === 'number') options = { mode: options } + return { ...defaults, ...options } } -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true +const permissionError = pth => { + // This replicates the exception of `fs.mkdir` with native the + // `recusive` option when run on an invalid drive under Windows. + const error = new Error(`operation not permitted, mkdir '${pth}'`) + error.code = 'EPERM' + error.errno = -4048 + error.path = pth + error.syscall = 'mkdir' + return error +} - var n = this.matches.length - if (n === 0) - return this._finish() +module.exports.makeDir = async (input, options) => { + checkPath(input) + options = processOptions(options) - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) + if (useNativeRecursiveOption) { + const pth = path.resolve(input) - function next () { - if (--n === 0) - self._finish() + return fs.mkdir(pth, { + mode: options.mode, + recursive: true + }) } -} -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() + const make = async pth => { + try { + await fs.mkdir(pth, options.mode) + } catch (error) { + if (error.code === 'EPERM') { + throw error + } - var found = Object.keys(matchset) - var self = this - var n = found.length + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth) + } - if (n === 0) - return cb() + if (error.message.includes('null bytes')) { + throw error + } - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here + await make(path.dirname(pth)) + return make(pth) + } - if (--n === 0) { - self.matches[index] = set - cb() + try { + const stats = await fs.stat(pth) + if (!stats.isDirectory()) { + // This error is never exposed to the user + // it is caught below, and the original error is thrown + throw new Error('The path is not a directory') + } + } catch { + throw error } - }) - }) -} + } + } -Glob.prototype._mark = function (p) { - return common.mark(this, p) + return make(path.resolve(input)) } -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} +module.exports.makeDirSync = (input, options) => { + checkPath(input) + options = processOptions(options) -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} + if (useNativeRecursiveOption) { + const pth = path.resolve(input) -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') + return fs.mkdirSync(pth, { + mode: options.mode, + recursive: true + }) } -} -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) + const make = pth => { + try { + fs.mkdirSync(pth, options.mode) + } catch (error) { + if (error.code === 'EPERM') { + throw error + } + + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth) + } + + if (error.message.includes('null bytes')) { + throw error + } + + make(path.dirname(pth)) + return make(pth) } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) + + try { + if (!fs.statSync(pth).isDirectory()) { + // This error is never exposed to the user + // it is caught below, and the original error is thrown + throw new Error('The path is not a directory') + } + } catch { + throw error } } } + + return make(path.resolve(input)) } -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - if (this.aborted) - return +/***/ }), - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } +/***/ 58611: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - //console.error('PROCESS %d', this._processing, pattern) +"use strict"; - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return +module.exports = { + moveSync: __nccwpck_require__(18178) +} - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } +/***/ }), - var remain = pattern.slice(n) +/***/ 18178: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix +"use strict"; - var abs = this._makeAbs(read) - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const copySync = __nccwpck_require__(6574).copySync +const removeSync = __nccwpck_require__(71703).removeSync +const mkdirpSync = __nccwpck_require__(81881).mkdirpSync +const stat = __nccwpck_require__(66834) - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} +function moveSync (src, dest, opts) { + opts = opts || {} + const overwrite = opts.overwrite || opts.clobber || false -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) + const { srcStat } = stat.checkPathsSync(src, dest, 'move') + stat.checkParentPathsSync(src, srcStat, dest, 'move') + mkdirpSync(path.dirname(dest)) + return doRename(src, dest, overwrite) } -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() +function doRename (src, dest, overwrite) { + if (overwrite) { + removeSync(dest) + return rename(src, dest, overwrite) + } + if (fs.existsSync(dest)) throw new Error('dest already exists.') + return rename(src, dest, overwrite) +} - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' +function rename (src, dest, overwrite) { + try { + fs.renameSync(src, dest) + } catch (err) { + if (err.code !== 'EXDEV') throw err + return moveAcrossDevice(src, dest, overwrite) + } +} - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } +function moveAcrossDevice (src, dest, overwrite) { + const opts = { + overwrite, + errorOnExist: true } + copySync(src, dest, opts) + return removeSync(src) +} - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) +module.exports = moveSync - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. +/***/ }), - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) +/***/ 96489: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } +"use strict"; - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() +const u = __nccwpck_require__(92178).fromCallback +module.exports = { + move: u(__nccwpck_require__(71294)) } -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (isIgnored(this, e)) - return - if (this.paused) { - this._emitQueue.push([index, e]) - return - } +/***/ }), - var abs = isAbsolute(e) ? e : this._makeAbs(e) +/***/ 71294: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (this.mark) - e = this._mark(e) +"use strict"; - if (this.absolute) - e = abs - if (this.matches[index][e]) - return +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const copy = __nccwpck_require__(11647).copy +const remove = __nccwpck_require__(71703).remove +const mkdirp = __nccwpck_require__(81881).mkdirp +const pathExists = __nccwpck_require__(42176).pathExists +const stat = __nccwpck_require__(66834) - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return +function move (src, dest, opts, cb) { + if (typeof opts === 'function') { + cb = opts + opts = {} } - this.matches[index][e] = true + const overwrite = opts.overwrite || opts.clobber || false - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) + stat.checkPaths(src, dest, 'move', (err, stats) => { + if (err) return cb(err) + const { srcStat } = stats + stat.checkParentPaths(src, srcStat, dest, 'move', err => { + if (err) return cb(err) + mkdirp(path.dirname(dest), err => { + if (err) return cb(err) + return doRename(src, dest, overwrite, cb) + }) + }) + }) +} - this.emit('match', e) +function doRename (src, dest, overwrite, cb) { + if (overwrite) { + return remove(dest, err => { + if (err) return cb(err) + return rename(src, dest, overwrite, cb) + }) + } + pathExists(dest, (err, destExists) => { + if (err) return cb(err) + if (destExists) return cb(new Error('dest already exists.')) + return rename(src, dest, overwrite, cb) + }) } -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return +function rename (src, dest, overwrite, cb) { + fs.rename(src, dest, err => { + if (!err) return cb() + if (err.code !== 'EXDEV') return cb(err) + return moveAcrossDevice(src, dest, overwrite, cb) + }) +} - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) +function moveAcrossDevice (src, dest, overwrite, cb) { + const opts = { + overwrite, + errorOnExist: true + } + copy(src, dest, opts, err => { + if (err) return cb(err) + return remove(src, cb) + }) +} - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) +module.exports = move - if (lstatcb) - fs.lstat(abs, lstatcb) - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() +/***/ }), - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym +/***/ 81192: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} +"use strict"; -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return +const u = __nccwpck_require__(92178).fromCallback +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(81881) +const pathExists = __nccwpck_require__(42176).pathExists - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() + const dir = path.dirname(file) + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return fs.writeFile(file, data, encoding, callback) - if (Array.isArray(c)) - return cb(null, c) - } + mkdir.mkdirs(dir, err => { + if (err) return callback(err) - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) + fs.writeFile(file, data, encoding, callback) + }) + }) } -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) +function outputFileSync (file, ...args) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync(file, ...args) } + mkdir.mkdirsSync(dir) + fs.writeFileSync(file, ...args) } -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return +module.exports = { + outputFile: u(outputFile), + outputFileSync +} - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - this.cache[abs] = entries - return cb(null, entries) -} +/***/ }), -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return +/***/ 42176: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break +"use strict"; - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break +const u = __nccwpck_require__(92178).fromPromise +const fs = __nccwpck_require__(82998) - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } +function pathExists (path) { + return fs.access(path).then(() => true).catch(() => false) +} - return cb() +module.exports = { + pathExists: u(pathExists), + pathExistsSync: fs.existsSync } -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) + +/***/ }), + +/***/ 71703: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const u = __nccwpck_require__(92178).fromCallback +const rimraf = __nccwpck_require__(90065) + +module.exports = { + remove: u(rimraf), + removeSync: rimraf.sync } -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) +/***/ }), - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() +/***/ 90065: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) +"use strict"; - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - var isSym = this.symlinks[abs] - var len = entries.length +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const assert = __nccwpck_require__(42357) - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() +const isWindows = (process.platform === 'win32') - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue +function defaults (options) { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) + options.maxBusyTries = options.maxBusyTries || 3 +} - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) +function rimraf (p, options, cb) { + let busyTries = 0 + + if (typeof options === 'function') { + cb = options + options = {} } - cb() -} + assert(p, 'rimraf: missing path') + assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') + assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && + busyTries < options.maxBusyTries) { + busyTries++ + const time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), time) + } + + // already gone + if (er.code === 'ENOENT') er = null + } -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) + cb(er) }) } -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - if (!this.matches[index]) - this.matches[index] = Object.create(null) +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === 'ENOENT') { + return cb(null) + } - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === 'EPERM' && isWindows) { + return fixWinEPERM(p, options, er, cb) } - } - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') + if (st && st.isDirectory()) { + return rmdir(p, options, er, cb) + } - // Mark this as a match - this._emitMatch(index, prefix) - cb() + options.unlink(p, er => { + if (er) { + if (er.code === 'ENOENT') { + return cb(null) + } + if (er.code === 'EPERM') { + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + } + if (er.code === 'EISDIR') { + return rmdir(p, options, er, cb) + } + } + return cb(er) + }) + }) } -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) + options.chmod(p, 0o666, er2 => { + if (er2) { + cb(er2.code === 'ENOENT' ? null : er) + } else { + options.stat(p, (er3, stats) => { + if (er3) { + cb(er3.code === 'ENOENT' ? null : er) + } else if (stats.isDirectory()) { + rmdir(p, options, er, cb) + } else { + options.unlink(p, cb) + } + }) + } + }) +} - if (needDir && c === 'FILE') - return cb() +function fixWinEPERMSync (p, options, er) { + let stats - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } + assert(p) + assert(options) - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === 'ENOENT') { + return + } else { + throw er } } - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === 'ENOENT') { + return } else { - self._stat2(f, abs, er, lstat, cb) + throw er } } -} -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() + if (stats.isDirectory()) { + rmdirSync(p, options, er) + } else { + options.unlinkSync(p) } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) } +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') -/***/ }), + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { + rmkids(p, options, cb) + } else if (er && er.code === 'ENOTDIR') { + cb(originalEr) + } else { + cb(er) + } + }) +} -/***/ 28427: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function rmkids (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') -module.exports = globSync -globSync.GlobSync = GlobSync + options.readdir(p, (er, files) => { + if (er) return cb(er) -var fs = __webpack_require__(35747) -var rp = __webpack_require__(54082) -var minimatch = __webpack_require__(26944) -var Minimatch = minimatch.Minimatch -var Glob = __webpack_require__(37966).Glob -var util = __webpack_require__(31669) -var path = __webpack_require__(85622) -var assert = __webpack_require__(42357) -var isAbsolute = __webpack_require__(36540) -var common = __webpack_require__(30357) -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored + let n = files.length + let errState -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') + if (n === 0) return options.rmdir(p, cb) - return new GlobSync(pattern, options).found + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) { + return + } + if (er) return cb(errState = er) + if (--n === 0) { + options.rmdir(p, cb) + } + }) + }) + }) } -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + let st - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') + options = options || {} + defaults(options) - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) + assert(p, 'rimraf: missing path') + assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') - setopts(this, pattern, options) + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return + } - if (this.noprocess) - return this + // Windows can EPERM on stat. Life is suffering. + if (er.code === 'EPERM' && isWindows) { + fixWinEPERMSync(p, options, er) + } + } - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) { + rmdirSync(p, options, null) + } else { + options.unlinkSync(p) + } + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'EPERM') { + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + } else if (er.code !== 'EISDIR') { + throw er + } + rmdirSync(p, options, er) } - this._finish() } -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === 'ENOTDIR') { + throw originalEr + } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { + rmkidsSync(p, options) + } else if (er.code !== 'ENOENT') { + throw er + } } - common.finish(this) } +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ + if (isWindows) { + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const startTime = Date.now() + do { + try { + const ret = options.rmdirSync(p, options) + return ret + } catch {} + } while (Date.now() - startTime < 500) // give up after 500ms + } else { + const ret = options.rmdirSync(p, options) + return ret } - // now n is the index of the first one that is *not* a string. +} - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return +module.exports = rimraf +rimraf.sync = rimrafSync - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } +/***/ }), - var remain = pattern.slice(n) +/***/ 66834: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix +"use strict"; - var abs = this._makeAbs(read) - //if ignored, skip processing - if (childrenIgnored(this, read)) - return +const fs = __nccwpck_require__(82998) +const path = __nccwpck_require__(85622) +const util = __nccwpck_require__(31669) +const atLeastNode = __nccwpck_require__(898) - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +const nodeSupportsBigInt = atLeastNode('10.5.0') +const stat = (file) => nodeSupportsBigInt ? fs.stat(file, { bigint: true }) : fs.stat(file) +const statSync = (file) => nodeSupportsBigInt ? fs.statSync(file, { bigint: true }) : fs.statSync(file) + +function getStats (src, dest) { + return Promise.all([ + stat(src), + stat(dest).catch(err => { + if (err.code === 'ENOENT') return null + throw err + }) + ]).then(([srcStat, destStat]) => ({ srcStat, destStat })) } +function getStatsSync (src, dest) { + let destStat + const srcStat = statSync(src) + try { + destStat = statSync(dest) + } catch (err) { + if (err.code === 'ENOENT') return { srcStat, destStat: null } + throw err + } + return { srcStat, destStat } +} -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) +function checkPaths (src, dest, funcName, cb) { + util.callbackify(getStats)(src, dest, (err, stats) => { + if (err) return cb(err) + const { srcStat, destStat } = stats + if (destStat && areIdentical(srcStat, destStat)) { + return cb(new Error('Source and destination must not be the same.')) + } + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + return cb(new Error(errMsg(src, dest, funcName))) + } + return cb(null, { srcStat, destStat }) + }) +} - // if the abs isn't a dir, then nothing can match! - if (!entries) - return +function checkPathsSync (src, dest, funcName) { + const { srcStat, destStat } = getStatsSync(src, dest) + if (destStat && areIdentical(srcStat, destStat)) { + throw new Error('Source and destination must not be the same.') + } + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + throw new Error(errMsg(src, dest, funcName)) + } + return { srcStat, destStat } +} - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' +// recursively check if dest parent is a subdirectory of src. +// It works for all file types including symlinks since it +// checks the src and dest inodes. It starts from the deepest +// parent and stops once it reaches the src parent or the root path. +function checkParentPaths (src, srcStat, dest, funcName, cb) { + const srcParent = path.resolve(path.dirname(src)) + const destParent = path.resolve(path.dirname(dest)) + if (destParent === srcParent || destParent === path.parse(destParent).root) return cb() + const callback = (err, destStat) => { + if (err) { + if (err.code === 'ENOENT') return cb() + return cb(err) + } + if (areIdentical(srcStat, destStat)) { + return cb(new Error(errMsg(src, dest, funcName))) + } + return checkParentPaths(src, srcStat, destParent, funcName, cb) + } + if (nodeSupportsBigInt) fs.stat(destParent, { bigint: true }, callback) + else fs.stat(destParent, callback) +} - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) +function checkParentPathsSync (src, srcStat, dest, funcName) { + const srcParent = path.resolve(path.dirname(src)) + const destParent = path.resolve(path.dirname(dest)) + if (destParent === srcParent || destParent === path.parse(destParent).root) return + let destStat + try { + destStat = statSync(destParent) + } catch (err) { + if (err.code === 'ENOENT') return + throw err + } + if (areIdentical(srcStat, destStat)) { + throw new Error(errMsg(src, dest, funcName)) + } + return checkParentPathsSync(src, srcStat, destParent, funcName) +} + +function areIdentical (srcStat, destStat) { + if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { + if (nodeSupportsBigInt || destStat.ino < Number.MAX_SAFE_INTEGER) { + // definitive answer + return true + } + // Use additional heuristics if we can't use 'bigint'. + // Different 'ino' could be represented the same if they are >= Number.MAX_SAFE_INTEGER + // See issue 657 + if (destStat.size === srcStat.size && + destStat.mode === srcStat.mode && + destStat.nlink === srcStat.nlink && + destStat.atimeMs === srcStat.atimeMs && + destStat.mtimeMs === srcStat.mtimeMs && + destStat.ctimeMs === srcStat.ctimeMs && + destStat.birthtimeMs === srcStat.birthtimeMs) { + // heuristic answer + return true } } + return false +} - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return +// return true if dest is a subdir of src, otherwise false. +// It only checks the path strings. +function isSrcSubdir (src, dest) { + const srcArr = path.resolve(src).split(path.sep).filter(i => i) + const destArr = path.resolve(dest).split(path.sep).filter(i => i) + return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) +} - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. +function errMsg (src, dest, funcName) { + return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.` +} - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) +module.exports = { + checkPaths, + checkPathsSync, + checkParentPaths, + checkParentPathsSync, + isSrcSubdir +} - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } +/***/ }), - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} +/***/ 64698: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - var abs = this._makeAbs(e) +const fs = __nccwpck_require__(82161) - if (this.mark) - e = this._mark(e) +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} - if (this.absolute) { - e = abs - } +function utimesMillisSync (path, atime, mtime) { + const fd = fs.openSync(path, 'r+') + fs.futimesSync(fd, atime, mtime) + return fs.closeSync(fd) +} - if (this.matches[index][e]) - return +module.exports = { + utimesMillis, + utimesMillisSync +} - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - this.matches[index][e] = true +/***/ }), - if (this.stat) - this._stat(e) -} +/***/ 16252: +/***/ ((module) => { +"use strict"; -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); } - } + var args = slice.call(arguments, 1); - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } - return entries -} + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) + return bound; +}; - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - if (Array.isArray(c)) - return c - } +/***/ }), - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} +/***/ 45489: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } +"use strict"; - this.cache[abs] = entries - // mark and cache dir-ness - return entries -} +var implementation = __nccwpck_require__(16252); -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break +module.exports = Function.prototype.bind || implementation; - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} +/***/ }), -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { +/***/ 5882: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var entries = this._readdir(abs, inGlobStar) +"use strict"; - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return +const {PassThrough: PassThroughStream} = __nccwpck_require__(92413); - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) +module.exports = options => { + options = {...options}; - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) + const {array} = options; + let {encoding} = options; + const isBuffer = encoding === 'buffer'; + let objectMode = false; - var len = entries.length - var isSym = this.symlinks[abs] + if (array) { + objectMode = !(encoding || isBuffer); + } else { + encoding = encoding || 'utf8'; + } - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return + if (isBuffer) { + encoding = null; + } - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue + const stream = new PassThroughStream({objectMode}); - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) + if (encoding) { + stream.setEncoding(encoding); + } - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} + let length = 0; + const chunks = []; -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) + stream.on('data', chunk => { + chunks.push(chunk); - if (!this.matches[index]) - this.matches[index] = Object.create(null) + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); - // If it doesn't exist, then just mark the lack of results - if (!exists) - return + stream.getBufferedValue = () => { + if (array) { + return chunks; + } - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } + return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); + }; - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') + stream.getBufferedLength = () => length; - // Mark this as a match - this._emitMatch(index, prefix) -} + return stream; +}; -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - if (f.length > this.maxLength) - return false +/***/ }), - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] +/***/ 63886: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (Array.isArray(c)) - c = 'DIR' +"use strict"; - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c +const {constants: BufferConstants} = __nccwpck_require__(64293); +const pump = __nccwpck_require__(20113); +const bufferStream = __nccwpck_require__(5882); - if (needDir && c === 'FILE') - return false +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } +} - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } +async function getStream(inputStream, options) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } + options = { + maxBuffer: Infinity, + ...options + }; - if (lstat && lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } + const {maxBuffer} = options; - this.statCache[abs] = stat + let stream; + await new Promise((resolve, reject) => { + const rejectPromise = error => { + // Don't retrieve an oversized buffer. + if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { + error.bufferedData = stream.getBufferedValue(); + } - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' + reject(error); + }; - this.cache[abs] = this.cache[abs] || c + stream = pump(inputStream, bufferStream(options), error => { + if (error) { + rejectPromise(error); + return; + } - if (needDir && c === 'FILE') - return false + resolve(); + }); - return c -} + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) + return stream.getBufferedValue(); } -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} +module.exports = getStream; +// TODO: Remove this for the next major release +module.exports.default = getStream; +module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); +module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); +module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 76609: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63258,7 +49654,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _roarr = _interopRequireDefault(__webpack_require__(30786)); +var _roarr = _interopRequireDefault(__nccwpck_require__(30786)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63273,7 +49669,7 @@ exports.default = _default; /***/ }), /***/ 72652: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63283,9 +49679,11 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _serializeError = __webpack_require__(81224); +var _serializeError = __nccwpck_require__(81224); -var _Logger = _interopRequireDefault(__webpack_require__(76609)); +var _boolean = __nccwpck_require__(8436); + +var _Logger = _interopRequireDefault(__nccwpck_require__(76609)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63366,8 +49764,45 @@ class Agent { const connectionConfiguration = { host: configuration.hostname || configuration.host, port: configuration.port || 80, - proxy - }; // $FlowFixMe It appears that Flow is missing the method description. + proxy, + tls: {} + }; // add optional tls options for https requests. + // @see https://nodejs.org/docs/latest-v12.x/api/https.html#https_https_request_url_options_callback : + // > The following additional options from tls.connect() + // > - https://nodejs.org/docs/latest-v12.x/api/tls.html#tls_tls_connect_options_callback - + // > are also accepted: + // > ca, cert, ciphers, clientCertEngine, crl, dhparam, ecdhCurve, honorCipherOrder, + // > key, passphrase, pfx, rejectUnauthorized, secureOptions, secureProtocol, servername, sessionIdContext. + + if (this.protocol === 'https:') { + connectionConfiguration.tls = { + ca: configuration.ca, + cert: configuration.cert, + ciphers: configuration.ciphers, + clientCertEngine: configuration.clientCertEngine, + crl: configuration.crl, + dhparam: configuration.dhparam, + ecdhCurve: configuration.ecdhCurve, + honorCipherOrder: configuration.honorCipherOrder, + key: configuration.key, + passphrase: configuration.passphrase, + pfx: configuration.pfx, + rejectUnauthorized: configuration.rejectUnauthorized, + secureOptions: configuration.secureOptions, + secureProtocol: configuration.secureProtocol, + servername: configuration.servername || connectionConfiguration.host, + sessionIdContext: configuration.sessionIdContext + }; // This is not ideal because there is no way to override this setting using `tls` configuration if `NODE_TLS_REJECT_UNAUTHORIZED=0`. + // However, popular HTTP clients (such as https://github.com/sindresorhus/got) come with pre-configured value for `rejectUnauthorized`, + // which makes it impossible to override that value globally and respect `rejectUnauthorized` for specific requests only. + // + // eslint-disable-next-line no-process-env + + if (typeof process.env.NODE_TLS_REJECT_UNAUTHORIZED === 'string' && (0, _boolean.boolean)(process.env.NODE_TLS_REJECT_UNAUTHORIZED) === false) { + connectionConfiguration.tls.rejectUnauthorized = false; + } + } // $FlowFixMe It appears that Flow is missing the method description. + this.createConnection(connectionConfiguration, (error, socket) => { log.trace({ @@ -63415,7 +49850,7 @@ exports.default = _default; /***/ }), /***/ 73946: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63425,9 +49860,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _net = _interopRequireDefault(__webpack_require__(11631)); +var _net = _interopRequireDefault(__nccwpck_require__(11631)); -var _Agent = _interopRequireDefault(__webpack_require__(72652)); +var _Agent = _interopRequireDefault(__nccwpck_require__(72652)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63455,7 +49890,7 @@ exports.default = _default; /***/ }), /***/ 18272: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63465,11 +49900,11 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _net = _interopRequireDefault(__webpack_require__(11631)); +var _net = _interopRequireDefault(__nccwpck_require__(11631)); -var _tls = _interopRequireDefault(__webpack_require__(4016)); +var _tls = _interopRequireDefault(__nccwpck_require__(4016)); -var _Agent = _interopRequireDefault(__webpack_require__(72652)); +var _Agent = _interopRequireDefault(__nccwpck_require__(72652)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63488,9 +49923,7 @@ class HttpsProxyAgent extends _Agent.default { callback(error); }); socket.once('data', () => { - const secureSocket = _tls.default.connect({ - rejectUnauthorized: false, - servername: configuration.host, + const secureSocket = _tls.default.connect({ ...configuration.tls, socket }); @@ -63517,7 +49950,7 @@ exports.default = _default; /***/ }), /***/ 1725: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63544,11 +49977,11 @@ Object.defineProperty(exports, "HttpsProxyAgent", ({ } })); -var _Agent = _interopRequireDefault(__webpack_require__(72652)); +var _Agent = _interopRequireDefault(__nccwpck_require__(72652)); -var _HttpProxyAgent = _interopRequireDefault(__webpack_require__(73946)); +var _HttpProxyAgent = _interopRequireDefault(__nccwpck_require__(73946)); -var _HttpsProxyAgent = _interopRequireDefault(__webpack_require__(18272)); +var _HttpsProxyAgent = _interopRequireDefault(__nccwpck_require__(18272)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map @@ -63556,7 +49989,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ }), /***/ 988: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63566,7 +49999,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.UnexpectedStateError = void 0; -var _es6Error = _interopRequireDefault(__webpack_require__(65393)); +var _es6Error = _interopRequireDefault(__nccwpck_require__(65393)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63585,7 +50018,7 @@ exports.UnexpectedStateError = UnexpectedStateError; /***/ }), /***/ 67165: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63595,23 +50028,23 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _http = _interopRequireDefault(__webpack_require__(98605)); +var _http = _interopRequireDefault(__nccwpck_require__(98605)); -var _https = _interopRequireDefault(__webpack_require__(57211)); +var _https = _interopRequireDefault(__nccwpck_require__(57211)); -var _boolean = __webpack_require__(8436); +var _boolean = __nccwpck_require__(8436); -var _semver = _interopRequireDefault(__webpack_require__(19618)); +var _semver = _interopRequireDefault(__nccwpck_require__(19618)); -var _Logger = _interopRequireDefault(__webpack_require__(76609)); +var _Logger = _interopRequireDefault(__nccwpck_require__(76609)); -var _classes = __webpack_require__(1725); +var _classes = __nccwpck_require__(1725); -var _errors = __webpack_require__(988); +var _errors = __nccwpck_require__(988); -var _utilities = __webpack_require__(33846); +var _utilities = __nccwpck_require__(33846); -var _createProxyController = _interopRequireDefault(__webpack_require__(55581)); +var _createProxyController = _interopRequireDefault(__nccwpck_require__(55581)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63651,7 +50084,7 @@ const createConfiguration = configurationInput => { const defaultConfiguration = { environmentVariableNamespace: typeof environment.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE === 'string' ? environment.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE : 'GLOBAL_AGENT_', forceGlobalAgent: typeof environment.GLOBAL_AGENT_FORCE_GLOBAL_AGENT === 'string' ? (0, _boolean.boolean)(environment.GLOBAL_AGENT_FORCE_GLOBAL_AGENT) : true, - socketConnectionTimeout: typeof environment.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT === 'string' ? parseInt(environment.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT, 10) : defaultConfigurationInput.socketConnectionTimeout + socketConnectionTimeout: typeof environment.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT === 'string' ? Number.parseInt(environment.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT, 10) : defaultConfigurationInput.socketConnectionTimeout }; // $FlowFixMe return { ...defaultConfiguration, @@ -63767,7 +50200,7 @@ exports.default = _default; /***/ }), /***/ 55581: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63777,7 +50210,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _Logger = _interopRequireDefault(__webpack_require__(76609)); +var _Logger = _interopRequireDefault(__nccwpck_require__(76609)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63819,7 +50252,7 @@ exports.default = _default; /***/ }), /***/ 459: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63840,9 +50273,9 @@ Object.defineProperty(exports, "createProxyController", ({ } })); -var _createGlobalProxyAgent = _interopRequireDefault(__webpack_require__(67165)); +var _createGlobalProxyAgent = _interopRequireDefault(__nccwpck_require__(67165)); -var _createProxyController = _interopRequireDefault(__webpack_require__(55581)); +var _createProxyController = _interopRequireDefault(__nccwpck_require__(55581)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map @@ -63850,7 +50283,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ }), /***/ 22407: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; var __webpack_unused_export__; @@ -63872,15 +50305,15 @@ __webpack_unused_export__ = ({ } }); -var _routines = __webpack_require__(52934); +var _routines = __nccwpck_require__(52934); -var _factories = __webpack_require__(459); +var _factories = __nccwpck_require__(459); //# sourceMappingURL=index.js.map /***/ }), /***/ 63187: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63890,9 +50323,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _Logger = _interopRequireDefault(__webpack_require__(76609)); +var _Logger = _interopRequireDefault(__nccwpck_require__(76609)); -var _factories = __webpack_require__(459); +var _factories = __nccwpck_require__(459); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63917,7 +50350,7 @@ exports.default = _default; /***/ }), /***/ 52934: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63932,7 +50365,7 @@ Object.defineProperty(exports, "bootstrap", ({ } })); -var _bootstrap = _interopRequireDefault(__webpack_require__(63187)); +var _bootstrap = _interopRequireDefault(__nccwpck_require__(63187)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map @@ -63940,7 +50373,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ }), /***/ 26269: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63950,9 +50383,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _http = _interopRequireDefault(__webpack_require__(98605)); +var _http = _interopRequireDefault(__nccwpck_require__(98605)); -var _https = _interopRequireDefault(__webpack_require__(57211)); +var _https = _interopRequireDefault(__nccwpck_require__(57211)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -64009,7 +50442,7 @@ exports.default = _default; /***/ }), /***/ 33846: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -64036,11 +50469,11 @@ Object.defineProperty(exports, "parseProxyUrl", ({ } })); -var _bindHttpMethod = _interopRequireDefault(__webpack_require__(26269)); +var _bindHttpMethod = _interopRequireDefault(__nccwpck_require__(26269)); -var _isUrlMatchingNoProxy = _interopRequireDefault(__webpack_require__(3075)); +var _isUrlMatchingNoProxy = _interopRequireDefault(__nccwpck_require__(3075)); -var _parseProxyUrl = _interopRequireDefault(__webpack_require__(12514)); +var _parseProxyUrl = _interopRequireDefault(__nccwpck_require__(12514)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map @@ -64048,7 +50481,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ }), /***/ 3075: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -64058,17 +50491,17 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _url = __webpack_require__(78835); +var _url = __nccwpck_require__(78835); -var _matcher = _interopRequireDefault(__webpack_require__(89437)); +var _matcher = _interopRequireDefault(__nccwpck_require__(89437)); -var _errors = __webpack_require__(988); +var _errors = __nccwpck_require__(988); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const isUrlMatchingNoProxy = (subjectUrl, noProxy) => { const subjectUrlTokens = (0, _url.parse)(subjectUrl); - const rules = noProxy.split(/[,\s]/); + const rules = noProxy.split(/[\s,]/); for (const rule of rules) { const ruleMatch = rule.replace(/^(?\.)/, '*').match(/^(?.+?)(?::(?\d+))?$/); @@ -64098,7 +50531,7 @@ exports.default = _default; /***/ }), /***/ 12514: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -64108,9 +50541,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _url = __webpack_require__(78835); +var _url = __nccwpck_require__(78835); -var _errors = __webpack_require__(988); +var _errors = __nccwpck_require__(988); const parseProxyUrl = url => { const urlTokens = (0, _url.parse)(url); @@ -64130,7 +50563,7 @@ const parseProxyUrl = url => { let port = 80; if (urlTokens.port) { - port = parseInt(urlTokens.port, 10); + port = Number.parseInt(urlTokens.port, 10); } return { @@ -64147,7 +50580,7 @@ exports.default = _default; /***/ }), /***/ 2667: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* jshint node:true */ @@ -64159,19 +50592,19 @@ exports.default = _default; var globalTunnel = exports; exports.constructor = function() {}; -var http = __webpack_require__(98605); -var https = __webpack_require__(57211); -var urlParse = __webpack_require__(78835).parse; -var urlStringify = __webpack_require__(78835).format; +var http = __nccwpck_require__(98605); +var https = __nccwpck_require__(57211); +var urlParse = __nccwpck_require__(78835).parse; +var urlStringify = __nccwpck_require__(78835).format; -var pick = __webpack_require__(53651); -var assign = __webpack_require__(66690); -var clone = __webpack_require__(31471); -var tunnel = __webpack_require__(57951); -var npmConfig = __webpack_require__(8569); -var encodeUrl = __webpack_require__(33874); +var pick = __nccwpck_require__(53651); +var assign = __nccwpck_require__(66690); +var clone = __nccwpck_require__(31471); +var tunnel = __nccwpck_require__(57951); +var npmConfig = __nccwpck_require__(8569); +var encodeUrl = __nccwpck_require__(33874); -var agents = __webpack_require__(34); +var agents = __nccwpck_require__(34); exports.agents = agents; var ENV_VAR_PROXY_SEARCH_ORDER = [ @@ -64503,19 +50936,19 @@ globalTunnel.end = function() { /***/ }), /***/ 34: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* jshint node:true */ -var util = __webpack_require__(31669); -var http = __webpack_require__(98605); +var util = __nccwpck_require__(31669); +var http = __nccwpck_require__(98605); var HttpAgent = http.Agent; -var https = __webpack_require__(57211); +var https = __nccwpck_require__(57211); var HttpsAgent = https.Agent; -var pick = __webpack_require__(53651); +var pick = __nccwpck_require__(53651); /** * Proxy some traffic over HTTP. @@ -64574,16 +51007,16 @@ module.exports = global; /***/ }), /***/ 35553: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var defineProperties = __webpack_require__(47778); +var defineProperties = __nccwpck_require__(47778); -var implementation = __webpack_require__(60531); -var getPolyfill = __webpack_require__(75854); -var shim = __webpack_require__(96303); +var implementation = __nccwpck_require__(60531); +var getPolyfill = __nccwpck_require__(75854); +var shim = __nccwpck_require__(96303); var polyfill = getPolyfill(); @@ -64601,12 +51034,12 @@ module.exports = getGlobal; /***/ }), /***/ 75854: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var implementation = __webpack_require__(60531); +var implementation = __nccwpck_require__(60531); module.exports = function getPolyfill() { if (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) { @@ -64619,13 +51052,13 @@ module.exports = function getPolyfill() { /***/ }), /***/ 96303: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var define = __webpack_require__(47778); -var getPolyfill = __webpack_require__(75854); +var define = __nccwpck_require__(47778); +var getPolyfill = __nccwpck_require__(75854); module.exports = function shimGlobal() { var polyfill = getPolyfill(); @@ -64649,11 +51082,11 @@ module.exports = function shimGlobal() { /***/ }), /***/ 83205: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {PassThrough} = __webpack_require__(92413); +const {PassThrough} = __nccwpck_require__(92413); module.exports = options => { options = Object.assign({}, options); @@ -64708,12 +51141,12 @@ module.exports = options => { /***/ }), /***/ 43141: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pump = __webpack_require__(20113); -const bufferStream = __webpack_require__(83205); +const pump = __nccwpck_require__(20113); +const bufferStream = __nccwpck_require__(83205); class MaxBufferError extends Error { constructor() { @@ -64766,18 +51199,18 @@ module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 59427: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const EventEmitter = __webpack_require__(28614); -const getStream = __webpack_require__(43141); -const is = __webpack_require__(24120); -const PCancelable = __webpack_require__(76348); -const requestAsEventEmitter = __webpack_require__(81406); -const {HTTPError, ParseError, ReadError} = __webpack_require__(21751); -const {options: mergeOptions} = __webpack_require__(34119); -const {reNormalize} = __webpack_require__(85277); +const EventEmitter = __nccwpck_require__(28614); +const getStream = __nccwpck_require__(43141); +const is = __nccwpck_require__(24120); +const PCancelable = __nccwpck_require__(76348); +const requestAsEventEmitter = __nccwpck_require__(81406); +const {HTTPError, ParseError, ReadError} = __nccwpck_require__(21751); +const {options: mergeOptions} = __nccwpck_require__(34119); +const {reNormalize} = __nccwpck_require__(85277); const asPromise = options => { const proxy = new EventEmitter(); @@ -64882,14 +51315,14 @@ module.exports = asPromise; /***/ }), /***/ 40919: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {PassThrough} = __webpack_require__(92413); -const duplexer3 = __webpack_require__(71257); -const requestAsEventEmitter = __webpack_require__(81406); -const {HTTPError, ReadError} = __webpack_require__(21751); +const {PassThrough} = __nccwpck_require__(92413); +const duplexer3 = __nccwpck_require__(71257); +const requestAsEventEmitter = __nccwpck_require__(81406); +const {HTTPError, ReadError} = __nccwpck_require__(21751); module.exports = options => { const input = new PassThrough(); @@ -64983,16 +51416,16 @@ module.exports = options => { /***/ }), /***/ 4094: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const errors = __webpack_require__(21751); -const asStream = __webpack_require__(40919); -const asPromise = __webpack_require__(59427); -const normalizeArguments = __webpack_require__(85277); -const merge = __webpack_require__(34119); -const deepFreeze = __webpack_require__(69734); +const errors = __nccwpck_require__(21751); +const asStream = __nccwpck_require__(40919); +const asPromise = __nccwpck_require__(59427); +const normalizeArguments = __nccwpck_require__(85277); +const merge = __nccwpck_require__(34119); +const deepFreeze = __nccwpck_require__(69734); const getPromiseOrStream = options => options.stream ? asStream(options) : asPromise(options); @@ -65070,14 +51503,14 @@ module.exports = create; /***/ }), /***/ 21751: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const urlLib = __webpack_require__(78835); -const http = __webpack_require__(98605); -const PCancelable = __webpack_require__(76348); -const is = __webpack_require__(24120); +const urlLib = __nccwpck_require__(78835); +const http = __nccwpck_require__(98605); +const PCancelable = __nccwpck_require__(76348); +const is = __nccwpck_require__(24120); class GotError extends Error { constructor(message, error, options) { @@ -65185,14 +51618,14 @@ module.exports.CancelError = PCancelable.CancelError; /***/ }), /***/ 76023: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const decompressResponse = __webpack_require__(47781); -const is = __webpack_require__(24120); -const mimicResponse = __webpack_require__(27480); -const progress = __webpack_require__(24368); +const decompressResponse = __nccwpck_require__(47781); +const is = __nccwpck_require__(24120); +const mimicResponse = __nccwpck_require__(27480); +const progress = __nccwpck_require__(24368); module.exports = (response, options, emitter) => { const downloadBodySize = Number(response.headers['content-length']) || null; @@ -65224,12 +51657,12 @@ module.exports = (response, options, emitter) => { /***/ }), /***/ 2673: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pkg = __webpack_require__(66256); -const create = __webpack_require__(4094); +const pkg = __nccwpck_require__(66256); +const create = __nccwpck_require__(4094); const defaults = { options: { @@ -65310,13 +51743,13 @@ module.exports = [ /***/ }), /***/ 34119: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {URL} = __webpack_require__(78835); -const is = __webpack_require__(24120); -const knownHookEvents = __webpack_require__(38589); +const {URL} = __nccwpck_require__(78835); +const is = __nccwpck_require__(24120); +const knownHookEvents = __nccwpck_require__(38589); const merge = (target, ...sources) => { for (const source of sources) { @@ -65391,19 +51824,19 @@ module.exports.instances = mergeInstances; /***/ }), /***/ 85277: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {URL, URLSearchParams} = __webpack_require__(78835); // TODO: Use the `URL` global when targeting Node.js 10 -const urlLib = __webpack_require__(78835); -const is = __webpack_require__(24120); -const urlParseLax = __webpack_require__(83530); -const lowercaseKeys = __webpack_require__(18984); -const urlToOptions = __webpack_require__(13674); -const isFormData = __webpack_require__(34908); -const merge = __webpack_require__(34119); -const knownHookEvents = __webpack_require__(38589); +const {URL, URLSearchParams} = __nccwpck_require__(78835); // TODO: Use the `URL` global when targeting Node.js 10 +const urlLib = __nccwpck_require__(78835); +const is = __nccwpck_require__(24120); +const urlParseLax = __nccwpck_require__(83530); +const lowercaseKeys = __nccwpck_require__(18984); +const urlToOptions = __nccwpck_require__(13674); +const isFormData = __nccwpck_require__(34908); +const merge = __nccwpck_require__(34119); +const knownHookEvents = __nccwpck_require__(38589); const retryAfterStatusCodes = new Set([413, 429, 503]); @@ -65664,11 +52097,11 @@ module.exports.reNormalize = reNormalize; /***/ }), /***/ 24368: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {Transform} = __webpack_require__(92413); +const {Transform} = __nccwpck_require__(92413); module.exports = { download(response, emitter, downloadBodySize) { @@ -65768,26 +52201,26 @@ module.exports = { /***/ }), /***/ 81406: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const {URL} = __webpack_require__(78835); // TODO: Use the `URL` global when targeting Node.js 10 -const util = __webpack_require__(31669); -const EventEmitter = __webpack_require__(28614); -const http = __webpack_require__(98605); -const https = __webpack_require__(57211); -const urlLib = __webpack_require__(78835); -const CacheableRequest = __webpack_require__(78837); -const toReadableStream = __webpack_require__(40081); -const is = __webpack_require__(24120); -const timer = __webpack_require__(8595); -const timedOut = __webpack_require__(92379); -const getBodySize = __webpack_require__(12966); -const getResponse = __webpack_require__(76023); -const progress = __webpack_require__(24368); -const {CacheError, UnsupportedProtocolError, MaxRedirectsError, RequestError, TimeoutError} = __webpack_require__(21751); -const urlToOptions = __webpack_require__(13674); +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const {URL} = __nccwpck_require__(78835); // TODO: Use the `URL` global when targeting Node.js 10 +const util = __nccwpck_require__(31669); +const EventEmitter = __nccwpck_require__(28614); +const http = __nccwpck_require__(98605); +const https = __nccwpck_require__(57211); +const urlLib = __nccwpck_require__(78835); +const CacheableRequest = __nccwpck_require__(78837); +const toReadableStream = __nccwpck_require__(40081); +const is = __nccwpck_require__(24120); +const timer = __nccwpck_require__(8595); +const timedOut = __nccwpck_require__(92379); +const getBodySize = __nccwpck_require__(12966); +const getResponse = __nccwpck_require__(76023); +const progress = __nccwpck_require__(24368); +const {CacheError, UnsupportedProtocolError, MaxRedirectsError, RequestError, TimeoutError} = __nccwpck_require__(21751); +const urlToOptions = __nccwpck_require__(13674); const getMethodRedirectCodes = new Set([300, 301, 302, 303, 304, 305, 307, 308]); const allMethodRedirectCodes = new Set([300, 303, 307, 308]); @@ -66088,11 +52521,11 @@ module.exports = (options, input) => { /***/ }), /***/ 69734: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const is = __webpack_require__(24120); +const is = __nccwpck_require__(24120); module.exports = function deepFreeze(object) { for (const [key, value] of Object.entries(object)) { @@ -66108,14 +52541,14 @@ module.exports = function deepFreeze(object) { /***/ }), /***/ 12966: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const util = __webpack_require__(31669); -const is = __webpack_require__(24120); -const isFormData = __webpack_require__(34908); +const fs = __nccwpck_require__(35747); +const util = __nccwpck_require__(31669); +const is = __nccwpck_require__(24120); +const isFormData = __nccwpck_require__(34908); module.exports = async options => { const {body} = options; @@ -66148,11 +52581,11 @@ module.exports = async options => { /***/ }), /***/ 34908: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const is = __webpack_require__(24120); +const is = __nccwpck_require__(24120); module.exports = body => is.nodeStream(body) && is.function(body.getBoundary); @@ -66160,11 +52593,11 @@ module.exports = body => is.nodeStream(body) && is.function(body.getBoundary); /***/ }), /***/ 92379: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const net = __webpack_require__(11631); +const net = __nccwpck_require__(11631); class TimeoutError extends Error { constructor(threshold, event) { @@ -66328,11 +52761,11 @@ module.exports.TimeoutError = TimeoutError; /***/ }), /***/ 13674: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const is = __webpack_require__(24120); +const is = __nccwpck_require__(24120); module.exports = url => { const options = { @@ -66388,14 +52821,14 @@ function clone (obj) { /***/ }), /***/ 82161: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __webpack_require__(35747) -var polyfills = __webpack_require__(60034) -var legacy = __webpack_require__(7077) -var clone = __webpack_require__(95581) +var fs = __nccwpck_require__(35747) +var polyfills = __nccwpck_require__(60034) +var legacy = __nccwpck_require__(7077) +var clone = __nccwpck_require__(95581) -var util = __webpack_require__(31669) +var util = __nccwpck_require__(31669) /* istanbul ignore next - node 0.x polyfill */ var gracefulQueue @@ -66476,7 +52909,7 @@ if (!fs[gracefulQueue]) { if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(fs[gracefulQueue]) - __webpack_require__(42357).equal(fs[gracefulQueue].length, 0) + __nccwpck_require__(42357).equal(fs[gracefulQueue].length, 0) }) } } @@ -66749,9 +53182,9 @@ function retry () { /***/ }), /***/ 7077: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Stream = __webpack_require__(92413).Stream +var Stream = __nccwpck_require__(92413).Stream module.exports = legacy @@ -66874,9 +53307,9 @@ function legacy (fs) { /***/ }), /***/ 60034: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var constants = __webpack_require__(27619) +var constants = __nccwpck_require__(27619) var origCwd = process.cwd var cwd = null @@ -67227,119 +53660,26 @@ function patch (fs) { "use strict"; -module.exports = (flag, argv) => { - argv = argv || process.argv; + +module.exports = (flag, argv = process.argv) => { const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const pos = argv.indexOf(prefix + flag); - const terminatorPos = argv.indexOf('--'); - return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); }; /***/ }), -/***/ 56530: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var os = __webpack_require__(12087); -if (typeof os.homedir !== 'undefined') { - module.exports = os.homedir; -} else { - module.exports = __webpack_require__(19949); -} - - - -/***/ }), - -/***/ 19949: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 97841: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var fs = __webpack_require__(35747); -var parse = __webpack_require__(43403); - -function homedir() { - // The following logic is from looking at logic used in the different platform - // versions of the uv_os_homedir function found in https://github.com/libuv/libuv - // This is the function used in modern versions of node.js - - if (process.platform === 'win32') { - // check the USERPROFILE first - if (process.env.USERPROFILE) { - return process.env.USERPROFILE; - } - - // check HOMEDRIVE and HOMEPATH - if (process.env.HOMEDRIVE && process.env.HOMEPATH) { - return process.env.HOMEDRIVE + process.env.HOMEPATH; - } - - // fallback to HOME - if (process.env.HOME) { - return process.env.HOME; - } - - return null; - } - - // check HOME environment variable first - if (process.env.HOME) { - return process.env.HOME; - } - - // on linux platforms (including OSX) find the current user and get their homedir from the /etc/passwd file - var passwd = tryReadFileSync('/etc/passwd'); - var home = find(parse(passwd), getuid()); - if (home) { - return home; - } - - // fallback to using user environment variables - var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME; - - if (!user) { - return null; - } - - if (process.platform === 'darwin') { - return '/Users/' + user; - } - - return '/home/' + user; -} - -function find(arr, uid) { - var len = arr.length; - for (var i = 0; i < len; i++) { - if (+arr[i].uid === uid) { - return arr[i].homedir; - } - } -} - -function getuid() { - if (typeof process.geteuid === 'function') { - return process.geteuid(); - } - return process.getuid(); -} - -function tryReadFileSync(fp) { - try { - return fs.readFileSync(fp, 'utf8'); - } catch (err) { - return ''; - } -} - -module.exports = homedir; +var bind = __nccwpck_require__(45489); +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); /***/ }), @@ -67432,11 +53772,11 @@ function formatHashFragment (fragment) { /***/ }), /***/ 13460: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var gitHosts = __webpack_require__(31489) +var gitHosts = __nccwpck_require__(31489) /* eslint-disable node/no-deprecated-api */ // copy-pasta util._extend from node's source, to avoid pulling @@ -67596,13 +53936,13 @@ GitHost.prototype.toString = function (opts) { /***/ }), /***/ 47052: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var url = __webpack_require__(78835) -var gitHosts = __webpack_require__(31489) -var GitHost = module.exports = __webpack_require__(13460) +var url = __nccwpck_require__(78835) +var gitHosts = __nccwpck_require__(31489) +var GitHost = module.exports = __nccwpck_require__(13460) var protocolToRepresentationMap = { 'git+ssh:': 'sshurl', @@ -68713,13 +55053,13 @@ standard:"other"}];exports.SIGNALS=SIGNALS; /***/ }), /***/ 18694: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__webpack_require__(12087); +Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__nccwpck_require__(12087); -var _signals=__webpack_require__(84193); -var _realtime=__webpack_require__(34337); +var _signals=__nccwpck_require__(84193); +var _realtime=__nccwpck_require__(34337); @@ -68817,13 +55157,13 @@ const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX; /***/ }), /***/ 84193: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__webpack_require__(12087); +Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__nccwpck_require__(12087); -var _core=__webpack_require__(54930); -var _realtime=__webpack_require__(34337); +var _core=__nccwpck_require__(54930); +var _realtime=__nccwpck_require__(34337); @@ -68858,3903 +55198,4492 @@ return{name,number,description,supported,action,forced,standard}; /***/ }), -/***/ 52111: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 44263: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var normalizeUrl = __webpack_require__(68203); -var stripUrlAuth = __webpack_require__(36889); +var Buffer = __nccwpck_require__(52340).Buffer; -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } +// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. +// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. +// To save memory and loading time, we read table files only when requested. - return normalizeUrl(stripUrlAuth(str)).replace(/^(?:https?:)?\/\//, ''); -}; +exports._dbcs = DBCSCodec; +var UNASSIGNED = -1, + GB18030_CODE = -2, + SEQ_START = -10, + NODE_START = -1000, + UNASSIGNED_NODE = new Array(0x100), + DEF_CHAR = -1; -/***/ }), +for (var i = 0; i < 0x100; i++) + UNASSIGNED_NODE[i] = UNASSIGNED; -/***/ 60131: -/***/ ((module) => { -"use strict"; +// Class DBCSCodec reads and initializes mapping tables. +function DBCSCodec(codecOptions, iconv) { + this.encodingName = codecOptions.encodingName; + if (!codecOptions) + throw new Error("DBCS codec is called without the data.") + if (!codecOptions.table) + throw new Error("Encoding '" + this.encodingName + "' has no data."); + + // Load tables. + var mappingTable = codecOptions.table(); -var toString = Object.prototype.toString; -module.exports = function (x) { - var prototype; - return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); -}; + // Decode tables: MBCS -> Unicode. + + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = []; + this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. + + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = []; + + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) + this._addDecodeChunk(mappingTable[i]); + + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === 'function') { + this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. + + // Add GB18030 common decode nodes. + var commonThirdByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + + var commonFourthByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + + // Fill out the tree + var firstByteNode = this.decodeTables[0]; + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; + for (var j = 0x30; j <= 0x39; j++) { + if (secondByteNode[j] === UNASSIGNED) { + secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; + } else if (secondByteNode[j] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 2"); + } + + var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; + for (var k = 0x81; k <= 0xFE; k++) { + if (thirdByteNode[k] === UNASSIGNED) { + thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; + } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { + continue; + } else if (thirdByteNode[k] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 3"); + } + var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; + for (var l = 0x30; l <= 0x39; l++) { + if (fourthByteNode[l] === UNASSIGNED) + fourthByteNode[l] = GB18030_CODE; + } + } + } + } + } + + this.defaultCharUnicode = iconv.defaultCharUnicode; + + + // Encode tables: Unicode -> DBCS. + + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = []; + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = []; + + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {}; + if (codecOptions.encodeSkipVals) + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i]; + if (typeof val === 'number') + skipEncodeChars[val] = true; + else + for (var j = val.from; j <= val.to; j++) + skipEncodeChars[j] = true; + } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars); + + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) + this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); + } + + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); +} + +DBCSCodec.prototype.encoder = DBCSEncoder; +DBCSCodec.prototype.decoder = DBCSDecoder; + +// Decoder helpers +DBCSCodec.prototype._getDecodeTrieNode = function(addr) { + var bytes = []; + for (; addr > 0; addr >>>= 8) + bytes.push(addr & 0xFF); + if (bytes.length == 0) + bytes.push(0); + + var node = this.decodeTables[0]; + for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]]; + + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length; + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); + } + else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val]; + } + else + throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); + } + return node; +} + + +DBCSCodec.prototype._addDecodeChunk = function(chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16); + + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr); + curAddr = curAddr & 0xFF; + + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k]; + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++); + if (0xD800 <= code && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++); + if (0xDC00 <= codeTrail && codeTrail < 0xE000) + writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); + else + throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); + } + else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2; + var seq = []; + for (var m = 0; m < len; m++) + seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. + + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; + this.decodeTableSeq.push(seq); + } + else + writeTable[curAddr++] = code; // Basic char + } + } + else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1; + for (var l = 0; l < part; l++) + writeTable[curAddr++] = charCode++; + } + else + throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); + } + if (curAddr > 0xFF) + throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); +} + +// Encoder helpers +DBCSCodec.prototype._getEncodeBucket = function(uCode) { + var high = uCode >> 8; // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) + this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. + return this.encodeTable[high]; +} + +DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + if (bucket[low] <= SEQ_START) + this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) + bucket[low] = dbcsCode; +} + +DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { + + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0]; + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + + var node; + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START-bucket[low]]; + } + else { + // There was no sequence object - allocate a new one. + node = {}; + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length; + this.encodeTableSeq.push(node); + } + + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length-1; j++) { + var oldVal = node[uCode]; + if (typeof oldVal === 'object') + node = oldVal; + else { + node = node[uCode] = {} + if (oldVal !== undefined) + node[DEF_CHAR] = oldVal + } + } -/***/ }), + // Set the leaf to given dbcsCode. + uCode = seq[seq.length-1]; + node[uCode] = dbcsCode; +} -/***/ 68203: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx]; + var hasValues = false; + var subNodeEmpty = {}; + for (var i = 0; i < 0x100; i++) { + var uCode = node[i]; + var mbCode = prefix + i; + if (skipEncodeChars[mbCode]) + continue; -"use strict"; + if (uCode >= 0) { + this._setEncodeChar(uCode, mbCode); + hasValues = true; + } else if (uCode <= NODE_START) { + var subNodeIdx = NODE_START - uCode; + if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). + var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. + if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) + hasValues = true; + else + subNodeEmpty[subNodeIdx] = true; + } + } else if (uCode <= SEQ_START) { + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + hasValues = true; + } + } + return hasValues; +} -var url = __webpack_require__(78835); -var punycode = __webpack_require__(94213); -var queryString = __webpack_require__(76671); -var prependHttp = __webpack_require__(24375); -var sortKeys = __webpack_require__(12843); -var objectAssign = __webpack_require__(14594); -var DEFAULT_PORTS = { - 'http:': 80, - 'https:': 443, - 'ftp:': 21 -}; -// protocols that always contain a `//`` bit -var slashedProtocol = { - 'http': true, - 'https': true, - 'ftp': true, - 'gopher': true, - 'file': true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true -}; +// == Encoder ================================================================== -function testParameter(name, filters) { - return filters.some(function (filter) { - return filter instanceof RegExp ? filter.test(name) : filter === name; - }); +function DBCSEncoder(options, codec) { + // Encoder state + this.leadSurrogate = -1; + this.seqObj = undefined; + + // Static data + this.encodeTable = codec.encodeTable; + this.encodeTableSeq = codec.encodeTableSeq; + this.defaultCharSingleByte = codec.defCharSB; + this.gb18030 = codec.gb18030; } -module.exports = function (str, opts) { - opts = objectAssign({ - normalizeProtocol: true, - normalizeHttps: false, - stripFragment: true, - stripWWW: true, - removeQueryParameters: [/^utm_\w+/i], - removeTrailingSlash: true, - removeDirectoryIndex: false - }, opts); +DBCSEncoder.prototype.write = function(str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), + leadSurrogate = this.leadSurrogate, + seqObj = this.seqObj, nextChar = -1, + i = 0, j = 0; - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break; + var uCode = str.charCodeAt(i++); + } + else { + var uCode = nextChar; + nextChar = -1; + } - var hasRelativeProtocol = str.indexOf('//') === 0; + // 1. Handle surrogates. + if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode; + continue; + } else { + leadSurrogate = uCode; + // Double lead surrogate found. + uCode = UNASSIGNED; + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); + leadSurrogate = -1; + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED; + } + + } + } + else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. + leadSurrogate = -1; + } - // prepend protocol - str = prependHttp(str.trim()).replace(/^\/\//, 'http://'); + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED; + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode]; + if (typeof resCode === 'object') { // Sequence continues. + seqObj = resCode; + continue; - var urlObj = url.parse(str); + } else if (typeof resCode == 'number') { // Sequence finished. Write it. + dbcsCode = resCode; - if (opts.normalizeHttps && urlObj.protocol === 'https:') { - urlObj.protocol = 'http:'; - } + } else if (resCode == undefined) { // Current character is not part of the sequence. - if (!urlObj.hostname && !urlObj.pathname) { - throw new Error('Invalid URL'); - } + // Try default character for this sequence + resCode = seqObj[DEF_CHAR]; + if (resCode !== undefined) { + dbcsCode = resCode; // Found. Write it. + nextChar = uCode; // Current character will be written too in the next iteration. - // prevent these from being used by `url.format` - delete urlObj.host; - delete urlObj.query; + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined; + } + else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8]; + if (subtable !== undefined) + dbcsCode = subtable[uCode & 0xFF]; + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; + continue; + } - // remove fragment - if (opts.stripFragment) { - delete urlObj.hash; - } + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode); + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; + newBuf[j++] = 0x30 + dbcsCode; + continue; + } + } + } - // remove default port - var port = DEFAULT_PORTS[urlObj.protocol]; - if (Number(urlObj.port) === port) { - delete urlObj.port; - } + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) + dbcsCode = this.defaultCharSingleByte; + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + else if (dbcsCode < 0x1000000) { + newBuf[j++] = dbcsCode >> 16; + newBuf[j++] = (dbcsCode >> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } else { + newBuf[j++] = dbcsCode >>> 24; + newBuf[j++] = (dbcsCode >>> 16) & 0xFF; + newBuf[j++] = (dbcsCode >>> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } + } - // remove duplicate slashes - if (urlObj.pathname) { - urlObj.pathname = urlObj.pathname.replace(/\/{2,}/g, '/'); - } + this.seqObj = seqObj; + this.leadSurrogate = leadSurrogate; + return newBuf.slice(0, j); +} - // decode URI octets - if (urlObj.pathname) { - urlObj.pathname = decodeURI(urlObj.pathname); - } +DBCSEncoder.prototype.end = function() { + if (this.leadSurrogate === -1 && this.seqObj === undefined) + return; // All clean. Most often case. - // remove directory index - if (opts.removeDirectoryIndex === true) { - opts.removeDirectoryIndex = [/^index\.[a-z]+$/]; - } + var newBuf = Buffer.alloc(10), j = 0; - if (Array.isArray(opts.removeDirectoryIndex) && opts.removeDirectoryIndex.length) { - var pathComponents = urlObj.pathname.split('/'); - var lastComponent = pathComponents[pathComponents.length - 1]; + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR]; + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + } else { + // See todo above. + } + this.seqObj = undefined; + } - if (testParameter(lastComponent, opts.removeDirectoryIndex)) { - pathComponents = pathComponents.slice(0, pathComponents.length - 1); - urlObj.pathname = pathComponents.slice(1).join('/') + '/'; - } - } + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte; + this.leadSurrogate = -1; + } + + return newBuf.slice(0, j); +} - // resolve relative paths, but only for slashed protocols - if (slashedProtocol[urlObj.protocol]) { - var domain = urlObj.protocol + '//' + urlObj.hostname; - var relative = url.resolve(domain, urlObj.pathname); - urlObj.pathname = relative.replace(domain, ''); - } +// Export for testing +DBCSEncoder.prototype.findIdx = findIdx; - if (urlObj.hostname) { - // IDN to Unicode - urlObj.hostname = punycode.toUnicode(urlObj.hostname).toLowerCase(); - // remove trailing dot - urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); +// == Decoder ================================================================== - // remove `www.` - if (opts.stripWWW) { - urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); - } - } +function DBCSDecoder(options, codec) { + // Decoder state + this.nodeIdx = 0; + this.prevBytes = []; - // remove URL with empty query string - if (urlObj.search === '?') { - delete urlObj.search; - } + // Static data + this.decodeTables = codec.decodeTables; + this.decodeTableSeq = codec.decodeTableSeq; + this.defaultCharUnicode = codec.defaultCharUnicode; + this.gb18030 = codec.gb18030; +} - var queryParameters = queryString.parse(urlObj.search); +DBCSDecoder.prototype.write = function(buf) { + var newBuf = Buffer.alloc(buf.length*2), + nodeIdx = this.nodeIdx, + prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, + seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. + uCode; - // remove query unwanted parameters - if (Array.isArray(opts.removeQueryParameters)) { - for (var key in queryParameters) { - if (testParameter(key, opts.removeQueryParameters)) { - delete queryParameters[key]; - } - } - } + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; - // sort query parameters - urlObj.search = queryString.stringify(sortKeys(queryParameters)); + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte]; - // decode query parameters - urlObj.search = decodeURIComponent(urlObj.search); + if (uCode >= 0) { + // Normal character, just use it. + } + else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + uCode = this.defaultCharUnicode.charCodeAt(0); + i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. + } + else if (uCode === GB18030_CODE) { + if (i >= 3) { + var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); + } else { + var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + + (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + + (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + + (curByte-0x30); + } + var idx = findIdx(this.gb18030.gbChars, ptr); + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; + } + else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode; + continue; + } + else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode]; + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k]; + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + } + uCode = seq[seq.length-1]; + } + else + throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); - // take advantage of many of the Node `url` normalizations - str = url.format(urlObj); + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode >= 0x10000) { + uCode -= 0x10000; + var uCodeLead = 0xD800 | (uCode >> 10); + newBuf[j++] = uCodeLead & 0xFF; + newBuf[j++] = uCodeLead >> 8; - // remove ending `/` - if (opts.removeTrailingSlash || urlObj.pathname === '/') { - str = str.replace(/\/$/, ''); - } + uCode = 0xDC00 | (uCode & 0x3FF); + } + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; - // restore relative protocol, if applicable - if (hasRelativeProtocol && !opts.normalizeProtocol) { - str = str.replace(/^http:\/\//, '//'); - } + // Reset trie node. + nodeIdx = 0; seqStart = i+1; + } - return str; -}; + this.nodeIdx = nodeIdx; + this.prevBytes = (seqStart >= 0) + ? Array.prototype.slice.call(buf, seqStart) + : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); + return newBuf.slice(0, j).toString('ucs2'); +} -/***/ }), +DBCSDecoder.prototype.end = function() { + var ret = ''; -/***/ 24375: -/***/ ((module) => { + // Try to parse all remaining chars. + while (this.prevBytes.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode; + var bytesArr = this.prevBytes.slice(1); -"use strict"; + // Parse remaining as usual. + this.prevBytes = []; + this.nodeIdx = 0; + if (bytesArr.length > 0) + ret += this.write(bytesArr); + } -module.exports = function (url) { - if (typeof url !== 'string') { - throw new TypeError('Expected a string, got ' + typeof url); - } + this.prevBytes = []; + this.nodeIdx = 0; + return ret; +} - url = url.trim(); +// Binary search for GB18030. Returns largest i such that table[i] <= val. +function findIdx(table, val) { + if (table[0] > val) + return -1; - if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { - return url; - } + var l = 0, r = table.length; + while (l < r-1) { // always table[l] <= val < table[r] + var mid = l + ((r-l+1) >> 1); + if (table[mid] <= val) + l = mid; + else + r = mid; + } + return l; +} - return url.replace(/^(?!(?:\w+:)?\/\/)/, 'http://'); -}; /***/ }), -/***/ 12843: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 14638: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var isPlainObj = __webpack_require__(60131); - -module.exports = function (obj, opts) { - if (!isPlainObj(obj)) { - throw new TypeError('Expected a plain object'); - } - - opts = opts || {}; - - // DEPRECATED - if (typeof opts === 'function') { - opts = {compare: opts}; - } - - var deep = opts.deep; - var seenInput = []; - var seenOutput = []; - - var sortKeys = function (x) { - var seenIndex = seenInput.indexOf(x); - - if (seenIndex !== -1) { - return seenOutput[seenIndex]; - } - - var ret = {}; - var keys = Object.keys(x).sort(opts.compare); - - seenInput.push(x); - seenOutput.push(ret); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var val = x[key]; - - ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; - } - - return ret; - }; - - return sortKeys(obj); -}; +// Description of supported double byte encodings and aliases. +// Tables are not require()-d until they are needed to speed up library load. +// require()-s are direct to support Browserify. -/***/ }), +module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) -/***/ 94889: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html -var wrappy = __webpack_require__(83640) -var reqs = Object.create(null) -var once = __webpack_require__(96754) + 'shiftjis': { + type: '_dbcs', + table: function() { return __nccwpck_require__(8075) }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + encodeSkipVals: [{from: 0xED40, to: 0xF940}], + }, + 'csshiftjis': 'shiftjis', + 'mskanji': 'shiftjis', + 'sjis': 'shiftjis', + 'windows31j': 'shiftjis', + 'ms31j': 'shiftjis', + 'xsjis': 'shiftjis', + 'windows932': 'shiftjis', + 'ms932': 'shiftjis', + '932': 'shiftjis', + 'cp932': 'shiftjis', -module.exports = wrappy(inflight) + 'eucjp': { + type: '_dbcs', + table: function() { return __nccwpck_require__(84777) }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + }, -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - } - }) -} + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder -function slice (args) { - var length = args.length - var array = [] + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + 'gb2312': 'cp936', + 'gb231280': 'cp936', + 'gb23121980': 'cp936', + 'csgb2312': 'cp936', + 'csiso58gb231280': 'cp936', + 'euccn': 'cp936', - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} + // Microsoft's CP936 is a subset and approximation of GBK. + 'windows936': 'cp936', + 'ms936': 'cp936', + '936': 'cp936', + 'cp936': { + type: '_dbcs', + table: function() { return __nccwpck_require__(1351) }, + }, + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + 'gbk': { + type: '_dbcs', + table: function() { return __nccwpck_require__(1351).concat(__nccwpck_require__(17559)) }, + }, + 'xgbk': 'gbk', + 'isoir58': 'gbk', -/***/ }), + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + 'gb18030': { + type: '_dbcs', + table: function() { return __nccwpck_require__(1351).concat(__nccwpck_require__(17559)) }, + gb18030: function() { return __nccwpck_require__(9630) }, + encodeSkipVals: [0x80], + encodeAdd: {'€': 0xA2E3}, + }, -/***/ 2989: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + 'chinese': 'gb18030', -try { - var util = __webpack_require__(31669); - /* istanbul ignore next */ - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - /* istanbul ignore next */ - module.exports = __webpack_require__(97350); -} + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + 'windows949': 'cp949', + 'ms949': 'cp949', + '949': 'cp949', + 'cp949': { + type: '_dbcs', + table: function() { return __nccwpck_require__(86401) }, + }, -/***/ }), + 'cseuckr': 'cp949', + 'csksc56011987': 'cp949', + 'euckr': 'cp949', + 'isoir149': 'cp949', + 'korean': 'cp949', + 'ksc56011987': 'cp949', + 'ksc56011989': 'cp949', + 'ksc5601': 'cp949', -/***/ 97350: -/***/ ((module) => { -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (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) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } - } -} + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + 'windows950': 'cp950', + 'ms950': 'cp950', + '950': 'cp950', + 'cp950': { + type: '_dbcs', + table: function() { return __nccwpck_require__(23940) }, + }, -/***/ }), + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + 'big5': 'big5hkscs', + 'big5hkscs': { + type: '_dbcs', + table: function() { return __nccwpck_require__(23940).concat(__nccwpck_require__(52777)) }, + encodeSkipVals: [0xa2cc], + }, -/***/ 27452: -/***/ ((__unused_webpack_module, exports) => { + 'cnbig5': 'big5hkscs', + 'csbig5': 'big5hkscs', + 'xxbig5': 'big5hkscs', +}; -exports.parse = exports.decode = decode -exports.stringify = exports.encode = encode +/***/ }), -exports.safe = safe -exports.unsafe = unsafe +/***/ 62228: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var eol = typeof process !== 'undefined' && - process.platform === 'win32' ? '\r\n' : '\n' +"use strict"; -function encode (obj, opt) { - var children = [] - var out = '' - if (typeof opt === 'string') { - opt = { - section: opt, - whitespace: false - } - } else { - opt = opt || {} - opt.whitespace = opt.whitespace === true - } +// Update this array if you add/rename/remove files in this directory. +// We support Browserify by skipping automatic module discovery and requiring modules directly. +var modules = [ + __nccwpck_require__(98199), + __nccwpck_require__(20060), + __nccwpck_require__(16290), + __nccwpck_require__(91935), + __nccwpck_require__(9967), + __nccwpck_require__(36630), + __nccwpck_require__(57117), + __nccwpck_require__(44263), + __nccwpck_require__(14638), +]; - var separator = opt.whitespace ? ' = ' : '=' +// Put all encoding/alias/codec definitions to single object and export it. +for (var i = 0; i < modules.length; i++) { + var module = modules[i]; + for (var enc in module) + if (Object.prototype.hasOwnProperty.call(module, enc)) + exports[enc] = module[enc]; +} - Object.keys(obj).forEach(function (k, _, __) { - var val = obj[k] - if (val && Array.isArray(val)) { - val.forEach(function (item) { - out += safe(k + '[]') + separator + safe(item) + '\n' - }) - } else if (val && typeof val === 'object') { - children.push(k) - } else { - out += safe(k) + separator + safe(val) + eol - } - }) - if (opt.section && out.length) { - out = '[' + safe(opt.section) + ']' + eol + out - } +/***/ }), - children.forEach(function (k, _, __) { - var nk = dotSplit(k).join('\\.') - var section = (opt.section ? opt.section + '.' : '') + nk - var child = encode(obj[k], { - section: section, - whitespace: opt.whitespace - }) - if (out.length && child.length) { - out += eol - } - out += child - }) +/***/ 98199: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return out -} +"use strict"; -function dotSplit (str) { - return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002') - .replace(/\\\./g, '\u0001') - .split(/\./).map(function (part) { - return part.replace(/\1/g, '\\.') - .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') - }) -} +var Buffer = __nccwpck_require__(52340).Buffer; -function decode (str) { - var out = {} - var p = out - var section = null - // section |key = value - var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i - var lines = str.split(/[\r\n]+/g) +// Export Node.js internal encodings. - lines.forEach(function (line, _, __) { - if (!line || line.match(/^\s*[;#]/)) return - var match = line.match(re) - if (!match) return - if (match[1] !== undefined) { - section = unsafe(match[1]) - p = out[section] = out[section] || {} - return - } - var key = unsafe(match[2]) - var value = match[3] ? unsafe(match[4]) : true - switch (value) { - case 'true': - case 'false': - case 'null': value = JSON.parse(value) - } +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true}, + cesu8: { type: "_internal", bomAware: true}, + unicode11utf8: "utf8", - // Convert keys with '[]' suffix to an array - if (key.length > 2 && key.slice(-2) === '[]') { - key = key.substring(0, key.length - 2) - if (!p[key]) { - p[key] = [] - } else if (!Array.isArray(p[key])) { - p[key] = [p[key]] - } - } + ucs2: { type: "_internal", bomAware: true}, + utf16le: "ucs2", - // safeguard against resetting a previously defined - // array by accidentally forgetting the brackets - if (Array.isArray(p[key])) { - p[key].push(value) - } else { - p[key] = value - } - }) + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, - // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} - // use a filter to return the keys that have to be deleted. - Object.keys(out).filter(function (k, _, __) { - if (!out[k] || - typeof out[k] !== 'object' || - Array.isArray(out[k])) { - return false - } - // see if the parent section is also an object. - // if so, add it to that, and mark this one for deletion - var parts = dotSplit(k) - var p = out - var l = parts.pop() - var nl = l.replace(/\\\./g, '.') - parts.forEach(function (part, _, __) { - if (!p[part] || typeof p[part] !== 'object') p[part] = {} - p = p[part] - }) - if (p === out && nl === l) { - return false - } - p[nl] = out[k] - return true - }).forEach(function (del, _, __) { - delete out[del] - }) + // Codec. + _internal: InternalCodec, +}; - return out -} +//------------------------------------------------------------------------------ -function isQuoted (val) { - return (val.charAt(0) === '"' && val.slice(-1) === '"') || - (val.charAt(0) === "'" && val.slice(-1) === "'") -} +function InternalCodec(codecOptions, iconv) { + this.enc = codecOptions.encodingName; + this.bomAware = codecOptions.bomAware; -function safe (val) { - return (typeof val !== 'string' || - val.match(/[=\r\n]/) || - val.match(/^\[/) || - (val.length > 1 && - isQuoted(val)) || - val !== val.trim()) - ? JSON.stringify(val) - : val.replace(/;/g, '\\;').replace(/#/g, '\\#') -} + if (this.enc === "base64") + this.encoder = InternalEncoderBase64; + else if (this.enc === "cesu8") { + this.enc = "utf8"; // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8; -function unsafe (val, doUnesc) { - val = (val || '').trim() - if (isQuoted(val)) { - // remove the single quotes before calling JSON.parse - if (val.charAt(0) === "'") { - val = val.substr(1, val.length - 2) - } - try { val = JSON.parse(val) } catch (_) {} - } else { - // walk the val to find the first not-escaped ; character - var esc = false - var unesc = '' - for (var i = 0, l = val.length; i < l; i++) { - var c = val.charAt(i) - if (esc) { - if ('\\;#'.indexOf(c) !== -1) { - unesc += c - } else { - unesc += '\\' + c + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { + this.decoder = InternalDecoderCesu8; + this.defaultCharUnicode = iconv.defaultCharUnicode; } - esc = false - } else if (';#'.indexOf(c) !== -1) { - break - } else if (c === '\\') { - esc = true - } else { - unesc += c - } } - if (esc) { - unesc += '\\' - } - return unesc.trim() - } - return val } +InternalCodec.prototype.encoder = InternalEncoder; +InternalCodec.prototype.decoder = InternalDecoder; -/***/ }), - -/***/ 30237: -/***/ ((module) => { +//------------------------------------------------------------------------------ -"use strict"; +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = __nccwpck_require__(24304).StringDecoder; +if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. + StringDecoder.prototype.end = function() {}; -module.exports = function isArrayish(obj) { - if (!obj) { - return false; - } - return obj instanceof Array || Array.isArray(obj) || - (obj.length >= 0 && obj.splice instanceof Function); -}; +function InternalDecoder(options, codec) { + this.decoder = new StringDecoder(codec.enc); +} +InternalDecoder.prototype.write = function(buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf); + } -/***/ }), + return this.decoder.write(buf); +} -/***/ 53966: -/***/ ((module) => { +InternalDecoder.prototype.end = function() { + return this.decoder.end(); +} -/*! - * is-extglob - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - */ -module.exports = function isExtglob(str) { - if (typeof str !== 'string' || str === '') { - return false; - } +//------------------------------------------------------------------------------ +// Encoder is mostly trivial - var match; - while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { - if (match[2]) return true; - str = str.slice(match.index + match[0].length); - } +function InternalEncoder(options, codec) { + this.enc = codec.enc; +} - return false; -}; +InternalEncoder.prototype.write = function(str) { + return Buffer.from(str, this.enc); +} +InternalEncoder.prototype.end = function() { +} -/***/ }), -/***/ 2182: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +//------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. -/*! - * is-glob - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ +function InternalEncoderBase64(options, codec) { + this.prevStr = ''; +} -var isExtglob = __webpack_require__(53966); -var chars = { '{': '}', '(': ')', '[': ']'}; -var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; -var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; +InternalEncoderBase64.prototype.write = function(str) { + str = this.prevStr + str; + var completeQuads = str.length - (str.length % 4); + this.prevStr = str.slice(completeQuads); + str = str.slice(0, completeQuads); -module.exports = function isGlob(str, options) { - if (typeof str !== 'string' || str === '') { - return false; - } + return Buffer.from(str, "base64"); +} - if (isExtglob(str)) { - return true; - } +InternalEncoderBase64.prototype.end = function() { + return Buffer.from(this.prevStr, "base64"); +} - var regex = strictRegex; - var match; - // optionally relax regex - if (options && options.strict === false) { - regex = relaxedRegex; - } +//------------------------------------------------------------------------------ +// CESU-8 encoder is also special. - while ((match = regex.exec(str))) { - if (match[2]) return true; - var idx = match.index + match[0].length; +function InternalEncoderCesu8(options, codec) { +} - // if an open bracket/brace/paren is escaped, - // set the index to the next closing character - var open = match[1]; - var close = open ? chars[open] : null; - if (open && close) { - var n = str.indexOf(close, idx); - if (n !== -1) { - idx = n + 1; - } +InternalEncoderCesu8.prototype.write = function(str) { + var buf = Buffer.alloc(str.length * 3), bufIdx = 0; + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i); + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) + buf[bufIdx++] = charCode; + else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12); + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } } + return buf.slice(0, bufIdx); +} - str = str.slice(idx); - } - return false; -}; - +InternalEncoderCesu8.prototype.end = function() { +} -/***/ }), +//------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ -/***/ 47133: -/***/ ((module) => { +function InternalDecoderCesu8(options, codec) { + this.acc = 0; + this.contBytes = 0; + this.accBytes = 0; + this.defaultCharUnicode = codec.defaultCharUnicode; +} -"use strict"; +InternalDecoderCesu8.prototype.write = function(buf) { + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, + res = ''; + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i]; + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode; + contBytes = 0; + } + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte); + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F; + contBytes = 1; accBytes = 1; + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F; + contBytes = 2; accBytes = 1; + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode; + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f); + contBytes--; accBytes++; + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) + res += this.defaultCharUnicode; + else if (accBytes === 3 && acc < 0x800) + res += this.defaultCharUnicode; + else + // Actually add character. + res += String.fromCharCode(acc); + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode; + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; + return res; +} -module.exports = ({stream = process.stdout} = {}) => { - return Boolean( - stream && stream.isTTY && - process.env.TERM !== 'dumb' && - !('CI' in process.env) - ); -}; +InternalDecoderCesu8.prototype.end = function() { + var res = 0; + if (this.contBytes > 0) + res += this.defaultCharUnicode; + return res; +} /***/ }), -/***/ 93458: -/***/ ((module) => { +/***/ 9967: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +var Buffer = __nccwpck_require__(52340).Buffer; -const isStream = stream => - stream !== null && - typeof stream === 'object' && - typeof stream.pipe === 'function'; - -isStream.writable = stream => - isStream(stream) && - stream.writable !== false && - typeof stream._write === 'function' && - typeof stream._writableState === 'object'; +// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that +// correspond to encoded bytes (if 128 - then lower half is ASCII). -isStream.readable = stream => - isStream(stream) && - stream.readable !== false && - typeof stream._read === 'function' && - typeof stream._readableState === 'object'; +exports._sbcs = SBCSCodec; +function SBCSCodec(codecOptions, iconv) { + if (!codecOptions) + throw new Error("SBCS codec is called without the data.") + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) + throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); + + if (codecOptions.chars.length === 128) { + var asciiString = ""; + for (var i = 0; i < 128; i++) + asciiString += String.fromCharCode(i); + codecOptions.chars = asciiString + codecOptions.chars; + } -isStream.duplex = stream => - isStream.writable(stream) && - isStream.readable(stream); + this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); -isStream.transform = stream => - isStream.duplex(stream) && - typeof stream._transform === 'function' && - typeof stream._transformState === 'object'; + for (var i = 0; i < codecOptions.chars.length; i++) + encodeBuf[codecOptions.chars.charCodeAt(i)] = i; -module.exports = isStream; + this.encodeBuf = encodeBuf; +} +SBCSCodec.prototype.encoder = SBCSEncoder; +SBCSCodec.prototype.decoder = SBCSDecoder; -/***/ }), -/***/ 99333: -/***/ ((module, exports) => { +function SBCSEncoder(options, codec) { + this.encodeBuf = codec.encodeBuf; +} -/*! - * is-windows - * - * Copyright © 2015-2018, Jon Schlinkert. - * Released under the MIT License. - */ +SBCSEncoder.prototype.write = function(str) { + var buf = Buffer.alloc(str.length); + for (var i = 0; i < str.length; i++) + buf[i] = this.encodeBuf[str.charCodeAt(i)]; + + return buf; +} -(function(factory) { - if (exports && typeof exports === 'object' && "object" !== 'undefined') { - module.exports = factory(); - } else if (typeof define === 'function' && define.amd) { - define([], factory); - } else if (typeof window !== 'undefined') { - window.isWindows = factory(); - } else if (typeof global !== 'undefined') { - global.isWindows = factory(); - } else if (typeof self !== 'undefined') { - self.isWindows = factory(); - } else { - this.isWindows = factory(); - } -})(function() { - 'use strict'; - return function isWindows() { - return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)); - }; -}); +SBCSEncoder.prototype.end = function() { +} -/***/ }), +function SBCSDecoder(options, codec) { + this.decodeBuf = codec.decodeBuf; +} -/***/ 52607: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +SBCSDecoder.prototype.write = function(buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf; + var newBuf = Buffer.alloc(buf.length*2); + var idx1 = 0, idx2 = 0; + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i]*2; idx2 = i*2; + newBuf[idx2] = decodeBuf[idx1]; + newBuf[idx2+1] = decodeBuf[idx1+1]; + } + return newBuf.toString('ucs2'); +} -var fs = __webpack_require__(35747) -var core -if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = __webpack_require__(59750) -} else { - core = __webpack_require__(37821) +SBCSDecoder.prototype.end = function() { } -module.exports = isexe -isexe.sync = sync -function isexe (path, options, cb) { - if (typeof options === 'function') { - cb = options - options = {} - } +/***/ }), - if (!cb) { - if (typeof Promise !== 'function') { - throw new TypeError('callback not provided') - } +/***/ 57117: +/***/ ((module) => { - return new Promise(function (resolve, reject) { - isexe(path, options || {}, function (er, is) { - if (er) { - reject(er) - } else { - resolve(is) - } - }) - }) - } +"use strict"; - core(path, options || {}, function (er, is) { - // ignore EACCES because that just means we aren't allowed to run it - if (er) { - if (er.code === 'EACCES' || options && options.ignoreErrors) { - er = null - is = false - } - } - cb(er, is) - }) -} -function sync (path, options) { - // my kingdom for a filtered catch - try { - return core.sync(path, options || {}) - } catch (er) { - if (options && options.ignoreErrors || er.code === 'EACCES') { - return false - } else { - throw er - } +// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "_sbcs", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "_sbcs", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8t": { + "type": "_sbcs", + "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "armscii8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" + }, + "rk1048": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "georgianps": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "pt154": { + "type": "_sbcs", + "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "viscii": { + "type": "_sbcs", + "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "hproman8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" + }, + "macintosh": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "ascii": { + "type": "_sbcs", + "chars": "��������������������������������������������������������������������������������������������������������������������������������" + }, + "tis620": { + "type": "_sbcs", + "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" } } - /***/ }), -/***/ 37821: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = isexe -isexe.sync = sync - -var fs = __webpack_require__(35747) - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), options) -} - -function checkStat (stat, options) { - return stat.isFile() && checkMode(stat, options) -} - -function checkMode (stat, options) { - var mod = stat.mode - var uid = stat.uid - var gid = stat.gid - - var myUid = options.uid !== undefined ? - options.uid : process.getuid && process.getuid() - var myGid = options.gid !== undefined ? - options.gid : process.getgid && process.getgid() +/***/ 36630: +/***/ ((module) => { - var u = parseInt('100', 8) - var g = parseInt('010', 8) - var o = parseInt('001', 8) - var ug = u | g +"use strict"; - var ret = (mod & o) || - (mod & g) && gid === myGid || - (mod & u) && uid === myUid || - (mod & ug) && myUid === 0 - return ret -} +// Manually added data to be used by sbcs codec in addition to generated one. +module.exports = { + // Not supported by iconv, not sure why. + "10029": "maccenteuro", + "maccenteuro": { + "type": "_sbcs", + "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, -/***/ }), + "808": "cp808", + "ibm808": "cp808", + "cp808": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " + }, -/***/ 59750: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + "mik": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, -module.exports = isexe -isexe.sync = sync + "cp720": { + "type": "_sbcs", + "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" + }, -var fs = __webpack_require__(35747) + // Aliases of generated encodings. + "ascii8bit": "ascii", + "usascii": "ascii", + "ansix34": "ascii", + "ansix341968": "ascii", + "ansix341986": "ascii", + "csascii": "ascii", + "cp367": "ascii", + "ibm367": "ascii", + "isoir6": "ascii", + "iso646us": "ascii", + "iso646irv": "ascii", + "us": "ascii", -function checkPathExt (path, options) { - var pathext = options.pathExt !== undefined ? - options.pathExt : process.env.PATHEXT + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin5": "iso88599", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", - if (!pathext) { - return true - } + "csisolatin1": "iso88591", + "csisolatin2": "iso88592", + "csisolatin3": "iso88593", + "csisolatin4": "iso88594", + "csisolatincyrillic": "iso88595", + "csisolatinarabic": "iso88596", + "csisolatingreek" : "iso88597", + "csisolatinhebrew": "iso88598", + "csisolatin5": "iso88599", + "csisolatin6": "iso885910", - pathext = pathext.split(';') - if (pathext.indexOf('') !== -1) { - return true - } - for (var i = 0; i < pathext.length; i++) { - var p = pathext[i].toLowerCase() - if (p && path.substr(-p.length).toLowerCase() === p) { - return true - } - } - return false -} + "l1": "iso88591", + "l2": "iso88592", + "l3": "iso88593", + "l4": "iso88594", + "l5": "iso88599", + "l6": "iso885910", + "l7": "iso885913", + "l8": "iso885914", + "l9": "iso885915", + "l10": "iso885916", -function checkStat (stat, path, options) { - if (!stat.isSymbolicLink() && !stat.isFile()) { - return false - } - return checkPathExt(path, options) -} + "isoir14": "iso646jp", + "isoir57": "iso646cn", + "isoir100": "iso88591", + "isoir101": "iso88592", + "isoir109": "iso88593", + "isoir110": "iso88594", + "isoir144": "iso88595", + "isoir127": "iso88596", + "isoir126": "iso88597", + "isoir138": "iso88598", + "isoir148": "iso88599", + "isoir157": "iso885910", + "isoir166": "tis620", + "isoir179": "iso885913", + "isoir199": "iso885914", + "isoir203": "iso885915", + "isoir226": "iso885916", -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, path, options)) - }) -} + "cp819": "iso88591", + "ibm819": "iso88591", -function sync (path, options) { - return checkStat(fs.statSync(path), path, options) -} + "cyrillic": "iso88595", + "arabic": "iso88596", + "arabic8": "iso88596", + "ecma114": "iso88596", + "asmo708": "iso88596", -/***/ }), + "greek" : "iso88597", + "greek8" : "iso88597", + "ecma118" : "iso88597", + "elot928" : "iso88597", -/***/ 52388: -/***/ ((__unused_webpack_module, exports) => { + "hebrew": "iso88598", + "hebrew8": "iso88598", -// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell -// License: MIT. (See LICENSE.) + "turkish": "iso88599", + "turkish8": "iso88599", -Object.defineProperty(exports, "__esModule", ({ - value: true -})) + "thai": "iso885911", + "thai8": "iso885911", -// This regex comes from regex.coffee, and is inserted here by generate-index.js -// (run `npm run build`). -exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g + "celtic": "iso885914", + "celtic8": "iso885914", + "isoceltic": "iso885914", -exports.matchToToken = function(match) { - var token = {type: "invalid", value: match[0], closed: undefined} - if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) - else if (match[ 5]) token.type = "comment" - else if (match[ 6]) token.type = "comment", token.closed = !!match[7] - else if (match[ 8]) token.type = "regex" - else if (match[ 9]) token.type = "number" - else if (match[10]) token.type = "name" - else if (match[11]) token.type = "punctuator" - else if (match[12]) token.type = "whitespace" - return token -} + "tis6200": "tis620", + "tis62025291": "tis620", + "tis62025330": "tis620", + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10079": "maciceland", + "10081": "macturkish", -/***/ }), + "cspc8codepage437": "cp437", + "cspc775baltic": "cp775", + "cspc850multilingual": "cp850", + "cspcp852": "cp852", + "cspc862latinhebrew": "cp862", + "cpgr": "cp869", -/***/ 75337: -/***/ ((__unused_webpack_module, exports) => { + "msee": "cp1250", + "mscyrl": "cp1251", + "msansi": "cp1252", + "msgreek": "cp1253", + "msturk": "cp1254", + "mshebr": "cp1255", + "msarab": "cp1256", + "winbaltrim": "cp1257", -//TODO: handle reviver/dehydrate function like normal -//and handle indentation, like normal. -//if anyone needs this... please send pull request. + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cskoi8r": "koi8r", -exports.stringify = function stringify (o) { - if('undefined' == typeof o) return o + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", - if(o && Buffer.isBuffer(o)) - return JSON.stringify(':base64:' + o.toString('base64')) + "strk10482002": "rk1048", - if(o && o.toJSON) - o = o.toJSON() + "tcvn5712": "tcvn", + "tcvn57121": "tcvn", - if(o && 'object' === typeof o) { - var s = '' - var array = Array.isArray(o) - s = array ? '[' : '{' - var first = true + "gb198880": "iso646cn", + "cn": "iso646cn", - for(var k in o) { - var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k]) - if(Object.hasOwnProperty.call(o, k) && !ignore) { - if(!first) - s += ',' - first = false - if (array) { - if(o[k] == undefined) - s += 'null' - else - s += stringify(o[k]) - } else if (o[k] !== void(0)) { - s += stringify(k) + ':' + stringify(o[k]) - } - } - } + "csiso14jisc6220ro": "iso646jp", + "jisc62201969ro": "iso646jp", + "jp": "iso646jp", - s += array ? ']' : '}' + "cshproman8": "hproman8", + "r8": "hproman8", + "roman8": "hproman8", + "xroman8": "hproman8", + "ibm1051": "hproman8", - return s - } else if ('string' === typeof o) { - return JSON.stringify(/^:/.test(o) ? ':' + o : o) - } else if ('undefined' === typeof o) { - return 'null'; - } else - return JSON.stringify(o) -} + "mac": "macintosh", + "csmacintosh": "macintosh", +}; -exports.parse = function (s) { - return JSON.parse(s, function (key, value) { - if('string' === typeof value) { - if(/^:base64:/.test(value)) - return new Buffer(value.substring(8), 'base64') - else - return /^:/.test(value) ? value.substring(1) : value - } - return value - }) -} /***/ }), -/***/ 48335: -/***/ ((module) => { +/***/ 16290: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +var Buffer = __nccwpck_require__(52340).Buffer; -module.exports = parseJson -function parseJson (txt, reviver, context) { - context = context || 20 - try { - return JSON.parse(txt, reviver) - } catch (e) { - if (typeof txt !== 'string') { - const isEmptyArray = Array.isArray(txt) && txt.length === 0 - const errorMessage = 'Cannot parse ' + - (isEmptyArray ? 'an empty array' : String(txt)) - throw new TypeError(errorMessage) - } - const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i) - const errIdx = syntaxErr - ? +syntaxErr[1] - : e.message.match(/^Unexpected end of JSON.*/i) - ? txt.length - 1 - : null - if (errIdx != null) { - const start = errIdx <= context - ? 0 - : errIdx - context - const end = errIdx + context >= txt.length - ? txt.length - : errIdx + context - e.message += ` while parsing near '${ - start === 0 ? '' : '...' - }${txt.slice(start, end)}${ - end === txt.length ? '' : '...' - }'` - } else { - e.message += ` while parsing '${txt.slice(0, context * 2)}'` - } - throw e - } -} - - -/***/ }), - -/***/ 4211: -/***/ ((module, exports) => { - -exports = module.exports = stringify -exports.getSerialize = serializer - -function stringify(obj, replacer, spaces, cycleReplacer) { - return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) -} - -function serializer(replacer, cycleReplacer) { - var stack = [], keys = [] - - if (cycleReplacer == null) cycleReplacer = function(key, value) { - if (stack[0] === value) return "[Circular ~]" - return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" - } +// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js - return function(key, value) { - if (stack.length > 0) { - var thisPos = stack.indexOf(this) - ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) - ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) - if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) - } - else stack.push(value) +// == UTF16-BE codec. ========================================================== - return replacer == null ? value : replacer.call(this, key, value) - } +exports.utf16be = Utf16BECodec; +function Utf16BECodec() { } +Utf16BECodec.prototype.encoder = Utf16BEEncoder; +Utf16BECodec.prototype.decoder = Utf16BEDecoder; +Utf16BECodec.prototype.bomAware = true; -/***/ }), -/***/ 91393: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +// -- Encoding -let _fs -try { - _fs = __webpack_require__(82161) -} catch (_) { - _fs = __webpack_require__(35747) +function Utf16BEEncoder() { } -const universalify = __webpack_require__(92178) -const { stringify, stripBom } = __webpack_require__(24401) - -async function _readFile (file, options = {}) { - if (typeof options === 'string') { - options = { encoding: options } - } - - const fs = options.fs || _fs - - const shouldThrow = 'throws' in options ? options.throws : true - - let data = await universalify.fromCallback(fs.readFile)(file, options) - - data = stripBom(data) - let obj - try { - obj = JSON.parse(data, options ? options.reviver : null) - } catch (err) { - if (shouldThrow) { - err.message = `${file}: ${err.message}` - throw err - } else { - return null +Utf16BEEncoder.prototype.write = function(str) { + var buf = Buffer.from(str, 'ucs2'); + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; } - } - - return obj + return buf; } -const readFile = universalify.fromPromise(_readFile) - -function readFileSync (file, options = {}) { - if (typeof options === 'string') { - options = { encoding: options } - } +Utf16BEEncoder.prototype.end = function() { +} - const fs = options.fs || _fs - const shouldThrow = 'throws' in options ? options.throws : true +// -- Decoding - try { - let content = fs.readFileSync(file, options) - content = stripBom(content) - return JSON.parse(content, options.reviver) - } catch (err) { - if (shouldThrow) { - err.message = `${file}: ${err.message}` - throw err - } else { - return null - } - } +function Utf16BEDecoder() { + this.overflowByte = -1; } -async function _writeFile (file, obj, options = {}) { - const fs = options.fs || _fs - - const str = stringify(obj, options) +Utf16BEDecoder.prototype.write = function(buf) { + if (buf.length == 0) + return ''; - await universalify.fromCallback(fs.writeFile)(file, str, options) -} + var buf2 = Buffer.alloc(buf.length + 1), + i = 0, j = 0; -const writeFile = universalify.fromPromise(_writeFile) + if (this.overflowByte !== -1) { + buf2[0] = buf[0]; + buf2[1] = this.overflowByte; + i = 1; j = 2; + } -function writeFileSync (file, obj, options = {}) { - const fs = options.fs || _fs + for (; i < buf.length-1; i += 2, j+= 2) { + buf2[j] = buf[i+1]; + buf2[j+1] = buf[i]; + } - const str = stringify(obj, options) - // not sure if fs.writeFileSync returns anything, but just in case - return fs.writeFileSync(file, str, options) + this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; + + return buf2.slice(0, j).toString('ucs2'); } -const jsonfile = { - readFile, - readFileSync, - writeFile, - writeFileSync +Utf16BEDecoder.prototype.end = function() { + this.overflowByte = -1; } -module.exports = jsonfile +// == UTF-16 codec ============================================================= +// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. +// Defaults to UTF-16LE, as it's prevalent and default in Node. +// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le +// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); -/***/ }), +// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). -/***/ 24401: -/***/ ((module) => { +exports.utf16 = Utf16Codec; +function Utf16Codec(codecOptions, iconv) { + this.iconv = iconv; +} + +Utf16Codec.prototype.encoder = Utf16Encoder; +Utf16Codec.prototype.decoder = Utf16Decoder; -function stringify (obj, options = {}) { - const EOL = options.EOL || '\n' - const str = JSON.stringify(obj, options ? options.replacer : null, options.spaces) +// -- Encoding (pass-through) - return str.replace(/\n/g, EOL) + EOL +function Utf16Encoder(options, codec) { + options = options || {}; + if (options.addBOM === undefined) + options.addBOM = true; + this.encoder = codec.iconv.getEncoder('utf-16le', options); } -function stripBom (content) { - // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified - if (Buffer.isBuffer(content)) content = content.toString('utf8') - return content.replace(/^\uFEFF/, '') +Utf16Encoder.prototype.write = function(str) { + return this.encoder.write(str); } -module.exports = { stringify, stripBom } +Utf16Encoder.prototype.end = function() { + return this.encoder.end(); +} -/***/ }), +// -- Decoding -/***/ 88735: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function Utf16Decoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; -"use strict"; + this.options = options || {}; + this.iconv = codec.iconv; +} +Utf16Decoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; + + if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) + return ''; -const EventEmitter = __webpack_require__(28614); -const JSONB = __webpack_require__(75337); + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); -const loadStore = opts => { - const adapters = { - redis: '@keyv/redis', - mongodb: '@keyv/mongo', - mongo: '@keyv/mongo', - sqlite: '@keyv/sqlite', - postgresql: '@keyv/postgres', - postgres: '@keyv/postgres', - mysql: '@keyv/mysql' - }; - if (opts.adapter || opts.uri) { - const adapter = opts.adapter || /^[^:]*/.exec(opts.uri)[0]; - return new (require(adapters[adapter]))(opts); - } - return new Map(); -}; + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); -class Keyv extends EventEmitter { - constructor(uri, opts) { - super(); - this.opts = Object.assign( - { - namespace: 'keyv', - serialize: JSONB.stringify, - deserialize: JSONB.parse - }, - (typeof uri === 'string') ? { uri } : uri, - opts - ); + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } - if (!this.opts.store) { - const adapterOpts = Object.assign({}, this.opts); - this.opts.store = loadStore(adapterOpts); - } + return this.decoder.write(buf); +} - if (typeof this.opts.store.on === 'function') { - this.opts.store.on('error', err => this.emit('error', err)); - } +Utf16Decoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); - this.opts.store.namespace = this.opts.namespace; - } + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); - _getKeyPrefix(key) { - return `${this.opts.namespace}:${key}`; - } + var trail = this.decoder.end(); + if (trail) + resStr += trail; - get(key) { - key = this._getKeyPrefix(key); - const store = this.opts.store; - return Promise.resolve() - .then(() => store.get(key)) - .then(data => { - data = (typeof data === 'string') ? this.opts.deserialize(data) : data; - if (data === undefined) { - return undefined; - } - if (typeof data.expires === 'number' && Date.now() > data.expires) { - this.delete(key); - return undefined; - } - return data.value; - }); - } + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + return this.decoder.end(); +} - set(key, value, ttl) { - key = this._getKeyPrefix(key); - if (typeof ttl === 'undefined') { - ttl = this.opts.ttl; - } - if (ttl === 0) { - ttl = undefined; - } - const store = this.opts.store; +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. - return Promise.resolve() - .then(() => { - const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null; - value = { value, expires }; - return store.set(key, this.opts.serialize(value), ttl); - }) - .then(() => true); - } + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 2) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; + if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; + } - delete(key) { - key = this._getKeyPrefix(key); - const store = this.opts.store; - return Promise.resolve() - .then(() => store.delete(key)); - } + if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; + if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; - clear() { - const store = this.opts.store; - return Promise.resolve() - .then(() => store.clear()); - } + b.length = 0; + charsProcessed++; + + if (charsProcessed >= 100) { + break outer_loop; + } + } + } + } + + // Make decisions. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; + if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-16le'; } -module.exports = Keyv; + /***/ }), -/***/ 99036: -/***/ ((__unused_webpack_module, exports) => { +/***/ 20060: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var LF = '\n'; -var CR = '\r'; -var LinesAndColumns = (function () { - function LinesAndColumns(string) { - this.string = string; - var offsets = [0]; - for (var offset = 0; offset < string.length;) { - switch (string[offset]) { - case LF: - offset += LF.length; - offsets.push(offset); - break; - case CR: - offset += CR.length; - if (string[offset] === LF) { - offset += LF.length; - } - offsets.push(offset); - break; - default: - offset++; - break; - } - } - this.offsets = offsets; - } - LinesAndColumns.prototype.locationForIndex = function (index) { - if (index < 0 || index > this.string.length) { - return null; - } - var line = 0; - var offsets = this.offsets; - while (offsets[line + 1] <= index) { - line++; - } - var column = index - offsets[line]; - return { line: line, column: column }; - }; - LinesAndColumns.prototype.indexForLocation = function (location) { - var line = location.line, column = location.column; - if (line < 0 || line >= this.offsets.length) { - return null; - } - if (column < 0 || column > this.lengthOfLine(line)) { - return null; - } - return this.offsets[line] + column; - }; - LinesAndColumns.prototype.lengthOfLine = function (line) { - var offset = this.offsets[line]; - var nextOffset = line === this.offsets.length - 1 ? this.string.length : this.offsets[line + 1]; - return nextOffset - offset; - }; - return LinesAndColumns; -}()); -exports.__esModule = true; -exports.default = LinesAndColumns; +var Buffer = __nccwpck_require__(52340).Buffer; -/***/ }), +// == UTF32-LE/BE codec. ========================================================== -/***/ 30815: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +exports._utf32 = Utf32Codec; -"use strict"; +function Utf32Codec(codecOptions, iconv) { + this.iconv = iconv; + this.bomAware = true; + this.isLE = codecOptions.isLE; +} -const path = __webpack_require__(85622); -const fs = __webpack_require__(35747); -const {promisify} = __webpack_require__(31669); -const pLocate = __webpack_require__(60364); +exports.utf32le = { type: '_utf32', isLE: true }; +exports.utf32be = { type: '_utf32', isLE: false }; -const fsStat = promisify(fs.stat); -const fsLStat = promisify(fs.lstat); +// Aliases +exports.ucs4le = 'utf32le'; +exports.ucs4be = 'utf32be'; -const typeMappings = { - directory: 'isDirectory', - file: 'isFile' -}; +Utf32Codec.prototype.encoder = Utf32Encoder; +Utf32Codec.prototype.decoder = Utf32Decoder; -function checkType({type}) { - if (type in typeMappings) { - return; - } +// -- Encoding - throw new Error(`Invalid type specified: ${type}`); +function Utf32Encoder(options, codec) { + this.isLE = codec.isLE; + this.highSurrogate = 0; } -const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); +Utf32Encoder.prototype.write = function(str) { + var src = Buffer.from(str, 'ucs2'); + var dst = Buffer.alloc(src.length * 2); + var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; + var offset = 0; -module.exports = async (paths, options) => { - options = { - cwd: process.cwd(), - type: 'file', - allowSymlinks: true, - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fsStat : fsLStat; + for (var i = 0; i < src.length; i += 2) { + var code = src.readUInt16LE(i); + var isHighSurrogate = (0xD800 <= code && code < 0xDC00); + var isLowSurrogate = (0xDC00 <= code && code < 0xE000); - return pLocate(paths, async path_ => { - try { - const stat = await statFn(path.resolve(options.cwd, path_)); - return matchType(options.type, stat); - } catch (_) { - return false; - } - }, options); -}; + if (this.highSurrogate) { + if (isHighSurrogate || !isLowSurrogate) { + // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low + // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character + // (technically wrong, but expected by some applications, like Windows file names). + write32.call(dst, this.highSurrogate, offset); + offset += 4; + } + else { + // Create 32-bit value from high and low surrogates; + var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; -module.exports.sync = (paths, options) => { - options = { - cwd: process.cwd(), - allowSymlinks: true, - type: 'file', - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; + write32.call(dst, codepoint, offset); + offset += 4; + this.highSurrogate = 0; - for (const path_ of paths) { - try { - const stat = statFn(path.resolve(options.cwd, path_)); + continue; + } + } - if (matchType(options.type, stat)) { - return path_; - } - } catch (_) { - } - } + if (isHighSurrogate) + this.highSurrogate = code; + else { + // Even if the current character is a low surrogate, with no previous high surrogate, we'll + // encode it as a semi-invalid stand-alone character for the same reasons expressed above for + // unpaired high surrogates. + write32.call(dst, code, offset); + offset += 4; + this.highSurrogate = 0; + } + } + + if (offset < dst.length) + dst = dst.slice(0, offset); + + return dst; }; +Utf32Encoder.prototype.end = function() { + // Treat any leftover high surrogate as a semi-valid independent character. + if (!this.highSurrogate) + return; + + var buf = Buffer.alloc(4); -/***/ }), + if (this.isLE) + buf.writeUInt32LE(this.highSurrogate, 0); + else + buf.writeUInt32BE(this.highSurrogate, 0); -/***/ 41066: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + this.highSurrogate = 0; -var getNative = __webpack_require__(76028), - root = __webpack_require__(562); + return buf; +}; -/* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'); +// -- Decoding -module.exports = DataView; +function Utf32Decoder(options, codec) { + this.isLE = codec.isLE; + this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); + this.overflow = []; +} +Utf32Decoder.prototype.write = function(src) { + if (src.length === 0) + return ''; -/***/ }), + var i = 0; + var codepoint = 0; + var dst = Buffer.alloc(src.length + 4); + var offset = 0; + var isLE = this.isLE; + var overflow = this.overflow; + var badChar = this.badChar; -/***/ 30731: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (overflow.length > 0) { + for (; i < src.length && overflow.length < 4; i++) + overflow.push(src[i]); + + if (overflow.length === 4) { + // NOTE: codepoint is a signed int32 and can be negative. + // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). + if (isLE) { + codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); + } else { + codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); + } + overflow.length = 0; -var hashClear = __webpack_require__(79130), - hashDelete = __webpack_require__(93067), - hashGet = __webpack_require__(21098), - hashHas = __webpack_require__(73949), - hashSet = __webpack_require__(48911); + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } + } -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + // Main loop. Should be as optimized as possible. + for (; i < src.length - 3; i += 4) { + // NOTE: codepoint is a signed int32 and can be negative. + if (isLE) { + codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); + } else { + codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); + } + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} + // Keep overflowing bytes. + for (; i < src.length; i++) { + overflow.push(src[i]); + } -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; + return dst.slice(0, offset).toString('ucs2'); +}; -module.exports = Hash; +function _writeCodepoint(dst, offset, codepoint, badChar) { + // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. + if (codepoint < 0 || codepoint > 0x10FFFF) { + // Not a valid Unicode codepoint + codepoint = badChar; + } + + // Ephemeral Planes: Write high surrogate. + if (codepoint >= 0x10000) { + codepoint -= 0x10000; + var high = 0xD800 | (codepoint >> 10); + dst[offset++] = high & 0xff; + dst[offset++] = high >> 8; -/***/ }), + // Low surrogate is written below. + var codepoint = 0xDC00 | (codepoint & 0x3FF); + } -/***/ 82746: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // Write BMP char or low surrogate. + dst[offset++] = codepoint & 0xff; + dst[offset++] = codepoint >> 8; -var listCacheClear = __webpack_require__(52523), - listCacheDelete = __webpack_require__(19937), - listCacheGet = __webpack_require__(15131), - listCacheHas = __webpack_require__(89528), - listCacheSet = __webpack_require__(51635); + return offset; +}; -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; +Utf32Decoder.prototype.end = function() { + this.overflow.length = 0; +}; + +// == UTF-32 Auto codec ============================================================= +// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. +// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 +// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } +// Encoder prepends BOM (which can be overridden with (addBOM: false}). + +exports.utf32 = Utf32AutoCodec; +exports.ucs4 = 'utf32'; + +function Utf32AutoCodec(options, iconv) { + this.iconv = iconv; } -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; +Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; +Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; -module.exports = ListCache; +// -- Encoding +function Utf32AutoEncoder(options, codec) { + options = options || {}; -/***/ }), + if (options.addBOM === undefined) + options.addBOM = true; -/***/ 51105: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); +} -var getNative = __webpack_require__(76028), - root = __webpack_require__(562); +Utf32AutoEncoder.prototype.write = function(str) { + return this.encoder.write(str); +}; -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'); +Utf32AutoEncoder.prototype.end = function() { + return this.encoder.end(); +}; -module.exports = Map; +// -- Decoding +function Utf32AutoDecoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; + this.options = options || {}; + this.iconv = codec.iconv; +} -/***/ }), +Utf32AutoDecoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; -/***/ 16531: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) + return ''; -var mapCacheClear = __webpack_require__(3489), - mapCacheDelete = __webpack_require__(288), - mapCacheGet = __webpack_require__(15712), - mapCacheHas = __webpack_require__(80369), - mapCacheSet = __webpack_require__(66935); + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; + return this.decoder.write(buf); +}; -module.exports = MapCache; +Utf32AutoDecoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); -/***/ }), + var trail = this.decoder.end(); + if (trail) + resStr += trail; -/***/ 40514: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } -var getNative = __webpack_require__(76028), - root = __webpack_require__(562); + return this.decoder.end(); +}; -/* Built-in method references that are verified to be native. */ -var Promise = getNative(root, 'Promise'); +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. + var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. -module.exports = Promise; + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 4) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { + return 'utf-32le'; + } + if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { + return 'utf-32be'; + } + } + if (b[0] !== 0 || b[1] > 0x10) invalidBE++; + if (b[3] !== 0 || b[2] > 0x10) invalidLE++; -/***/ }), + if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; + if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; -/***/ 9056: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + b.length = 0; + charsProcessed++; -var getNative = __webpack_require__(76028), - root = __webpack_require__(562); + if (charsProcessed >= 100) { + break outer_loop; + } + } + } + } -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); + // Make decisions. + if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; + if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; -module.exports = Set; + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-32le'; +} /***/ }), -/***/ 49754: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 91935: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var ListCache = __webpack_require__(82746), - stackClear = __webpack_require__(22614), - stackDelete = __webpack_require__(24202), - stackGet = __webpack_require__(96310), - stackHas = __webpack_require__(58721), - stackSet = __webpack_require__(90320); +"use strict"; -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; -} +var Buffer = __nccwpck_require__(52340).Buffer; -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; +// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 +// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 -module.exports = Stack; +exports.utf7 = Utf7Codec; +exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 +function Utf7Codec(codecOptions, iconv) { + this.iconv = iconv; +}; +Utf7Codec.prototype.encoder = Utf7Encoder; +Utf7Codec.prototype.decoder = Utf7Decoder; +Utf7Codec.prototype.bomAware = true; -/***/ }), -/***/ 39929: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +// -- Encoding -var root = __webpack_require__(562); +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; -/** Built-in value references. */ -var Symbol = root.Symbol; +function Utf7Encoder(options, codec) { + this.iconv = codec.iconv; +} -module.exports = Symbol; +Utf7Encoder.prototype.write = function(str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function(chunk) { + return "+" + (chunk === '+' ? '' : + this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + + "-"; + }.bind(this))); +} +Utf7Encoder.prototype.end = function() { +} -/***/ }), -/***/ 81918: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +// -- Decoding -var root = __webpack_require__(562); +function Utf7Decoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} -/** Built-in value references. */ -var Uint8Array = root.Uint8Array; +var base64Regex = /[A-Za-z0-9\/+]/; +var base64Chars = []; +for (var i = 0; i < 256; i++) + base64Chars[i] = base64Regex.test(String.fromCharCode(i)); -module.exports = Uint8Array; +var plusChar = '+'.charCodeAt(0), + minusChar = '-'.charCodeAt(0), + andChar = '&'.charCodeAt(0); +Utf7Decoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; -/***/ }), + // The decoder is more involved as we must handle chunks in stream. -/***/ 87243: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" + res += "+"; + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } -var getNative = __webpack_require__(76028), - root = __webpack_require__(562); + if (buf[i] != minusChar) // Minus is absorbed after base64. + i--; -/* Built-in method references that are verified to be native. */ -var WeakMap = getNative(root, 'WeakMap'); + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } -module.exports = WeakMap; + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); -/***/ }), + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } -/***/ 99502: -/***/ ((module) => { + this.inBase64 = inBase64; + this.base64Accum = base64Accum; -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); + return res; } -module.exports = apply; +Utf7Decoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + this.inBase64 = false; + this.base64Accum = ''; + return res; +} -/***/ }), -/***/ 98029: -/***/ ((module) => { +// UTF-7-IMAP codec. +// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) +// Differences: +// * Base64 part is started by "&" instead of "+" +// * Direct characters are 0x20-0x7E, except "&" (0x26) +// * In Base64, "," is used instead of "/" +// * Base64 must not be used to represent direct characters. +// * No implicit shift back from Base64 (should always end with '-') +// * String must end in non-shifted position. +// * "-&" while in base64 is not allowed. -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} +exports.utf7imap = Utf7IMAPCodec; +function Utf7IMAPCodec(codecOptions, iconv) { + this.iconv = iconv; +}; -module.exports = arrayEach; +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; +Utf7IMAPCodec.prototype.bomAware = true; -/***/ }), +// -- Encoding -/***/ 69459: -/***/ ((module) => { +function Utf7IMAPEncoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = Buffer.alloc(6); + this.base64AccumIdx = 0; +} -/** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; +Utf7IMAPEncoder.prototype.write = function(str) { + var inBase64 = this.inBase64, + base64Accum = this.base64Accum, + base64AccumIdx = this.base64AccumIdx, + buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; -} + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i); + if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + base64AccumIdx = 0; + } -module.exports = arrayFilter; + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + inBase64 = false; + } + if (!inBase64) { + buf[bufIdx++] = uChar; // Write direct character -/***/ }), + if (uChar === andChar) // Ampersand -> '&-' + buf[bufIdx++] = minusChar; + } -/***/ 63360: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. + inBase64 = true; + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8; + base64Accum[base64AccumIdx++] = uChar & 0xFF; -var baseTimes = __webpack_require__(15683), - isArguments = __webpack_require__(24839), - isArray = __webpack_require__(43364), - isBuffer = __webpack_require__(12963), - isIndex = __webpack_require__(72950), - isTypedArray = __webpack_require__(53635); + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); + base64AccumIdx = 0; + } + } + } + } -/** Used for built-in method references. */ -var objectProto = Object.prototype; + this.inBase64 = inBase64; + this.base64AccumIdx = base64AccumIdx; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + return buf.slice(0, bufIdx); +} -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; +Utf7IMAPEncoder.prototype.end = function() { + var buf = Buffer.alloc(10), bufIdx = 0; + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + this.base64AccumIdx = 0; + } - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + this.inBase64 = false; } - } - return result; + + return buf.slice(0, bufIdx); } -module.exports = arrayLikeKeys; +// -- Decoding -/***/ }), +function Utf7IMAPDecoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} -/***/ 77680: -/***/ ((module) => { +var base64IMAPChars = base64Chars.slice(); +base64IMAPChars[','.charCodeAt(0)] = true; -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); +Utf7IMAPDecoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; + + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&"; + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus may be absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); -module.exports = arrayMap; + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } -/***/ }), + this.inBase64 = inBase64; + this.base64Accum = base64Accum; -/***/ 52061: -/***/ ((module) => { + return res; +} -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; +Utf7IMAPDecoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - while (++index < length) { - array[offset + index] = values[index]; - } - return array; + this.inBase64 = false; + this.base64Accum = ''; + return res; } -module.exports = arrayPush; + /***/ }), -/***/ 55647: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 44162: +/***/ ((__unused_webpack_module, exports) => { -var baseAssignValue = __webpack_require__(71850), - eq = __webpack_require__(28650); +"use strict"; -/** Used for built-in method references. */ -var objectProto = Object.prototype; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var BOMChar = '\uFEFF'; -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } +exports.PrependBOM = PrependBOMWrapper +function PrependBOMWrapper(encoder, options) { + this.encoder = encoder; + this.addBOM = true; } -module.exports = assignValue; +PrependBOMWrapper.prototype.write = function(str) { + if (this.addBOM) { + str = BOMChar + str; + this.addBOM = false; + } + return this.encoder.write(str); +} -/***/ }), +PrependBOMWrapper.prototype.end = function() { + return this.encoder.end(); +} -/***/ 886: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var eq = __webpack_require__(28650); +//------------------------------------------------------------------------------ -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; +exports.StripBOM = StripBOMWrapper; +function StripBOMWrapper(decoder, options) { + this.decoder = decoder; + this.pass = false; + this.options = options || {}; } -module.exports = assocIndexOf; - - -/***/ }), +StripBOMWrapper.prototype.write = function(buf) { + var res = this.decoder.write(buf); + if (this.pass || !res) + return res; -/***/ 57361: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (res[0] === BOMChar) { + res = res.slice(1); + if (typeof this.options.stripBOM === 'function') + this.options.stripBOM(); + } -var copyObject = __webpack_require__(83568), - keys = __webpack_require__(50288); + this.pass = true; + return res; +} -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); +StripBOMWrapper.prototype.end = function() { + return this.decoder.end(); } -module.exports = baseAssign; /***/ }), -/***/ 86677: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var copyObject = __webpack_require__(83568), - keysIn = __webpack_require__(86032); - -/** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); -} - -module.exports = baseAssignIn; +/***/ 21377: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; -/***/ }), -/***/ 71850: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var Buffer = __nccwpck_require__(52340).Buffer; -var defineProperty = __webpack_require__(59252); +var bomHandling = __nccwpck_require__(44162), + iconv = module.exports; -/** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } -} +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +iconv.encodings = null; -module.exports = baseAssignValue; +// Characters emitted in case of error. +iconv.defaultCharUnicode = '�'; +iconv.defaultCharSingleByte = '?'; +// Public API. +iconv.encode = function encode(str, encoding, options) { + str = "" + (str || ""); // Ensure string. -/***/ }), + var encoder = iconv.getEncoder(encoding, options); -/***/ 95570: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var Stack = __webpack_require__(49754), - arrayEach = __webpack_require__(98029), - assignValue = __webpack_require__(55647), - baseAssign = __webpack_require__(57361), - baseAssignIn = __webpack_require__(86677), - cloneBuffer = __webpack_require__(82009), - copyArray = __webpack_require__(76640), - copySymbols = __webpack_require__(85337), - copySymbolsIn = __webpack_require__(93017), - getAllKeys = __webpack_require__(18785), - getAllKeysIn = __webpack_require__(54296), - getTag = __webpack_require__(207), - initCloneArray = __webpack_require__(4025), - initCloneByTag = __webpack_require__(27353), - initCloneObject = __webpack_require__(66312), - isArray = __webpack_require__(43364), - isBuffer = __webpack_require__(12963), - isMap = __webpack_require__(13689), - isObject = __webpack_require__(43420), - isSet = __webpack_require__(81360), - keys = __webpack_require__(50288); + var res = encoder.write(str); + var trail = encoder.end(); + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; +} -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; +iconv.decode = function decode(buf, encoding, options) { + if (typeof buf === 'string') { + if (!iconv.skipDecodeWarning) { + console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); + iconv.skipDecodeWarning = true; + } -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; + buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. + } -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; + var decoder = iconv.getDecoder(encoding, options); -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; + var res = decoder.write(buf); + var trail = decoder.end(); -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; + return trail ? (res + trail) : res; +} - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); +iconv.encodingExists = function encodingExists(enc) { + try { + iconv.getCodec(enc); + return true; + } catch (e) { + return false; } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; +} - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); +// Legacy aliases to convert functions +iconv.toEncoding = iconv.encode; +iconv.fromEncoding = iconv.decode; - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +iconv._codecDataCache = {}; +iconv.getCodec = function getCodec(encoding) { + if (!iconv.encodings) + iconv.encodings = __nccwpck_require__(62228); // Lazy load all encoding definitions. + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = iconv._canonicalizeEncoding(encoding); - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); + // Traverse iconv.encodings to find actual codec. + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; -} + var codecDef = iconv.encodings[enc]; -module.exports = baseClone; + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef; + break; + case "object": // Alias with options. Can be layered. + for (var key in codecDef) + codecOptions[key] = codecDef[key]; -/***/ }), + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + enc = codecDef.type; + break; -/***/ 14794: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + case "function": // Codec itself. + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; -var isObject = __webpack_require__(43420); + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + codec = new codecDef(codecOptions, iconv); -/** Built-in value references. */ -var objectCreate = Object.create; + iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. + return codec; -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ -var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; -}()); - -module.exports = baseCreate; +} +iconv._canonicalizeEncoding = function(encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); +} -/***/ }), +iconv.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), + encoder = new codec.encoder(options, codec); -/***/ 5765: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (codec.bomAware && options && options.addBOM) + encoder = new bomHandling.PrependBOM(encoder, options); -var arrayPush = __webpack_require__(52061), - isFlattenable = __webpack_require__(6426); + return encoder; +} -/** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ -function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; +iconv.getDecoder = function getDecoder(encoding, options) { + var codec = iconv.getCodec(encoding), + decoder = new codec.decoder(options, codec); - predicate || (predicate = isFlattenable); - result || (result = []); + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; + return decoder; } -module.exports = baseFlatten; +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { + if (iconv.supportsStreams) + return; + // Dependency-inject stream module to create IconvLite stream classes. + var streams = __nccwpck_require__(2409)(stream_module); -/***/ }), + // Not public API yet, but expose the stream classes. + iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; -/***/ 86685: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // Streaming API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + } -var castPath = __webpack_require__(18963), - toKey = __webpack_require__(30668); + iconv.decodeStream = function decodeStream(encoding, options) { + return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + } -/** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ -function baseGet(object, path) { - path = castPath(path, object); + iconv.supportsStreams = true; +} + +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var stream_module; +try { + stream_module = __nccwpck_require__(92413); +} catch (e) {} - var index = 0, - length = path.length; +if (stream_module && stream_module.Transform) { + iconv.enableStreamingAPI(stream_module); - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + iconv.encodeStream = iconv.decodeStream = function() { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); + }; } -module.exports = baseGet; +if (false) {} /***/ }), -/***/ 98160: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 2409: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var arrayPush = __webpack_require__(52061), - isArray = __webpack_require__(43364); +"use strict"; -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); -} -module.exports = baseGetAllKeys; +var Buffer = __nccwpck_require__(52340).Buffer; +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function(stream_module) { + var Transform = stream_module.Transform; -/***/ }), + // == Encoder stream ======================================================= -/***/ 98653: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); + } -var Symbol = __webpack_require__(39929), - getRawTag = __webpack_require__(32608), - objectToString = __webpack_require__(49052); + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }); -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; + IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} + IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; + } -module.exports = baseGetTag; + // == Decoder stream ======================================================= -/***/ }), + function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); + } -/***/ 56263: -/***/ ((module) => { + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }); -/** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ -function baseHasIn(object, key) { - return object != null && key in Object(object); -} + IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } -module.exports = baseHasIn; + IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } + IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; + } -/***/ }), + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream, + }; +}; -/***/ 77907: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var baseGetTag = __webpack_require__(98653), - isObjectLike = __webpack_require__(9111); +/***/ }), -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; +/***/ 2989: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; +try { + var util = __nccwpck_require__(31669); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = __nccwpck_require__(97350); } -module.exports = baseIsArguments; - /***/ }), -/***/ 81391: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var getTag = __webpack_require__(207), - isObjectLike = __webpack_require__(9111); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]'; +/***/ 97350: +/***/ ((module) => { -/** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ -function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (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) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } } -module.exports = baseIsMap; - /***/ }), -/***/ 72294: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var isFunction = __webpack_require__(66827), - isMasked = __webpack_require__(16716), - isObject = __webpack_require__(43420), - toSource = __webpack_require__(98241); - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +/***/ 27452: +/***/ ((__unused_webpack_module, exports) => { -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; +exports.parse = exports.decode = decode -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; +exports.stringify = exports.encode = encode -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +exports.safe = safe +exports.unsafe = unsafe -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var eol = typeof process !== 'undefined' && + process.platform === 'win32' ? '\r\n' : '\n' -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); +function encode (obj, opt) { + var children = [] + var out = '' -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; + if (typeof opt === 'string') { + opt = { + section: opt, + whitespace: false, + } + } else { + opt = opt || {} + opt.whitespace = opt.whitespace === true } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} -module.exports = baseIsNative; + var separator = opt.whitespace ? ' = ' : '=' + Object.keys(obj).forEach(function (k, _, __) { + var val = obj[k] + if (val && Array.isArray(val)) { + val.forEach(function (item) { + out += safe(k + '[]') + separator + safe(item) + '\n' + }) + } else if (val && typeof val === 'object') + children.push(k) + else + out += safe(k) + separator + safe(val) + eol + }) -/***/ }), + if (opt.section && out.length) + out = '[' + safe(opt.section) + ']' + eol + out -/***/ 19472: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + children.forEach(function (k, _, __) { + var nk = dotSplit(k).join('\\.') + var section = (opt.section ? opt.section + '.' : '') + nk + var child = encode(obj[k], { + section: section, + whitespace: opt.whitespace, + }) + if (out.length && child.length) + out += eol -var getTag = __webpack_require__(207), - isObjectLike = __webpack_require__(9111); + out += child + }) -/** `Object#toString` result references. */ -var setTag = '[object Set]'; + return out +} -/** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ -function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; +function dotSplit (str) { + return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002') + .replace(/\\\./g, '\u0001') + .split(/\./).map(function (part) { + return part.replace(/\1/g, '\\.') + .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') + }) } -module.exports = baseIsSet; +function decode (str) { + var out = {} + var p = out + var section = null + // section |key = value + var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i + var lines = str.split(/[\r\n]+/g) + lines.forEach(function (line, _, __) { + if (!line || line.match(/^\s*[;#]/)) + return + var match = line.match(re) + if (!match) + return + if (match[1] !== undefined) { + section = unsafe(match[1]) + if (section === '__proto__') { + // not allowed + // keep parsing the section, but don't attach it. + p = {} + return + } + p = out[section] = out[section] || {} + return + } + var key = unsafe(match[2]) + if (key === '__proto__') + return + var value = match[3] ? unsafe(match[4]) : true + switch (value) { + case 'true': + case 'false': + case 'null': value = JSON.parse(value) + } -/***/ }), + // Convert keys with '[]' suffix to an array + if (key.length > 2 && key.slice(-2) === '[]') { + key = key.substring(0, key.length - 2) + if (key === '__proto__') + return + if (!p[key]) + p[key] = [] + else if (!Array.isArray(p[key])) + p[key] = [p[key]] + } -/***/ 86944: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // safeguard against resetting a previously defined + // array by accidentally forgetting the brackets + if (Array.isArray(p[key])) + p[key].push(value) + else + p[key] = value + }) -var baseGetTag = __webpack_require__(98653), - isLength = __webpack_require__(55752), - isObjectLike = __webpack_require__(9111); + // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} + // use a filter to return the keys that have to be deleted. + Object.keys(out).filter(function (k, _, __) { + if (!out[k] || + typeof out[k] !== 'object' || + Array.isArray(out[k])) + return false -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; + // see if the parent section is also an object. + // if so, add it to that, and mark this one for deletion + var parts = dotSplit(k) + var p = out + var l = parts.pop() + var nl = l.replace(/\\\./g, '.') + parts.forEach(function (part, _, __) { + if (part === '__proto__') + return + if (!p[part] || typeof p[part] !== 'object') + p[part] = {} + p = p[part] + }) + if (p === out && nl === l) + return false -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; + p[nl] = out[k] + return true + }).forEach(function (del, _, __) { + delete out[del] + }) -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; + return out +} -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +function isQuoted (val) { + return (val.charAt(0) === '"' && val.slice(-1) === '"') || + (val.charAt(0) === "'" && val.slice(-1) === "'") } -module.exports = baseIsTypedArray; +function safe (val) { + return (typeof val !== 'string' || + val.match(/[=\r\n]/) || + val.match(/^\[/) || + (val.length > 1 && + isQuoted(val)) || + val !== val.trim()) + ? JSON.stringify(val) + : val.replace(/;/g, '\\;').replace(/#/g, '\\#') +} +function unsafe (val, doUnesc) { + val = (val || '').trim() + if (isQuoted(val)) { + // remove the single quotes before calling JSON.parse + if (val.charAt(0) === "'") + val = val.substr(1, val.length - 2) -/***/ }), + try { + val = JSON.parse(val) + } catch (_) {} + } else { + // walk the val to find the first not-escaped ; character + var esc = false + var unesc = '' + for (var i = 0, l = val.length; i < l; i++) { + var c = val.charAt(i) + if (esc) { + if ('\\;#'.indexOf(c) !== -1) + unesc += c + else + unesc += '\\' + c -/***/ 24787: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + esc = false + } else if (';#'.indexOf(c) !== -1) + break + else if (c === '\\') + esc = true + else + unesc += c + } + if (esc) + unesc += '\\' -var isPrototype = __webpack_require__(4954), - nativeKeys = __webpack_require__(11491); + return unesc.trim() + } + return val +} -/** Used for built-in method references. */ -var objectProto = Object.prototype; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/***/ }), -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} +/***/ 30237: +/***/ ((module) => { -module.exports = baseKeys; +"use strict"; + + +module.exports = function isArrayish(obj) { + if (!obj) { + return false; + } + + return obj instanceof Array || Array.isArray(obj) || + (obj.length >= 0 && obj.splice instanceof Function); +}; /***/ }), -/***/ 14535: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 21176: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var isObject = __webpack_require__(43420), - isPrototype = __webpack_require__(4954), - nativeKeysIn = __webpack_require__(43101); +"use strict"; -/** Used for built-in method references. */ -var objectProto = Object.prototype; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var has = __nccwpck_require__(97841); -/** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; +function specifierIncluded(current, specifier) { + var nodeParts = current.split('.'); + var parts = specifier.split(' '); + var op = parts.length > 1 ? parts[0] : '='; + var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; + for (var i = 0; i < 3; ++i) { + var cur = parseInt(nodeParts[i] || 0, 10); + var ver = parseInt(versionParts[i] || 0, 10); + if (cur === ver) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + if (op === '<') { + return cur < ver; + } + if (op === '>=') { + return cur >= ver; + } + return false; + } + return op === '>='; } -module.exports = baseKeysIn; - +function matchesRange(current, range) { + var specifiers = range.split(/ ?&& ?/); + if (specifiers.length === 0) { + return false; + } + for (var i = 0; i < specifiers.length; ++i) { + if (!specifierIncluded(current, specifiers[i])) { + return false; + } + } + return true; +} -/***/ }), +function versionIncluded(nodeVersion, specifierValue) { + if (typeof specifierValue === 'boolean') { + return specifierValue; + } -/***/ 3529: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var current = typeof nodeVersion === 'undefined' + ? process.versions && process.versions.node && process.versions.node + : nodeVersion; -var basePickBy = __webpack_require__(85041), - hasIn = __webpack_require__(14426); + if (typeof current !== 'string') { + throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required'); + } -/** - * The base implementation of `_.pick` without support for individual - * property identifiers. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. - */ -function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); + if (specifierValue && typeof specifierValue === 'object') { + for (var i = 0; i < specifierValue.length; ++i) { + if (matchesRange(current, specifierValue[i])) { + return true; + } + } + return false; + } + return matchesRange(current, specifierValue); } -module.exports = basePick; +var data = __nccwpck_require__(74986); + +module.exports = function isCore(x, nodeVersion) { + return has(data, x) && versionIncluded(nodeVersion, data[x]); +}; /***/ }), -/***/ 85041: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 47133: +/***/ ((module) => { -var baseGet = __webpack_require__(86685), - baseSet = __webpack_require__(90374), - castPath = __webpack_require__(18963); +"use strict"; -/** - * The base implementation of `_.pickBy` without support for iteratee shorthands. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. - */ -function basePickBy(object, paths, predicate) { - var index = -1, - length = paths.length, - result = {}; - while (++index < length) { - var path = paths[index], - value = baseGet(object, path); +module.exports = ({stream = process.stdout} = {}) => { + return Boolean( + stream && stream.isTTY && + process.env.TERM !== 'dumb' && + !('CI' in process.env) + ); +}; - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); - } - } - return result; -} -module.exports = basePickBy; +/***/ }), +/***/ 93458: +/***/ ((module) => { -/***/ }), +"use strict"; -/***/ 31428: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var identity = __webpack_require__(57460), - overRest = __webpack_require__(216), - setToString = __webpack_require__(65444); +const isStream = stream => + stream !== null && + typeof stream === 'object' && + typeof stream.pipe === 'function'; -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); -} +isStream.writable = stream => + isStream(stream) && + stream.writable !== false && + typeof stream._write === 'function' && + typeof stream._writableState === 'object'; -module.exports = baseRest; +isStream.readable = stream => + isStream(stream) && + stream.readable !== false && + typeof stream._read === 'function' && + typeof stream._readableState === 'object'; + +isStream.duplex = stream => + isStream.writable(stream) && + isStream.readable(stream); + +isStream.transform = stream => + isStream.duplex(stream) && + typeof stream._transform === 'function' && + typeof stream._transformState === 'object'; + +module.exports = isStream; /***/ }), -/***/ 90374: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 52607: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(35747) +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = __nccwpck_require__(59750) +} else { + core = __nccwpck_require__(37821) +} -var assignValue = __webpack_require__(55647), - castPath = __webpack_require__(18963), - isIndex = __webpack_require__(72950), - isObject = __webpack_require__(43420), - toKey = __webpack_require__(30668); +module.exports = isexe +isexe.sync = sync -/** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ -function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} } - path = castPath(path, object); - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') + } - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) + } + }) + }) + } - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false } } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; + cb(er, is) + }) } -module.exports = baseSet; +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false + } else { + throw er + } + } +} /***/ }), -/***/ 3503: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 37821: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var constant = __webpack_require__(66915), - defineProperty = __webpack_require__(59252), - identity = __webpack_require__(57460); +module.exports = isexe +isexe.sync = sync -/** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); -}; +var fs = __nccwpck_require__(35747) -module.exports = baseSetToString; +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, options)) + }) +} +function sync (path, options) { + return checkStat(fs.statSync(path), options) +} -/***/ }), +function checkStat (stat, options) { + return stat.isFile() && checkMode(stat, options) +} -/***/ 15683: -/***/ ((module) => { +function checkMode (stat, options) { + var mod = stat.mode + var uid = stat.uid + var gid = stat.gid -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); + var myUid = options.uid !== undefined ? + options.uid : process.getuid && process.getuid() + var myGid = options.gid !== undefined ? + options.gid : process.getgid && process.getgid() - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} + var u = parseInt('100', 8) + var g = parseInt('010', 8) + var o = parseInt('001', 8) + var ug = u | g -module.exports = baseTimes; + var ret = (mod & o) || + (mod & g) && gid === myGid || + (mod & u) && uid === myUid || + (mod & ug) && myUid === 0 + + return ret +} /***/ }), -/***/ 74851: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 59750: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Symbol = __webpack_require__(39929), - arrayMap = __webpack_require__(77680), - isArray = __webpack_require__(43364), - isSymbol = __webpack_require__(82500); +module.exports = isexe +isexe.sync = sync -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; +var fs = __nccwpck_require__(35747) -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; + if (!pathext) { + return true } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; + + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true + } } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + return false } -module.exports = baseToString; +function checkStat (stat, path, options) { + if (!stat.isSymbolicLink() && !stat.isFile()) { + return false + } + return checkPathExt(path, options) +} + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, path, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), path, options) +} /***/ }), -/***/ 83717: -/***/ ((module) => { +/***/ 52388: +/***/ ((__unused_webpack_module, exports) => { -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} +// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell +// License: MIT. (See LICENSE.) -module.exports = baseUnary; +Object.defineProperty(exports, "__esModule", ({ + value: true +})) + +// This regex comes from regex.coffee, and is inserted here by generate-index.js +// (run `npm run build`). +exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g + +exports.matchToToken = function(match) { + var token = {type: "invalid", value: match[0], closed: undefined} + if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) + else if (match[ 5]) token.type = "comment" + else if (match[ 6]) token.type = "comment", token.closed = !!match[7] + else if (match[ 8]) token.type = "regex" + else if (match[ 9]) token.type = "number" + else if (match[10]) token.type = "name" + else if (match[11]) token.type = "punctuator" + else if (match[12]) token.type = "whitespace" + return token +} /***/ }), -/***/ 18963: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 75337: +/***/ ((__unused_webpack_module, exports) => { -var isArray = __webpack_require__(43364), - isKey = __webpack_require__(20007), - stringToPath = __webpack_require__(35725), - toString = __webpack_require__(49228); +//TODO: handle reviver/dehydrate function like normal +//and handle indentation, like normal. +//if anyone needs this... please send pull request. -/** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ -function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); -} +exports.stringify = function stringify (o) { + if('undefined' == typeof o) return o -module.exports = castPath; + if(o && Buffer.isBuffer(o)) + return JSON.stringify(':base64:' + o.toString('base64')) + if(o && o.toJSON) + o = o.toJSON() -/***/ }), + if(o && 'object' === typeof o) { + var s = '' + var array = Array.isArray(o) + s = array ? '[' : '{' + var first = true -/***/ 18384: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + for(var k in o) { + var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k]) + if(Object.hasOwnProperty.call(o, k) && !ignore) { + if(!first) + s += ',' + first = false + if (array) { + if(o[k] == undefined) + s += 'null' + else + s += stringify(o[k]) + } else if (o[k] !== void(0)) { + s += stringify(k) + ':' + stringify(o[k]) + } + } + } -var Uint8Array = __webpack_require__(81918); + s += array ? ']' : '}' -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; + return s + } else if ('string' === typeof o) { + return JSON.stringify(/^:/.test(o) ? ':' + o : o) + } else if ('undefined' === typeof o) { + return 'null'; + } else + return JSON.stringify(o) +} + +exports.parse = function (s) { + return JSON.parse(s, function (key, value) { + if('string' === typeof value) { + if(/^:base64:/.test(value)) + return new Buffer(value.substring(8), 'base64') + else + return /^:/.test(value) ? value.substring(1) : value + } + return value + }) } -module.exports = cloneArrayBuffer; - /***/ }), -/***/ 82009: -/***/ ((module, exports, __webpack_require__) => { - -/* module decorator */ module = __webpack_require__.nmd(module); -var root = __webpack_require__(562); - -/** Detect free variable `exports`. */ -var freeExports = true && exports && !exports.nodeType && exports; +/***/ 36873: +/***/ ((module) => { -/** Detect free variable `module`. */ -var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; +"use strict"; -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; +const hexify = char => { + const h = char.charCodeAt(0).toString(16).toUpperCase() + return '0x' + (h.length % 2 ? '0' : '') + h +} -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); +const parseError = (e, txt, context) => { + if (!txt) { + return { + message: e.message + ' while parsing empty string', + position: 0, + } } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + const badToken = e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i) + const errIdx = badToken ? +badToken[2] + : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 + : null - buffer.copy(result); - return result; -} + const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${ + JSON.stringify(badToken[1]) + } (${hexify(badToken[1])})`) + : e.message -module.exports = cloneBuffer; + if (errIdx !== null && errIdx !== undefined) { + const start = errIdx <= context ? 0 + : errIdx - context + const end = errIdx + context >= txt.length ? txt.length + : errIdx + context -/***/ }), + const slice = (start === 0 ? '' : '...') + + txt.slice(start, end) + + (end === txt.length ? '' : '...') -/***/ 8534: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + const near = txt === slice ? '' : 'near ' -var cloneArrayBuffer = __webpack_require__(18384); + return { + message: msg + ` while parsing ${near}${JSON.stringify(slice)}`, + position: errIdx, + } + } else { + return { + message: msg + ` while parsing '${txt.slice(0, context * 2)}'`, + position: 0, + } + } +} -/** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ -function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +class JSONParseError extends SyntaxError { + constructor (er, txt, context, caller) { + context = context || 20 + const metadata = parseError(er, txt, context) + super(metadata.message) + Object.assign(this, metadata) + this.code = 'EJSONPARSE' + this.systemError = er + Error.captureStackTrace(this, caller || this.constructor) + } + get name () { return this.constructor.name } + set name (n) {} + get [Symbol.toStringTag] () { return this.constructor.name } } -module.exports = cloneDataView; +const kIndent = Symbol.for('indent') +const kNewline = Symbol.for('newline') +// only respect indentation if we got a line break, otherwise squash it +// things other than objects and arrays aren't indented, so ignore those +// Important: in both of these regexps, the $1 capture group is the newline +// or undefined, and the $2 capture group is the indent, or undefined. +const formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/ +const emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/ +const parseJson = (txt, reviver, context) => { + const parseText = stripBOM(txt) + context = context || 20 + try { + // get the indentation so that we can save it back nicely + // if the file starts with {" then we have an indent of '', ie, none + // otherwise, pick the indentation of the next line after the first \n + // If the pattern doesn't match, then it means no indentation. + // JSON.stringify ignores symbols, so this is reasonably safe. + // if the string is '{}' or '[]', then use the default 2-space indent. + const [, newline = '\n', indent = ' '] = parseText.match(emptyRE) || + parseText.match(formatRE) || + [, '', ''] + + const result = JSON.parse(parseText, reviver) + if (result && typeof result === 'object') { + result[kNewline] = newline + result[kIndent] = indent + } + return result + } catch (e) { + if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) { + const isEmptyArray = Array.isArray(txt) && txt.length === 0 + throw Object.assign(new TypeError( + `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}` + ), { + code: 'EJSONPARSE', + systemError: e, + }) + } -/***/ }), + throw new JSONParseError(e, parseText, context, parseJson) + } +} -/***/ 86549: -/***/ ((module) => { +// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) +// because the buffer-to-string conversion in `fs.readFileSync()` +// translates it to FEFF, the UTF-16 BOM. +const stripBOM = txt => String(txt).replace(/^\uFEFF/, '') -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; +module.exports = parseJson +parseJson.JSONParseError = JSONParseError -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; +parseJson.noExceptions = (txt, reviver) => { + try { + return JSON.parse(stripBOM(txt), reviver) + } catch (e) {} } -module.exports = cloneRegExp; - /***/ }), -/***/ 81731: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var Symbol = __webpack_require__(39929); +/***/ 4211: +/***/ ((module, exports) => { -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; +exports = module.exports = stringify +exports.getSerialize = serializer -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +function stringify(obj, replacer, spaces, cycleReplacer) { + return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) } -module.exports = cloneSymbol; - - -/***/ }), +function serializer(replacer, cycleReplacer) { + var stack = [], keys = [] -/***/ 13817: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (cycleReplacer == null) cycleReplacer = function(key, value) { + if (stack[0] === value) return "[Circular ~]" + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" + } -var cloneArrayBuffer = __webpack_require__(18384); + return function(key, value) { + if (stack.length > 0) { + var thisPos = stack.indexOf(this) + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) + if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) + } + else stack.push(value) -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + return replacer == null ? value : replacer.call(this, key, value) + } } -module.exports = cloneTypedArray; - /***/ }), -/***/ 76640: -/***/ ((module) => { +/***/ 91393: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; +let _fs +try { + _fs = __nccwpck_require__(82161) +} catch (_) { + _fs = __nccwpck_require__(35747) +} +const universalify = __nccwpck_require__(92178) +const { stringify, stripBom } = __nccwpck_require__(24401) - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; +async function _readFile (file, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } } - return array; -} -module.exports = copyArray; + const fs = options.fs || _fs + const shouldThrow = 'throws' in options ? options.throws : true -/***/ }), + let data = await universalify.fromCallback(fs.readFile)(file, options) -/***/ 83568: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + data = stripBom(data) + + let obj + try { + obj = JSON.parse(data, options ? options.reviver : null) + } catch (err) { + if (shouldThrow) { + err.message = `${file}: ${err.message}` + throw err + } else { + return null + } + } -var assignValue = __webpack_require__(55647), - baseAssignValue = __webpack_require__(71850); + return obj +} -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); +const readFile = universalify.fromPromise(_readFile) - var index = -1, - length = props.length; +function readFileSync (file, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } + } - while (++index < length) { - var key = props[index]; + const fs = options.fs || _fs - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; + const shouldThrow = 'throws' in options ? options.throws : true - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); + try { + let content = fs.readFileSync(file, options) + content = stripBom(content) + return JSON.parse(content, options.reviver) + } catch (err) { + if (shouldThrow) { + err.message = `${file}: ${err.message}` + throw err } else { - assignValue(object, key, newValue); + return null } } - return object; } -module.exports = copyObject; +async function _writeFile (file, obj, options = {}) { + const fs = options.fs || _fs + const str = stringify(obj, options) -/***/ }), + await universalify.fromCallback(fs.writeFile)(file, str, options) +} -/***/ 85337: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +const writeFile = universalify.fromPromise(_writeFile) -var copyObject = __webpack_require__(83568), - getSymbols = __webpack_require__(5841); +function writeFileSync (file, obj, options = {}) { + const fs = options.fs || _fs -/** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); + const str = stringify(obj, options) + // not sure if fs.writeFileSync returns anything, but just in case + return fs.writeFileSync(file, str, options) } -module.exports = copySymbols; +const jsonfile = { + readFile, + readFileSync, + writeFile, + writeFileSync +} + +module.exports = jsonfile /***/ }), -/***/ 93017: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 24401: +/***/ ((module) => { -var copyObject = __webpack_require__(83568), - getSymbolsIn = __webpack_require__(85468); +function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) { + const EOF = finalEOL ? EOL : '' + const str = JSON.stringify(obj, replacer, spaces) -/** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); + return str.replace(/\n/g, EOL) + EOF } -module.exports = copySymbolsIn; - +function stripBom (content) { + // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified + if (Buffer.isBuffer(content)) content = content.toString('utf8') + return content.replace(/^\uFEFF/, '') +} -/***/ }), +module.exports = { stringify, stripBom } -/***/ 54554: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var root = __webpack_require__(562); +/***/ }), -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; +/***/ 88735: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = coreJsData; +"use strict"; -/***/ }), +const EventEmitter = __nccwpck_require__(28614); +const JSONB = __nccwpck_require__(75337); -/***/ 21479: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +const loadStore = opts => { + const adapters = { + redis: '@keyv/redis', + mongodb: '@keyv/mongo', + mongo: '@keyv/mongo', + sqlite: '@keyv/sqlite', + postgresql: '@keyv/postgres', + postgres: '@keyv/postgres', + mysql: '@keyv/mysql' + }; + if (opts.adapter || opts.uri) { + const adapter = opts.adapter || /^[^:]*/.exec(opts.uri)[0]; + return new (require(adapters[adapter]))(opts); + } + return new Map(); +}; -var baseRest = __webpack_require__(31428), - isIterateeCall = __webpack_require__(78155); +class Keyv extends EventEmitter { + constructor(uri, opts) { + super(); + this.opts = Object.assign( + { + namespace: 'keyv', + serialize: JSONB.stringify, + deserialize: JSONB.parse + }, + (typeof uri === 'string') ? { uri } : uri, + opts + ); -/** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ -function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; + if (!this.opts.store) { + const adapterOpts = Object.assign({}, this.opts); + this.opts.store = loadStore(adapterOpts); + } - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; + if (typeof this.opts.store.on === 'function') { + this.opts.store.on('error', err => this.emit('error', err)); + } - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); -} + this.opts.store.namespace = this.opts.namespace; + } -module.exports = createAssigner; + _getKeyPrefix(key) { + return `${this.opts.namespace}:${key}`; + } + get(key) { + key = this._getKeyPrefix(key); + const store = this.opts.store; + return Promise.resolve() + .then(() => store.get(key)) + .then(data => { + data = (typeof data === 'string') ? this.opts.deserialize(data) : data; + if (data === undefined) { + return undefined; + } + if (typeof data.expires === 'number' && Date.now() > data.expires) { + this.delete(key); + return undefined; + } + return data.value; + }); + } -/***/ }), + set(key, value, ttl) { + key = this._getKeyPrefix(key); + if (typeof ttl === 'undefined') { + ttl = this.opts.ttl; + } + if (ttl === 0) { + ttl = undefined; + } + const store = this.opts.store; -/***/ 59252: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + return Promise.resolve() + .then(() => { + const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null; + value = { value, expires }; + return store.set(key, this.opts.serialize(value), ttl); + }) + .then(() => true); + } -var getNative = __webpack_require__(76028); + delete(key) { + key = this._getKeyPrefix(key); + const store = this.opts.store; + return Promise.resolve() + .then(() => store.delete(key)); + } -var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} -}()); + clear() { + const store = this.opts.store; + return Promise.resolve() + .then(() => store.clear()); + } +} -module.exports = defineProperty; +module.exports = Keyv; /***/ }), -/***/ 34800: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var flatten = __webpack_require__(8708), - overRest = __webpack_require__(216), - setToString = __webpack_require__(65444); - -/** - * A specialized version of `baseRest` which flattens the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ -function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); -} - -module.exports = flatRest; +/***/ 99036: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; -/***/ }), +var LF = '\n'; +var CR = '\r'; +var LinesAndColumns = (function () { + function LinesAndColumns(string) { + this.string = string; + var offsets = [0]; + for (var offset = 0; offset < string.length;) { + switch (string[offset]) { + case LF: + offset += LF.length; + offsets.push(offset); + break; + case CR: + offset += CR.length; + if (string[offset] === LF) { + offset += LF.length; + } + offsets.push(offset); + break; + default: + offset++; + break; + } + } + this.offsets = offsets; + } + LinesAndColumns.prototype.locationForIndex = function (index) { + if (index < 0 || index > this.string.length) { + return null; + } + var line = 0; + var offsets = this.offsets; + while (offsets[line + 1] <= index) { + line++; + } + var column = index - offsets[line]; + return { line: line, column: column }; + }; + LinesAndColumns.prototype.indexForLocation = function (location) { + var line = location.line, column = location.column; + if (line < 0 || line >= this.offsets.length) { + return null; + } + if (column < 0 || column > this.lengthOfLine(line)) { + return null; + } + return this.offsets[line] + column; + }; + LinesAndColumns.prototype.lengthOfLine = function (line) { + var offset = this.offsets[line]; + var nextOffset = line === this.offsets.length - 1 ? this.string.length : this.offsets[line + 1]; + return nextOffset - offset; + }; + return LinesAndColumns; +}()); +exports.__esModule = true; +exports.default = LinesAndColumns; -/***/ 37825: -/***/ ((module) => { -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; +/***/ }), -module.exports = freeGlobal; +/***/ 30815: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; -/***/ }), +const path = __nccwpck_require__(85622); +const fs = __nccwpck_require__(35747); +const {promisify} = __nccwpck_require__(31669); +const pLocate = __nccwpck_require__(60364); -/***/ 18785: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +const fsStat = promisify(fs.stat); +const fsLStat = promisify(fs.lstat); -var baseGetAllKeys = __webpack_require__(98160), - getSymbols = __webpack_require__(5841), - keys = __webpack_require__(50288); +const typeMappings = { + directory: 'isDirectory', + file: 'isFile' +}; -/** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); -} +function checkType({type}) { + if (type in typeMappings) { + return; + } -module.exports = getAllKeys; + throw new Error(`Invalid type specified: ${type}`); +} +const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); -/***/ }), +module.exports = async (paths, options) => { + options = { + cwd: process.cwd(), + type: 'file', + allowSymlinks: true, + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fsStat : fsLStat; -/***/ 54296: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + return pLocate(paths, async path_ => { + try { + const stat = await statFn(path.resolve(options.cwd, path_)); + return matchType(options.type, stat); + } catch (_) { + return false; + } + }, options); +}; -var baseGetAllKeys = __webpack_require__(98160), - getSymbolsIn = __webpack_require__(85468), - keysIn = __webpack_require__(86032); +module.exports.sync = (paths, options) => { + options = { + cwd: process.cwd(), + allowSymlinks: true, + type: 'file', + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; -/** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); -} + for (const path_ of paths) { + try { + const stat = statFn(path.resolve(options.cwd, path_)); -module.exports = getAllKeysIn; + if (matchType(options.type, stat)) { + return path_; + } + } catch (_) { + } + } +}; /***/ }), -/***/ 71198: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 41066: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var isKeyable = __webpack_require__(89958); +var getNative = __nccwpck_require__(76028), + root = __nccwpck_require__(562); -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); -module.exports = getMapData; +module.exports = DataView; /***/ }), -/***/ 76028: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 30731: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var baseIsNative = __webpack_require__(72294), - getValue = __webpack_require__(64413); +var hashClear = __nccwpck_require__(79130), + hashDelete = __nccwpck_require__(93067), + hashGet = __nccwpck_require__(21098), + hashHas = __nccwpck_require__(73949), + hashSet = __nccwpck_require__(48911); /** - * Gets the native function at `key` of `object`. + * Creates a hash object. * * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -module.exports = getNative; - - -/***/ }), - -/***/ 63363: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; -var overArg = __webpack_require__(90570); + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} -/** Built-in value references. */ -var getPrototype = overArg(Object.getPrototypeOf, Object); +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; -module.exports = getPrototype; +module.exports = Hash; /***/ }), -/***/ 32608: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var Symbol = __webpack_require__(39929); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; +/***/ 82746: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; +var listCacheClear = __nccwpck_require__(52523), + listCacheDelete = __nccwpck_require__(19937), + listCacheGet = __nccwpck_require__(15131), + listCacheHas = __nccwpck_require__(89528), + listCacheSet = __nccwpck_require__(51635); /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * Creates an list cache object. * * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - return result; } -module.exports = getRawTag; - - -/***/ }), +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; -/***/ 5841: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +module.exports = ListCache; -var arrayFilter = __webpack_require__(69459), - stubArray = __webpack_require__(87632); -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/***/ }), -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; +/***/ 51105: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; +var getNative = __nccwpck_require__(76028), + root = __nccwpck_require__(562); -/** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); -}; +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); -module.exports = getSymbols; +module.exports = Map; /***/ }), -/***/ 85468: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var arrayPush = __webpack_require__(52061), - getPrototype = __webpack_require__(63363), - getSymbols = __webpack_require__(5841), - stubArray = __webpack_require__(87632); +/***/ 16531: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; +var mapCacheClear = __nccwpck_require__(3489), + mapCacheDelete = __nccwpck_require__(288), + mapCacheGet = __nccwpck_require__(15712), + mapCacheHas = __nccwpck_require__(80369), + mapCacheSet = __nccwpck_require__(66935); /** - * Creates an array of the own and inherited enumerable symbols of `object`. + * Creates a map cache object to store key-value pairs. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - return result; -}; +} -module.exports = getSymbolsIn; +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; /***/ }), -/***/ 207: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 40514: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var DataView = __webpack_require__(41066), - Map = __webpack_require__(51105), - Promise = __webpack_require__(40514), - Set = __webpack_require__(9056), - WeakMap = __webpack_require__(87243), - baseGetTag = __webpack_require__(98653), - toSource = __webpack_require__(98241); +var getNative = __nccwpck_require__(76028), + root = __nccwpck_require__(562); -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - setTag = '[object Set]', - weakMapTag = '[object WeakMap]'; +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); -var dataViewTag = '[object DataView]'; +module.exports = Promise; -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -var getTag = baseGetTag; +/***/ }), -// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; +/***/ 9056: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} +var getNative = __nccwpck_require__(76028), + root = __nccwpck_require__(562); -module.exports = getTag; +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; /***/ }), -/***/ 64413: -/***/ ((module) => { +/***/ 49754: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var ListCache = __nccwpck_require__(82746), + stackClear = __nccwpck_require__(22614), + stackDelete = __nccwpck_require__(24202), + stackGet = __nccwpck_require__(96310), + stackHas = __nccwpck_require__(58721), + stackSet = __nccwpck_require__(90320); /** - * Gets the value at `key` of `object`. + * Creates a stack cache object to store key-value pairs. * * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function getValue(object, key) { - return object == null ? undefined : object[key]; +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; } -module.exports = getValue; - +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; -/***/ }), +module.exports = Stack; -/***/ 23144: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var castPath = __webpack_require__(18963), - isArguments = __webpack_require__(24839), - isArray = __webpack_require__(43364), - isIndex = __webpack_require__(72950), - isLength = __webpack_require__(55752), - toKey = __webpack_require__(30668); +/***/ }), -/** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ -function hasPath(object, path, hasFunc) { - path = castPath(path, object); +/***/ 39929: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var index = -1, - length = path.length, - result = false; +var root = __nccwpck_require__(562); - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); -} +/** Built-in value references. */ +var Symbol = root.Symbol; -module.exports = hasPath; +module.exports = Symbol; /***/ }), -/***/ 79130: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 81918: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var nativeCreate = __webpack_require__(36786); +var root = __nccwpck_require__(562); -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; -} +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; -module.exports = hashClear; +module.exports = Uint8Array; /***/ }), -/***/ 93067: -/***/ ((module) => { - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; -} - -module.exports = hashDelete; - +/***/ 87243: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var getNative = __nccwpck_require__(76028), + root = __nccwpck_require__(562); -/***/ 21098: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); -var nativeCreate = __webpack_require__(36786); +module.exports = WeakMap; -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/***/ }), -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/***/ 99502: +/***/ ((module) => { /** - * Gets the hash value for `key`. + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. * * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); } - return hasOwnProperty.call(data, key) ? data[key] : undefined; + return func.apply(thisArg, args); } -module.exports = hashGet; +module.exports = apply; /***/ }), -/***/ 73949: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var nativeCreate = __webpack_require__(36786); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/***/ 98029: +/***/ ((module) => { /** - * Checks if a hash value for `key` exists. + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. * * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; } -module.exports = hashHas; +module.exports = arrayEach; /***/ }), -/***/ 48911: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var nativeCreate = __webpack_require__(36786); - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; +/***/ 69459: +/***/ ((module) => { /** - * Sets the hash `key` to `value`. + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. * * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. */ -function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; } -module.exports = hashSet; +module.exports = arrayFilter; /***/ }), -/***/ 4025: -/***/ ((module) => { +/***/ 63360: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseTimes = __nccwpck_require__(15683), + isArguments = __nccwpck_require__(24839), + isArray = __nccwpck_require__(43364), + isBuffer = __nccwpck_require__(12963), + isIndex = __nccwpck_require__(72950), + isTypedArray = __nccwpck_require__(53635); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -72763,5541 +59692,4846 @@ var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; /** - * Initializes an array clone. + * Creates an array of the enumerable property names of the array-like `value`. * * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. */ -function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } } return result; } -module.exports = initCloneArray; +module.exports = arrayLikeKeys; /***/ }), -/***/ 27353: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var cloneArrayBuffer = __webpack_require__(18384), - cloneDataView = __webpack_require__(8534), - cloneRegExp = __webpack_require__(86549), - cloneSymbol = __webpack_require__(81731), - cloneTypedArray = __webpack_require__(13817); - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]', - dateTag = '[object Date]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; +/***/ 77680: +/***/ ((module) => { /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. * * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. */ -function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return new Ctor; - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return new Ctor; +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); - case symbolTag: - return cloneSymbol(object); + while (++index < length) { + result[index] = iteratee(array[index], index, array); } + return result; } -module.exports = initCloneByTag; +module.exports = arrayMap; /***/ }), -/***/ 66312: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseCreate = __webpack_require__(14794), - getPrototype = __webpack_require__(63363), - isPrototype = __webpack_require__(4954); +/***/ 52061: +/***/ ((module) => { /** - * Initializes an object clone. + * Appends the elements of `values` to `array`. * * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; } -module.exports = initCloneObject; +module.exports = arrayPush; /***/ }), -/***/ 6426: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 55647: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Symbol = __webpack_require__(39929), - isArguments = __webpack_require__(24839), - isArray = __webpack_require__(43364); +var baseAssignValue = __nccwpck_require__(71850), + eq = __nccwpck_require__(28650); -/** Built-in value references. */ -var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Checks if `value` is a flattenable `arguments` object or array. + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ -function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } } -module.exports = isFlattenable; +module.exports = assignValue; /***/ }), -/***/ 72950: -/***/ ((module) => { - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; +/***/ 886: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; +var eq = __nccwpck_require__(28650); /** - * Checks if `value` is a valid array-like index. + * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. */ -function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; } -module.exports = isIndex; +module.exports = assocIndexOf; /***/ }), -/***/ 78155: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 57361: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var eq = __webpack_require__(28650), - isArrayLike = __webpack_require__(20577), - isIndex = __webpack_require__(72950), - isObject = __webpack_require__(43420); +var copyObject = __nccwpck_require__(83568), + keys = __nccwpck_require__(50288); /** - * Checks if the given arguments are from an iteratee call. + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. * * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. */ -function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); } -module.exports = isIterateeCall; +module.exports = baseAssign; /***/ }), -/***/ 20007: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var isArray = __webpack_require__(43364), - isSymbol = __webpack_require__(82500); +/***/ 86677: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/; +var copyObject = __nccwpck_require__(83568), + keysIn = __nccwpck_require__(86032); /** - * Checks if `value` is a property name and not a property path. + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. * * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. */ -function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); } -module.exports = isKey; +module.exports = baseAssignIn; /***/ }), -/***/ 89958: -/***/ ((module) => { +/***/ 71850: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var defineProperty = __nccwpck_require__(59252); /** - * Checks if `value` is suitable for use as unique object key. + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } } -module.exports = isKeyable; +module.exports = baseAssignValue; /***/ }), -/***/ 16716: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 95570: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Stack = __nccwpck_require__(49754), + arrayEach = __nccwpck_require__(98029), + assignValue = __nccwpck_require__(55647), + baseAssign = __nccwpck_require__(57361), + baseAssignIn = __nccwpck_require__(86677), + cloneBuffer = __nccwpck_require__(82009), + copyArray = __nccwpck_require__(76640), + copySymbols = __nccwpck_require__(85337), + copySymbolsIn = __nccwpck_require__(93017), + getAllKeys = __nccwpck_require__(18785), + getAllKeysIn = __nccwpck_require__(54296), + getTag = __nccwpck_require__(207), + initCloneArray = __nccwpck_require__(4025), + initCloneByTag = __nccwpck_require__(27353), + initCloneObject = __nccwpck_require__(66312), + isArray = __nccwpck_require__(43364), + isBuffer = __nccwpck_require__(12963), + isMap = __nccwpck_require__(13689), + isObject = __nccwpck_require__(43420), + isSet = __nccwpck_require__(81360), + keys = __nccwpck_require__(50288), + keysIn = __nccwpck_require__(86032); -var coreJsData = __webpack_require__(54554); +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; /** - * Checks if `func` has its source masked. + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. * * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -module.exports = isMasked; - +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; -/***/ }), + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; -/***/ 4954: -/***/ ((module) => { + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); -/** Used for built-in method references. */ -var objectProto = Object.prototype; + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); - return value === proto; + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; } -module.exports = isPrototype; +module.exports = baseClone; /***/ }), -/***/ 52523: -/***/ ((module) => { +/***/ 14794: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isObject = __nccwpck_require__(43420); + +/** Built-in value references. */ +var objectCreate = Object.create; /** - * Removes all key-value entries from the list cache. + * The base implementation of `_.create` without support for assigning + * properties to the created object. * * @private - * @name clear - * @memberOf ListCache + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. */ -function listCacheClear() { - this.__data__ = []; - this.size = 0; -} +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); -module.exports = listCacheClear; +module.exports = baseCreate; /***/ }), -/***/ 19937: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var assocIndexOf = __webpack_require__(886); - -/** Used for built-in method references. */ -var arrayProto = Array.prototype; +/***/ 5765: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Built-in value references. */ -var splice = arrayProto.splice; +var arrayPush = __nccwpck_require__(52061), + isFlattenable = __nccwpck_require__(6426); /** - * Removes `key` and its value from the list cache. + * The base implementation of `_.flatten` with support for restricting flattening. * * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } } - --this.size; - return true; + return result; } -module.exports = listCacheDelete; +module.exports = baseFlatten; /***/ }), -/***/ 15131: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 86685: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var assocIndexOf = __webpack_require__(886); +var castPath = __nccwpck_require__(18963), + toKey = __nccwpck_require__(30668); /** - * Gets the list cache value for `key`. + * The base implementation of `_.get` without support for default values. * * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); +function baseGet(object, path) { + path = castPath(path, object); - return index < 0 ? undefined : data[index][1]; + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; } -module.exports = listCacheGet; +module.exports = baseGet; /***/ }), -/***/ 89528: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 98160: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var assocIndexOf = __webpack_require__(886); +var arrayPush = __nccwpck_require__(52061), + isArray = __nccwpck_require__(43364); /** - * Checks if a list cache value for `key` exists. + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. * * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } -module.exports = listCacheHas; +module.exports = baseGetAllKeys; /***/ }), -/***/ 51635: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 98653: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Symbol = __nccwpck_require__(39929), + getRawTag = __nccwpck_require__(32608), + objectToString = __nccwpck_require__(49052); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; -var assocIndexOf = __webpack_require__(886); +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** - * Sets the list cache `key` to `value`. + * The base implementation of `getTag` without fallbacks for buggy environments. * * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; } - return this; + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); } -module.exports = listCacheSet; +module.exports = baseGetTag; /***/ }), -/***/ 3489: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var Hash = __webpack_require__(30731), - ListCache = __webpack_require__(82746), - Map = __webpack_require__(51105); +/***/ 56263: +/***/ ((module) => { /** - * Removes all key-value entries from the map. + * The base implementation of `_.hasIn` without support for deep paths. * * @private - * @name clear - * @memberOf MapCache + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. */ -function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; +function baseHasIn(object, key) { + return object != null && key in Object(object); } -module.exports = mapCacheClear; +module.exports = baseHasIn; /***/ }), -/***/ 288: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 77907: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var getMapData = __webpack_require__(71198); +var baseGetTag = __nccwpck_require__(98653), + isObjectLike = __nccwpck_require__(9111); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; /** - * Removes `key` and its value from the map. + * The base implementation of `_.isArguments`. * * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ -function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; } -module.exports = mapCacheDelete; +module.exports = baseIsArguments; /***/ }), -/***/ 15712: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 81391: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getTag = __nccwpck_require__(207), + isObjectLike = __nccwpck_require__(9111); -var getMapData = __webpack_require__(71198); +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; /** - * Gets the map value for `key`. + * The base implementation of `_.isMap` without Node.js optimizations. * * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; } -module.exports = mapCacheGet; +module.exports = baseIsMap; /***/ }), -/***/ 80369: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 72294: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var getMapData = __webpack_require__(71198); +var isFunction = __nccwpck_require__(66827), + isMasked = __nccwpck_require__(16716), + isObject = __nccwpck_require__(43420), + toSource = __nccwpck_require__(98241); /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -module.exports = mapCacheHas; +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; -/***/ }), +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; -/***/ 66935: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -var getMapData = __webpack_require__(71198); +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); /** - * Sets the map `key` to `value`. + * The base implementation of `_.isNative` without bad shim checks. * * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. */ -function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } -module.exports = mapCacheSet; +module.exports = baseIsNative; /***/ }), -/***/ 46717: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 19472: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var memoize = __webpack_require__(89058); +var getTag = __nccwpck_require__(207), + isObjectLike = __nccwpck_require__(9111); -/** Used as the maximum memoize cache size. */ -var MAX_MEMOIZE_SIZE = 500; +/** `Object#toString` result references. */ +var setTag = '[object Set]'; /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * The base implementation of `_.isSet` without Node.js optimizations. * * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ -function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; } -module.exports = memoizeCapped; +module.exports = baseIsSet; /***/ }), -/***/ 36786: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 86944: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var getNative = __webpack_require__(76028); +var baseGetTag = __nccwpck_require__(98653), + isLength = __nccwpck_require__(55752), + isObjectLike = __nccwpck_require__(9111); -/* Built-in method references that are verified to be native. */ -var nativeCreate = getNative(Object, 'create'); +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; -module.exports = nativeCreate; +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; -/***/ }), +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} -/***/ 11491: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +module.exports = baseIsTypedArray; -var overArg = __webpack_require__(90570); -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object); +/***/ }), -module.exports = nativeKeys; +/***/ 24787: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var isPrototype = __nccwpck_require__(4954), + nativeKeys = __nccwpck_require__(11491); -/***/ }), +/** Used for built-in method references. */ +var objectProto = Object.prototype; -/***/ 43101: -/***/ ((module) => { +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ -function nativeKeysIn(object) { +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } var result = []; - if (object != null) { - for (var key in Object(object)) { + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } -module.exports = nativeKeysIn; +module.exports = baseKeys; /***/ }), -/***/ 62470: -/***/ ((module, exports, __webpack_require__) => { - -/* module decorator */ module = __webpack_require__.nmd(module); -var freeGlobal = __webpack_require__(37825); - -/** Detect free variable `exports`. */ -var freeExports = true && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; - -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); - -module.exports = nodeUtil; - - -/***/ }), +/***/ 14535: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ 49052: -/***/ ((module) => { +var isObject = __nccwpck_require__(43420), + isPrototype = __nccwpck_require__(4954), + nativeKeysIn = __nccwpck_require__(43101); /** Used for built-in method references. */ var objectProto = Object.prototype; -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); -} - -module.exports = objectToString; - - -/***/ }), - -/***/ 90570: -/***/ ((module) => { - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -module.exports = overArg; - - -/***/ }), - -/***/ 216: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var apply = __webpack_require__(99502); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * A specialized version of `baseRest` which transforms the rest array. + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ -function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; -} - -module.exports = overRest; - - -/***/ }), - -/***/ 562: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var freeGlobal = __webpack_require__(37825); - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} -module.exports = root; +module.exports = baseKeysIn; /***/ }), -/***/ 65444: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 3529: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var baseSetToString = __webpack_require__(3503), - shortOut = __webpack_require__(10697); +var basePickBy = __nccwpck_require__(85041), + hasIn = __nccwpck_require__(14426); /** - * Sets the `toString` method of `func` to return `string`. + * The base implementation of `_.pick` without support for individual + * property identifiers. * * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. */ -var setToString = shortOut(baseSetToString); +function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); +} -module.exports = setToString; +module.exports = basePick; /***/ }), -/***/ 10697: -/***/ ((module) => { - -/** Used to detect hot functions by number of calls within a span of milliseconds. */ -var HOT_COUNT = 800, - HOT_SPAN = 16; +/***/ 85041: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeNow = Date.now; +var baseGet = __nccwpck_require__(86685), + baseSet = __nccwpck_require__(90374), + castPath = __nccwpck_require__(18963); /** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. + * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. */ -function shortOut(func) { - var count = 0, - lastCalled = 0; +function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); } - return func.apply(undefined, arguments); - }; + } + return result; } -module.exports = shortOut; +module.exports = basePickBy; /***/ }), -/***/ 22614: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 31428: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var ListCache = __webpack_require__(82746); +var identity = __nccwpck_require__(57460), + overRest = __nccwpck_require__(216), + setToString = __nccwpck_require__(65444); /** - * Removes all key-value entries from the stack. + * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private - * @name clear - * @memberOf Stack + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. */ -function stackClear() { - this.__data__ = new ListCache; - this.size = 0; +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); } -module.exports = stackClear; +module.exports = baseRest; /***/ }), -/***/ 24202: -/***/ ((module) => { +/***/ 90374: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var assignValue = __nccwpck_require__(55647), + castPath = __nccwpck_require__(18963), + isIndex = __nccwpck_require__(72950), + isObject = __nccwpck_require__(43420), + toKey = __nccwpck_require__(30668); /** - * Removes `key` and its value from the stack. + * The base implementation of `_.set`. * * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. */ -function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); +function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); - this.size = data.size; - return result; + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; } -module.exports = stackDelete; +module.exports = baseSet; /***/ }), -/***/ 96310: -/***/ ((module) => { +/***/ 3503: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var constant = __nccwpck_require__(66915), + defineProperty = __nccwpck_require__(59252), + identity = __nccwpck_require__(57460); /** - * Gets the stack value for `key`. + * The base implementation of `setToString` without support for hot loop shorting. * * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. */ -function stackGet(key) { - return this.__data__.get(key); -} +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; -module.exports = stackGet; +module.exports = baseSetToString; /***/ }), -/***/ 58721: +/***/ 15683: /***/ ((module) => { /** - * Checks if a stack value for `key` exists. + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. * * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. */ -function stackHas(key) { - return this.__data__.has(key); +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; } -module.exports = stackHas; +module.exports = baseTimes; /***/ }), -/***/ 90320: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 74851: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var ListCache = __webpack_require__(82746), - Map = __webpack_require__(51105), - MapCache = __webpack_require__(16531); +var Symbol = __nccwpck_require__(39929), + arrayMap = __nccwpck_require__(77680), + isArray = __nccwpck_require__(43364), + isSymbol = __nccwpck_require__(82500); -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; /** - * Sets the stack `key` to `value`. + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. * * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. + * @param {*} value The value to process. + * @returns {string} Returns the string. */ -function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; } - data.set(key, value); - this.size = data.size; - return this; + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } -module.exports = stackSet; +module.exports = baseToString; /***/ }), -/***/ 35725: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var memoizeCapped = __webpack_require__(46717); - -/** Used to match property names within property paths. */ -var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; +/***/ 83717: +/***/ ((module) => { /** - * Converts `string` to a property path array. + * The base implementation of `_.unary` without support for storing metadata. * * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. */ -var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46 /* . */) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; -}); +function baseUnary(func) { + return function(value) { + return func(value); + }; +} -module.exports = stringToPath; +module.exports = baseUnary; /***/ }), -/***/ 30668: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var isSymbol = __webpack_require__(82500); +/***/ 18963: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; +var isArray = __nccwpck_require__(43364), + isKey = __nccwpck_require__(20007), + stringToPath = __nccwpck_require__(35725), + toString = __nccwpck_require__(49228); /** - * Converts `value` to a string key if it's not a string or symbol. + * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { +function castPath(value, object) { + if (isArray(value)) { return value; } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + return isKey(value, object) ? [value] : stringToPath(toString(value)); } -module.exports = toKey; +module.exports = castPath; /***/ }), -/***/ 98241: -/***/ ((module) => { - -/** Used for built-in method references. */ -var funcProto = Function.prototype; +/***/ 18384: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +var Uint8Array = __nccwpck_require__(81918); /** - * Converts `func` to its source code. + * Creates a clone of `arrayBuffer`. * * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; } -module.exports = toSource; +module.exports = cloneArrayBuffer; /***/ }), -/***/ 66690: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var assignValue = __webpack_require__(55647), - copyObject = __webpack_require__(83568), - createAssigner = __webpack_require__(21479), - isArrayLike = __webpack_require__(20577), - isPrototype = __webpack_require__(4954), - keys = __webpack_require__(50288); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } - */ -var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); - } - } -}); - -module.exports = assign; +/***/ 82009: +/***/ ((module, exports, __nccwpck_require__) => { +/* module decorator */ module = __nccwpck_require__.nmd(module); +var root = __nccwpck_require__(562); -/***/ }), +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; -/***/ 31471: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; -var baseClone = __webpack_require__(95570); +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; -/** Used to compose bitmasks for cloning. */ -var CLONE_SYMBOLS_FLAG = 4; +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * Creates a clone of `buffer`. * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. */ -function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; } -module.exports = clone; +module.exports = cloneBuffer; /***/ }), -/***/ 66915: -/***/ ((module) => { +/***/ 8534: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var cloneArrayBuffer = __nccwpck_require__(18384); /** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] + * Creates a clone of `dataView`. * - * console.log(objects[0] === objects[1]); - * // => true + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. */ -function constant(value) { - return function() { - return value; - }; +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } -module.exports = constant; +module.exports = cloneDataView; /***/ }), -/***/ 28650: +/***/ 86549: /***/ ((module) => { +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false + * Creates a clone of `regexp`. * - * _.eq(NaN, NaN); - * // => true + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. */ -function eq(value, other) { - return value === other || (value !== value && other !== other); +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; } -module.exports = eq; +module.exports = cloneRegExp; /***/ }), -/***/ 8708: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 81731: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Symbol = __nccwpck_require__(39929); -var baseFlatten = __webpack_require__(5765); +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example + * Creates a clone of the `symbol` object. * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. */ -function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } -module.exports = flatten; +module.exports = cloneSymbol; /***/ }), -/***/ 14426: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 13817: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var baseHasIn = __webpack_require__(56263), - hasPath = __webpack_require__(23144); +var cloneArrayBuffer = __nccwpck_require__(18384); /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true + * Creates a clone of `typedArray`. * - * _.hasIn(object, 'b'); - * // => false + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. */ -function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } -module.exports = hasIn; +module.exports = cloneTypedArray; /***/ }), -/***/ 57460: +/***/ 76640: /***/ ((module) => { /** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; + * Copies the values of `source` to `array`. * - * console.log(_.identity(object) === object); - * // => true + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. */ -function identity(value) { - return value; +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; } -module.exports = identity; +module.exports = copyArray; /***/ }), -/***/ 24839: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseIsArguments = __webpack_require__(77907), - isObjectLike = __webpack_require__(9111); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/***/ 83568: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; +var assignValue = __nccwpck_require__(55647), + baseAssignValue = __nccwpck_require__(71850); /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true + * Copies properties of `source` to `object`. * - * _.isArguments([1, 2, 3]); - * // => false + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. */ -var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); -}; +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); -module.exports = isArguments; + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; /***/ }), -/***/ 43364: -/***/ ((module) => { +/***/ 85337: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var copyObject = __nccwpck_require__(83568), + getSymbols = __nccwpck_require__(5841); /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false + * Copies own symbols of `source` to `object`. * - * _.isArray(_.noop); - * // => false + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. */ -var isArray = Array.isArray; +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} -module.exports = isArray; +module.exports = copySymbols; /***/ }), -/***/ 20577: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 93017: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var isFunction = __webpack_require__(66827), - isLength = __webpack_require__(55752); +var copyObject = __nccwpck_require__(83568), + getSymbolsIn = __nccwpck_require__(85468); /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true + * Copies own and inherited symbols of `source` to `object`. * - * _.isArrayLike(_.noop); - * // => false + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); +function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); } -module.exports = isArrayLike; +module.exports = copySymbolsIn; /***/ }), -/***/ 12963: -/***/ ((module, exports, __webpack_require__) => { +/***/ 54554: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* module decorator */ module = __webpack_require__.nmd(module); -var root = __webpack_require__(562), - stubFalse = __webpack_require__(90377); +var root = __nccwpck_require__(562); -/** Detect free variable `exports`. */ -var freeExports = true && exports && !exports.nodeType && exports; +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; -/** Detect free variable `module`. */ -var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; +module.exports = coreJsData; -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; +/***/ }), -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; +/***/ 21479: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseRest = __nccwpck_require__(31428), + isIterateeCall = __nccwpck_require__(78155); /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true + * Creates a function like `_.assign`. * - * _.isBuffer(new Uint8Array(2)); - * // => false + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. */ -var isBuffer = nativeIsBuffer || stubFalse; +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; -module.exports = isBuffer; + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} -/***/ }), +module.exports = createAssigner; -/***/ 66827: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var baseGetTag = __webpack_require__(98653), - isObject = __webpack_require__(43420); +/***/ }), -/** `Object#toString` result references. */ -var asyncTag = '[object AsyncFunction]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - proxyTag = '[object Proxy]'; +/***/ 59252: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; -} +var getNative = __nccwpck_require__(76028); -module.exports = isFunction; +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; /***/ }), -/***/ 55752: -/***/ ((module) => { +/***/ 34800: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; +var flatten = __nccwpck_require__(8708), + overRest = __nccwpck_require__(216), + setToString = __nccwpck_require__(65444); /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false + * A specialized version of `baseRest` which flattens the rest array. * - * _.isLength('3'); - * // => false + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); } -module.exports = isLength; +module.exports = flatRest; /***/ }), -/***/ 13689: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseIsMap = __webpack_require__(81391), - baseUnary = __webpack_require__(83717), - nodeUtil = __webpack_require__(62470); - -/* Node.js helper references. */ -var nodeIsMap = nodeUtil && nodeUtil.isMap; +/***/ 37825: +/***/ ((module) => { -/** - * Checks if `value` is classified as a `Map` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - * @example - * - * _.isMap(new Map); - * // => true - * - * _.isMap(new WeakMap); - * // => false - */ -var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; -module.exports = isMap; +module.exports = freeGlobal; /***/ }), -/***/ 43420: -/***/ ((module) => { +/***/ 18785: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseGetAllKeys = __nccwpck_require__(98160), + getSymbols = __nccwpck_require__(5841), + keys = __nccwpck_require__(50288); /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true + * Creates an array of own enumerable property names and symbols of `object`. * - * _.isObject(null); - * // => false + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); } -module.exports = isObject; +module.exports = getAllKeys; /***/ }), -/***/ 9111: -/***/ ((module) => { +/***/ 54296: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseGetAllKeys = __nccwpck_require__(98160), + getSymbolsIn = __nccwpck_require__(85468), + keysIn = __nccwpck_require__(86032); /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. * - * _.isObjectLike(null); - * // => false + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); } -module.exports = isObjectLike; +module.exports = getAllKeysIn; /***/ }), -/***/ 81360: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseIsSet = __webpack_require__(19472), - baseUnary = __webpack_require__(83717), - nodeUtil = __webpack_require__(62470); +/***/ 71198: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* Node.js helper references. */ -var nodeIsSet = nodeUtil && nodeUtil.isSet; +var isKeyable = __nccwpck_require__(89958); /** - * Checks if `value` is classified as a `Set` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - * @example - * - * _.isSet(new Set); - * // => true + * Gets the data for `map`. * - * _.isSet(new WeakSet); - * // => false + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. */ -var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} -module.exports = isSet; +module.exports = getMapData; /***/ }), -/***/ 82500: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseGetTag = __webpack_require__(98653), - isObjectLike = __webpack_require__(9111); +/***/ 76028: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; +var baseIsNative = __nccwpck_require__(72294), + getValue = __nccwpck_require__(64413); /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true + * Gets the native function at `key` of `object`. * - * _.isSymbol('abc'); - * // => false + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; } -module.exports = isSymbol; +module.exports = getNative; /***/ }), -/***/ 53635: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 63363: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var baseIsTypedArray = __webpack_require__(86944), - baseUnary = __webpack_require__(83717), - nodeUtil = __webpack_require__(62470); +var overArg = __nccwpck_require__(90570); -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; + + +/***/ }), + +/***/ 32608: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Symbol = __nccwpck_require__(39929); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * - * _.isTypedArray([]); - * // => false + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; -module.exports = isTypedArray; + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; /***/ }), -/***/ 50288: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 5841: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var arrayLikeKeys = __webpack_require__(63360), - baseKeys = __webpack_require__(24787), - isArrayLike = __webpack_require__(20577); +var arrayFilter = __nccwpck_require__(69459), + stubArray = __nccwpck_require__(87632); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. + * Creates an array of the own enumerable symbols of `object`. * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object + * @private * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] + * @returns {Array} Returns the array of symbols. */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; -module.exports = keys; +module.exports = getSymbols; /***/ }), -/***/ 86032: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 85468: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var arrayLikeKeys = __webpack_require__(63360), - baseKeysIn = __webpack_require__(14535), - isArrayLike = __webpack_require__(20577); +var arrayPush = __nccwpck_require__(52061), + getPrototype = __nccwpck_require__(63363), + getSymbols = __nccwpck_require__(5841), + stubArray = __nccwpck_require__(87632); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. + * Creates an array of the own and inherited enumerable symbols of `object`. * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object + * @private * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + * @returns {Array} Returns the array of symbols. */ -function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); -} +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; -module.exports = keysIn; +module.exports = getSymbolsIn; /***/ }), -/***/ 89058: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 207: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var MapCache = __webpack_require__(16531); +var DataView = __nccwpck_require__(41066), + Map = __nccwpck_require__(51105), + Promise = __nccwpck_require__(40514), + Set = __nccwpck_require__(9056), + WeakMap = __nccwpck_require__(87243), + baseGetTag = __nccwpck_require__(98653), + toSource = __nccwpck_require__(98241); -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] + * Gets the `toStringTag` of `value`. * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; +var getTag = baseGetTag; - if (cache.has(key)) { - return cache.get(key); +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; return result; }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; } -// Expose `MapCache`. -memoize.Cache = MapCache; - -module.exports = memoize; +module.exports = getTag; /***/ }), -/***/ 53651: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var basePick = __webpack_require__(3529), - flatRest = __webpack_require__(34800); +/***/ 64413: +/***/ ((module) => { /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * Gets the value at `key` of `object`. * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. */ -var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); -}); +function getValue(object, key) { + return object == null ? undefined : object[key]; +} -module.exports = pick; +module.exports = getValue; /***/ }), -/***/ 87632: -/***/ ((module) => { +/***/ 23144: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var castPath = __nccwpck_require__(18963), + isArguments = __nccwpck_require__(24839), + isArray = __nccwpck_require__(43364), + isIndex = __nccwpck_require__(72950), + isLength = __nccwpck_require__(55752), + toKey = __nccwpck_require__(30668); /** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] + * Checks if `path` exists on `object`. * - * console.log(arrays[0] === arrays[1]); - * // => false + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. */ -function stubArray() { - return []; +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); } -module.exports = stubArray; +module.exports = hasPath; /***/ }), -/***/ 90377: -/***/ ((module) => { +/***/ 79130: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var nativeCreate = __nccwpck_require__(36786); /** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example + * Removes all key-value entries from the hash. * - * _.times(2, _.stubFalse); - * // => [false, false] + * @private + * @name clear + * @memberOf Hash */ -function stubFalse() { - return false; +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } -module.exports = stubFalse; +module.exports = hashClear; /***/ }), -/***/ 49228: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseToString = __webpack_require__(74851); +/***/ 93067: +/***/ ((module) => { /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' + * Removes `key` and its value from the hash. * - * _.toString([1, 2, 3]); - * // => '1,2,3' + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ -function toString(value) { - return value == null ? '' : baseToString(value); +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; } -module.exports = toString; +module.exports = hashDelete; /***/ }), -/***/ 87279: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 21098: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var nativeCreate = __nccwpck_require__(36786); -const chalk = __webpack_require__(22607); +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; -const isSupported = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color'; +/** Used for built-in method references. */ +var objectProto = Object.prototype; -const main = { - info: chalk.blue('ℹ'), - success: chalk.green('✔'), - warning: chalk.yellow('⚠'), - error: chalk.red('✖') -}; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -const fallbacks = { - info: chalk.blue('i'), - success: chalk.green('√'), - warning: chalk.yellow('‼'), - error: chalk.red('×') -}; +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} -module.exports = isSupported ? main : fallbacks; +module.exports = hashGet; /***/ }), -/***/ 22607: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 73949: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var nativeCreate = __nccwpck_require__(36786); -const ansiStyles = __webpack_require__(58588); -const {stdout: stdoutColor, stderr: stderrColor} = __webpack_require__(28106); -const { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -} = __webpack_require__(78984); +/** Used for built-in method references. */ +var objectProto = Object.prototype; -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = [ - 'ansi', - 'ansi', - 'ansi256', - 'ansi16m' -]; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +module.exports = hashHas; -const styles = Object.create(null); -const applyOptions = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error('The `level` option should be an integer from 0 to 3'); - } +/***/ }), - // Detect level if not set manually - const colorLevel = stdoutColor ? stdoutColor.level : 0; - object.level = options.level === undefined ? colorLevel : options.level; -}; +/***/ 48911: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -class ChalkClass { - constructor(options) { - // eslint-disable-next-line no-constructor-return - return chalkFactory(options); - } +var nativeCreate = __nccwpck_require__(36786); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; } -const chalkFactory = options => { - const chalk = {}; - applyOptions(chalk, options); +module.exports = hashSet; - chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); +/***/ }), - chalk.template.constructor = () => { - throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); - }; +/***/ 4025: +/***/ ((module) => { - chalk.template.Instance = ChalkClass; +/** Used for built-in method references. */ +var objectProto = Object.prototype; - return chalk.template; -}; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -function Chalk(options) { - return chalkFactory(options); -} +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); -for (const [styleName, style] of Object.entries(ansiStyles)) { - styles[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); - Object.defineProperty(this, styleName, {value: builder}); - return builder; - } - }; + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; } -styles.visible = { - get() { - const builder = createBuilder(this, this._styler, true); - Object.defineProperty(this, 'visible', {value: builder}); - return builder; - } -}; +module.exports = initCloneArray; -const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; -for (const model of usedModels) { - styles[model] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; -} +/***/ }), -for (const model of usedModels) { - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; -} +/***/ 27353: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const proto = Object.defineProperties(() => {}, { - ...styles, - level: { - enumerable: true, - get() { - return this._generator.level; - }, - set(level) { - this._generator.level = level; - } - } -}); +var cloneArrayBuffer = __nccwpck_require__(18384), + cloneDataView = __nccwpck_require__(8534), + cloneRegExp = __nccwpck_require__(86549), + cloneSymbol = __nccwpck_require__(81731), + cloneTypedArray = __nccwpck_require__(13817); -const createStyler = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === undefined) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; - return { - open, - close, - openAll, - closeAll, - parent - }; -}; +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; -const createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => { - // Single argument is hot path, implicit coercion is faster than anything - // eslint-disable-next-line no-implicit-coercion - return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); - }; +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); - // We alter the prototype because we must return a function, but there is - // no way to create a function with a different prototype - Object.setPrototypeOf(builder, proto); + case boolTag: + case dateTag: + return new Ctor(+object); - builder._generator = self; - builder._styler = _styler; - builder._isEmpty = _isEmpty; + case dataViewTag: + return cloneDataView(object, isDeep); - return builder; -}; + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); -const applyStyle = (self, string) => { - if (self.level <= 0 || !string) { - return self._isEmpty ? '' : string; - } + case mapTag: + return new Ctor; - let styler = self._styler; + case numberTag: + case stringTag: + return new Ctor(object); - if (styler === undefined) { - return string; - } + case regexpTag: + return cloneRegExp(object); - const {openAll, closeAll} = styler; - if (string.indexOf('\u001B') !== -1) { - while (styler !== undefined) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - string = stringReplaceAll(string, styler.close, styler.open); + case setTag: + return new Ctor; - styler = styler.parent; - } - } + case symbolTag: + return cloneSymbol(object); + } +} - // We can move both next actions out of loop, because remaining actions in loop won't have - // any/visible effect on parts we add here. Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 - const lfIndex = string.indexOf('\n'); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); - } +module.exports = initCloneByTag; - return openAll + string + closeAll; -}; -let template; -const chalkTag = (chalk, ...strings) => { - const [firstString] = strings; +/***/ }), - if (!Array.isArray(firstString)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return strings.join(' '); - } +/***/ 66312: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const arguments_ = strings.slice(1); - const parts = [firstString.raw[0]]; +var baseCreate = __nccwpck_require__(14794), + getPrototype = __nccwpck_require__(63363), + isPrototype = __nccwpck_require__(4954); - for (let i = 1; i < firstString.length; i++) { - parts.push( - String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), - String(firstString.raw[i]) - ); - } +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} - if (template === undefined) { - template = __webpack_require__(55790); - } +module.exports = initCloneObject; - return template(chalk, parts.join('')); -}; -Object.defineProperties(Chalk.prototype, styles); +/***/ }), -const chalk = Chalk(); // eslint-disable-line new-cap -chalk.supportsColor = stdoutColor; -chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap -chalk.stderr.supportsColor = stderrColor; +/***/ 6426: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = chalk; +var Symbol = __nccwpck_require__(39929), + isArguments = __nccwpck_require__(24839), + isArray = __nccwpck_require__(43364); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +module.exports = isFlattenable; /***/ }), -/***/ 55790: +/***/ 72950: /***/ ((module) => { -"use strict"; +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; -const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; -const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; -const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; -const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; -const ESCAPES = new Map([ - ['n', '\n'], - ['r', '\r'], - ['t', '\t'], - ['b', '\b'], - ['f', '\f'], - ['v', '\v'], - ['0', '\0'], - ['\\', '\\'], - ['e', '\u001B'], - ['a', '\u0007'] -]); +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; -function unescape(c) { - const u = c[0] === 'u'; - const bracket = c[1] === '{'; + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} - if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { - return String.fromCharCode(parseInt(c.slice(1), 16)); - } +module.exports = isIndex; - if (u && bracket) { - return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); - } - return ESCAPES.get(c) || c; -} +/***/ }), -function parseArguments(name, arguments_) { - const results = []; - const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches; +/***/ 78155: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - for (const chunk of chunks) { - const number = Number(chunk); - if (!Number.isNaN(number)) { - results.push(number); - } else if ((matches = chunk.match(STRING_REGEX))) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } - } +var eq = __nccwpck_require__(28650), + isArrayLike = __nccwpck_require__(20577), + isIndex = __nccwpck_require__(72950), + isObject = __nccwpck_require__(43420); - return results; +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; } -function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; +module.exports = isIterateeCall; - const results = []; - let matches; - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; +/***/ }), - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } - } +/***/ 20007: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return results; -} +var isArray = __nccwpck_require__(43364), + isSymbol = __nccwpck_require__(82500); -function buildStyle(chalk, styles) { - const enabled = {}; +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} - let current = chalk; - for (const [styleName, styles] of Object.entries(enabled)) { - if (!Array.isArray(styles)) { - continue; - } +module.exports = isKey; - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } - current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; - } +/***/ }), - return current; +/***/ 89958: +/***/ ((module) => { + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); } -module.exports = (chalk, temporary) => { - const styles = []; - const chunks = []; - let chunk = []; +module.exports = isKeyable; - // eslint-disable-next-line max-params - temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { - if (escapeCharacter) { - chunk.push(unescape(escapeCharacter)); - } else if (style) { - const string = chunk.join(''); - chunk = []; - chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); - styles.push({inverse, styles: parseStyle(style)}); - } else if (close) { - if (styles.length === 0) { - throw new Error('Found extraneous } in Chalk template literal'); - } - chunks.push(buildStyle(chalk, styles)(chunk.join(''))); - chunk = []; - styles.pop(); - } else { - chunk.push(character); - } - }); +/***/ }), - chunks.push(chunk.join('')); +/***/ 16716: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (styles.length > 0) { - const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; - throw new Error(errMessage); - } +var coreJsData = __nccwpck_require__(54554); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} - return chunks.join(''); -}; +module.exports = isMasked; /***/ }), -/***/ 78984: +/***/ 4954: /***/ ((module) => { -"use strict"; - - -const stringReplaceAll = (string, substring, replacer) => { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } - - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ''; - do { - returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); - - returnValue += string.substr(endIndex); - return returnValue; -}; +/** Used for built-in method references. */ +var objectProto = Object.prototype; -const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { - let endIndex = 0; - let returnValue = ''; - do { - const gotCR = string[index - 1] === '\r'; - returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; - endIndex = index + 1; - index = string.indexOf('\n', endIndex); - } while (index !== -1); +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - returnValue += string.substr(endIndex); - return returnValue; -}; + return value === proto; +} -module.exports = { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -}; +module.exports = isPrototype; /***/ }), -/***/ 18984: +/***/ 52523: /***/ ((module) => { -"use strict"; +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} -module.exports = function (obj) { - var ret = {}; - var keys = Object.keys(Object(obj)); +module.exports = listCacheClear; - for (var i = 0; i < keys.length; i++) { - ret[keys[i].toLowerCase()] = obj[keys[i]]; - } - return ret; -}; +/***/ }), +/***/ 19937: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var assocIndexOf = __nccwpck_require__(886); -/***/ 90293: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/** Used for built-in method references. */ +var arrayProto = Array.prototype; -"use strict"; +/** Built-in value references. */ +var splice = arrayProto.splice; -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const {promisify} = __webpack_require__(31669); -const semver = __webpack_require__(41124); +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); -const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0'); + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); +module.exports = listCacheDelete; - if (pathHasInvalidWinCharacters) { - const error = new Error(`Path contains invalid characters: ${pth}`); - error.code = 'EINVAL'; - throw error; - } - } -}; -const processOptions = options => { - // https://github.com/sindresorhus/make-dir/issues/18 - const defaults = { - mode: 0o777, - fs - }; +/***/ }), - return { - ...defaults, - ...options - }; -}; +/***/ 15131: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const permissionError = pth => { - // This replicates the exception of `fs.mkdir` with native the - // `recusive` option when run on an invalid drive under Windows. - const error = new Error(`operation not permitted, mkdir '${pth}'`); - error.code = 'EPERM'; - error.errno = -4048; - error.path = pth; - error.syscall = 'mkdir'; - return error; -}; +var assocIndexOf = __nccwpck_require__(886); -const makeDir = async (input, options) => { - checkPath(input); - options = processOptions(options); +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); - const mkdir = promisify(options.fs.mkdir); - const stat = promisify(options.fs.stat); + return index < 0 ? undefined : data[index][1]; +} - if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) { - const pth = path.resolve(input); +module.exports = listCacheGet; - await mkdir(pth, { - mode: options.mode, - recursive: true - }); - return pth; - } +/***/ }), - const make = async pth => { - try { - await mkdir(pth, options.mode); +/***/ 89528: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return pth; - } catch (error) { - if (error.code === 'EPERM') { - throw error; - } +var assocIndexOf = __nccwpck_require__(886); - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw permissionError(pth); - } +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} - if (error.message.includes('null bytes')) { - throw error; - } +module.exports = listCacheHas; - await make(path.dirname(pth)); - return make(pth); - } +/***/ }), - try { - const stats = await stat(pth); - if (!stats.isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw error; - } +/***/ 51635: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return pth; - } - }; +var assocIndexOf = __nccwpck_require__(886); - return make(path.resolve(input)); -}; +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); -module.exports = makeDir; + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} -module.exports.sync = (input, options) => { - checkPath(input); - options = processOptions(options); +module.exports = listCacheSet; - if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) { - const pth = path.resolve(input); - fs.mkdirSync(pth, { - mode: options.mode, - recursive: true - }); +/***/ }), - return pth; - } +/***/ 3489: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const make = pth => { - try { - options.fs.mkdirSync(pth, options.mode); - } catch (error) { - if (error.code === 'EPERM') { - throw error; - } +var Hash = __nccwpck_require__(30731), + ListCache = __nccwpck_require__(82746), + Map = __nccwpck_require__(51105); - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw permissionError(pth); - } +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} - if (error.message.includes('null bytes')) { - throw error; - } +module.exports = mapCacheClear; - make(path.dirname(pth)); - return make(pth); - } - try { - if (!options.fs.statSync(pth).isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw error; - } - } +/***/ }), - return pth; - }; +/***/ 288: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return make(path.resolve(input)); -}; +var getMapData = __nccwpck_require__(71198); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +module.exports = mapCacheDelete; /***/ }), -/***/ 41124: -/***/ ((module, exports) => { +/***/ 15712: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -exports = module.exports = SemVer +var getMapData = __nccwpck_require__(71198); -var debug -/* istanbul ignore next */ -if (typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift('SEMVER') - console.log.apply(console, args) - } -} else { - debug = function () {} +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); } -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0' +module.exports = mapCacheGet; -var MAX_LENGTH = 256 -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16 +/***/ }), -// The actual regexps go on exports.re -var re = exports.re = [] -var src = exports.src = [] -var t = exports.tokens = {} -var R = 0 +/***/ 80369: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function tok (n) { - t[n] = R++ -} +var getMapData = __nccwpck_require__(71198); -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. +module.exports = mapCacheHas; -tok('NUMERICIDENTIFIER') -src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' -tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. +/***/ }), -tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' +/***/ 66935: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// ## Main Version -// Three dot-separated numeric identifiers. +var getMapData = __nccwpck_require__(71198); -tok('MAINVERSION') -src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')' +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; -tok('MAINVERSIONLOOSE') -src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. +module.exports = mapCacheSet; -tok('PRERELEASEIDENTIFIER') -src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' -tok('PRERELEASEIDENTIFIERLOOSE') -src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' +/***/ }), -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. +/***/ 46717: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -tok('PRERELEASE') -src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' +var memoize = __nccwpck_require__(89058); -tok('PRERELEASELOOSE') -src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); -tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' + var cache = result.cache; + return result; +} -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. +module.exports = memoizeCapped; -tok('BUILD') -src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + - '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. +/***/ }), -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. +/***/ 36786: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -tok('FULL') -tok('FULLPLAIN') -src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + - src[t.PRERELEASE] + '?' + - src[t.BUILD] + '?' +var getNative = __nccwpck_require__(76028); -src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -tok('LOOSEPLAIN') -src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + - src[t.PRERELEASELOOSE] + '?' + - src[t.BUILD] + '?' +module.exports = nativeCreate; -tok('LOOSE') -src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' -tok('GTLT') -src[t.GTLT] = '((?:<|>)?=?)' +/***/ }), -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -tok('XRANGEIDENTIFIERLOOSE') -src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' -tok('XRANGEIDENTIFIER') -src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' +/***/ 11491: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -tok('XRANGEPLAIN') -src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:' + src[t.PRERELEASE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' +var overArg = __nccwpck_require__(90570); -tok('XRANGEPLAINLOOSE') -src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[t.PRERELEASELOOSE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); -tok('XRANGE') -src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' -tok('XRANGELOOSE') -src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' +module.exports = nativeKeys; -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -tok('COERCE') -src[t.COERCE] = '(^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])' -tok('COERCERTL') -re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') -// Tilde ranges. -// Meaning is "reasonably at or greater than" -tok('LONETILDE') -src[t.LONETILDE] = '(?:~>?)' +/***/ }), -tok('TILDETRIM') -src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' -re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') -var tildeTrimReplace = '$1~' +/***/ 43101: +/***/ ((module) => { -tok('TILDE') -src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' -tok('TILDELOOSE') -src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} -// Caret ranges. -// Meaning is "at least and backwards compatible with" -tok('LONECARET') -src[t.LONECARET] = '(?:\\^)' +module.exports = nativeKeysIn; -tok('CARETTRIM') -src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' -re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') -var caretTrimReplace = '$1^' -tok('CARET') -src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' -tok('CARETLOOSE') -src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' +/***/ }), -// A simple gt/lt/eq thing, or just "" to indicate "any version" -tok('COMPARATORLOOSE') -src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' -tok('COMPARATOR') -src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' +/***/ 62470: +/***/ ((module, exports, __nccwpck_require__) => { -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -tok('COMPARATORTRIM') -src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + - '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' +/* module decorator */ module = __nccwpck_require__.nmd(module); +var freeGlobal = __nccwpck_require__(37825); -// this one has to use the /g flag -re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') -var comparatorTrimReplace = '$1$2$3' +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -tok('HYPHENRANGE') -src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAIN] + ')' + - '\\s*$' +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; -tok('HYPHENRANGELOOSE') -src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s*$' +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; -// Star ranges basically just allow anything at all. -tok('STAR') -src[t.STAR] = '(<|>)?=?\\s*\\*' +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]) - if (!re[i]) { - re[i] = new RegExp(src[i]) - } -} +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; -exports.parse = parse -function parse (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false + if (types) { + return types; } - } - if (version instanceof SemVer) { - return version - } + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); - if (typeof version !== 'string') { - return null - } +module.exports = nodeUtil; - if (version.length > MAX_LENGTH) { - return null - } - var r = options.loose ? re[t.LOOSE] : re[t.FULL] - if (!r.test(version)) { - return null - } +/***/ }), - try { - return new SemVer(version, options) - } catch (er) { - return null - } -} +/***/ 49052: +/***/ ((module) => { -exports.valid = valid -function valid (version, options) { - var v = parse(version, options) - return v ? v.version : null -} +/** Used for built-in method references. */ +var objectProto = Object.prototype; -exports.clean = clean -function clean (version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; -exports.SemVer = SemVer +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} -function SemVer (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version) - } +module.exports = objectToString; - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - } - if (!(this instanceof SemVer)) { - return new SemVer(version, options) - } +/***/ }), - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose +/***/ 90570: +/***/ ((module) => { - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} - if (!m) { - throw new TypeError('Invalid Version: ' + version) - } +module.exports = overArg; - this.raw = version - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] +/***/ }), - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } +/***/ 216: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } +var apply = __nccwpck_require__(99502); - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); - this.build = m[5] ? m[5].split('.') : [] - this.format() + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; } -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.') - } - return this.version -} +module.exports = overRest; -SemVer.prototype.toString = function () { - return this.version -} -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +/***/ }), - return this.compareMain(other) || this.comparePre(other) -} +/***/ 562: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +var freeGlobal = __nccwpck_require__(37825); - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) -} +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } +module.exports = root; - var i = 0 - do { - var a = this.prerelease[i] - var b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) -} -SemVer.prototype.compareBuild = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +/***/ }), - var i = 0 - do { - var a = this.build[i] - var b = other.build[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) -} +/***/ 65444: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) - } - this.inc('pre', identifier) - break +var baseSetToString = __nccwpck_require__(3503), + shortOut = __nccwpck_require__(10697); - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - var i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); - default: - throw new Error('invalid increment argument: ' + release) - } - this.format() - this.raw = this.version - return this -} +module.exports = setToString; -exports.inc = inc -function inc (version, release, loose, identifier) { - if (typeof (loose) === 'string') { - identifier = loose - loose = undefined - } - try { - return new SemVer(version, loose).inc(release, identifier).version - } catch (er) { - return null - } -} +/***/ }), -exports.diff = diff -function diff (version1, version2) { - if (eq(version1, version2)) { - return null - } else { - var v1 = parse(version1) - var v2 = parse(version2) - var prefix = '' - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre' - var defaultResult = 'prerelease' - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } +/***/ 10697: +/***/ ((module) => { + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; } + } else { + count = 0; } - return defaultResult // may be undefined - } + return func.apply(undefined, arguments); + }; } -exports.compareIdentifiers = compareIdentifiers +module.exports = shortOut; -var numeric = /^[0-9]+$/ -function compareIdentifiers (a, b) { - var anum = numeric.test(a) - var bnum = numeric.test(b) - if (anum && bnum) { - a = +a - b = +b - } +/***/ }), - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} +/***/ 22614: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -exports.rcompareIdentifiers = rcompareIdentifiers -function rcompareIdentifiers (a, b) { - return compareIdentifiers(b, a) -} +var ListCache = __nccwpck_require__(82746); -exports.major = major -function major (a, loose) { - return new SemVer(a, loose).major +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; } -exports.minor = minor -function minor (a, loose) { - return new SemVer(a, loose).minor -} +module.exports = stackClear; -exports.patch = patch -function patch (a, loose) { - return new SemVer(a, loose).patch -} -exports.compare = compare -function compare (a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)) -} +/***/ }), -exports.compareLoose = compareLoose -function compareLoose (a, b) { - return compare(a, b, true) -} +/***/ 24202: +/***/ ((module) => { -exports.compareBuild = compareBuild -function compareBuild (a, b, loose) { - var versionA = new SemVer(a, loose) - var versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); -exports.rcompare = rcompare -function rcompare (a, b, loose) { - return compare(b, a, loose) + this.size = data.size; + return result; } -exports.sort = sort -function sort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(a, b, loose) - }) -} +module.exports = stackDelete; -exports.rsort = rsort -function rsort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(b, a, loose) - }) -} -exports.gt = gt -function gt (a, b, loose) { - return compare(a, b, loose) > 0 -} +/***/ }), -exports.lt = lt -function lt (a, b, loose) { - return compare(a, b, loose) < 0 -} +/***/ 96310: +/***/ ((module) => { -exports.eq = eq -function eq (a, b, loose) { - return compare(a, b, loose) === 0 +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); } -exports.neq = neq -function neq (a, b, loose) { - return compare(a, b, loose) !== 0 -} +module.exports = stackGet; -exports.gte = gte -function gte (a, b, loose) { - return compare(a, b, loose) >= 0 -} -exports.lte = lte -function lte (a, b, loose) { - return compare(a, b, loose) <= 0 -} +/***/ }), -exports.cmp = cmp -function cmp (a, op, b, loose) { - switch (op) { - case '===': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a === b +/***/ 58721: +/***/ ((module) => { - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} - case '': - case '=': - case '==': - return eq(a, b, loose) +module.exports = stackHas; - case '!=': - return neq(a, b, loose) - case '>': - return gt(a, b, loose) +/***/ }), - case '>=': - return gte(a, b, loose) +/***/ 90320: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - case '<': - return lt(a, b, loose) +var ListCache = __nccwpck_require__(82746), + Map = __nccwpck_require__(51105), + MapCache = __nccwpck_require__(16531); - case '<=': - return lte(a, b, loose) +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; - default: - throw new TypeError('Invalid operator: ' + op) +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); } + data.set(key, value); + this.size = data.size; + return this; } -exports.Comparator = Comparator -function Comparator (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +module.exports = stackSet; - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options) - } +/***/ }), - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) +/***/ 35725: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } +var memoizeCapped = __nccwpck_require__(46717); - debug('comp', this) -} +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; -var ANY = {} -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - var m = comp.match(r) +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; - if (!m) { - throw new TypeError('Invalid comparator: ' + comp) +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } +module.exports = stringToPath; - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) + +/***/ }), + +/***/ 30668: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isSymbol = __nccwpck_require__(82500); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } -Comparator.prototype.toString = function () { - return this.value -} +module.exports = toKey; -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose) - if (this.semver === ANY || version === ANY) { - return true - } +/***/ }), - if (typeof version === 'string') { +/***/ 98241: +/***/ ((module) => { + +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} } - - return cmp(version, this.operator, this.semver, this.options) + return ''; } -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } +module.exports = toSource; - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - var rangeTmp +/***/ }), - if (this.operator === '') { - if (this.value === '') { - return true - } - rangeTmp = new Range(comp.value, options) - return satisfies(this.value, rangeTmp, options) - } else if (comp.operator === '') { - if (comp.value === '') { - return true +/***/ 66690: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var assignValue = __nccwpck_require__(55647), + copyObject = __nccwpck_require__(83568), + createAssigner = __nccwpck_require__(21479), + isArrayLike = __nccwpck_require__(20577), + isPrototype = __nccwpck_require__(4954), + keys = __nccwpck_require__(50288); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); } - rangeTmp = new Range(this.value, options) - return satisfies(comp.semver, rangeTmp, options) } +}); - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - var sameSemVer = this.semver.version === comp.semver.version - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')) - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')) +module.exports = assign; - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan + +/***/ }), + +/***/ 31471: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseClone = __nccwpck_require__(95570); + +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; + +/** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ +function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); } -exports.Range = Range -function Range (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +module.exports = clone; - if (range instanceof Range) { - if (range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease) { - return range - } else { - return new Range(range.raw, options) - } - } - if (range instanceof Comparator) { - return new Range(range.value, options) - } +/***/ }), + +/***/ 66915: +/***/ ((module) => { + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} - if (!(this instanceof Range)) { - return new Range(range, options) - } +module.exports = constant; - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - // First, split based on boolean or || - this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { - return this.parseRange(range.trim()) - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length - }) +/***/ }), - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) - } +/***/ 28650: +/***/ ((module) => { - this.format() +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); } -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim() - }).join('||').trim() - return this.range -} +module.exports = eq; -Range.prototype.toString = function () { - return this.range -} -Range.prototype.parseRange = function (range) { - var loose = this.options.loose - range = range.trim() - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) +/***/ }), - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) +/***/ 8708: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) +var baseFlatten = __nccwpck_require__(5765); - // normalize spaces - range = range.split(/\s+/).join(' ') +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} - // At this point, the range is completely trimmed and - // ready to be split into comparators. +module.exports = flatten; - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options) - }, this).join(' ').split(/\s+/) - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe) - }) - } - set = set.map(function (comp) { - return new Comparator(comp, this.options) - }, this) - return set -} +/***/ }), -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } +/***/ 14426: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return this.set.some(function (thisComparators) { - return ( - isSatisfiable(thisComparators, options) && - range.set.some(function (rangeComparators) { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every(function (thisComparator) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) -} +var baseHasIn = __nccwpck_require__(56263), + hasPath = __nccwpck_require__(23144); -// take a set of comparators and determine whether there -// exists a version which can satisfy it -function isSatisfiable (comparators, options) { - var result = true - var remainingComparators = comparators.slice() - var testComparator = remainingComparators.pop() +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} - while (result && remainingComparators.length) { - result = remainingComparators.every(function (otherComparator) { - return testComparator.intersects(otherComparator, options) - }) +module.exports = hasIn; - testComparator = remainingComparators.pop() - } - return result -} +/***/ }), -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators -function toComparators (range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value - }).join(' ').trim().split(' ') - }) -} +/***/ 57460: +/***/ ((module) => { -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator (comp, options) { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; } -function isX (id) { - return !id || id.toLowerCase() === 'x' || id === '*' -} +module.exports = identity; -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options) - }).join(' ') -} -function replaceTilde (comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr) - var ret +/***/ }), - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else if (pr) { - debug('replaceTilde pr', pr) - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } +/***/ 24839: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - debug('tilde return', ret) - return ret - }) -} +var baseIsArguments = __nccwpck_require__(77907), + isObjectLike = __nccwpck_require__(9111); -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options) - }).join(' ') -} +/** Used for built-in method references. */ +var objectProto = Object.prototype; -function replaceCaret (comp, options) { - debug('caret', comp, options) - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr) - var ret +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + (+M + 1) + '.0.0' - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0' - } - } +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; - debug('caret return', ret) - return ret - }) -} +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; -function replaceXRanges (comp, options) { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options) - }).join(' ') -} +module.exports = isArguments; -function replaceXRange (comp, options) { - comp = comp.trim() - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - var xM = isX(M) - var xm = xM || isX(m) - var xp = xm || isX(p) - var anyX = xp - if (gtlt === '=' && anyX) { - gtlt = '' - } +/***/ }), - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' +/***/ 43364: +/***/ ((module) => { - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } +module.exports = isArray; - ret = gtlt + M + '.' + m + '.' + p + pr - } else if (xm) { - ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr - } else if (xp) { - ret = '>=' + M + '.' + m + '.0' + pr + - ' <' + M + '.' + (+m + 1) + '.0' + pr - } - debug('xRange return', ret) +/***/ }), - return ret - }) -} +/***/ 20577: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars (comp, options) { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') -} +var isFunction = __nccwpck_require__(66827), + isLength = __nccwpck_require__(55752); -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = '>=' + fM + '.0.0' - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0' - } else { - from = '>=' + from - } +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0' - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0' - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr - } else { - to = '<=' + to - } +module.exports = isArrayLike; - return (from + ' ' + to).trim() -} -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function (version) { - if (!version) { - return false - } +/***/ }), - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } +/***/ 12963: +/***/ ((module, exports, __nccwpck_require__) => { - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false -} +/* module decorator */ module = __nccwpck_require__.nmd(module); +var root = __nccwpck_require__(562), + stubFalse = __nccwpck_require__(90377); -function testSet (set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === ANY) { - continue - } +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; - // Version has a -pre, but it's not one of the ones we like. - return false - } +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; - return true -} +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; -exports.maxSatisfying = maxSatisfying -function maxSatisfying (versions, range, options) { - var max = null - var maxSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} +module.exports = isBuffer; -exports.minSatisfying = minSatisfying -function minSatisfying (versions, range, options) { - var min = null - var minSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) +/***/ }), - var minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } +/***/ 66827: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } +var baseGetTag = __nccwpck_require__(98653), + isObject = __nccwpck_require__(43420); - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error('Unexpected operation: ' + comparator.operator) - } - }) +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} - if (minver && range.test(minver)) { - return minver - } +module.exports = isFunction; - return null -} -exports.validRange = validRange -function validRange (range, options) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} +/***/ }), -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr -function ltr (version, range, options) { - return outside(version, range, '<', options) -} +/***/ 55752: +/***/ ((module) => { -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr -function gtr (version, range, options) { - return outside(version, range, '>', options) -} +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} - var gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } +module.exports = isLength; - // If it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false - } - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. +/***/ }), - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] +/***/ 13689: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var high = null - var low = null +var baseIsMap = __nccwpck_require__(81391), + baseUnary = __nccwpck_require__(83717), + nodeUtil = __nccwpck_require__(62470); - comparators.forEach(function (comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) +/* Node.js helper references. */ +var nodeIsMap = nodeUtil && nodeUtil.isMap; - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} +module.exports = isMap; -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} +/***/ }), -exports.coerce = coerce -function coerce (version, options) { - if (version instanceof SemVer) { - return version - } +/***/ 43420: +/***/ ((module) => { - if (typeof version === 'number') { - version = String(version) - } +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} - if (typeof version !== 'string') { - return null - } +module.exports = isObject; - options = options || {} - var match = null - if (!options.rtl) { - match = version.match(re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - var next - while ((next = re[t.COERCERTL].exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 - } +/***/ }), - if (match === null) { - return null - } +/***/ 9111: +/***/ ((module) => { - return parse(match[2] + - '.' + (match[3] || '0') + - '.' + (match[4] || '0'), options) +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; } +module.exports = isObjectLike; -/***/ }), -/***/ 89437: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ }), -"use strict"; +/***/ 81360: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const escapeStringRegexp = __webpack_require__(77619); +var baseIsSet = __nccwpck_require__(19472), + baseUnary = __nccwpck_require__(83717), + nodeUtil = __nccwpck_require__(62470); -const regexpCache = new Map(); +/* Node.js helper references. */ +var nodeIsSet = nodeUtil && nodeUtil.isSet; -function makeRegexp(pattern, options) { - options = { - caseSensitive: false, - ...options - }; +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; - const cacheKey = pattern + JSON.stringify(options); +module.exports = isSet; - if (regexpCache.has(cacheKey)) { - return regexpCache.get(cacheKey); - } - const negated = pattern[0] === '!'; +/***/ }), - if (negated) { - pattern = pattern.slice(1); - } +/***/ 82500: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - pattern = escapeStringRegexp(pattern).replace(/\\\*/g, '.*'); +var baseGetTag = __nccwpck_require__(98653), + isObjectLike = __nccwpck_require__(9111); - const regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? '' : 'i'); - regexp.negated = negated; - regexpCache.set(cacheKey, regexp); +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; - return regexp; +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); } -module.exports = (inputs, patterns, options) => { - if (!(Array.isArray(inputs) && Array.isArray(patterns))) { - throw new TypeError(`Expected two arrays, got ${typeof inputs} ${typeof patterns}`); - } +module.exports = isSymbol; - if (patterns.length === 0) { - return inputs; - } - const firstNegated = patterns[0][0] === '!'; +/***/ }), - patterns = patterns.map(pattern => makeRegexp(pattern, options)); +/***/ 53635: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const result = []; +var baseIsTypedArray = __nccwpck_require__(86944), + baseUnary = __nccwpck_require__(83717), + nodeUtil = __nccwpck_require__(62470); - for (const input of inputs) { - // If first pattern is negated we include everything to match user expectation - let matches = firstNegated; +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - for (const pattern of patterns) { - if (pattern.test(input)) { - matches = !pattern.negated; - } - } +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - if (matches) { - result.push(input); - } - } +module.exports = isTypedArray; - return result; -}; -module.exports.isMatch = (input, pattern, options) => { - const inputArray = Array.isArray(input) ? input : [input]; - const patternArray = Array.isArray(pattern) ? pattern : [pattern]; +/***/ }), - return inputArray.some(input => { - return patternArray.every(pattern => { - const regexp = makeRegexp(pattern, options); - const matches = regexp.test(input); - return regexp.negated ? !matches : matches; - }); - }); -}; +/***/ 50288: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var arrayLikeKeys = __nccwpck_require__(63360), + baseKeys = __nccwpck_require__(24787), + isArrayLike = __nccwpck_require__(20577); -/***/ }), +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} -/***/ 77619: -/***/ ((module) => { +module.exports = keys; -"use strict"; +/***/ }), -const matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g; +/***/ 86032: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = string => { - if (typeof string !== 'string') { - throw new TypeError('Expected a string'); - } +var arrayLikeKeys = __nccwpck_require__(63360), + baseKeysIn = __nccwpck_require__(14535), + isArrayLike = __nccwpck_require__(20577); - return string.replace(matchOperatorsRegex, '\\$&'); -}; +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} +module.exports = keysIn; -/***/ }), -/***/ 6020: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ }), -"use strict"; +/***/ 89058: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var MapCache = __nccwpck_require__(16531); -const { PassThrough } = __webpack_require__(92413); +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; -module.exports = function (/*streams...*/) { - var sources = [] - var output = new PassThrough({objectMode: true}) +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; - output.setMaxListeners(0) + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} - output.add = add - output.isEmpty = isEmpty +// Expose `MapCache`. +memoize.Cache = MapCache; - output.on('unpipe', remove) +module.exports = memoize; - Array.prototype.slice.call(arguments).forEach(add) - return output +/***/ }), - function add (source) { - if (Array.isArray(source)) { - source.forEach(add) - return this - } +/***/ 53651: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - sources.push(source); - source.once('end', remove.bind(null, source)) - source.once('error', output.emit.bind(output, 'error')) - source.pipe(output, {end: false}) - return this - } +var basePick = __nccwpck_require__(3529), + flatRest = __nccwpck_require__(34800); - function isEmpty () { - return sources.length == 0; - } +/** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ +var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); +}); - function remove (source) { - sources = sources.filter(function (it) { return it !== source }) - if (!sources.length && output.readable) { output.end() } - } -} +module.exports = pick; /***/ }), -/***/ 71883: +/***/ 87632: /***/ ((module) => { -"use strict"; - - -const mimicFn = (to, from) => { - for (const prop of Reflect.ownKeys(from)) { - Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); - } - - return to; -}; +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} -module.exports = mimicFn; -// TODO: Remove this for the next major release -module.exports.default = mimicFn; +module.exports = stubArray; /***/ }), -/***/ 27480: +/***/ 90377: /***/ ((module) => { -"use strict"; - +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} -// We define these manually to ensure they're always copied -// even if they would move up the prototype chain -// https://nodejs.org/api/http.html#http_class_http_incomingmessage -const knownProps = [ - 'destroy', - 'setTimeout', - 'socket', - 'headers', - 'trailers', - 'rawHeaders', - 'statusCode', - 'httpVersion', - 'httpVersionMinor', - 'httpVersionMajor', - 'rawTrailers', - 'statusMessage' -]; +module.exports = stubFalse; -module.exports = (fromStream, toStream) => { - const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); - for (const prop of fromProps) { - // Don't overwrite existing properties - if (prop in toStream) { - continue; - } +/***/ }), - toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; - } -}; +/***/ 49228: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var baseToString = __nccwpck_require__(74851); -/***/ }), +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} -/***/ 26944: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +module.exports = toString; -module.exports = minimatch -minimatch.Minimatch = Minimatch -var path = { sep: '/' } -try { - path = __webpack_require__(85622) -} catch (er) {} +/***/ }), -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(85533) +/***/ 87279: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} +"use strict"; -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' +const chalk = __nccwpck_require__(7833); -// * => any number of characters -var star = qmark + '*?' +const isSupported = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color'; -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' +const main = { + info: chalk.blue('ℹ'), + success: chalk.green('✔'), + warning: chalk.yellow('⚠'), + error: chalk.red('✖') +}; -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' +const fallbacks = { + info: chalk.blue('i'), + success: chalk.green('√'), + warning: chalk.yellow('‼'), + error: chalk.red('×') +}; -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') +module.exports = isSupported ? main : fallbacks; -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} -// normalizes slashes. -var slashSplit = /\/+/ +/***/ }), -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} +/***/ 18984: +/***/ ((module) => { -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} +"use strict"; -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch +module.exports = function (obj) { + var ret = {}; + var keys = Object.keys(Object(obj)); - var orig = minimatch + for (var i = 0; i < keys.length; i++) { + ret[keys[i].toLowerCase()] = obj[keys[i]]; + } - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } + return ret; +}; - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - return m -} +/***/ }), -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} +/***/ 85069: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } +"use strict"; - if (!options) options = {} - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } +// A linked list to keep track of recently-used-ness +const Yallist = __nccwpck_require__(3652) - // "" only matches "" - if (pattern.trim() === '') return p === '' +const MAX = Symbol('max') +const LENGTH = Symbol('length') +const LENGTH_CALCULATOR = Symbol('lengthCalculator') +const ALLOW_STALE = Symbol('allowStale') +const MAX_AGE = Symbol('maxAge') +const DISPOSE = Symbol('dispose') +const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') +const LRU_LIST = Symbol('lruList') +const CACHE = Symbol('cache') +const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') - return new Minimatch(pattern, options).match(p) -} +const naiveLength = () => 1 -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } +// lruList is a yallist where the head is the youngest +// item, and the tail is the oldest. the list contains the Hit +// objects as the entries. +// Each Hit object has a reference to its Yallist.Node. This +// never changes. +// +// cache is a Map (or PseudoMap) that matches the keys to +// the Yallist.Node object. +class LRUCache { + constructor (options) { + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') + if (options.max && (typeof options.max !== 'number' || options.max < 0)) + throw new TypeError('max must be a non-negative number') + // Kind of weird to have a default max of Infinity, but oh well. + const max = this[MAX] = options.max || Infinity + + const lc = options.length || naiveLength + this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc + this[ALLOW_STALE] = options.stale || false + if (options.maxAge && typeof options.maxAge !== 'number') + throw new TypeError('maxAge must be a number') + this[MAX_AGE] = options.maxAge || 0 + this[DISPOSE] = options.dispose + this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false + this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false + this.reset() } - if (!options) options = {} - pattern = pattern.trim() + // resize the cache when the max changes. + set max (mL) { + if (typeof mL !== 'number' || mL < 0) + throw new TypeError('max must be a non-negative number') - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') + this[MAX] = mL || Infinity + trim(this) + } + get max () { + return this[MAX] } - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} + set allowStale (allowStale) { + this[ALLOW_STALE] = !!allowStale + } + get allowStale () { + return this[ALLOW_STALE] + } -Minimatch.prototype.debug = function () {} + set maxAge (mA) { + if (typeof mA !== 'number') + throw new TypeError('maxAge must be a non-negative number') -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return + this[MAX_AGE] = mA + trim(this) + } + get maxAge () { + return this[MAX_AGE] + } - var pattern = this.pattern - var options = this.options + // resize the cache when the lengthCalculator changes. + set lengthCalculator (lC) { + if (typeof lC !== 'function') + lC = naiveLength - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return + if (lC !== this[LENGTH_CALCULATOR]) { + this[LENGTH_CALCULATOR] = lC + this[LENGTH] = 0 + this[LRU_LIST].forEach(hit => { + hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) + this[LENGTH] += hit.length + }) + } + trim(this) } + get lengthCalculator () { return this[LENGTH_CALCULATOR] } - // step 1: figure out negation, etc. - this.parseNegate() + get length () { return this[LENGTH] } + get itemCount () { return this[LRU_LIST].length } - // step 2: expand braces - var set = this.globSet = this.braceExpand() + rforEach (fn, thisp) { + thisp = thisp || this + for (let walker = this[LRU_LIST].tail; walker !== null;) { + const prev = walker.prev + forEachStep(this, fn, walker, thisp) + walker = prev + } + } - if (options.debug) this.debug = console.error + forEach (fn, thisp) { + thisp = thisp || this + for (let walker = this[LRU_LIST].head; walker !== null;) { + const next = walker.next + forEachStep(this, fn, walker, thisp) + walker = next + } + } - this.debug(this.pattern, set) + keys () { + return this[LRU_LIST].toArray().map(k => k.key) + } - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) + values () { + return this[LRU_LIST].toArray().map(k => k.value) + } - this.debug(this.pattern, set) + reset () { + if (this[DISPOSE] && + this[LRU_LIST] && + this[LRU_LIST].length) { + this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) + } - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) + this[CACHE] = new Map() // hash of items by key + this[LRU_LIST] = new Yallist() // list of items in order of use recency + this[LENGTH] = 0 // length of items in the list + } - this.debug(this.pattern, set) + dump () { + return this[LRU_LIST].map(hit => + isStale(this, hit) ? false : { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }).toArray().filter(h => h) + } - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) + dumpLru () { + return this[LRU_LIST] + } - this.debug(this.pattern, set) + set (key, value, maxAge) { + maxAge = maxAge || this[MAX_AGE] - this.set = set -} + if (maxAge && typeof maxAge !== 'number') + throw new TypeError('maxAge must be a number') -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 + const now = maxAge ? Date.now() : 0 + const len = this[LENGTH_CALCULATOR](value, key) - if (options.nonegate) return + if (this[CACHE].has(key)) { + if (len > this[MAX]) { + del(this, this[CACHE].get(key)) + return false + } - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } + const node = this[CACHE].get(key) + const item = node.value - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} + // dispose of the old one before overwriting + // split out into 2 ifs for better coverage tracking + if (this[DISPOSE]) { + if (!this[NO_DISPOSE_ON_SET]) + this[DISPOSE](key, item.value) + } -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} + item.now = now + item.maxAge = maxAge + item.value = value + this[LENGTH] += len - item.length + item.length = len + this.get(key) + trim(this) + return true + } -Minimatch.prototype.braceExpand = braceExpand + const hit = new Entry(key, value, len, now, maxAge) -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} + // oversized objects fall out of cache automatically. + if (hit.length > this[MAX]) { + if (this[DISPOSE]) + this[DISPOSE](key, value) + + return false } + + this[LENGTH] += hit.length + this[LRU_LIST].unshift(hit) + this[CACHE].set(key, this[LRU_LIST].head) + trim(this) + return true } - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern + has (key) { + if (!this[CACHE].has(key)) return false + const hit = this[CACHE].get(key).value + return !isStale(this, hit) + } - if (typeof pattern === 'undefined') { - throw new TypeError('undefined pattern') + get (key) { + return get(this, key, true) } - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] + peek (key) { + return get(this, key, false) } - return expand(pattern) -} + pop () { + const node = this[LRU_LIST].tail + if (!node) + return null -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - if (pattern.length > 1024 * 64) { - throw new TypeError('pattern is too long') + del(this, node) + return node.value } - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' + del (key) { + del(this, this[CACHE].get(key)) + } - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this + load (arr) { + // reset the cache + this.reset() - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break + const now = Date.now() + // A previous serialized cache has the most recent items first + for (let l = arr.length - 1; l >= 0; l--) { + const hit = arr[l] + const expiresAt = hit.e || 0 + if (expiresAt === 0) + // the item was created without expiration in a non aged cache + this.set(hit.k, hit.v) + else { + const maxAge = expiresAt - now + // dont add already expired items + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge) + } } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false } } - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) + prune () { + this[CACHE].forEach((value, key) => get(this, key, false)) + } +} - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue +const get = (self, key, doUse) => { + const node = self[CACHE].get(key) + if (node) { + const hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!self[ALLOW_STALE]) + return undefined + } else { + if (doUse) { + if (self[UPDATE_AGE_ON_GET]) + node.value.now = Date.now() + self[LRU_LIST].unshiftNode(node) + } } + return hit.value + } +} - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } +const isStale = (self, hit) => { + if (!hit || (!hit.maxAge && !self[MAX_AGE])) + return false - if (!stateChar) { - re += '\\(' - continue - } + const diff = Date.now() - hit.now + return hit.maxAge ? diff > hit.maxAge + : self[MAX_AGE] && (diff > self[MAX_AGE]) +} - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue +const trim = self => { + if (self[LENGTH] > self[MAX]) { + for (let walker = self[LRU_LIST].tail; + self[LENGTH] > self[MAX] && walker !== null;) { + // We know that we're about to delete this one, and also + // what the next least recently used key will be, so just + // go ahead and set it now. + const prev = walker.prev + del(self, walker) + walker = prev + } + } +} - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } +const del = (self, node) => { + if (node) { + const hit = node.value + if (self[DISPOSE]) + self[DISPOSE](hit.key, hit.value) - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue + self[LENGTH] -= hit.length + self[CACHE].delete(hit.key) + self[LRU_LIST].removeNode(node) + } +} - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } +class Entry { + constructor (key, value, length, now, maxAge) { + this.key = key + this.value = value + this.length = length + this.now = now + this.maxAge = maxAge || 0 + } +} - clearStateChar() - re += '|' - continue +const forEachStep = (self, fn, node, thisp) => { + let hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!self[ALLOW_STALE]) + hit = undefined + } + if (hit) + fn.call(thisp, hit.value, hit.key, self) +} - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() +module.exports = LRUCache - if (inClass) { - re += '\\' + c - continue - } - inClass = true - classStart = i - reClassStart = re.length - re += c - continue +/***/ }), - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } +/***/ 89437: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } +"use strict"; - // finish up the class. - hasMagic = true - inClass = false - re += c - continue +const escapeStringRegexp = __nccwpck_require__(77619); - default: - // swallow any state char that wasn't consumed - clearStateChar() +const regexpCache = new Map(); - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } +function makeRegexp(pattern, options) { + options = { + caseSensitive: false, + ...options + }; - re += c + const cacheKey = pattern + JSON.stringify(options); - } // switch - } // for + if (regexpCache.has(cacheKey)) { + return regexpCache.get(cacheKey); + } - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } + const negated = pattern[0] === '!'; - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } + if (negated) { + pattern = pattern.slice(1); + } - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) + pattern = escapeStringRegexp(pattern).replace(/\\\*/g, '[\\s\\S]*'); - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type + const regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? '' : 'i'); + regexp.negated = negated; + regexpCache.set(cacheKey, regexp); - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } + return regexp; +} - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } +module.exports = (inputs, patterns, options) => { + if (!(Array.isArray(inputs) && Array.isArray(patterns))) { + throw new TypeError(`Expected two arrays, got ${typeof inputs} ${typeof patterns}`); + } - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } + if (patterns.length === 0) { + return inputs; + } - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] + const isFirstPatternNegated = patterns[0][0] === '!'; - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) + patterns = patterns.map(pattern => makeRegexp(pattern, options)); - nlLast += nlAfter + const result = []; - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter + for (const input of inputs) { + // If first pattern is negated we include everything to match user expectation. + let matches = isFirstPatternNegated; - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } + for (const pattern of patterns) { + if (pattern.test(input)) { + matches = !pattern.negated; + } + } - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } + if (matches) { + result.push(input); + } + } - if (addPatternStart) { - re = patternStart + re - } + return result; +}; - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } +module.exports.isMatch = (input, pattern, options) => { + const inputArray = Array.isArray(input) ? input : [input]; + const patternArray = Array.isArray(pattern) ? pattern : [pattern]; - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } + return inputArray.some(input => { + return patternArray.every(pattern => { + const regexp = makeRegexp(pattern, options); + const matches = regexp.test(input); + return regexp.negated ? !matches : matches; + }); + }); +}; - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - regExp._glob = pattern - regExp._src = re +/***/ }), - return regExp -} +/***/ 77619: +/***/ ((module) => { -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} +"use strict"; -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set +module.exports = string => { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options + // Escape characters with special meaning either inside or outside character sets. + // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. + return string + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') + .replace(/-/g, '\\x2d'); +}; - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') +/***/ }), - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' +/***/ 6020: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' +"use strict"; - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} +const { PassThrough } = __nccwpck_require__(92413); -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' +module.exports = function (/*streams...*/) { + var sources = [] + var output = new PassThrough({objectMode: true}) - if (f === '/' && partial) return true + output.setMaxListeners(0) - var options = this.options + output.add = add + output.isEmpty = isEmpty - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } + output.on('unpipe', remove) - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) + Array.prototype.slice.call(arguments).forEach(add) - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. + return output - var set = this.set - this.debug(this.pattern, 'set', set) + function add (source) { + if (Array.isArray(source)) { + source.forEach(add) + return this + } - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break + sources.push(source); + source.once('end', remove.bind(null, source)) + source.once('error', output.emit.bind(output, 'error')) + source.pipe(output, {end: false}) + return this } - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } + function isEmpty () { + return sources.length == 0; } - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate + function remove (source) { + sources = sources.filter(function (it) { return it !== source }) + if (!sources.length && output.readable) { output.end() } + } } -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - this.debug(pattern, p, f) +/***/ }), - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false +/***/ 71883: +/***/ ((module) => { - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) +"use strict"; - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] +const mimicFn = (to, from) => { + for (const prop of Reflect.ownKeys(from)) { + Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); + } - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + return to; +}; - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } +module.exports = mimicFn; +// TODO: Remove this for the next major release +module.exports.default = mimicFn; - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } +/***/ }), - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } +/***/ 27480: +/***/ ((module) => { - if (!hit) return false - } +"use strict"; - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } +// We define these manually to ensure they're always copied +// even if they would move up the prototype chain +// https://nodejs.org/api/http.html#http_class_http_incomingmessage +const knownProps = [ + 'destroy', + 'setTimeout', + 'socket', + 'headers', + 'trailers', + 'rawHeaders', + 'statusCode', + 'httpVersion', + 'httpVersionMinor', + 'httpVersionMajor', + 'rawTrailers', + 'statusMessage' +]; - // should be unreachable. - throw new Error('wtf?') -} +module.exports = (fromStream, toStream) => { + const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} + for (const prop of fromProps) { + // Don't overwrite existing properties + if (prop in toStream) { + continue; + } -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} + toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; + } +}; /***/ }), @@ -78469,158 +64703,6 @@ function plural(ms, msAbs, n, name) { } -/***/ }), - -/***/ 64003: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var Stream = __webpack_require__(92413) - -module.exports = MuteStream - -// var out = new MuteStream(process.stdout) -// argument auto-pipes -function MuteStream (opts) { - Stream.apply(this) - opts = opts || {} - this.writable = this.readable = true - this.muted = false - this.on('pipe', this._onpipe) - this.replace = opts.replace - - // For readline-type situations - // This much at the start of a line being redrawn after a ctrl char - // is seen (such as backspace) won't be redrawn as the replacement - this._prompt = opts.prompt || null - this._hadControl = false -} - -MuteStream.prototype = Object.create(Stream.prototype) - -Object.defineProperty(MuteStream.prototype, 'constructor', { - value: MuteStream, - enumerable: false -}) - -MuteStream.prototype.mute = function () { - this.muted = true -} - -MuteStream.prototype.unmute = function () { - this.muted = false -} - -Object.defineProperty(MuteStream.prototype, '_onpipe', { - value: onPipe, - enumerable: false, - writable: true, - configurable: true -}) - -function onPipe (src) { - this._src = src -} - -Object.defineProperty(MuteStream.prototype, 'isTTY', { - get: getIsTTY, - set: setIsTTY, - enumerable: true, - configurable: true -}) - -function getIsTTY () { - return( (this._dest) ? this._dest.isTTY - : (this._src) ? this._src.isTTY - : false - ) -} - -// basically just get replace the getter/setter with a regular value -function setIsTTY (isTTY) { - Object.defineProperty(this, 'isTTY', { - value: isTTY, - enumerable: true, - writable: true, - configurable: true - }) -} - -Object.defineProperty(MuteStream.prototype, 'rows', { - get: function () { - return( this._dest ? this._dest.rows - : this._src ? this._src.rows - : undefined ) - }, enumerable: true, configurable: true }) - -Object.defineProperty(MuteStream.prototype, 'columns', { - get: function () { - return( this._dest ? this._dest.columns - : this._src ? this._src.columns - : undefined ) - }, enumerable: true, configurable: true }) - - -MuteStream.prototype.pipe = function (dest, options) { - this._dest = dest - return Stream.prototype.pipe.call(this, dest, options) -} - -MuteStream.prototype.pause = function () { - if (this._src) return this._src.pause() -} - -MuteStream.prototype.resume = function () { - if (this._src) return this._src.resume() -} - -MuteStream.prototype.write = function (c) { - if (this.muted) { - if (!this.replace) return true - if (c.match(/^\u001b/)) { - if(c.indexOf(this._prompt) === 0) { - c = c.substr(this._prompt.length); - c = c.replace(/./g, this.replace); - c = this._prompt + c; - } - this._hadControl = true - return this.emit('data', c) - } else { - if (this._prompt && this._hadControl && - c.indexOf(this._prompt) === 0) { - this._hadControl = false - this.emit('data', this._prompt) - c = c.substr(this._prompt.length) - } - c = c.toString().replace(/./g, this.replace) - } - } - this.emit('data', c) -} - -MuteStream.prototype.end = function (c) { - if (this.muted) { - if (c && this.replace) { - c = c.toString().replace(/./g, this.replace) - } else { - c = null - } - } - if (c) this.emit('data', c) - this.emit('end') -} - -function proxy (fn) { return function () { - var d = this._dest - var s = this._src - if (d && d[fn]) d[fn].apply(d, arguments) - if (s && s[fn]) s[fn].apply(s, arguments) -}} - -MuteStream.prototype.destroy = proxy('destroy') -MuteStream.prototype.destroySoon = proxy('destroySoon') -MuteStream.prototype.close = proxy('close') - - /***/ }), /***/ 76254: @@ -78645,16 +64727,16 @@ function extractDescription (d) { /***/ }), /***/ 94704: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var semver = __webpack_require__(9546) -var validateLicense = __webpack_require__(52078); -var hostedGitInfo = __webpack_require__(47052) -var isBuiltinModule = __webpack_require__(72305).isCore +var semver = __nccwpck_require__(9546) +var validateLicense = __nccwpck_require__(52078); +var hostedGitInfo = __nccwpck_require__(47052) +var isBuiltinModule = __nccwpck_require__(72305).isCore var depTypes = ["dependencies","devDependencies","optionalDependencies"] -var extractDescription = __webpack_require__(76254) -var url = __webpack_require__(78835) -var typos = __webpack_require__(30488) +var extractDescription = __nccwpck_require__(76254) +var url = __nccwpck_require__(78835) +var typos = __nccwpck_require__(30488) var fixer = module.exports = { // default warning function @@ -79070,10 +65152,10 @@ function bugsTypos(bugs, warn) { /***/ }), /***/ 21652: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __webpack_require__(31669) -var messages = __webpack_require__(51510) +var util = __nccwpck_require__(31669) +var messages = __nccwpck_require__(51510) module.exports = function() { var args = Array.prototype.slice.call(arguments, 0) @@ -79100,14 +65182,14 @@ function makeTypoWarning (providedName, probableName, field) { /***/ }), /***/ 44586: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = normalize -var fixer = __webpack_require__(94704) +var fixer = __nccwpck_require__(94704) normalize.fixer = fixer -var makeWarning = __webpack_require__(21652) +var makeWarning = __nccwpck_require__(21652) var fieldsToFix = ['name','version','description','repository','modules','scripts' ,'files','bin','man','bugs','keywords','readme','homepage','license'] @@ -80636,12 +66718,12 @@ function coerce (version) { /***/ }), /***/ 68938: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; // TODO: Use the `URL` global when targeting Node.js 10 -const URLParser = typeof URL === 'undefined' ? __webpack_require__(78835).URL : URL; +const URLParser = typeof URL === 'undefined' ? __nccwpck_require__(78835).URL : URL; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain'; @@ -80865,13 +66947,13 @@ module.exports.default = normalizeUrl; /***/ }), /***/ 8569: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const Conf = __webpack_require__(12430); -const defaults = __webpack_require__(5473); +const path = __nccwpck_require__(85622); +const Conf = __nccwpck_require__(12430); +const defaults = __nccwpck_require__(5473); // https://github.com/npm/npm/blob/latest/lib/config/core.js#L101-L200 module.exports = opts => { @@ -80916,14 +66998,14 @@ module.exports.defaults = Object.assign({}, defaults.defaults); /***/ }), /***/ 12430: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const ConfigChain = __webpack_require__(18271).ConfigChain; -const util = __webpack_require__(95950); +const fs = __nccwpck_require__(35747); +const path = __nccwpck_require__(85622); +const ConfigChain = __nccwpck_require__(18271).ConfigChain; +const util = __nccwpck_require__(95950); class Conf extends ConfigChain { // https://github.com/npm/npm/blob/latest/lib/config/core.js#L208-L222 @@ -81098,14 +67180,14 @@ module.exports = Conf; /***/ }), /***/ 5473: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; // Generated with `lib/make.js` - const os = __webpack_require__(12087); - const path = __webpack_require__(85622); + const os = __nccwpck_require__(12087); + const path = __nccwpck_require__(85622); const temp = os.tmpdir(); const uidOrPid = process.getuid ? process.getuid() : process.pid; @@ -81275,15 +67357,15 @@ module.exports = Conf; /***/ }), /***/ 18406: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; // Generated with `lib/make.js` - const path = __webpack_require__(85622); - const Stream = __webpack_require__(92413).Stream; - const url = __webpack_require__(78835); + const path = __nccwpck_require__(85622); + const Stream = __nccwpck_require__(92413).Stream; + const url = __nccwpck_require__(78835); const Umask = () => {}; const getLocalAddresses = () => []; @@ -81410,13 +67492,13 @@ module.exports = Conf; /***/ }), /***/ 95950: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const types = __webpack_require__(18406); +const fs = __nccwpck_require__(35747); +const path = __nccwpck_require__(85622); +const types = __nccwpck_require__(18406); // https://github.com/npm/npm/blob/latest/lib/config/core.js#L409-L423 const envReplace = str => { @@ -81565,12 +67647,12 @@ exports.parseField = parseField; /***/ }), /***/ 79391: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const pathKey = __webpack_require__(59086); +const path = __nccwpck_require__(85622); +const pathKey = __nccwpck_require__(37637); const npmRunPath = options => { options = { @@ -81617,132 +67699,10 @@ module.exports.env = options => { }; -/***/ }), - -/***/ 59086: -/***/ ((module) => { - -"use strict"; - - -const pathKey = (options = {}) => { - const environment = options.env || process.env; - const platform = options.platform || process.platform; - - if (platform !== 'win32') { - return 'PATH'; - } - - return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; -}; - -module.exports = pathKey; -// TODO: Remove this for the next major release -module.exports.default = pathKey; - - -/***/ }), - -/***/ 14594: -/***/ ((module) => { - -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - - -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - - /***/ }), /***/ 37971: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -81752,7 +67712,7 @@ if (!Object.keys) { // modified from https://github.com/es-shims/es5-shim var has = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; - var isArgs = __webpack_require__(10243); // eslint-disable-line global-require + var isArgs = __nccwpck_require__(10243); // eslint-disable-line global-require var isEnumerable = Object.prototype.propertyIsEnumerable; var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); @@ -81872,16 +67832,16 @@ module.exports = keysShim; /***/ }), /***/ 28777: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; var slice = Array.prototype.slice; -var isArgs = __webpack_require__(10243); +var isArgs = __nccwpck_require__(10243); var origKeys = Object.keys; -var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(37971); +var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __nccwpck_require__(37971); var originalKeys = Object.keys; @@ -81937,9 +67897,9 @@ module.exports = function isArguments(value) { /***/ }), /***/ 96754: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var wrappy = __webpack_require__(83640) +var wrappy = __nccwpck_require__(83640) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) @@ -81986,90 +67946,89 @@ function onceStrict (fn) { /***/ }), /***/ 81053: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const mimicFn = __webpack_require__(71883); +const mimicFn = __nccwpck_require__(71883); const calledFunctions = new WeakMap(); -const oneTime = (fn, options = {}) => { - if (typeof fn !== 'function') { +const onetime = (function_, options = {}) => { + if (typeof function_ !== 'function') { throw new TypeError('Expected a function'); } - let ret; - let isCalled = false; + let returnValue; let callCount = 0; - const functionName = fn.displayName || fn.name || ''; + const functionName = function_.displayName || function_.name || ''; - const onetime = function (...args) { + const onetime = function (...arguments_) { calledFunctions.set(onetime, ++callCount); - if (isCalled) { - if (options.throw === true) { - throw new Error(`Function \`${functionName}\` can only be called once`); - } - - return ret; + if (callCount === 1) { + returnValue = function_.apply(this, arguments_); + function_ = null; + } else if (options.throw === true) { + throw new Error(`Function \`${functionName}\` can only be called once`); } - isCalled = true; - ret = fn.apply(this, args); - fn = null; - - return ret; + return returnValue; }; - mimicFn(onetime, fn); + mimicFn(onetime, function_); calledFunctions.set(onetime, callCount); return onetime; }; -module.exports = oneTime; +module.exports = onetime; // TODO: Remove this for the next major release -module.exports.default = oneTime; +module.exports.default = onetime; -module.exports.callCount = fn => { - if (!calledFunctions.has(fn)) { - throw new Error(`The given function \`${fn.name}\` is not wrapped by the \`onetime\` package`); +module.exports.callCount = function_ => { + if (!calledFunctions.has(function_)) { + throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); } - return calledFunctions.get(fn); + return calledFunctions.get(function_); }; /***/ }), /***/ 5420: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const readline = __webpack_require__(51058); -const chalk = __webpack_require__(7833); -const cliCursor = __webpack_require__(87400); -const cliSpinners = __webpack_require__(63488); -const logSymbols = __webpack_require__(87279); -const stripAnsi = __webpack_require__(26301); -const wcwidth = __webpack_require__(25997); -const isInteractive = __webpack_require__(47133); -const MuteStream = __webpack_require__(64003); +const readline = __nccwpck_require__(51058); +const chalk = __nccwpck_require__(7833); +const cliCursor = __nccwpck_require__(87400); +const cliSpinners = __nccwpck_require__(63488); +const logSymbols = __nccwpck_require__(87279); +const stripAnsi = __nccwpck_require__(26301); +const wcwidth = __nccwpck_require__(25997); +const isInteractive = __nccwpck_require__(47133); +const {BufferListStream} = __nccwpck_require__(93453); const TEXT = Symbol('text'); const PREFIX_TEXT = Symbol('prefixText'); const ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code +const terminalSupportsUnicode = () => ( + process.platform !== 'win32' || + process.env.TERM_PROGRAM === 'vscode' || + Boolean(process.env.WT_SESSION) +); + class StdinDiscarder { constructor() { this.requests = 0; - this.mutedStream = new MuteStream(); + this.mutedStream = new BufferListStream(); this.mutedStream.pipe(process.stdout); - this.mutedStream.mute(); const self = this; this.ourEmit = function (event, data, ...args) { @@ -82213,7 +68172,7 @@ class Ora { } this._spinner = spinner; - } else if (process.platform === 'win32') { + } else if (!terminalSupportsUnicode()) { this._spinner = cliSpinners.line; } else if (spinner === undefined) { // Set default spinner @@ -82231,10 +68190,20 @@ class Ora { return this[TEXT]; } + set text(value) { + this[TEXT] = value; + this.updateLineCount(); + } + get prefixText() { return this[PREFIX_TEXT]; } + set prefixText(value) { + this[PREFIX_TEXT] = value; + this.updateLineCount(); + } + get isSpinning() { return this.id !== undefined; } @@ -82254,19 +68223,10 @@ class Ora { updateLineCount() { const columns = this.stream.columns || 80; const fullPrefixText = this.getFullPrefixText(this.prefixText, '-'); - this.lineCount = stripAnsi(fullPrefixText + '--' + this[TEXT]).split('\n').reduce((count, line) => { - return count + Math.max(1, Math.ceil(wcwidth(line) / columns)); - }, 0); - } - - set text(value) { - this[TEXT] = value; - this.updateLineCount(); - } - - set prefixText(value) { - this[PREFIX_TEXT] = value; - this.updateLineCount(); + this.lineCount = 0; + for (const line of stripAnsi(fullPrefixText + '--' + this[TEXT]).split('\n')) { + this.lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns)); + } } get isEnabled() { @@ -82447,7 +68407,7 @@ module.exports.promise = (action, options) => { try { await action; spinner.succeed(); - } catch (_) { + } catch { spinner.fail(); } })(); @@ -82459,11 +68419,11 @@ module.exports.promise = (action, options) => { /***/ }), /***/ 87400: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -const restoreCursor = __webpack_require__(37463); +const restoreCursor = __nccwpck_require__(37463); let isHidden = false; @@ -82502,12 +68462,12 @@ exports.toggle = (force, writableStream) => { /***/ }), /***/ 37463: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const onetime = __webpack_require__(81053); -const signalExit = __webpack_require__(22317); +const onetime = __nccwpck_require__(81053); +const signalExit = __nccwpck_require__(22317); module.exports = onetime(() => { signalExit(() => { @@ -82630,11 +68590,11 @@ module.exports.CancelError = CancelError; /***/ }), /***/ 18884: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pTry = __webpack_require__(84944); +const pTry = __nccwpck_require__(84944); const pLimit = concurrency => { if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { @@ -82695,11 +68655,11 @@ module.exports.default = pLimit; /***/ }), /***/ 60364: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pLimit = __webpack_require__(18884); +const pLimit = __nccwpck_require__(18884); class EndError extends Error { constructor(value) { @@ -82771,125 +68731,88 @@ module.exports.default = pTry; /***/ }), -/***/ 43403: -/***/ ((module) => { +/***/ 52518: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +const errorEx = __nccwpck_require__(98361); +const fallback = __nccwpck_require__(36873); +const {default: LinesAndColumns} = __nccwpck_require__(99036); +const {codeFrameColumns} = __nccwpck_require__(36553); -/** - * Parse the content of a passwd file into a list of user objects. - * This function ignores blank lines and comments. - * - * ```js - * // assuming '/etc/passwd' contains: - * // doowb:*:123:123:Brian Woodward:/Users/doowb:/bin/bash - * console.log(parse(fs.readFileSync('/etc/passwd', 'utf8'))); - * - * //=> [ - * //=> { - * //=> username: 'doowb', - * //=> password: '*', - * //=> uid: '123', - * //=> gid: '123', - * //=> gecos: 'Brian Woodward', - * //=> homedir: '/Users/doowb', - * //=> shell: '/bin/bash' - * //=> } - * //=> ] - * ``` - * @param {String} `content` Content of a passwd file to parse. - * @return {Array} Array of user objects parsed from the content. - * @api public - */ - -module.exports = function(content) { - if (typeof content !== 'string') { - throw new Error('expected a string'); - } - return content - .split('\n') - .map(user) - .filter(Boolean); -}; - -function user(line, i) { - if (!line || !line.length || line.charAt(0) === '#') { - return null; - } - - // see https://en.wikipedia.org/wiki/Passwd for field descriptions - var fields = line.split(':'); - return { - username: fields[0], - password: fields[1], - uid: fields[2], - gid: fields[3], - // see https://en.wikipedia.org/wiki/Gecos_field for GECOS field descriptions - gecos: fields[4], - homedir: fields[5], - shell: fields[6] - }; -} +const JSONError = errorEx('JSONError', { + fileName: errorEx.append('in %s'), + codeFrame: errorEx.append('\n\n%s\n') +}); +const parseJson = (string, reviver, filename) => { + if (typeof reviver === 'string') { + filename = reviver; + reviver = null; + } -/***/ }), + try { + try { + return JSON.parse(string, reviver); + } catch (error) { + fallback(string, reviver); + throw error; + } + } catch (error) { + error.message = error.message.replace(/\n/g, ''); + const indexMatch = error.message.match(/in JSON at position (\d+) while parsing/); -/***/ 27255: -/***/ ((module) => { + const jsonError = new JSONError(error); + if (filename) { + jsonError.fileName = filename; + } -/*! - * pascalcase - * - * Copyright (c) 2015-present, Jon ("Schlink") Schlinkert. - * Licensed under the MIT License. - */ + if (indexMatch && indexMatch.length > 0) { + const lines = new LinesAndColumns(string); + const index = Number(indexMatch[1]); + const location = lines.locationForIndex(index); -const titlecase = input => input[0].toLocaleUpperCase() + input.slice(1); + const codeFrame = codeFrameColumns( + string, + {start: {line: location.line + 1, column: location.column + 1}}, + {highlightCode: true} + ); -module.exports = value => { - if (value === null || value === void 0) return ''; - if (typeof value.toString !== 'function') return ''; + jsonError.codeFrame = codeFrame; + } - let input = value.toString().trim(); - if (input === '') return ''; - if (input.length === 1) return input.toLocaleUpperCase(); + throw jsonError; + } +}; - let match = input.match(/[a-zA-Z0-9]+/g); - if (match) { - return match.map(m => titlecase(m)).join(''); - } +parseJson.JSONError = JSONError; - return input; -}; +module.exports = parseJson; /***/ }), -/***/ 36540: +/***/ 37637: /***/ ((module) => { "use strict"; -function posix(path) { - return path.charAt(0) === '/'; -} +const pathKey = (options = {}) => { + const environment = options.env || process.env; + const platform = options.platform || process.platform; -function win32(path) { - // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = Boolean(device && device.charAt(1) !== ':'); + if (platform !== 'win32') { + return 'PATH'; + } - // UNC paths are always absolute - return Boolean(result[2] || isUnc); -} + return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; +}; -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; +module.exports = pathKey; +// TODO: Remove this for the next major release +module.exports.default = pathKey; /***/ }), @@ -83057,3551 +68980,3811 @@ function pendGo(self, fn) { /***/ }), -/***/ 5669: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = __webpack_require__(47188); - - -/***/ }), - -/***/ 1259: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 32979: +/***/ ((module) => { "use strict"; +module.exports = (url, opts) => { + if (typeof url !== 'string') { + throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``); + } -const path = __webpack_require__(85622); -const WIN_SLASH = '\\\\/'; -const WIN_NO_SLASH = `[^${WIN_SLASH}]`; - -/** - * Posix glob regex - */ - -const DOT_LITERAL = '\\.'; -const PLUS_LITERAL = '\\+'; -const QMARK_LITERAL = '\\?'; -const SLASH_LITERAL = '\\/'; -const ONE_CHAR = '(?=.)'; -const QMARK = '[^/]'; -const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; -const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; -const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; -const NO_DOT = `(?!${DOT_LITERAL})`; -const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; -const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; -const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; -const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; -const STAR = `${QMARK}*?`; - -const POSIX_CHARS = { - DOT_LITERAL, - PLUS_LITERAL, - QMARK_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - QMARK, - END_ANCHOR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK_NO_DOT, - STAR, - START_ANCHOR -}; - -/** - * Windows glob regex - */ - -const WINDOWS_CHARS = { - ...POSIX_CHARS, - - SLASH_LITERAL: `[${WIN_SLASH}]`, - QMARK: WIN_NO_SLASH, - STAR: `${WIN_NO_SLASH}*?`, - DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, - NO_DOT: `(?!${DOT_LITERAL})`, - NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, - NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - QMARK_NO_DOT: `[^.${WIN_SLASH}]`, - START_ANCHOR: `(?:^|[${WIN_SLASH}])`, - END_ANCHOR: `(?:[${WIN_SLASH}]|$)` -}; + url = url.trim(); + opts = Object.assign({https: false}, opts); -/** - * POSIX Bracket Regex - */ + if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { + return url; + } -const POSIX_REGEX_SOURCE = { - alnum: 'a-zA-Z0-9', - alpha: 'a-zA-Z', - ascii: '\\x00-\\x7F', - blank: ' \\t', - cntrl: '\\x00-\\x1F\\x7F', - digit: '0-9', - graph: '\\x21-\\x7E', - lower: 'a-z', - print: '\\x20-\\x7E ', - punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', - space: ' \\t\\r\\n\\v\\f', - upper: 'A-Z', - word: 'A-Za-z0-9_', - xdigit: 'A-Fa-f0-9' + return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://'); }; -module.exports = { - MAX_LENGTH: 1024 * 64, - POSIX_REGEX_SOURCE, - - // regular expressions - REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, - REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, - REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, - REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, - REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, - REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, - // Replace globs with equivalent patterns to reduce parsing time. - REPLACEMENTS: { - '***': '*', - '**/**': '**', - '**/**/**': '**' - }, - - // Digits - CHAR_0: 48, /* 0 */ - CHAR_9: 57, /* 9 */ - - // Alphabet chars. - CHAR_UPPERCASE_A: 65, /* A */ - CHAR_LOWERCASE_A: 97, /* a */ - CHAR_UPPERCASE_Z: 90, /* Z */ - CHAR_LOWERCASE_Z: 122, /* z */ - - CHAR_LEFT_PARENTHESES: 40, /* ( */ - CHAR_RIGHT_PARENTHESES: 41, /* ) */ - - CHAR_ASTERISK: 42, /* * */ - - // Non-alphabetic chars. - CHAR_AMPERSAND: 38, /* & */ - CHAR_AT: 64, /* @ */ - CHAR_BACKWARD_SLASH: 92, /* \ */ - CHAR_CARRIAGE_RETURN: 13, /* \r */ - CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ - CHAR_COLON: 58, /* : */ - CHAR_COMMA: 44, /* , */ - CHAR_DOT: 46, /* . */ - CHAR_DOUBLE_QUOTE: 34, /* " */ - CHAR_EQUAL: 61, /* = */ - CHAR_EXCLAMATION_MARK: 33, /* ! */ - CHAR_FORM_FEED: 12, /* \f */ - CHAR_FORWARD_SLASH: 47, /* / */ - CHAR_GRAVE_ACCENT: 96, /* ` */ - CHAR_HASH: 35, /* # */ - CHAR_HYPHEN_MINUS: 45, /* - */ - CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ - CHAR_LEFT_CURLY_BRACE: 123, /* { */ - CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ - CHAR_LINE_FEED: 10, /* \n */ - CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ - CHAR_PERCENT: 37, /* % */ - CHAR_PLUS: 43, /* + */ - CHAR_QUESTION_MARK: 63, /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ - CHAR_RIGHT_CURLY_BRACE: 125, /* } */ - CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ - CHAR_SEMICOLON: 59, /* ; */ - CHAR_SINGLE_QUOTE: 39, /* ' */ - CHAR_SPACE: 32, /* */ - CHAR_TAB: 9, /* \t */ - CHAR_UNDERSCORE: 95, /* _ */ - CHAR_VERTICAL_LINE: 124, /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ - - SEP: path.sep, - - /** - * Create EXTGLOB_CHARS - */ +/***/ }), - extglobChars(chars) { - return { - '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, - '?': { type: 'qmark', open: '(?:', close: ')?' }, - '+': { type: 'plus', open: '(?:', close: ')+' }, - '*': { type: 'star', open: '(?:', close: ')*' }, - '@': { type: 'at', open: '(?:', close: ')' } - }; - }, +/***/ 9154: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Create GLOB_CHARS - */ - - globChars(win32) { - return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; - } -}; +module.exports = __nccwpck_require__(91341); /***/ }), -/***/ 3155: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - +/***/ 91341: +/***/ ((module, exports) => { -const constants = __webpack_require__(1259); -const utils = __webpack_require__(86444); +/*! + * node-progress + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ /** - * Constants + * Expose `ProgressBar`. */ -const { - MAX_LENGTH, - POSIX_REGEX_SOURCE, - REGEX_NON_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_BACKREF, - REPLACEMENTS -} = constants; +exports = module.exports = ProgressBar; /** - * Helpers + * Initialize a `ProgressBar` with the given `fmt` string and `options` or + * `total`. + * + * Options: + * + * - `curr` current completed index + * - `total` total number of ticks to complete + * - `width` the displayed width of the progress bar defaulting to total + * - `stream` the output stream defaulting to stderr + * - `head` head character defaulting to complete character + * - `complete` completion character defaulting to "=" + * - `incomplete` incomplete character defaulting to "-" + * - `renderThrottle` minimum time between updates in milliseconds defaulting to 16 + * - `callback` optional function to call when the progress bar completes + * - `clear` will clear the progress bar upon termination + * + * Tokens: + * + * - `:bar` the progress bar itself + * - `:current` current tick number + * - `:total` total ticks + * - `:elapsed` time elapsed in seconds + * - `:percent` completion percentage + * - `:eta` eta in seconds + * - `:rate` rate of ticks per second + * + * @param {string} fmt + * @param {object|number} options or total + * @api public */ -const expandRange = (args, options) => { - if (typeof options.expandRange === 'function') { - return options.expandRange(...args, options); - } - - args.sort(); - const value = `[${args.join('-')}]`; +function ProgressBar(fmt, options) { + this.stream = options.stream || process.stderr; - try { - /* eslint-disable-next-line no-new */ - new RegExp(value); - } catch (ex) { - return args.map(v => utils.escapeRegex(v)).join('..'); + if (typeof(options) == 'number') { + var total = options; + options = {}; + options.total = total; + } else { + options = options || {}; + if ('string' != typeof fmt) throw new Error('format required'); + if ('number' != typeof options.total) throw new Error('total required'); } - return value; -}; - -/** - * Create the message for a syntax error - */ - -const syntaxError = (type, char) => { - return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; -}; + this.fmt = fmt; + this.curr = options.curr || 0; + this.total = options.total; + this.width = options.width || this.total; + this.clear = options.clear + this.chars = { + complete : options.complete || '=', + incomplete : options.incomplete || '-', + head : options.head || (options.complete || '=') + }; + this.renderThrottle = options.renderThrottle !== 0 ? (options.renderThrottle || 16) : 0; + this.lastRender = -Infinity; + this.callback = options.callback || function () {}; + this.tokens = {}; + this.lastDraw = ''; +} /** - * Parse the given input string. - * @param {String} input - * @param {Object} options - * @return {Object} + * "tick" the progress bar with optional `len` and optional `tokens`. + * + * @param {number|object} len or tokens + * @param {object} tokens + * @api public */ -const parse = (input, options) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } - - input = REPLACEMENTS[input] || input; - - const opts = { ...options }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - - let len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); - } - - const bos = { type: 'bos', value: '', output: opts.prepend || '' }; - const tokens = [bos]; - - const capture = opts.capture ? '' : '?:'; - const win32 = utils.isWindows(options); +ProgressBar.prototype.tick = function(len, tokens){ + if (len !== 0) + len = len || 1; - // create constants based on platform, for windows or posix - const PLATFORM_CHARS = constants.globChars(win32); - const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + // swap tokens + if ('object' == typeof len) tokens = len, len = 1; + if (tokens) this.tokens = tokens; - const { - DOT_LITERAL, - PLUS_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK, - QMARK_NO_DOT, - STAR, - START_ANCHOR - } = PLATFORM_CHARS; + // start time for eta + if (0 == this.curr) this.start = new Date; - const globstar = (opts) => { - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; + this.curr += len - const nodot = opts.dot ? '' : NO_DOT; - const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; - let star = opts.bash === true ? globstar(opts) : STAR; + // try to render + this.render(); - if (opts.capture) { - star = `(${star})`; + // progress complete + if (this.curr >= this.total) { + this.render(undefined, true); + this.complete = true; + this.terminate(); + this.callback(this); + return; } +}; - // minimatch options support - if (typeof opts.noext === 'boolean') { - opts.noextglob = opts.noext; - } +/** + * Method to render the progress bar with optional `tokens` to place in the + * progress bar's `fmt` field. + * + * @param {object} tokens + * @api public + */ - const state = { - input, - index: -1, - start: 0, - dot: opts.dot === true, - consumed: '', - output: '', - prefix: '', - backtrack: false, - negated: false, - brackets: 0, - braces: 0, - parens: 0, - quotes: 0, - globstar: false, - tokens - }; +ProgressBar.prototype.render = function (tokens, force) { + force = force !== undefined ? force : false; + if (tokens) this.tokens = tokens; - input = utils.removePrefix(input, state); - len = input.length; + if (!this.stream.isTTY) return; - const extglobs = []; - const braces = []; - const stack = []; - let prev = bos; - let value; + var now = Date.now(); + var delta = now - this.lastRender; + if (!force && (delta < this.renderThrottle)) { + return; + } else { + this.lastRender = now; + } - /** - * Tokenizing helpers - */ + var ratio = this.curr / this.total; + ratio = Math.min(Math.max(ratio, 0), 1); - const eos = () => state.index === len - 1; - const peek = state.peek = (n = 1) => input[state.index + n]; - const advance = state.advance = () => input[++state.index]; - const remaining = () => input.slice(state.index + 1); - const consume = (value = '', num = 0) => { - state.consumed += value; - state.index += num; - }; - const append = token => { - state.output += token.output != null ? token.output : token.value; - consume(token.value); - }; + var percent = Math.floor(ratio * 100); + var incomplete, complete, completeLength; + var elapsed = new Date - this.start; + var eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1); + var rate = this.curr / (elapsed / 1000); - const negate = () => { - let count = 1; + /* populate the bar template with percentages and timestamps */ + var str = this.fmt + .replace(':current', this.curr) + .replace(':total', this.total) + .replace(':elapsed', isNaN(elapsed) ? '0.0' : (elapsed / 1000).toFixed(1)) + .replace(':eta', (isNaN(eta) || !isFinite(eta)) ? '0.0' : (eta / 1000) + .toFixed(1)) + .replace(':percent', percent.toFixed(0) + '%') + .replace(':rate', Math.round(rate)); - while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { - advance(); - state.start++; - count++; - } + /* compute the available space (non-zero) for the bar */ + var availableSpace = Math.max(0, this.stream.columns - str.replace(':bar', '').length); + if(availableSpace && process.platform === 'win32'){ + availableSpace = availableSpace - 1; + } - if (count % 2 === 0) { - return false; - } + var width = Math.min(this.width, availableSpace); - state.negated = true; - state.start++; - return true; - }; + /* TODO: the following assumes the user has one ':bar' token */ + completeLength = Math.round(width * ratio); + complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete); + incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete); - const increment = type => { - state[type]++; - stack.push(type); - }; + /* add head to the complete string */ + if(completeLength > 0) + complete = complete.slice(0, -1) + this.chars.head; - const decrement = type => { - state[type]--; - stack.pop(); - }; + /* fill in the actual progress bar */ + str = str.replace(':bar', complete + incomplete); - /** - * Push tokens onto the tokens array. This helper speeds up - * tokenizing by 1) helping us avoid backtracking as much as possible, - * and 2) helping us avoid creating extra tokens when consecutive - * characters are plain text. This improves performance and simplifies - * lookbehinds. - */ + /* replace the extra tokens */ + if (this.tokens) for (var key in this.tokens) str = str.replace(':' + key, this.tokens[key]); - const push = tok => { - if (prev.type === 'globstar') { - const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); - const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + if (this.lastDraw !== str) { + this.stream.cursorTo(0); + this.stream.write(str); + this.stream.clearLine(1); + this.lastDraw = str; + } +}; - if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { - state.output = state.output.slice(0, -prev.output.length); - prev.type = 'star'; - prev.value = '*'; - prev.output = star; - state.output += prev.output; - } - } +/** + * "update" the progress bar to represent an exact percentage. + * The ratio (between 0 and 1) specified will be multiplied by `total` and + * floored, representing the closest available "tick." For example, if a + * progress bar has a length of 3 and `update(0.5)` is called, the progress + * will be set to 1. + * + * A ratio of 0.5 will attempt to set the progress to halfway. + * + * @param {number} ratio The ratio (between 0 and 1 inclusive) to set the + * overall completion to. + * @api public + */ - if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) { - extglobs[extglobs.length - 1].inner += tok.value; - } +ProgressBar.prototype.update = function (ratio, tokens) { + var goal = Math.floor(ratio * this.total); + var delta = goal - this.curr; - if (tok.value || tok.output) append(tok); - if (prev && prev.type === 'text' && tok.type === 'text') { - prev.value += tok.value; - prev.output = (prev.output || '') + tok.value; - return; + this.tick(delta, tokens); +}; + +/** + * "interrupt" the progress bar and write a message above it. + * @param {string} message The message to write. + * @api public + */ + +ProgressBar.prototype.interrupt = function (message) { + // clear the current line + this.stream.clearLine(); + // move the cursor to the start of the line + this.stream.cursorTo(0); + // write the message text + this.stream.write(message); + // terminate the line after writing the message + this.stream.write('\n'); + // re-display the progress bar with its lastDraw + this.stream.write(this.lastDraw); +}; + +/** + * Terminates a progress bar. + * + * @api public + */ + +ProgressBar.prototype.terminate = function () { + if (this.clear) { + if (this.stream.clearLine) { + this.stream.clearLine(); + this.stream.cursorTo(0); } + } else { + this.stream.write('\n'); + } +}; - tok.prev = prev; - tokens.push(tok); - prev = tok; - }; - const extglobOpen = (type, value) => { - const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; +/***/ }), - token.prev = prev; - token.parens = state.parens; - token.output = state.output; - const output = (opts.capture ? '(' : '') + token.open; +/***/ 98051: +/***/ ((module) => { - increment('parens'); - push({ type, value, output: state.output ? '' : ONE_CHAR }); - push({ type: 'paren', extglob: true, value: advance(), output }); - extglobs.push(token); - }; - const extglobClose = token => { - let output = token.close + (opts.capture ? ')' : ''); +module.exports = ProtoList - if (token.type === 'negate') { - let extglobStar = star; +function setProto(obj, proto) { + if (typeof Object.setPrototypeOf === "function") + return Object.setPrototypeOf(obj, proto) + else + obj.__proto__ = proto +} - if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { - extglobStar = globstar(opts); +function ProtoList () { + this.list = [] + var root = null + Object.defineProperty(this, 'root', { + get: function () { return root }, + set: function (r) { + root = r + if (this.list.length) { + setProto(this.list[this.list.length - 1], r) } + }, + enumerable: true, + configurable: true + }) +} - if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { - output = token.close = `)$))${extglobStar}`; +ProtoList.prototype = + { get length () { return this.list.length } + , get keys () { + var k = [] + for (var i in this.list[0]) k.push(i) + return k + } + , get snapshot () { + var o = {} + this.keys.forEach(function (k) { o[k] = this.get(k) }, this) + return o + } + , get store () { + return this.list[0] + } + , push : function (obj) { + if (typeof obj !== "object") obj = {valueOf:obj} + if (this.list.length >= 1) { + setProto(this.list[this.list.length - 1], obj) } - - if (token.prev.type === 'bos' && eos()) { - state.negatedExtglob = true; + setProto(obj, this.root) + return this.list.push(obj) + } + , pop : function () { + if (this.list.length >= 2) { + setProto(this.list[this.list.length - 2], this.root) + } + return this.list.pop() + } + , unshift : function (obj) { + setProto(obj, this.list[0] || this.root) + return this.list.unshift(obj) + } + , shift : function () { + if (this.list.length === 1) { + setProto(this.list[0], this.root) + } + return this.list.shift() + } + , get : function (key) { + return this.list[0][key] + } + , set : function (key, val, save) { + if (!this.length) this.push({}) + if (save && this.list[0].hasOwnProperty(key)) this.push({}) + return this.list[0][key] = val + } + , forEach : function (fn, thisp) { + for (var key in this.list[0]) fn.call(thisp, key, this.list[0][key]) + } + , slice : function () { + return this.list.slice.apply(this.list, arguments) + } + , splice : function () { + // handle injections + var ret = this.list.splice.apply(this.list, arguments) + for (var i = 0, l = this.list.length; i < l; i++) { + setProto(this.list[i], this.list[i + 1] || this.root) } + return ret } + } - push({ type: 'paren', extglob: true, value, output }); - decrement('parens'); - }; - /** - * Fast paths - */ +/***/ }), - if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { - let backslashes = false; +/***/ 20113: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { - if (first === '\\') { - backslashes = true; - return m; - } +var once = __nccwpck_require__(96754) +var eos = __nccwpck_require__(11745) +var fs = __nccwpck_require__(35747) // we only need fs to get the ReadStream and WriteStream prototypes - if (first === '?') { - if (esc) { - return esc + first + (rest ? QMARK.repeat(rest.length) : ''); - } - if (index === 0) { - return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); - } - return QMARK.repeat(chars.length); - } +var noop = function () {} +var ancient = /^v?\.0/.test(process.version) - if (first === '.') { - return DOT_LITERAL.repeat(chars.length); - } +var isFn = function (fn) { + return typeof fn === 'function' +} - if (first === '*') { - if (esc) { - return esc + first + (rest ? star : ''); - } - return star; - } - return esc ? m : `\\${m}`; - }); +var isFS = function (stream) { + if (!ancient) return false // newer node version do not need to care about fs is a special way + if (!fs) return false // browser + return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) +} - if (backslashes === true) { - if (opts.unescape === true) { - output = output.replace(/\\/g, ''); - } else { - output = output.replace(/\\+/g, m => { - return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); - }); - } - } +var isRequest = function (stream) { + return stream.setHeader && isFn(stream.abort) +} - if (output === input && opts.contains === true) { - state.output = input; - return state; - } +var destroyer = function (stream, reading, writing, callback) { + callback = once(callback) - state.output = utils.wrapOutput(output, state, options); - return state; - } + var closed = false + stream.on('close', function () { + closed = true + }) - /** - * Tokenize input until we reach end-of-string - */ + eos(stream, {readable: reading, writable: writing}, function (err) { + if (err) return callback(err) + closed = true + callback() + }) - while (!eos()) { - value = advance(); + var destroyed = false + return function (err) { + if (closed) return + if (destroyed) return + destroyed = true - if (value === '\u0000') { - continue; - } + if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks + if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want - /** - * Escaped characters - */ + if (isFn(stream.destroy)) return stream.destroy() - if (value === '\\') { - const next = peek(); + callback(err || new Error('stream was destroyed')) + } +} - if (next === '/' && opts.bash !== true) { - continue; - } +var call = function (fn) { + fn() +} - if (next === '.' || next === ';') { - continue; - } +var pipe = function (from, to) { + return from.pipe(to) +} - if (!next) { - value += '\\'; - push({ type: 'text', value }); - continue; - } +var pump = function () { + var streams = Array.prototype.slice.call(arguments) + var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop - // collapse slashes to reduce potential for exploits - const match = /^\\+/.exec(remaining()); - let slashes = 0; + if (Array.isArray(streams[0])) streams = streams[0] + if (streams.length < 2) throw new Error('pump requires two streams per minimum') - if (match && match[0].length > 2) { - slashes = match[0].length; - state.index += slashes; - if (slashes % 2 !== 0) { - value += '\\'; - } - } + var error + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1 + var writing = i > 0 + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err + if (err) destroys.forEach(call) + if (reading) return + destroys.forEach(call) + callback(error) + }) + }) - if (opts.unescape === true) { - value = advance() || ''; - } else { - value += advance() || ''; - } + return streams.reduce(pipe) +} - if (state.brackets === 0) { - push({ type: 'text', value }); - continue; - } - } +module.exports = pump - /** - * If we're inside a regex character class, continue - * until we reach the closing bracket. - */ - if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { - if (opts.posix !== false && value === ':') { - const inner = prev.value.slice(1); - if (inner.includes('[')) { - prev.posix = true; +/***/ }), - if (inner.includes(':')) { - const idx = prev.value.lastIndexOf('['); - const pre = prev.value.slice(0, idx); - const rest = prev.value.slice(idx + 2); - const posix = POSIX_REGEX_SOURCE[rest]; - if (posix) { - prev.value = pre + posix; - state.backtrack = true; - advance(); +/***/ 45730: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (!bos.output && tokens.indexOf(prev) === 1) { - bos.output = ONE_CHAR; - } - continue; - } - } - } - } +"use strict"; - if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { - value = `\\${value}`; - } +const path = __nccwpck_require__(85622); +const findUp = __nccwpck_require__(2885); +const readPkg = __nccwpck_require__(19003); - if (value === ']' && (prev.value === '[' || prev.value === '[^')) { - value = `\\${value}`; - } +module.exports = async options => { + const filePath = await findUp('package.json', options); - if (opts.posix === true && value === '!' && prev.value === '[') { - value = '^'; - } + if (!filePath) { + return; + } - prev.value += value; - append({ value }); - continue; - } + return { + packageJson: await readPkg({...options, cwd: path.dirname(filePath)}), + path: filePath + }; +}; - /** - * If we're inside a quoted string, continue - * until we reach the closing double quote. - */ +module.exports.sync = options => { + const filePath = findUp.sync('package.json', options); - if (state.quotes === 1 && value !== '"') { - value = utils.escapeRegex(value); - prev.value += value; - append({ value }); - continue; - } + if (!filePath) { + return; + } + + return { + packageJson: readPkg.sync({...options, cwd: path.dirname(filePath)}), + path: filePath + }; +}; - /** - * Double quotes - */ - if (value === '"') { - state.quotes = state.quotes === 1 ? 0 : 1; - if (opts.keepQuotes === true) { - push({ type: 'text', value }); - } - continue; - } +/***/ }), - /** - * Parentheses - */ +/***/ 19003: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (value === '(') { - increment('parens'); - push({ type: 'paren', value }); - continue; - } +"use strict"; - if (value === ')') { - if (state.parens === 0 && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '(')); - } +const {promisify} = __nccwpck_require__(31669); +const fs = __nccwpck_require__(35747); +const path = __nccwpck_require__(85622); +const parseJson = __nccwpck_require__(52518); - const extglob = extglobs[extglobs.length - 1]; - if (extglob && state.parens === extglob.parens + 1) { - extglobClose(extglobs.pop()); - continue; - } +const readFileAsync = promisify(fs.readFile); - push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); - decrement('parens'); - continue; - } +module.exports = async options => { + options = { + cwd: process.cwd(), + normalize: true, + ...options + }; - /** - * Square brackets - */ + const filePath = path.resolve(options.cwd, 'package.json'); + const json = parseJson(await readFileAsync(filePath, 'utf8')); - if (value === '[') { - if (opts.nobracket === true || !remaining().includes(']')) { - if (opts.nobracket !== true && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('closing', ']')); - } + if (options.normalize) { + __nccwpck_require__(44586)(json); + } - value = `\\${value}`; - } else { - increment('brackets'); - } + return json; +}; - push({ type: 'bracket', value }); - continue; - } +module.exports.sync = options => { + options = { + cwd: process.cwd(), + normalize: true, + ...options + }; - if (value === ']') { - if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { - push({ type: 'text', value, output: `\\${value}` }); - continue; - } + const filePath = path.resolve(options.cwd, 'package.json'); + const json = parseJson(fs.readFileSync(filePath, 'utf8')); - if (state.brackets === 0) { - if (opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '[')); - } + if (options.normalize) { + __nccwpck_require__(44586)(json); + } - push({ type: 'text', value, output: `\\${value}` }); - continue; - } + return json; +}; - decrement('brackets'); - const prevValue = prev.value.slice(1); - if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { - value = `/${value}`; - } +/***/ }), - prev.value += value; - append({ value }); +/***/ 92036: +/***/ ((module) => { - // when literal brackets are explicitly disabled - // assume we should match with a regex character class - if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { - continue; - } +"use strict"; - const escaped = utils.escapeRegex(prev.value); - state.output = state.output.slice(0, -prev.value.length); - // when literal brackets are explicitly enabled - // assume we should escape the brackets to match literal characters - if (opts.literalBrackets === true) { - state.output += escaped; - prev.value = escaped; - continue; - } +const codes = {}; - // when the user specifies nothing, try to match both - prev.value = `(${capture}${escaped}|${prev.value})`; - state.output += prev.value; - continue; +function createErrorType(code, message, Base) { + if (!Base) { + Base = Error + } + + function getMessage (arg1, arg2, arg3) { + if (typeof message === 'string') { + return message + } else { + return message(arg1, arg2, arg3) } + } - /** - * Braces - */ + class NodeError extends Base { + constructor (arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } - if (value === '{' && opts.nobrace !== true) { - increment('braces'); + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; - const open = { - type: 'brace', - value, - output: '(', - outputIndex: state.output.length, - tokensIndex: state.tokens.length - }; + codes[code] = NodeError; +} - braces.push(open); - push(open); - continue; +// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js +function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i) => String(i)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; } + } else { + return `of ${thing} ${String(expected)}`; + } +} - if (value === '}') { - const brace = braces[braces.length - 1]; +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith +function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; +} - if (opts.nobrace === true || !brace) { - push({ type: 'text', value, output: value }); - continue; - } +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith +function endsWith(str, search, this_len) { + if (this_len === undefined || this_len > str.length) { + this_len = str.length; + } + return str.substring(this_len - search.length, this_len) === search; +} - let output = ')'; +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes +function includes(str, search, start) { + if (typeof start !== 'number') { + start = 0; + } - if (brace.dots === true) { - const arr = tokens.slice(); - const range = []; + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } +} - for (let i = arr.length - 1; i >= 0; i--) { - tokens.pop(); - if (arr[i].type === 'brace') { - break; - } - if (arr[i].type !== 'dots') { - range.unshift(arr[i].value); - } - } +createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"' +}, TypeError); +createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { + // determiner: 'must be' or 'must not be' + let determiner; + if (typeof expected === 'string' && startsWith(expected, 'not ')) { + determiner = 'must not be'; + expected = expected.replace(/^not /, ''); + } else { + determiner = 'must be'; + } - output = expandRange(range, opts); - state.backtrack = true; - } + let msg; + if (endsWith(name, ' argument')) { + // For cases like 'first argument' + msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; + } else { + const type = includes(name, '.') ? 'property' : 'argument'; + msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; + } - if (brace.comma !== true && brace.dots !== true) { - const out = state.output.slice(0, brace.outputIndex); - const toks = state.tokens.slice(brace.tokensIndex); - brace.value = brace.output = '\\{'; - value = output = '\\}'; - state.output = out; - for (const t of toks) { - state.output += (t.output || t.value); - } - } + msg += `. Received type ${typeof actual}`; + return msg; +}, TypeError); +createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); +createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { + return 'The ' + name + ' method is not implemented' +}); +createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); +createErrorType('ERR_STREAM_DESTROYED', function (name) { + return 'Cannot call ' + name + ' after a stream was destroyed'; +}); +createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); +createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); +createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); +createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); +createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { + return 'Unknown encoding: ' + arg +}, TypeError); +createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); - push({ type: 'brace', value, output }); - decrement('braces'); - braces.pop(); - continue; - } +module.exports.q = codes; - /** - * Pipes - */ - if (value === '|') { - if (extglobs.length > 0) { - extglobs[extglobs.length - 1].conditions++; - } - push({ type: 'text', value }); - continue; - } +/***/ }), - /** - * Commas - */ +/***/ 42770: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (value === ',') { - let output = value; +"use strict"; +// 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. +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. - const brace = braces[braces.length - 1]; - if (brace && stack[stack.length - 1] === 'braces') { - brace.comma = true; - output = '|'; - } +/**/ - push({ type: 'comma', value, output }); - continue; - } +var objectKeys = Object.keys || function (obj) { + var keys = []; - /** - * Slashes - */ + for (var key in obj) { + keys.push(key); + } - if (value === '/') { - // if the beginning of the glob is "./", advance the start - // to the current index, and don't add the "./" characters - // to the state. This greatly simplifies lookbehinds when - // checking for BOS characters like "!" and "." (not "./") - if (prev.type === 'dot' && state.index === state.start + 1) { - state.start = state.index + 1; - state.consumed = ''; - state.output = ''; - tokens.pop(); - prev = bos; // reset "prev" to the first token - continue; - } + return keys; +}; +/**/ - push({ type: 'slash', value, output: SLASH_LITERAL }); - continue; - } - /** - * Dots - */ +module.exports = Duplex; - if (value === '.') { - if (state.braces > 0 && prev.type === 'dot') { - if (prev.value === '.') prev.output = DOT_LITERAL; - const brace = braces[braces.length - 1]; - prev.type = 'dots'; - prev.output += value; - prev.value += value; - brace.dots = true; - continue; - } +var Readable = __nccwpck_require__(79341); - if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { - push({ type: 'text', value, output: DOT_LITERAL }); - continue; - } +var Writable = __nccwpck_require__(78063); - push({ type: 'dot', value, output: DOT_LITERAL }); - continue; - } +__nccwpck_require__(2989)(Duplex, Readable); - /** - * Question marks - */ +{ + // Allow the keys array to be GC'ed. + var keys = objectKeys(Writable.prototype); - if (value === '?') { - const isGroup = prev && prev.value === '('; - if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('qmark', value); - continue; - } + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} - if (prev && prev.type === 'paren') { - const next = peek(); - let output = value; +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + Readable.call(this, options); + Writable.call(this, options); + this.allowHalfOpen = true; - if (next === '<' && !utils.supportsLookbehinds()) { - throw new Error('Node.js v10 or higher is required for regex lookbehinds'); - } + if (options) { + if (options.readable === false) this.readable = false; + if (options.writable === false) this.writable = false; - if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { - output = `\\${value}`; - } + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once('end', onend); + } + } +} - push({ type: 'text', value, output }); - continue; - } +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } +}); +Object.defineProperty(Duplex.prototype, 'writableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } +}); +Object.defineProperty(Duplex.prototype, 'writableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } +}); // the no-half-open enforcer - if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { - push({ type: 'qmark', value, output: QMARK_NO_DOT }); - continue; - } +function onend() { + // If the writable side ended, then we're ok. + if (this._writableState.ended) return; // no more data can be written. + // But allow more writes to happen in this tick. - push({ type: 'qmark', value, output: QMARK }); - continue; + process.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined || this._writableState === undefined) { + return false; } - /** - * Exclamation - */ + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed - if (value === '!') { - if (opts.noextglob !== true && peek() === '(') { - if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { - extglobOpen('negate', value); - continue; - } - } - if (opts.nonegate !== true && state.index === 0) { - negate(); - continue; - } - } + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); - /** - * Plus - */ +/***/ }), - if (value === '+') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('plus', value); - continue; - } +/***/ 60143: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if ((prev && prev.value === '(') || opts.regex === false) { - push({ type: 'plus', value, output: PLUS_LITERAL }); - continue; - } +"use strict"; +// 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. +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. - if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { - push({ type: 'plus', value }); - continue; - } - push({ type: 'plus', value: PLUS_LITERAL }); - continue; - } +module.exports = PassThrough; - /** - * Plain text - */ +var Transform = __nccwpck_require__(62826); - if (value === '@') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - push({ type: 'at', extglob: true, value, output: '' }); - continue; - } +__nccwpck_require__(2989)(PassThrough, Transform); - push({ type: 'text', value }); - continue; - } +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); +} - /** - * Plain text - */ +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; - if (value !== '*') { - if (value === '$' || value === '^') { - value = `\\${value}`; - } +/***/ }), - const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); - if (match) { - value += match[0]; - state.index += match[0].length; - } +/***/ 79341: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - push({ type: 'text', value }); - continue; - } +"use strict"; +// 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. - /** - * Stars - */ - if (prev && (prev.type === 'globstar' || prev.star === true)) { - prev.type = 'star'; - prev.star = true; - prev.value += value; - prev.output = star; - state.backtrack = true; - state.globstar = true; - consume(value); - continue; - } +module.exports = Readable; +/**/ - let rest = remaining(); - if (opts.noextglob !== true && /^\([^?]/.test(rest)) { - extglobOpen('star', value); - continue; - } +var Duplex; +/**/ - if (prev.type === 'star') { - if (opts.noglobstar === true) { - consume(value); - continue; - } +Readable.ReadableState = ReadableState; +/**/ - const prior = prev.prev; - const before = prior.prev; - const isStart = prior.type === 'slash' || prior.type === 'bos'; - const afterStar = before && (before.type === 'star' || before.type === 'globstar'); +var EE = __nccwpck_require__(28614).EventEmitter; - if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { - push({ type: 'star', value, output: '' }); - continue; - } +var EElistenerCount = function EElistenerCount(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ - const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); - const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); - if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { - push({ type: 'star', value, output: '' }); - continue; - } +/**/ - // strip consecutive `/**/` - while (rest.slice(0, 3) === '/**') { - const after = input[state.index + 4]; - if (after && after !== '/') { - break; - } - rest = rest.slice(3); - consume('/**', 3); - } - if (prior.type === 'bos' && eos()) { - prev.type = 'globstar'; - prev.value += value; - prev.output = globstar(opts); - state.output = prev.output; - state.globstar = true; - consume(value); - continue; - } +var Stream = __nccwpck_require__(1065); +/**/ - if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; - prev.type = 'globstar'; - prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); - prev.value += value; - state.globstar = true; - state.output += prior.output + prev.output; - consume(value); - continue; - } +var Buffer = __nccwpck_require__(64293).Buffer; + +var OurUint8Array = global.Uint8Array || function () {}; + +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} + +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} +/**/ + + +var debugUtil = __nccwpck_require__(31669); - if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { - const end = rest[1] !== void 0 ? '|$' : ''; +var debug; - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function debug() {}; +} +/**/ - prev.type = 'globstar'; - prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; - prev.value += value; - state.output += prior.output + prev.output; - state.globstar = true; +var BufferList = __nccwpck_require__(29464); - consume(value + advance()); +var destroyImpl = __nccwpck_require__(87915); - push({ type: 'slash', value: '/', output: '' }); - continue; - } +var _require = __nccwpck_require__(13400), + getHighWaterMark = _require.getHighWaterMark; - if (prior.type === 'bos' && rest[0] === '/') { - prev.type = 'globstar'; - prev.value += value; - prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; - state.output = prev.output; - state.globstar = true; - consume(value + advance()); - push({ type: 'slash', value: '/', output: '' }); - continue; - } +var _require$codes = __nccwpck_require__(92036)/* .codes */ .q, + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. - // remove single star from output - state.output = state.output.slice(0, -prev.output.length); - // reset previous token to globstar - prev.type = 'globstar'; - prev.output = globstar(opts); - prev.value += value; +var StringDecoder; +var createReadableStreamAsyncIterator; +var from; - // reset output with globstar - state.output += prev.output; - state.globstar = true; - consume(value); - continue; - } +__nccwpck_require__(2989)(Readable, Stream); - const token = { type: 'star', value, output: star }; +var errorOrDestroy = destroyImpl.errorOrDestroy; +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - if (opts.bash === true) { - token.output = '.*?'; - if (prev.type === 'bos' || prev.type === 'slash') { - token.output = nodot + token.output; - } - push(token); - continue; - } +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. - if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { - token.output = value; - push(token); - continue; - } + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} - if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { - if (prev.type === 'dot') { - state.output += NO_DOT_SLASH; - prev.output += NO_DOT_SLASH; +function ReadableState(options, stream, isDuplex) { + Duplex = Duplex || __nccwpck_require__(42770); + options = options || {}; // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. - } else if (opts.dot === true) { - state.output += NO_DOTS_SLASH; - prev.output += NO_DOTS_SLASH; + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away - } else { - state.output += nodot; - prev.output += nodot; - } + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" - if (peek() !== '*') { - state.output += ONE_CHAR; - prev.output += ONE_CHAR; - } - } + this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() - push(token); - } + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. - while (state.brackets > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); - state.output = utils.escapeLast(state.output, '['); - decrement('brackets'); - } + this.sync = true; // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. - while (state.parens > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); - state.output = utils.escapeLast(state.output, '('); - decrement('parens'); - } + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; // Should close be emitted on destroy. Defaults to true. - while (state.braces > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); - state.output = utils.escapeLast(state.output, '{'); - decrement('braces'); - } + this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') - if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { - push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); - } + this.autoDestroy = !!options.autoDestroy; // has it been destroyed - // rebuild the output if we had to backtrack at any point - if (state.backtrack === true) { - state.output = ''; + this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. - for (const token of state.tokens) { - state.output += token.output != null ? token.output : token.value; + this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s - if (token.suffix) { - state.output += token.suffix; - } - } + this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled + + this.readingMore = false; + this.decoder = null; + this.encoding = null; + + if (options.encoding) { + if (!StringDecoder) StringDecoder = __nccwpck_require__(90937)/* .StringDecoder */ .s; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; } +} - return state; -}; +function Readable(options) { + Duplex = Duplex || __nccwpck_require__(42770); + if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside + // the ReadableState constructor, at least with V8 6.5 -/** - * Fast paths for creating regular expressions for common glob patterns. - * This can significantly speed up processing and has very little downside - * impact when none of the fast paths match. - */ + var isDuplex = this instanceof Duplex; + this._readableState = new ReadableState(options, this, isDuplex); // legacy -parse.fastpaths = (input, options) => { - const opts = { ...options }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - const len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + if (typeof options.destroy === 'function') this._destroy = options.destroy; } - input = REPLACEMENTS[input] || input; - const win32 = utils.isWindows(options); + Stream.call(this); +} - // create constants based on platform, for windows or posix - const { - DOT_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOTS_SLASH, - STAR, - START_ANCHOR - } = constants.globChars(win32); +Object.defineProperty(Readable.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined) { + return false; + } - const nodot = opts.dot ? NO_DOTS : NO_DOT; - const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; - const capture = opts.capture ? '' : '?:'; - const state = { negated: false, prefix: '' }; - let star = opts.bash === true ? '.*?' : STAR; + return this._readableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed - if (opts.capture) { - star = `(${star})`; + + this._readableState.destroyed = value; } +}); +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; - const globstar = (opts) => { - if (opts.noglobstar === true) return star; - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; +Readable.prototype._destroy = function (err, cb) { + cb(err); +}; // Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. - const create = str => { - switch (str) { - case '*': - return `${nodot}${ONE_CHAR}${star}`; - case '.*': - return `${DOT_LITERAL}${ONE_CHAR}${star}`; +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; - case '*.*': - return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; - case '*/*': - return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } - case '**': - return nodot + globstar(opts); + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } - case '**/*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; // Unshift should *always* be something directly out of read() - case '**/*.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; - case '**/.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; - default: { - const match = /^(.*?)\.(\w+)$/.exec(str); - if (!match) return; +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + debug('readableAddChunk', chunk); + var state = stream._readableState; - const source = create(match[1]); - if (!source) return; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); - return source + DOT_LITERAL + match[2]; + if (er) { + errorOrDestroy(stream, er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); + } else if (state.ended) { + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; + + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream, state); } - }; + } // We can push more data if we are below the highWaterMark. + // Also, if we have no data yet, we can stand some more bytes. + // This is to work around cases where hwm=0, such as the repl. - const output = utils.removePrefix(input, state); - let source = create(output); - if (source && opts.strictSlashes !== true) { - source += `${SLASH_LITERAL}?`; + return !state.ended && (state.length < state.highWaterMark || state.length === 0); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream.emit('data', chunk); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + if (state.needReadable) emitReadable(stream); } - return source; -}; + maybeReadMore(stream, state); +} -module.exports = parse; +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); + } -/***/ }), + return er; +} -/***/ 47188: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; // backwards compatibility. -"use strict"; +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = __nccwpck_require__(90937)/* .StringDecoder */ .s; + var decoder = new StringDecoder(enc); + this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 -const path = __webpack_require__(85622); -const scan = __webpack_require__(15715); -const parse = __webpack_require__(3155); -const utils = __webpack_require__(86444); -const constants = __webpack_require__(1259); -const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: -/** - * Creates a matcher function from one or more glob patterns. The - * returned function takes a string to match as its first argument, - * and returns true if the string is a match. The returned matcher - * function also takes a boolean as the second argument that, when true, - * returns an object with additional information. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch(glob[, options]); - * - * const isMatch = picomatch('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @name picomatch - * @param {String|Array} `globs` One or more glob patterns. - * @param {Object=} `options` - * @return {Function=} Returns a matcher function. - * @api public - */ + var p = this._readableState.buffer.head; + var content = ''; -const picomatch = (glob, options, returnState = false) => { - if (Array.isArray(glob)) { - const fns = glob.map(input => picomatch(input, options, returnState)); - const arrayMatcher = str => { - for (const isMatch of fns) { - const state = isMatch(str); - if (state) return state; - } - return false; - }; - return arrayMatcher; + while (p !== null) { + content += decoder.write(p.data); + p = p.next; } - const isState = isObject(glob) && glob.tokens && glob.input; + this._readableState.buffer.clear(); - if (glob === '' || (typeof glob !== 'string' && !isState)) { - throw new TypeError('Expected pattern to be a non-empty string'); - } + if (content !== '') this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; +}; // Don't raise the hwm > 1GB - const opts = options || {}; - const posix = utils.isWindows(options); - const regex = isState - ? picomatch.compileRe(glob, options) - : picomatch.makeRe(glob, options, false, true); - const state = regex.state; - delete regex.state; +var MAX_HWM = 0x40000000; - let isIgnored = () => false; - if (opts.ignore) { - const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; - isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; } - const matcher = (input, returnObject = false) => { - const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); - const result = { glob, state, regex, posix, input, output, match, isMatch }; + return n; +} // This function is designed to be inlinable, so please take care when making +// changes to the function body. - if (typeof opts.onResult === 'function') { - opts.onResult(result); - } - if (isMatch === false) { - result.isMatch = false; - return returnObject ? result : false; - } +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; - if (isIgnored(input)) { - if (typeof opts.onIgnore === 'function') { - opts.onIgnore(result); - } - result.isMatch = false; - return returnObject ? result : false; - } + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } // If we're asking for more than the current hwm, then raise the hwm. - if (typeof opts.onMatch === 'function') { - opts.onMatch(result); - } - return returnObject ? result : true; - }; - if (returnState) { - matcher.state = state; + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; // Don't have enough + + if (!state.ended) { + state.needReadable = true; + return 0; } - return matcher; -}; + return state.length; +} // you can override either this method, or the async _read(n) below. -/** - * Test `input` with the given `regex`. This is used by the main - * `picomatch()` function to test the input string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.test(input, regex[, options]); - * - * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); - * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } - * ``` - * @param {String} `input` String to test. - * @param {RegExp} `regex` - * @return {Object} Returns an object with matching info. - * @api public - */ -picomatch.test = (input, regex, options, { glob, posix } = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected input to be a string'); - } +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. - if (input === '') { - return { isMatch: false, output: '' }; + if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; } - const opts = options || {}; - const format = opts.format || (posix ? utils.toPosixSlashes : null); - let match = input === glob; - let output = (match && format) ? format(input) : input; + n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. - if (match === false) { - output = format ? format(input) : input; - match = output === glob; + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + // if we need a readable event, then we need to do some reading. + + + var doRead = state.needReadable; + debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some + + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + + + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; // if the length is currently zero, then we *need* a readable event. + + if (state.length === 0) state.needReadable = true; // call internal read method + + this._read(state.highWaterMark); + + state.sync = false; // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + + if (!state.reading) n = howMuchToRead(nOrig, state); } - if (match === false || opts.capture === true) { - if (opts.matchBase === true || opts.basename === true) { - match = picomatch.matchBase(input, regex, options, posix); - } else { - match = regex.exec(output); - } + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n = 0; + } else { + state.length -= n; + state.awaitDrain = 0; } - return { isMatch: Boolean(match), match, output }; -}; + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. -/** - * Match the basename of a filepath. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.matchBase(input, glob[, options]); - * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true - * ``` - * @param {String} `input` String to test. - * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). - * @return {Boolean} - * @api public - */ + if (nOrig !== n && state.ended) endReadable(this); + } -picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { - const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); - return regex.test(path.basename(input)); + if (ret !== null) this.emit('data', ret); + return ret; }; -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.isMatch(string, patterns[, options]); - * - * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String|Array} str The string to test. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} [options] See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ +function onEofChunk(stream, state) { + debug('onEofChunk'); + if (state.ended) return; -picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + if (state.decoder) { + var chunk = state.decoder.end(); -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const picomatch = require('picomatch'); - * const result = picomatch.parse(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as a regex source string. - * @api public - */ + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } -picomatch.parse = (pattern, options) => { - if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); - return parse(pattern, { ...options, fastpaths: false }); -}; + state.ended = true; -/** - * Scan a glob pattern to separate the pattern into segments. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.scan(input[, options]); - * - * const result = picomatch.scan('!./foo/*.js'); - * console.log(result); - * { prefix: '!./', - * input: '!./foo/*.js', - * start: 3, - * base: 'foo', - * glob: '*.js', - * isBrace: false, - * isBracket: false, - * isGlob: true, - * isExtglob: false, - * isGlobstar: false, - * negated: true } - * ``` - * @param {String} `input` Glob pattern to scan. - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ + if (state.sync) { + // if we are sync, wait until next tick to emit the data. + // Otherwise we risk emitting data in the flow() + // the readable code triggers during a read() call + emitReadable(stream); + } else { + // emit 'readable' now to make sure it gets picked up. + state.needReadable = false; -picomatch.scan = (input, options) => scan(input, options); + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream); + } + } +} // Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. -/** - * Create a regular expression from a parsed glob pattern. - * - * ```js - * const picomatch = require('picomatch'); - * const state = picomatch.parse('*.js'); - * // picomatch.compileRe(state[, options]); - * - * console.log(picomatch.compileRe(state)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `state` The object returned from the `.parse` method. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ -picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => { - if (returnOutput === true) { - return parsed.output; +function emitReadable(stream) { + var state = stream._readableState; + debug('emitReadable', state.needReadable, state.emittedReadable); + state.needReadable = false; + + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + process.nextTick(emitReadable_, stream); } +} - const opts = options || {}; - const prepend = opts.contains ? '' : '^'; - const append = opts.contains ? '' : '$'; +function emitReadable_(stream) { + var state = stream._readableState; + debug('emitReadable_', state.destroyed, state.length, state.ended); - let source = `${prepend}(?:${parsed.output})${append}`; - if (parsed && parsed.negated === true) { - source = `^(?!${source}).*$`; + if (!state.destroyed && (state.length || state.ended)) { + stream.emit('readable'); + state.emittedReadable = false; + } // The stream needs another readable event if + // 1. It is not flowing, as the flow mechanism will take + // care of it. + // 2. It is not ended. + // 3. It is below the highWaterMark, so we can schedule + // another readable later. + + + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow(stream); +} // at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. + + +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(maybeReadMore_, stream, state); } +} - const regex = picomatch.toRegex(source, options); - if (returnState === true) { - regex.state = parsed; +function maybeReadMore_(stream, state) { + // Attempt to read more data if we should. + // + // The conditions for reading more data are (one of): + // - Not enough data buffered (state.length < state.highWaterMark). The loop + // is responsible for filling the buffer with enough data if such data + // is available. If highWaterMark is 0 and we are not in the flowing mode + // we should _not_ attempt to buffer any extra data. We'll get more data + // when the stream consumer calls read() instead. + // - No data in the buffer, and the stream is in flowing mode. In this mode + // the loop below is responsible for ensuring read() is called. Failing to + // call read here would abort the flow and there's no other mechanism for + // continuing the flow if the stream consumer has just subscribed to the + // 'data' event. + // + // In addition to the above conditions to keep reading data, the following + // conditions prevent the data from being read: + // - The stream has ended (state.ended). + // - There is already a pending 'read' operation (state.reading). This is a + // case where the the stream has called the implementation defined _read() + // method, but they are processing the call asynchronously and have _not_ + // called push() with new data. In this case we skip performing more + // read()s. The execution ends in this method again after the _read() ends + // up calling push() with more data. + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + var len = state.length; + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) // didn't get any data, stop spinning. + break; } - return regex; + state.readingMore = false; +} // abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. + + +Readable.prototype._read = function (n) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); }; -picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => { - if (!input || typeof input !== 'string') { - throw new TypeError('Expected a non-empty string'); - } +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; - const opts = options || {}; - let parsed = { negated: false, fastpaths: true }; - let prefix = ''; - let output; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; - if (input.startsWith('./')) { - input = input.slice(2); - prefix = parsed.prefix = './'; - } + case 1: + state.pipes = [state.pipes, dest]; + break; - if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { - output = parse.fastpaths(input, options); + default: + state.pipes.push(dest); + break; } - if (output === undefined) { - parsed = parse(input, options); - parsed.prefix = prefix + (parsed.prefix || ''); - } else { - parsed.output = output; - } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); + dest.on('unpipe', onunpipe); - return picomatch.compileRe(parsed, options, returnOutput, returnState); -}; + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); -/** - * Create a regular expression from the given regex source string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.toRegex(source[, options]); - * - * const { output } = picomatch.parse('*.js'); - * console.log(picomatch.toRegex(output)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `source` Regular expression source string. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } -picomatch.toRegex = (source, options) => { - try { - const opts = options || {}; - return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); - } catch (err) { - if (options && options.debug === true) throw err; - return /$^/; + function onend() { + debug('onend'); + dest.end(); + } // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + + + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + var cleanedUp = false; + + function cleanup() { + debug('cleanup'); // cleanup event handlers once the pipe is broken + + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + cleanedUp = true; // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } -}; -/** - * Picomatch constants. - * @return {Object} - */ + src.on('data', ondata); -picomatch.constants = constants; + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + debug('dest.write', ret); -/** - * Expose "picomatch" - */ + if (ret === false) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', state.awaitDrain); + state.awaitDrain++; + } -module.exports = picomatch; + src.pause(); + } + } // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. -/***/ }), + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); + } // Make sure our error handler is attached before userland ones. -/***/ 15715: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -"use strict"; + prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } -const utils = __webpack_require__(86444); -const { - CHAR_ASTERISK, /* * */ - CHAR_AT, /* @ */ - CHAR_BACKWARD_SLASH, /* \ */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_EXCLAMATION_MARK, /* ! */ - CHAR_FORWARD_SLASH, /* / */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_PLUS, /* + */ - CHAR_QUESTION_MARK, /* ? */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_RIGHT_SQUARE_BRACKET /* ] */ -} = __webpack_require__(1259); + dest.once('close', onclose); -const isPathSeparator = code => { - return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; -}; + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } -const depth = token => { - if (token.isPrefix !== true) { - token.depth = token.isGlobstar ? Infinity : 1; + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } // tell the dest that it's being piped to + + + dest.emit('pipe', src); // start the flow if it hasn't been started already. + + if (!state.flowing) { + debug('pipe resume'); + src.resume(); } + + return dest; }; -/** - * Quickly scans a glob pattern and returns an object with a handful of - * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), - * `glob` (the actual pattern), and `negated` (true if the path starts with `!`). - * - * ```js - * const pm = require('picomatch'); - * console.log(pm.scan('foo/bar/*.js')); - * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {Object} Returns an object with tokens and regex source string. - * @api public - */ +function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; -const scan = (input, options) => { - const opts = options || {}; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} - const length = input.length - 1; - const scanToEnd = opts.parts === true || opts.scanToEnd === true; - const slashes = []; - const tokens = []; - const parts = []; +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; // if we're not piping anywhere, then do nothing. - let str = input; - let index = -1; - let start = 0; - let lastIndex = 0; - let isBrace = false; - let isBracket = false; - let isGlob = false; - let isExtglob = false; - let isGlobstar = false; - let braceEscaped = false; - let backslashes = false; - let negated = false; - let finished = false; - let braces = 0; - let prev; - let code; - let token = { value: '', depth: 0, isGlob: false }; + if (state.pipesCount === 0) return this; // just one destination. most common case. - const eos = () => index >= length; - const peek = () => str.charCodeAt(index + 1); - const advance = () => { - prev = code; - return str.charCodeAt(++index); - }; + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + if (!dest) dest = state.pipes; // got a match. - while (index < length) { - code = advance(); - let next; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } // slow case. multiple pipe destinations. - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); - if (code === CHAR_LEFT_CURLY_BRACE) { - braceEscaped = true; + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, { + hasUnpiped: false + }); + } + + return this; + } // try to find the right one. + + + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + dest.emit('unpipe', this, unpipeInfo); + return this; +}; // set up data events if they are asked for +// Ensure readable listeners eventually get something + + +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + var state = this._readableState; + + if (ev === 'data') { + // update readableListening so that resume() may be a no-op + // a few lines down. This is needed to support once('readable'). + state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused + + if (state.flowing !== false) this.resume(); + } else if (ev === 'readable') { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug('on readable', state.length, state.reading); + + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process.nextTick(nReadingNextTick, this); } - continue; } + } - if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { - braces++; + return res; +}; - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } +Readable.prototype.addListener = Readable.prototype.on; - if (code === CHAR_LEFT_CURLY_BRACE) { - braces++; - continue; - } +Readable.prototype.removeListener = function (ev, fn) { + var res = Stream.prototype.removeListener.call(this, ev, fn); - if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; + if (ev === 'readable') { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } - if (scanToEnd === true) { - continue; - } + return res; +}; - break; - } +Readable.prototype.removeAllListeners = function (ev) { + var res = Stream.prototype.removeAllListeners.apply(this, arguments); - if (braceEscaped !== true && code === CHAR_COMMA) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; + if (ev === 'readable' || ev === undefined) { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } - if (scanToEnd === true) { - continue; - } + return res; +}; - break; - } +function updateReadableListening(self) { + var state = self._readableState; + state.readableListening = self.listenerCount('readable') > 0; - if (code === CHAR_RIGHT_CURLY_BRACE) { - braces--; + if (state.resumeScheduled && !state.paused) { + // flowing needs to be set to true now, otherwise + // the upcoming resume will not flow. + state.flowing = true; // crude way to check if we should resume + } else if (self.listenerCount('data') > 0) { + self.resume(); + } +} - if (braces === 0) { - braceEscaped = false; - isBrace = token.isBrace = true; - finished = true; - break; - } - } - } +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} // pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. - if (scanToEnd === true) { - continue; - } - break; - } +Readable.prototype.resume = function () { + var state = this._readableState; - if (code === CHAR_FORWARD_SLASH) { - slashes.push(index); - tokens.push(token); - token = { value: '', depth: 0, isGlob: false }; + if (!state.flowing) { + debug('resume'); // we flow only if there is no one listening + // for readable, but we still have to call + // resume() - if (finished === true) continue; - if (prev === CHAR_DOT && index === (start + 1)) { - start += 2; - continue; - } + state.flowing = !state.readableListening; + resume(this, state); + } - lastIndex = index + 1; - continue; - } + state.paused = false; + return this; +}; - if (opts.noext !== true) { - const isExtglobChar = code === CHAR_PLUS - || code === CHAR_AT - || code === CHAR_ASTERISK - || code === CHAR_QUESTION_MARK - || code === CHAR_EXCLAMATION_MARK; +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process.nextTick(resume_, stream, state); + } +} - if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; - isExtglob = token.isExtglob = true; - finished = true; +function resume_(stream, state) { + debug('resume', state.reading); - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } + if (!state.reading) { + stream.read(0); + } - if (code === CHAR_RIGHT_PARENTHESES) { - isGlob = token.isGlob = true; - finished = true; - break; - } - } - continue; - } - break; - } - } + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} - if (code === CHAR_ASTERISK) { - if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; - isGlob = token.isGlob = true; - finished = true; +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); - if (scanToEnd === true) { - continue; - } - break; - } + if (this._readableState.flowing !== false) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } - if (code === CHAR_QUESTION_MARK) { - isGlob = token.isGlob = true; - finished = true; + this._readableState.paused = true; + return this; +}; - if (scanToEnd === true) { - continue; - } - break; +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + + while (state.flowing && stream.read() !== null) { + ; + } +} // wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. + + +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + stream.on('end', function () { + debug('wrapped end'); + + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); } - if (code === CHAR_LEFT_SQUARE_BRACKET) { - while (eos() !== true && (next = advance())) { - if (next === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } + _this.push(null); + }); + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - isBracket = token.isBracket = true; - isGlob = token.isGlob = true; - finished = true; + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - if (scanToEnd === true) { - continue; - } - break; - } - } + var ret = _this.push(chunk); + + if (!ret) { + paused = true; + stream.pause(); } + }); // proxy all the other methods. + // important when wrapping filters and duplexes. - if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { - negated = token.negated = true; - start++; - continue; + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function methodWrap(method) { + return function methodWrapReturnFunction() { + return stream[method].apply(stream, arguments); + }; + }(i); } + } // proxy certain important events. - if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_LEFT_PARENTHESES) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } // when we try to consume some more bytes, simply unpause the + // underlying stream. - if (code === CHAR_RIGHT_PARENTHESES) { - finished = true; - break; - } - } - continue; - } - break; + + this._read = function (n) { + debug('wrapped _read', n); + + if (paused) { + paused = false; + stream.resume(); } + }; - if (isGlob === true) { - finished = true; + return this; +}; - if (scanToEnd === true) { - continue; - } +if (typeof Symbol === 'function') { + Readable.prototype[Symbol.asyncIterator] = function () { + if (createReadableStreamAsyncIterator === undefined) { + createReadableStreamAsyncIterator = __nccwpck_require__(60863); + } - break; + return createReadableStreamAsyncIterator(this); + }; +} + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.highWaterMark; + } +}); +Object.defineProperty(Readable.prototype, 'readableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState && this._readableState.buffer; + } +}); +Object.defineProperty(Readable.prototype, 'readableFlowing', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.flowing; + }, + set: function set(state) { + if (this._readableState) { + this._readableState.flowing = state; } } +}); // exposed for testing purposes only. - if (opts.noext === true) { - isExtglob = false; - isGlob = false; +Readable._fromList = fromList; +Object.defineProperty(Readable.prototype, 'readableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.length; + } +}); // Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. + +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = state.buffer.consume(n, state.decoder); } + return ret; +} - let base = str; - let prefix = ''; - let glob = ''; +function endReadable(stream) { + var state = stream._readableState; + debug('endReadable', state.endEmitted); - if (start > 0) { - prefix = str.slice(0, start); - str = str.slice(start); - lastIndex -= start; + if (!state.endEmitted) { + state.ended = true; + process.nextTick(endReadableNT, state, stream); } +} - if (base && isGlob === true && lastIndex > 0) { - base = str.slice(0, lastIndex); - glob = str.slice(lastIndex); - } else if (isGlob === true) { - base = ''; - glob = str; - } else { - base = str; - } +function endReadableNT(state, stream) { + debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. - if (base && base !== '' && base !== '/' && base !== str) { - if (isPathSeparator(base.charCodeAt(base.length - 1))) { - base = base.slice(0, -1); - } - } + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); - if (opts.unescape === true) { - if (glob) glob = utils.removeBackslashes(glob); + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the writable side is ready for autoDestroy as well + var wState = stream._writableState; - if (base && backslashes === true) { - base = utils.removeBackslashes(base); + if (!wState || wState.autoDestroy && wState.finished) { + stream.destroy(); + } } } +} - const state = { - prefix, - input, - start, - base, - glob, - isBrace, - isBracket, - isGlob, - isExtglob, - isGlobstar, - negated +if (typeof Symbol === 'function') { + Readable.from = function (iterable, opts) { + if (from === undefined) { + from = __nccwpck_require__(32244); + } + + return from(Readable, iterable, opts); }; +} - if (opts.tokens === true) { - state.maxDepth = 0; - if (!isPathSeparator(code)) { - tokens.push(token); - } - state.tokens = tokens; +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; } - if (opts.parts === true || opts.tokens === true) { - let prevIndex; + return -1; +} - for (let idx = 0; idx < slashes.length; idx++) { - const n = prevIndex ? prevIndex + 1 : start; - const i = slashes[idx]; - const value = input.slice(n, i); - if (opts.tokens) { - if (idx === 0 && start !== 0) { - tokens[idx].isPrefix = true; - tokens[idx].value = prefix; - } else { - tokens[idx].value = value; - } - depth(tokens[idx]); - state.maxDepth += tokens[idx].depth; - } - if (idx !== 0 || value !== '') { - parts.push(value); - } - prevIndex = i; - } +/***/ }), - if (prevIndex && prevIndex + 1 < input.length) { - const value = input.slice(prevIndex + 1); - parts.push(value); +/***/ 62826: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (opts.tokens) { - tokens[tokens.length - 1].value = value; - depth(tokens[tokens.length - 1]); - state.maxDepth += tokens[tokens.length - 1].depth; - } - } +"use strict"; +// 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. +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. - state.slashes = slashes; - state.parts = parts; + +module.exports = Transform; + +var _require$codes = __nccwpck_require__(92036)/* .codes */ .q, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, + ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; + +var Duplex = __nccwpck_require__(42770); + +__nccwpck_require__(2989)(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + + if (cb === null) { + return this.emit('error', new ERR_MULTIPLE_CALLBACK()); } - return state; -}; + ts.writechunk = null; + ts.writecb = null; + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; -module.exports = scan; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; // start out asking for a readable event once data is transformed. -/***/ }), + this._readableState.needReadable = true; // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. -/***/ 86444: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + this._readableState.sync = false; -"use strict"; + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + if (typeof options.flush === 'function') this._flush = options.flush; + } // When the writable side finishes, then flush out anything remaining. -const path = __webpack_require__(85622); -const win32 = process.platform === 'win32'; -const { - REGEX_BACKSLASH, - REGEX_REMOVE_BACKSLASH, - REGEX_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_GLOBAL -} = __webpack_require__(1259); + this.on('prefinish', prefinish); +} -exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); -exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); -exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); -exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); -exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); +function prefinish() { + var _this = this; -exports.removeBackslashes = str => { - return str.replace(REGEX_REMOVE_BACKSLASH, match => { - return match === '\\' ? '' : match; - }); + if (typeof this._flush === 'function' && !this._readableState.destroyed) { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; // This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. + + +Transform.prototype._transform = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); }; -exports.supportsLookbehinds = () => { - const segs = process.version.slice(1).split('.').map(Number); - if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { - return true; +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } - return false; -}; +}; // Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. -exports.isWindows = options => { - if (options && typeof options.windows === 'boolean') { - return options.windows; + +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } - return win32 === true || path.sep === '\\'; }; -exports.escapeLast = (input, char, lastIdx) => { - const idx = input.lastIndexOf(char, lastIdx); - if (idx === -1) return input; - if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); - return `${input.slice(0, idx)}\\${input.slice(idx)}`; +Transform.prototype._destroy = function (err, cb) { + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + }); }; -exports.removePrefix = (input, state = {}) => { - let output = input; - if (output.startsWith('./')) { - output = output.slice(2); - state.prefix = './'; - } - return output; -}; +function done(stream, er, data) { + if (er) return stream.emit('error', er); + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); // TODO(BridgeAR): Write a test for these two error cases + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + + if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream.push(null); +} + +/***/ }), + +/***/ 78063: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// 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. +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + -exports.wrapOutput = (input, state = {}, options = {}) => { - const prepend = options.contains ? '' : '^'; - const append = options.contains ? '' : '$'; +module.exports = Writable; +/* */ - let output = `${prepend}(?:${input})${append}`; - if (state.negated === true) { - output = `(?:^(?!${output}).*$)`; - } - return output; -}; +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} // It seems a linked list but it is not +// there will be only 2 of these for each stream -/***/ }), +function CorkedRequest(state) { + var _this = this; -/***/ 4548: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + this.next = null; + this.entry = null; -"use strict"; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ +/**/ -module.exports = typeof Promise === 'function' ? Promise : __webpack_require__(97609); +var Duplex; +/**/ -/***/ }), +Writable.WritableState = WritableState; +/**/ -/***/ 97609: -/***/ ((module) => { +var internalUtil = { + deprecate: __nccwpck_require__(92262) +}; +/**/ -"use strict"; +/**/ +var Stream = __nccwpck_require__(1065); +/**/ -var PENDING = 'pending'; -var SETTLED = 'settled'; -var FULFILLED = 'fulfilled'; -var REJECTED = 'rejected'; -var NOOP = function () {}; -var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; -var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; -var asyncQueue = []; -var asyncTimer; +var Buffer = __nccwpck_require__(64293).Buffer; -function asyncFlush() { - // run promise callbacks - for (var i = 0; i < asyncQueue.length; i++) { - asyncQueue[i][0](asyncQueue[i][1]); - } +var OurUint8Array = global.Uint8Array || function () {}; - // reset async asyncQueue - asyncQueue = []; - asyncTimer = false; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); } -function asyncCall(callback, arg) { - asyncQueue.push([callback, arg]); - - if (!asyncTimer) { - asyncTimer = true; - asyncSetTimer(asyncFlush, 0); - } +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } -function invokeResolver(resolver, promise) { - function resolvePromise(value) { - resolve(promise, value); - } +var destroyImpl = __nccwpck_require__(87915); - function rejectPromise(reason) { - reject(promise, reason); - } +var _require = __nccwpck_require__(13400), + getHighWaterMark = _require.getHighWaterMark; - try { - resolver(resolvePromise, rejectPromise); - } catch (e) { - rejectPromise(e); - } -} +var _require$codes = __nccwpck_require__(92036)/* .codes */ .q, + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, + ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, + ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, + ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; -function invokeCallback(subscriber) { - var owner = subscriber.owner; - var settled = owner._state; - var value = owner._data; - var callback = subscriber[settled]; - var promise = subscriber.then; +var errorOrDestroy = destroyImpl.errorOrDestroy; - if (typeof callback === 'function') { - settled = FULFILLED; - try { - value = callback(value); - } catch (e) { - reject(promise, e); - } - } +__nccwpck_require__(2989)(Writable, Stream); - if (!handleThenable(promise, value)) { - if (settled === FULFILLED) { - resolve(promise, value); - } +function nop() {} - if (settled === REJECTED) { - reject(promise, value); - } - } -} +function WritableState(options, stream, isDuplex) { + Duplex = Duplex || __nccwpck_require__(42770); + options = options || {}; // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream, + // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. -function handleThenable(promise, value) { - var resolved; + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream + // contains buffers or objects. - try { - if (promise === value) { - throw new TypeError('A promises callback cannot return that same promise.'); - } + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() - if (value && (typeof value === 'function' || typeof value === 'object')) { - // then should be retrieved only once - var then = value.then; + this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called - if (typeof then === 'function') { - then.call(value, function (val) { - if (!resolved) { - resolved = true; + this.finalCalled = false; // drain event flag. - if (value === val) { - fulfill(promise, val); - } else { - resolve(promise, val); - } - } - }, function (reason) { - if (!resolved) { - resolved = true; + this.needDrain = false; // at the start of calling end() - reject(promise, reason); - } - }); + this.ending = false; // when end() has been called, and returned - return true; - } - } - } catch (e) { - if (!resolved) { - reject(promise, e); - } + this.ended = false; // when 'finish' is emitted - return true; - } + this.finished = false; // has it been destroyed - return false; -} + this.destroyed = false; // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. -function resolve(promise, value) { - if (promise === value || !handleThenable(promise, value)) { - fulfill(promise, value); - } -} + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. -function fulfill(promise, value) { - if (promise._state === PENDING) { - promise._state = SETTLED; - promise._data = value; + this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. - asyncCall(publishFulfillment, promise); - } -} + this.length = 0; // a flag to see when we're in the middle of a write. -function reject(promise, reason) { - if (promise._state === PENDING) { - promise._state = SETTLED; - promise._data = reason; + this.writing = false; // when true all writes will be buffered until .uncork() call - asyncCall(publishRejection, promise); - } -} + this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. -function publish(promise) { - promise._then = promise._then.forEach(invokeCallback); -} + this.sync = true; // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. -function publishFulfillment(promise) { - promise._state = FULFILLED; - publish(promise); -} + this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) -function publishRejection(promise) { - promise._state = REJECTED; - publish(promise); - if (!promise._handled && isNode) { - global.process.emit('unhandledRejection', promise._data, promise); - } -} + this.onwrite = function (er) { + onwrite(stream, er); + }; // the callback that the user supplies to write(chunk,encoding,cb) -function notifyRejectionHandled(promise) { - global.process.emit('rejectionHandled', promise); -} -/** - * @class - */ -function Promise(resolver) { - if (typeof resolver !== 'function') { - throw new TypeError('Promise resolver ' + resolver + ' is not a function'); - } + this.writecb = null; // the amount that is being written when _write is called. - if (this instanceof Promise === false) { - throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); - } + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted - this._then = []; + this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams - invokeResolver(resolver, this); -} + this.prefinished = false; // True if the error was already emitted and should not be thrown again -Promise.prototype = { - constructor: Promise, + this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. - _state: PENDING, - _then: null, - _data: undefined, - _handled: false, + this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') - then: function (onFulfillment, onRejection) { - var subscriber = { - owner: this, - then: new this.constructor(NOOP), - fulfilled: onFulfillment, - rejected: onRejection - }; + this.autoDestroy = !!options.autoDestroy; // count buffered requests - if ((onRejection || onFulfillment) && !this._handled) { - this._handled = true; - if (this._state === REJECTED && isNode) { - asyncCall(notifyRejectionHandled, this); - } - } + this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two - if (this._state === FULFILLED || this._state === REJECTED) { - // already resolved, call callback async - asyncCall(invokeCallback, subscriber); - } else { - // subscribe - this._then.push(subscriber); - } + this.corkedRequestsFree = new CorkedRequest(this); +} - return subscriber.then; - }, +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; - catch: function (onRejection) { - return this.then(null, onRejection); - } + while (current) { + out.push(current); + current = current.next; + } + + return out; }; -Promise.all = function (promises) { - if (!Array.isArray(promises)) { - throw new TypeError('You must pass an array to Promise.all().'); - } +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); // Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. - return new Promise(function (resolve, reject) { - var results = []; - var remaining = 0; - function resolver(index) { - remaining++; - return function (value) { - results[index] = value; - if (!--remaining) { - resolve(results); - } - }; - } +var realHasInstance; - for (var i = 0, promise; i < promises.length; i++) { - promise = promises[i]; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function value(object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function realHasInstance(object) { + return object instanceof this; + }; +} - if (promise && typeof promise.then === 'function') { - promise.then(resolver(i), reject); - } else { - results[i] = promise; - } - } +function Writable(options) { + Duplex = Duplex || __nccwpck_require__(42770); // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + // Checking for a Stream.Duplex instance is faster here instead of inside + // the WritableState constructor, at least with V8 6.5 - if (!remaining) { - resolve(results); - } - }); -}; + var isDuplex = this instanceof Duplex; + if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); + this._writableState = new WritableState(options, this, isDuplex); // legacy. -Promise.race = function (promises) { - if (!Array.isArray(promises)) { - throw new TypeError('You must pass an array to Promise.race().'); - } + this.writable = true; - return new Promise(function (resolve, reject) { - for (var i = 0, promise; i < promises.length; i++) { - promise = promises[i]; + if (options) { + if (typeof options.write === 'function') this._write = options.write; + if (typeof options.writev === 'function') this._writev = options.writev; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + if (typeof options.final === 'function') this._final = options.final; + } - if (promise && typeof promise.then === 'function') { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - }); -}; + Stream.call(this); +} // Otherwise people can pipe Writable streams, which is just wrong. -Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - return new Promise(function (resolve) { - resolve(value); - }); +Writable.prototype.pipe = function () { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; -Promise.reject = function (reason) { - return new Promise(function (resolve, reject) { - reject(reason); - }); -}; +function writeAfterEnd(stream, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb -module.exports = Promise; + errorOrDestroy(stream, er); + process.nextTick(cb, er); +} // Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. -/***/ }), +function validChunk(stream, state, chunk, cb) { + var er; -/***/ 32979: -/***/ ((module) => { + if (chunk === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk !== 'string' && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); + } -"use strict"; + if (er) { + errorOrDestroy(stream, er); + process.nextTick(cb, er); + return false; + } -module.exports = (url, opts) => { - if (typeof url !== 'string') { - throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``); - } + return true; +} - url = url.trim(); - opts = Object.assign({https: false}, opts); +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; - if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { - return url; - } + var isBuf = !state.objectMode && _isUint8Array(chunk); - return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://'); + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + if (typeof cb !== 'function') cb = nop; + if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + return ret; }; +Writable.prototype.cork = function () { + this._writableState.corked++; +}; -/***/ }), +Writable.prototype.uncork = function () { + var state = this._writableState; -/***/ 9154: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; -module.exports = __webpack_require__(91341); +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; +Object.defineProperty(Writable.prototype, 'writableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } +}); -/***/ }), +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } -/***/ 91341: -/***/ ((module, exports) => { + return chunk; +} -/*! - * node-progress - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } +}); // if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. -/** - * Expose `ProgressBar`. - */ +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); -exports = module.exports = ProgressBar; + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } -/** - * Initialize a `ProgressBar` with the given `fmt` string and `options` or - * `total`. - * - * Options: - * - * - `curr` current completed index - * - `total` total number of ticks to complete - * - `width` the displayed width of the progress bar defaulting to total - * - `stream` the output stream defaulting to stderr - * - `head` head character defaulting to complete character - * - `complete` completion character defaulting to "=" - * - `incomplete` incomplete character defaulting to "-" - * - `renderThrottle` minimum time between updates in milliseconds defaulting to 16 - * - `callback` optional function to call when the progress bar completes - * - `clear` will clear the progress bar upon termination - * - * Tokens: - * - * - `:bar` the progress bar itself - * - `:current` current tick number - * - `:total` total ticks - * - `:elapsed` time elapsed in seconds - * - `:percent` completion percentage - * - `:eta` eta in seconds - * - `:rate` rate of ticks per second - * - * @param {string} fmt - * @param {object|number} options or total - * @api public - */ + var len = state.objectMode ? 1 : chunk.length; + state.length += len; + var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. -function ProgressBar(fmt, options) { - this.stream = options.stream || process.stderr; + if (!ret) state.needDrain = true; - if (typeof(options) == 'number') { - var total = options; - options = {}; - options.total = total; + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + + state.bufferedRequestCount += 1; } else { - options = options || {}; - if ('string' != typeof fmt) throw new Error('format required'); - if ('number' != typeof options.total) throw new Error('total required'); + doWrite(stream, state, false, len, chunk, encoding, cb); } - this.fmt = fmt; - this.curr = options.curr || 0; - this.total = options.total; - this.width = options.width || this.total; - this.clear = options.clear - this.chars = { - complete : options.complete || '=', - incomplete : options.incomplete || '-', - head : options.head || (options.complete || '=') - }; - this.renderThrottle = options.renderThrottle !== 0 ? (options.renderThrottle || 16) : 0; - this.lastRender = -Infinity; - this.callback = options.callback || function () {}; - this.tokens = {}; - this.lastDraw = ''; + return ret; } -/** - * "tick" the progress bar with optional `len` and optional `tokens`. - * - * @param {number|object} len or tokens - * @param {object} tokens - * @api public - */ - -ProgressBar.prototype.tick = function(len, tokens){ - if (len !== 0) - len = len || 1; - - // swap tokens - if ('object' == typeof len) tokens = len, len = 1; - if (tokens) this.tokens = tokens; +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} - // start time for eta - if (0 == this.curr) this.start = new Date; +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; - this.curr += len + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + process.nextTick(cb, er); // this can emit finish, and it will always happen + // after error - // try to render - this.render(); + process.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); // this can emit finish, but finish must + // always follow error - // progress complete - if (this.curr >= this.total) { - this.render(undefined, true); - this.complete = true; - this.terminate(); - this.callback(this); - return; + finishMaybe(stream, state); } -}; +} -/** - * Method to render the progress bar with optional `tokens` to place in the - * progress bar's `fmt` field. - * - * @param {object} tokens - * @api public - */ +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} -ProgressBar.prototype.render = function (tokens, force) { - force = force !== undefined ? force : false; - if (tokens) this.tokens = tokens; +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state) || stream.destroyed; - if (!this.stream.isTTY) return; + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } - var now = Date.now(); - var delta = now - this.lastRender; - if (!force && (delta < this.renderThrottle)) { - return; - } else { - this.lastRender = now; + if (sync) { + process.nextTick(afterWrite, stream, state, finished, cb); + } else { + afterWrite(stream, state, finished, cb); + } } +} - var ratio = this.curr / this.total; - ratio = Math.min(Math.max(ratio, 0), 1); - - var percent = Math.floor(ratio * 100); - var incomplete, complete, completeLength; - var elapsed = new Date - this.start; - var eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1); - var rate = this.curr / (elapsed / 1000); +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} // Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. - /* populate the bar template with percentages and timestamps */ - var str = this.fmt - .replace(':current', this.curr) - .replace(':total', this.total) - .replace(':elapsed', isNaN(elapsed) ? '0.0' : (elapsed / 1000).toFixed(1)) - .replace(':eta', (isNaN(eta) || !isFinite(eta)) ? '0.0' : (eta / 1000) - .toFixed(1)) - .replace(':percent', percent.toFixed(0) + '%') - .replace(':rate', Math.round(rate)); - /* compute the available space (non-zero) for the bar */ - var availableSpace = Math.max(0, this.stream.columns - str.replace(':bar', '').length); - if(availableSpace && process.platform === 'win32'){ - availableSpace = availableSpace - 1; +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); } +} // if there's something in the buffer waiting, then process it - var width = Math.min(this.width, availableSpace); - /* TODO: the following assumes the user has one ':bar' token */ - completeLength = Math.round(width * ratio); - complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete); - incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete); +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; - /* add head to the complete string */ - if(completeLength > 0) - complete = complete.slice(0, -1) + this.chars.head; + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count = 0; + var allBuffers = true; - /* fill in the actual progress bar */ - str = str.replace(':bar', complete + incomplete); + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } - /* replace the extra tokens */ - if (this.tokens) for (var key in this.tokens) str = str.replace(':' + key, this.tokens[key]); + buffer.allBuffers = allBuffers; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite - if (this.lastDraw !== str) { - this.stream.cursorTo(0); - this.stream.write(str); - this.stream.clearLine(1); - this.lastDraw = str; - } -}; + state.pendingcb++; + state.lastBufferedRequest = null; -/** - * "update" the progress bar to represent an exact percentage. - * The ratio (between 0 and 1) specified will be multiplied by `total` and - * floored, representing the closest available "tick." For example, if a - * progress bar has a length of 3 and `update(0.5)` is called, the progress - * will be set to 1. - * - * A ratio of 0.5 will attempt to set the progress to halfway. - * - * @param {number} ratio The ratio (between 0 and 1 inclusive) to set the - * overall completion to. - * @api public - */ + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } -ProgressBar.prototype.update = function (ratio, tokens) { - var goal = Math.floor(ratio * this.total); - var delta = goal - this.curr; + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + + if (state.writing) { + break; + } + } - this.tick(delta, tokens); -}; + if (entry === null) state.lastBufferedRequest = null; + } -/** - * "interrupt" the progress bar and write a message above it. - * @param {string} message The message to write. - * @api public - */ + state.bufferedRequest = entry; + state.bufferProcessing = false; +} -ProgressBar.prototype.interrupt = function (message) { - // clear the current line - this.stream.clearLine(); - // move the cursor to the start of the line - this.stream.cursorTo(0); - // write the message text - this.stream.write(message); - // terminate the line after writing the message - this.stream.write('\n'); - // re-display the progress bar with its lastDraw - this.stream.write(this.lastDraw); +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); }; -/** - * Terminates a progress bar. - * - * @api public - */ +Writable.prototype._writev = null; -ProgressBar.prototype.terminate = function () { - if (this.clear) { - if (this.stream.clearLine) { - this.stream.clearLine(); - this.stream.cursorTo(0); - } - } else { - this.stream.write('\n'); +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; } -}; + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks -/***/ }), + if (state.corked) { + state.corked = 1; + this.uncork(); + } // ignore unnecessary end() calls. -/***/ 98051: -/***/ ((module) => { + if (!state.ending) endWritable(this, state, cb); + return this; +}; -module.exports = ProtoList +Object.defineProperty(Writable.prototype, 'writableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } +}); -function setProto(obj, proto) { - if (typeof Object.setPrototypeOf === "function") - return Object.setPrototypeOf(obj, proto) - else - obj.__proto__ = proto +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } -function ProtoList () { - this.list = [] - var root = null - Object.defineProperty(this, 'root', { - get: function () { return root }, - set: function (r) { - root = r - if (this.list.length) { - setProto(this.list[this.list.length - 1], r) - } - }, - enumerable: true, - configurable: true - }) -} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; -ProtoList.prototype = - { get length () { return this.list.length } - , get keys () { - var k = [] - for (var i in this.list[0]) k.push(i) - return k - } - , get snapshot () { - var o = {} - this.keys.forEach(function (k) { o[k] = this.get(k) }, this) - return o - } - , get store () { - return this.list[0] - } - , push : function (obj) { - if (typeof obj !== "object") obj = {valueOf:obj} - if (this.list.length >= 1) { - setProto(this.list[this.list.length - 1], obj) - } - setProto(obj, this.root) - return this.list.push(obj) - } - , pop : function () { - if (this.list.length >= 2) { - setProto(this.list[this.list.length - 2], this.root) - } - return this.list.pop() - } - , unshift : function (obj) { - setProto(obj, this.list[0] || this.root) - return this.list.unshift(obj) - } - , shift : function () { - if (this.list.length === 1) { - setProto(this.list[0], this.root) - } - return this.list.shift() - } - , get : function (key) { - return this.list[0][key] - } - , set : function (key, val, save) { - if (!this.length) this.push({}) - if (save && this.list[0].hasOwnProperty(key)) this.push({}) - return this.list[0][key] = val - } - , forEach : function (fn, thisp) { - for (var key in this.list[0]) fn.call(thisp, key, this.list[0][key]) - } - , slice : function () { - return this.list.slice.apply(this.list, arguments) + if (err) { + errorOrDestroy(stream, err); } - , splice : function () { - // handle injections - var ret = this.list.splice.apply(this.list, arguments) - for (var i = 0, l = this.list.length; i < l; i++) { - setProto(this.list[i], this.list[i + 1] || this.root) - } - return ret + + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} + +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function' && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); } } +} +function finishMaybe(stream, state) { + var need = needFinish(state); -/***/ }), + if (need) { + prefinish(stream, state); -/***/ 20113: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); -var once = __webpack_require__(96754) -var eos = __webpack_require__(11745) -var fs = __webpack_require__(35747) // we only need fs to get the ReadStream and WriteStream prototypes + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the readable side is ready for autoDestroy as well + var rState = stream._readableState; -var noop = function () {} -var ancient = /^v?\.0/.test(process.version) + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream.destroy(); + } + } + } + } -var isFn = function (fn) { - return typeof fn === 'function' + return need; } -var isFS = function (stream) { - if (!ancient) return false // newer node version do not need to care about fs is a special way - if (!fs) return false // browser - return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) -} +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); -var isRequest = function (stream) { - return stream.setHeader && isFn(stream.abort) + if (cb) { + if (state.finished) process.nextTick(cb);else stream.once('finish', cb); + } + + state.ended = true; + stream.writable = false; } -var destroyer = function (stream, reading, writing, callback) { - callback = once(callback) +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; - var closed = false - stream.on('close', function () { - closed = true - }) + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } // reuse the free corkReq. - eos(stream, {readable: reading, writable: writing}, function (err) { - if (err) return callback(err) - closed = true - callback() - }) - var destroyed = false - return function (err) { - if (closed) return - if (destroyed) return - destroyed = true + state.corkedRequestsFree.next = corkReq; +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._writableState === undefined) { + return false; + } - if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks - if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want + return this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed - if (isFn(stream.destroy)) return stream.destroy() - callback(err || new Error('stream was destroyed')) + this._writableState.destroyed = value; } -} +}); +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; -var call = function (fn) { - fn() -} +Writable.prototype._destroy = function (err, cb) { + cb(err); +}; -var pipe = function (from, to) { - return from.pipe(to) -} +/***/ }), -var pump = function () { - var streams = Array.prototype.slice.call(arguments) - var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop +/***/ 60863: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (Array.isArray(streams[0])) streams = streams[0] - if (streams.length < 2) throw new Error('pump requires two streams per minimum') +"use strict"; - var error - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1 - var writing = i > 0 - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err - if (err) destroys.forEach(call) - if (reading) return - destroys.forEach(call) - callback(error) - }) - }) - return streams.reduce(pipe) -} +var _Object$setPrototypeO; -module.exports = pump +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; } +var finished = __nccwpck_require__(22979); -/***/ }), +var kLastResolve = Symbol('lastResolve'); +var kLastReject = Symbol('lastReject'); +var kError = Symbol('error'); +var kEnded = Symbol('ended'); +var kLastPromise = Symbol('lastPromise'); +var kHandlePromise = Symbol('handlePromise'); +var kStream = Symbol('stream'); -/***/ 76671: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +function createIterResult(value, done) { + return { + value: value, + done: done + }; +} -"use strict"; +function readAndResolve(iter) { + var resolve = iter[kLastResolve]; -var strictUriEncode = __webpack_require__(61778); -var objectAssign = __webpack_require__(14594); + if (resolve !== null) { + var data = iter[kStream].read(); // we defer if data is null + // we can be expecting either 'end' or + // 'error' -function encoderForArrayFormat(opts) { - switch (opts.arrayFormat) { - case 'index': - return function (key, value, index) { - return value === null ? [ - encode(key, opts), - '[', - index, - ']' - ].join('') : [ - encode(key, opts), - '[', - encode(index, opts), - ']=', - encode(value, opts) - ].join(''); - }; + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve(createIterResult(data, false)); + } + } +} - case 'bracket': - return function (key, value) { - return value === null ? encode(key, opts) : [ - encode(key, opts), - '[]=', - encode(value, opts) - ].join(''); - }; +function onReadable(iter) { + // we wait for the next tick, because it might + // emit an error with process.nextTick + process.nextTick(readAndResolve, iter); +} - default: - return function (key, value) { - return value === null ? encode(key, opts) : [ - encode(key, opts), - '=', - encode(value, opts) - ].join(''); - }; - } +function wrapForNext(lastPromise, iter) { + return function (resolve, reject) { + lastPromise.then(function () { + if (iter[kEnded]) { + resolve(createIterResult(undefined, true)); + return; + } + + iter[kHandlePromise](resolve, reject); + }, reject); + }; } -function parserForArrayFormat(opts) { - var result; +var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); +var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, - switch (opts.arrayFormat) { - case 'index': - return function (key, value, accumulator) { - result = /\[(\d*)\]$/.exec(key); + next: function next() { + var _this = this; - key = key.replace(/\[\d*\]$/, ''); + // if we have detected an error in the meanwhile + // reject straight away + var error = this[kError]; - if (!result) { - accumulator[key] = value; - return; - } + if (error !== null) { + return Promise.reject(error); + } - if (accumulator[key] === undefined) { - accumulator[key] = {}; - } + if (this[kEnded]) { + return Promise.resolve(createIterResult(undefined, true)); + } - accumulator[key][result[1]] = value; - }; + if (this[kStream].destroyed) { + // We need to defer via nextTick because if .destroy(err) is + // called, the error will be emitted via nextTick, and + // we cannot guarantee that there is no error lingering around + // waiting to be emitted. + return new Promise(function (resolve, reject) { + process.nextTick(function () { + if (_this[kError]) { + reject(_this[kError]); + } else { + resolve(createIterResult(undefined, true)); + } + }); + }); + } // if we have multiple next() calls + // we will wait for the previous Promise to finish + // this logic is optimized to support for await loops, + // where next() is only called once at a time - case 'bracket': - return function (key, value, accumulator) { - result = /(\[\])$/.exec(key); - key = key.replace(/\[\]$/, ''); - if (!result) { - accumulator[key] = value; - return; - } else if (accumulator[key] === undefined) { - accumulator[key] = [value]; - return; - } + var lastPromise = this[kLastPromise]; + var promise; - accumulator[key] = [].concat(accumulator[key], value); - }; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + // fast path needed to support multiple this.push() + // without triggering the next() queue + var data = this[kStream].read(); - default: - return function (key, value, accumulator) { - if (accumulator[key] === undefined) { - accumulator[key] = value; - return; - } + if (data !== null) { + return Promise.resolve(createIterResult(data, false)); + } - accumulator[key] = [].concat(accumulator[key], value); - }; - } -} + promise = new Promise(this[kHandlePromise]); + } -function encode(value, opts) { - if (opts.encode) { - return opts.strict ? strictUriEncode(value) : encodeURIComponent(value); - } + this[kLastPromise] = promise; + return promise; + } +}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { + return this; +}), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + + // destroy(err, cb) is a private API + // we can guarantee we have that here, because we control the + // Readable class this is attached to + return new Promise(function (resolve, reject) { + _this2[kStream].destroy(null, function (err) { + if (err) { + reject(err); + return; + } - return value; -} + resolve(createIterResult(undefined, true)); + }); + }); +}), _Object$setPrototypeO), AsyncIteratorPrototype); + +var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { + var _Object$create; + + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value(resolve, reject) { + var data = iterator[kStream].read(); + + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(data, false)); + } else { + iterator[kLastResolve] = resolve; + iterator[kLastReject] = reject; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished(stream, function (err) { + if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { + var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise + // returned by next() and store the error + + if (reject !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject(err); + } + + iterator[kError] = err; + return; + } -function keysSorter(input) { - if (Array.isArray(input)) { - return input.sort(); - } else if (typeof input === 'object') { - return keysSorter(Object.keys(input)).sort(function (a, b) { - return Number(a) - Number(b); - }).map(function (key) { - return input[key]; - }); - } + var resolve = iterator[kLastResolve]; - return input; -} + if (resolve !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(undefined, true)); + } -exports.extract = function (str) { - return str.split('?')[1] || ''; + iterator[kEnded] = true; + }); + stream.on('readable', onReadable.bind(null, iterator)); + return iterator; }; -exports.parse = function (str, opts) { - opts = objectAssign({arrayFormat: 'none'}, opts); +module.exports = createReadableStreamAsyncIterator; - var formatter = parserForArrayFormat(opts); +/***/ }), - // Create an object with no prototype - // https://github.com/sindresorhus/query-string/issues/47 - var ret = Object.create(null); +/***/ 29464: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (typeof str !== 'string') { - return ret; - } +"use strict"; - str = str.trim().replace(/^(\?|#|&)/, ''); - if (!str) { - return ret; - } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - str.split('&').forEach(function (param) { - var parts = param.replace(/\+/g, ' ').split('='); - // Firefox (pre 40) decodes `%3D` to `=` - // https://github.com/sindresorhus/query-string/pull/37 - var key = parts.shift(); - var val = parts.length > 0 ? parts.join('=') : undefined; +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - // missing `=` should be `null`: - // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - val = val === undefined ? null : decodeURIComponent(val); +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; } - formatter(decodeURIComponent(key), val, ret); - }); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - return Object.keys(ret).sort().reduce(function (result, key) { - var val = ret[key]; - if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) { - // Sort object keys, not values - result[key] = keysSorter(val); - } else { - result[key] = val; - } +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 result; - }, Object.create(null)); -}; +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -exports.stringify = function (obj, opts) { - var defaults = { - encode: true, - strict: true, - arrayFormat: 'none' - }; +var _require = __nccwpck_require__(64293), + Buffer = _require.Buffer; - opts = objectAssign(defaults, opts); +var _require2 = __nccwpck_require__(31669), + inspect = _require2.inspect; - var formatter = encoderForArrayFormat(opts); +var custom = inspect && inspect.custom || 'inspect'; - return obj ? Object.keys(obj).sort().map(function (key) { - var val = obj[key]; +function copyBuffer(src, target, offset) { + Buffer.prototype.copy.call(src, target, offset); +} - if (val === undefined) { - return ''; - } +module.exports = +/*#__PURE__*/ +function () { + function BufferList() { + _classCallCheck(this, BufferList); - if (val === null) { - return encode(key, opts); - } + this.head = null; + this.tail = null; + this.length = 0; + } - if (Array.isArray(val)) { - var result = []; + _createClass(BufferList, [{ + key: "push", + value: function push(v) { + var entry = { + data: v, + next: null + }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift(v) { + var entry = { + data: v, + next: this.head + }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; - val.slice().forEach(function (val2) { - if (val2 === undefined) { - return; - } + while (p = p.next) { + ret += s + p.data; + } - result.push(formatter(key, val2, result.length)); - }); + return ret; + } + }, { + key: "concat", + value: function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; - return result.join('&'); - } + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } - return encode(key, opts) + '=' + encode(val, opts); - }).filter(function (x) { - return x.length > 0; - }).join('&') : ''; -}; + return ret; + } // Consumes a specified amount of bytes or characters from the buffered data. + }, { + key: "consume", + value: function consume(n, hasStrings) { + var ret; + + if (n < this.head.data.length) { + // `slice` is the same for buffers and strings. + ret = this.head.data.slice(0, n); + this.head.data = this.head.data.slice(n); + } else if (n === this.head.data.length) { + // First chunk is a perfect match. + ret = this.shift(); + } else { + // Result spans more than one buffer. + ret = hasStrings ? this._getString(n) : this._getBuffer(n); + } -/***/ }), + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } // Consumes a specified amount of characters from the buffered data. -/***/ 45730: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + }, { + key: "_getString", + value: function _getString(n) { + var p = this.head; + var c = 1; + var ret = p.data; + n -= ret.length; + + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) this.head = p.next;else this.head = this.tail = null; + } else { + this.head = p; + p.data = str.slice(nb); + } -"use strict"; + break; + } -const path = __webpack_require__(85622); -const findUp = __webpack_require__(2885); -const readPkg = __webpack_require__(19003); + ++c; + } -module.exports = async options => { - const filePath = await findUp('package.json', options); + this.length -= c; + return ret; + } // Consumes a specified amount of bytes from the buffered data. - if (!filePath) { - return; - } + }, { + key: "_getBuffer", + value: function _getBuffer(n) { + var ret = Buffer.allocUnsafe(n); + var p = this.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) this.head = p.next;else this.head = this.tail = null; + } else { + this.head = p; + p.data = buf.slice(nb); + } - return { - packageJson: await readPkg({...options, cwd: path.dirname(filePath)}), - path: filePath - }; -}; + break; + } -module.exports.sync = options => { - const filePath = findUp.sync('package.json', options); + ++c; + } - if (!filePath) { - return; - } + this.length -= c; + return ret; + } // Make sure the linked list only shows the minimal necessary information. - return { - packageJson: readPkg.sync({...options, cwd: path.dirname(filePath)}), - path: filePath - }; -}; + }, { + key: custom, + value: function value(_, options) { + return inspect(this, _objectSpread({}, options, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + return BufferList; +}(); /***/ }), -/***/ 40349: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 87915: +/***/ ((module) => { "use strict"; + // undocumented cb() API, needed for core, not for public API -const errorEx = __webpack_require__(98361); -const fallback = __webpack_require__(48335); -const {default: LinesAndColumns} = __webpack_require__(99036); -const {codeFrameColumns} = __webpack_require__(36553); +function destroy(err, cb) { + var _this = this; -const JSONError = errorEx('JSONError', { - fileName: errorEx.append('in %s'), - codeFrame: errorEx.append('\n\n%s\n') -}); + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; -module.exports = (string, reviver, filename) => { - if (typeof reviver === 'string') { - filename = reviver; - reviver = null; - } + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process.nextTick(emitErrorNT, this, err); + } + } - try { - try { - return JSON.parse(string, reviver); - } catch (error) { - fallback(string, reviver); - throw error; - } - } catch (error) { - error.message = error.message.replace(/\n/g, ''); - const indexMatch = error.message.match(/in JSON at position (\d+) while parsing near/); + return this; + } // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks - const jsonError = new JSONError(error); - if (filename) { - jsonError.fileName = filename; - } - if (indexMatch && indexMatch.length > 0) { - const lines = new LinesAndColumns(string); - const index = Number(indexMatch[1]); - const location = lines.locationForIndex(index); + if (this._readableState) { + this._readableState.destroyed = true; + } // if this is a duplex stream mark the writable part as destroyed as well - const codeFrame = codeFrameColumns( - string, - {start: {line: location.line + 1, column: location.column + 1}}, - {highlightCode: true} - ); - jsonError.codeFrame = codeFrame; - } + if (this._writableState) { + this._writableState.destroyed = true; + } - throw jsonError; - } -}; + this._destroy(err || null, function (err) { + if (!cb && err) { + if (!_this._writableState) { + process.nextTick(emitErrorAndCloseNT, _this, err); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process.nextTick(emitErrorAndCloseNT, _this, err); + } else { + process.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process.nextTick(emitCloseNT, _this); + cb(err); + } else { + process.nextTick(emitCloseNT, _this); + } + }); + + return this; +} + +function emitErrorAndCloseNT(self, err) { + emitErrorNT(self, err); + emitCloseNT(self); +} + +function emitCloseNT(self) { + if (self._writableState && !self._writableState.emitClose) return; + if (self._readableState && !self._readableState.emitClose) return; + self.emit('close'); +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} +function emitErrorNT(self, err) { + self.emit('error', err); +} + +function errorOrDestroy(stream, err) { + // We have tests that rely on errors being emitted + // in the same tick, so changing this is semver major. + // For now when you opt-in to autoDestroy we allow + // the error to be emitted nextTick. In a future + // semver major update we should change the default to this. + var rState = stream._readableState; + var wState = stream._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy, + errorOrDestroy: errorOrDestroy +}; /***/ }), -/***/ 19003: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 22979: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +// Ported from https://github.com/mafintosh/end-of-stream with +// permission from the author, Mathias Buus (@mafintosh). -const {promisify} = __webpack_require__(31669); -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const parseJson = __webpack_require__(40349); -const readFileAsync = promisify(fs.readFile); +var ERR_STREAM_PREMATURE_CLOSE = __nccwpck_require__(92036)/* .codes.ERR_STREAM_PREMATURE_CLOSE */ .q.ERR_STREAM_PREMATURE_CLOSE; -module.exports = async options => { - options = { - cwd: process.cwd(), - normalize: true, - ...options - }; +function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; - const filePath = path.resolve(options.cwd, 'package.json'); - const json = parseJson(await readFileAsync(filePath, 'utf8')); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - if (options.normalize) { - __webpack_require__(44586)(json); - } + callback.apply(this, args); + }; +} - return json; -}; +function noop() {} -module.exports.sync = options => { - options = { - cwd: process.cwd(), - normalize: true, - ...options - }; +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +} - const filePath = path.resolve(options.cwd, 'package.json'); - const json = parseJson(fs.readFileSync(filePath, 'utf8')); +function eos(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + callback = once(callback || noop); + var readable = opts.readable || opts.readable !== false && stream.readable; + var writable = opts.writable || opts.writable !== false && stream.writable; - if (options.normalize) { - __webpack_require__(44586)(json); - } + var onlegacyfinish = function onlegacyfinish() { + if (!stream.writable) onfinish(); + }; - return json; -}; + var writableEnded = stream._writableState && stream._writableState.finished; + + var onfinish = function onfinish() { + writable = false; + writableEnded = true; + if (!readable) callback.call(stream); + }; + var readableEnded = stream._readableState && stream._readableState.endEmitted; -/***/ }), + var onend = function onend() { + readable = false; + readableEnded = true; + if (!writable) callback.call(stream); + }; -/***/ 20493: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var onerror = function onerror(err) { + callback.call(stream, err); + }; -"use strict"; -/*! - * resolve-dir - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ + var onclose = function onclose() { + var err; + if (readable && !readableEnded) { + if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + if (writable && !writableEnded) { + if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + }; -var path = __webpack_require__(85622); -var expand = __webpack_require__(3718); -var gm = __webpack_require__(6637); + var onrequest = function onrequest() { + stream.req.on('finish', onfinish); + }; -module.exports = function resolveDir(dir) { - if (dir.charAt(0) === '~') { - dir = expand(dir); - } - if (dir.charAt(0) === '@') { - dir = path.join(gm, dir.slice(1)); - } - return dir; -}; + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest();else stream.on('request', onrequest); + } else if (writable && !stream._writableState) { + // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + return function () { + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +} +module.exports = eos; /***/ }), -/***/ 6637: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 32244: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/* module decorator */ module = __webpack_require__.nmd(module); -/*! - * global-modules - * - * Copyright (c) 2015-2017 Jon Schlinkert. - * Licensed under the MIT license. - */ +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -var path = __webpack_require__(85622); -var prefix = __webpack_require__(96397); -var isWindows = __webpack_require__(99333); -var gm; +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function getPath() { - if (isWindows()) { - return path.resolve(prefix, 'node_modules'); - } - return path.resolve(prefix, 'lib/node_modules'); -} +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } -/** - * Expose `global-modules` path - */ +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } -Object.defineProperty(module, 'exports', { - enumerable: true, - get: function() { - return gm || (gm = getPath()); - } -}); +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; } +var ERR_INVALID_ARG_TYPE = __nccwpck_require__(92036)/* .codes.ERR_INVALID_ARG_TYPE */ .q.ERR_INVALID_ARG_TYPE; -/***/ }), +function from(Readable, iterable, opts) { + var iterator; -/***/ 96397: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (iterable && typeof iterable.next === 'function') { + iterator = iterable; + } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); -"use strict"; -/* module decorator */ module = __webpack_require__.nmd(module); -/*! - * global-prefix - * - * Copyright (c) 2015-2017 Jon Schlinkert. - * Licensed under the MIT license. - */ + var readable = new Readable(_objectSpread({ + objectMode: true + }, opts)); // Reading boolean to protect against _read + // being called before last iteration completion. + var reading = false; + readable._read = function () { + if (!reading) { + reading = true; + next(); + } + }; -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var expand = __webpack_require__(3718); -var homedir = __webpack_require__(56530); -var ini = __webpack_require__(27452); -var prefix; + function next() { + return _next2.apply(this, arguments); + } -function getPrefix() { - if (process.env.PREFIX) { - prefix = process.env.PREFIX; - } else { - // Start by checking if the global prefix is set by the user - var home = homedir(); - if (home) { - // homedir() returns undefined if $HOME not set; path.resolve requires strings - var userConfig = path.resolve(home, '.npmrc'); - prefix = tryConfigPath(userConfig); - } - - if (!prefix) { - // Otherwise find the path of npm - var npm = tryNpmPath(); - if (npm) { - // Check the built-in npm config file - var builtinConfig = path.resolve(npm, '..', '..', 'npmrc'); - prefix = tryConfigPath(builtinConfig); - - if (prefix) { - // Now the global npm config can also be checked. - var globalConfig = path.resolve(prefix, 'etc', 'npmrc'); - prefix = tryConfigPath(globalConfig) || prefix; + function _next2() { + _next2 = _asyncToGenerator(function* () { + try { + var _ref = yield iterator.next(), + value = _ref.value, + done = _ref.done; + + if (done) { + readable.push(null); + } else if (readable.push((yield value))) { + next(); + } else { + reading = false; } + } catch (err) { + readable.destroy(err); } - - if (!prefix) fallback(); - } + }); + return _next2.apply(this, arguments); } - if (prefix) { - return expand(prefix); - } + return readable; } -function fallback() { - var isWindows = __webpack_require__(99333); - if (isWindows()) { - // c:\node\node.exe --> prefix=c:\node\ - prefix = process.env.APPDATA - ? path.join(process.env.APPDATA, 'npm') - : path.dirname(process.execPath); - } else { - // /usr/local/bin/node --> prefix=/usr/local - prefix = path.dirname(path.dirname(process.execPath)); +module.exports = from; - // destdir only is respected on Unix - if (process.env.DESTDIR) { - prefix = path.join(process.env.DESTDIR, prefix); - } - } -} +/***/ }), -function tryNpmPath() { - try { - return fs.realpathSync(__webpack_require__(88291).sync('npm')); - } catch (err) {} - return null; +/***/ 25320: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Ported from https://github.com/mafintosh/pump with +// permission from the author, Mathias Buus (@mafintosh). + + +var eos; + +function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; + callback.apply(void 0, arguments); + }; } -function tryConfigPath(configPath) { - try { - var data = fs.readFileSync(configPath, 'utf-8'); - var config = ini.parse(data); - if (config.prefix) return config.prefix; - } catch (err) {} - return null; +var _require$codes = __nccwpck_require__(92036)/* .codes */ .q, + ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + +function noop(err) { + // Rethrow the error if it exists to avoid swallowing it + if (err) throw err; } -/** - * Expose `prefix` - */ +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +} -Object.defineProperty(module, 'exports', { - enumerable: true, - get: function() { - return prefix || (prefix = getPrefix()); - } -}); +function destroyer(stream, reading, writing, callback) { + callback = once(callback); + var closed = false; + stream.on('close', function () { + closed = true; + }); + if (eos === undefined) eos = __nccwpck_require__(22979); + eos(stream, { + readable: reading, + writable: writing + }, function (err) { + if (err) return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function (err) { + if (closed) return; + if (destroyed) return; + destroyed = true; // request.destroy just do .end - .abort is what we want + if (isRequest(stream)) return stream.abort(); + if (typeof stream.destroy === 'function') return stream.destroy(); + callback(err || new ERR_STREAM_DESTROYED('pipe')); + }; +} -/***/ }), +function call(fn) { + fn(); +} -/***/ 88291: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function pipe(from, to) { + return from.pipe(to); +} -module.exports = which -which.sync = whichSync +function popCallback(streams) { + if (!streams.length) return noop; + if (typeof streams[streams.length - 1] !== 'function') return noop; + return streams.pop(); +} -var isWindows = process.platform === 'win32' || - process.env.OSTYPE === 'cygwin' || - process.env.OSTYPE === 'msys' +function pipeline() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } -var path = __webpack_require__(85622) -var COLON = isWindows ? ';' : ':' -var isexe = __webpack_require__(52607) + var callback = popCallback(streams); + if (Array.isArray(streams[0])) streams = streams[0]; -function getNotFoundError (cmd) { - var er = new Error('not found: ' + cmd) - er.code = 'ENOENT' + if (streams.length < 2) { + throw new ERR_MISSING_ARGS('streams'); + } - return er + var error; + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1; + var writing = i > 0; + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err; + if (err) destroys.forEach(call); + if (reading) return; + destroys.forEach(call); + callback(error); + }); + }); + return streams.reduce(pipe); } -function getPathInfo (cmd, opt) { - var colon = opt.colon || COLON - var pathEnv = opt.path || process.env.PATH || '' - var pathExt = [''] +module.exports = pipeline; - pathEnv = pathEnv.split(colon) +/***/ }), - var pathExtExe = '' - if (isWindows) { - pathEnv.unshift(process.cwd()) - pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') - pathExt = pathExtExe.split(colon) +/***/ 13400: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; - // Always test the cmd itself first. isexe will check to make sure - // it's found in the pathExt set. - if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') - pathExt.unshift('') - } - // If it has a slash, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) - pathEnv = [''] +var ERR_INVALID_OPT_VALUE = __nccwpck_require__(92036)/* .codes.ERR_INVALID_OPT_VALUE */ .q.ERR_INVALID_OPT_VALUE; - return { - env: pathEnv, - ext: pathExt, - extExe: pathExtExe - } +function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } -function which (cmd, opt, cb) { - if (typeof opt === 'function') { - cb = opt - opt = {} - } - - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] +function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - ;(function F (i, l) { - if (i === l) { - if (opt.all && found.length) - return cb(null, found) - else - return cb(getNotFoundError(cmd)) + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name = isDuplex ? duplexKey : 'highWaterMark'; + throw new ERR_INVALID_OPT_VALUE(name, hwm); } - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) + return Math.floor(hwm); + } // Default value - var p = path.join(pathPart, cmd) - if (!pathPart && (/^\.[\\\/]/).test(cmd)) { - p = cmd.slice(0, 2) + p - } - ;(function E (ii, ll) { - if (ii === ll) return F(i + 1, l) - var ext = pathExt[ii] - isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { - if (!er && is) { - if (opt.all) - found.push(p + ext) - else - return cb(null, p + ext) - } - return E(ii + 1, ll) - }) - })(0, pathExt.length) - })(0, pathEnv.length) + + return state.objectMode ? 16 : 16 * 1024; } -function whichSync (cmd, opt) { - opt = opt || {} +module.exports = { + getHighWaterMark: getHighWaterMark +}; - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] +/***/ }), - for (var i = 0, l = pathEnv.length; i < l; i ++) { - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) +/***/ 1065: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var p = path.join(pathPart, cmd) - if (!pathPart && /^\.[\\\/]/.test(cmd)) { - p = cmd.slice(0, 2) + p - } - for (var j = 0, ll = pathExt.length; j < ll; j ++) { - var cur = p + pathExt[j] - var is - try { - is = isexe.sync(cur, { pathExt: pathExtExe }) - if (is) { - if (opt.all) - found.push(cur) - else - return cur - } - } catch (ex) {} - } - } +module.exports = __nccwpck_require__(92413); - if (opt.all && found.length) - return found - if (opt.nothrow) - return null +/***/ }), - throw getNotFoundError(cmd) +/***/ 68193: +/***/ ((module, exports, __nccwpck_require__) => { + +var Stream = __nccwpck_require__(92413); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream.Readable; + Object.assign(module.exports, Stream); + module.exports.Stream = Stream; +} else { + exports = module.exports = __nccwpck_require__(79341); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __nccwpck_require__(78063); + exports.Duplex = __nccwpck_require__(42770); + exports.Transform = __nccwpck_require__(62826); + exports.PassThrough = __nccwpck_require__(60143); + exports.finished = __nccwpck_require__(22979); + exports.pipeline = __nccwpck_require__(25320); } /***/ }), /***/ 72305: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var async = __webpack_require__(97801); -async.core = __webpack_require__(91540); -async.isCore = __webpack_require__(67069); -async.sync = __webpack_require__(57955); +var async = __nccwpck_require__(97801); +async.core = __nccwpck_require__(91540); +async.isCore = __nccwpck_require__(67069); +async.sync = __nccwpck_require__(57955); module.exports = async; @@ -86609,14 +72792,14 @@ module.exports = async; /***/ }), /***/ 97801: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var caller = __webpack_require__(14365); -var nodeModulesPaths = __webpack_require__(50833); -var normalizeOptions = __webpack_require__(98233); -var isCore = __webpack_require__(67069); +var fs = __nccwpck_require__(35747); +var path = __nccwpck_require__(85622); +var caller = __nccwpck_require__(14365); +var nodeModulesPaths = __nccwpck_require__(50833); +var normalizeOptions = __nccwpck_require__(98233); +var isCore = __nccwpck_require__(21176); var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; @@ -86686,6 +72869,7 @@ module.exports = function resolve(x, options, callback) { var packageIterator = opts.packageIterator; var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; var basedir = opts.basedir || path.dirname(caller()); var parent = opts.filename || basedir; @@ -86712,7 +72896,7 @@ module.exports = function resolve(x, options, callback) { if ((/\/$/).test(x) && res === basedir) { loadAsDirectory(res, opts.package, onfile); } else loadAsFile(res, opts.package, onfile); - } else if (isCore(x)) { + } else if (includeCoreModules && isCore(x)) { return cb(null, x); } else loadNodeModules(x, basedir, function (err, n, pkg) { if (err) cb(err); @@ -86929,7 +73113,7 @@ module.exports = function () { /***/ }), /***/ 91540: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; @@ -86939,8 +73123,8 @@ function specifierIncluded(specifier) { var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); for (var i = 0; i < 3; ++i) { - var cur = Number(current[i] || 0); - var ver = Number(versionParts[i] || 0); + var cur = parseInt(current[i] || 0, 10); + var ver = parseInt(versionParts[i] || 0, 10); if (cur === ver) { continue; // eslint-disable-line no-restricted-syntax, no-continue } @@ -86975,7 +73159,7 @@ function versionIncluded(specifierValue) { return matchesRange(specifierValue); } -var data = __webpack_require__(52538); +var data = __nccwpck_require__(52538); var core = {}; for (var mod in data) { // eslint-disable-line no-restricted-syntax @@ -86989,22 +73173,22 @@ module.exports = core; /***/ }), /***/ 67069: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var core = __webpack_require__(91540); +var isCoreModule = __nccwpck_require__(21176); module.exports = function isCore(x) { - return Object.prototype.hasOwnProperty.call(core, x); + return isCoreModule(x); }; /***/ }), /***/ 50833: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var path = __webpack_require__(85622); -var parse = path.parse || __webpack_require__(50731); +var path = __nccwpck_require__(85622); +var parse = path.parse || __nccwpck_require__(50731); var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { var prefix = '/'; @@ -87067,14 +73251,14 @@ module.exports = function (x, opts) { /***/ }), /***/ 57955: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var isCore = __webpack_require__(67069); -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var caller = __webpack_require__(14365); -var nodeModulesPaths = __webpack_require__(50833); -var normalizeOptions = __webpack_require__(98233); +var isCore = __nccwpck_require__(21176); +var fs = __nccwpck_require__(35747); +var path = __nccwpck_require__(85622); +var caller = __nccwpck_require__(14365); +var nodeModulesPaths = __nccwpck_require__(50833); +var normalizeOptions = __nccwpck_require__(98233); var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; @@ -87137,6 +73321,7 @@ module.exports = function resolveSync(x, options) { var packageIterator = opts.packageIterator; var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; var basedir = opts.basedir || path.dirname(caller()); var parent = opts.filename || basedir; @@ -87150,7 +73335,7 @@ module.exports = function resolveSync(x, options) { if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; var m = loadAsFileSync(res) || loadAsDirectorySync(res); if (m) return maybeRealpathSync(realpathSync, m, opts); - } else if (isCore(x)) { + } else if (includeCoreModules && isCore(x)) { return x; } else { var n = loadNodeModulesSync(x, absoluteStart); @@ -87265,13 +73450,13 @@ module.exports = function resolveSync(x, options) { /***/ }), /***/ 39014: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Readable = __webpack_require__(92413).Readable; -const lowercaseKeys = __webpack_require__(18984); +const Readable = __nccwpck_require__(92413).Readable; +const lowercaseKeys = __nccwpck_require__(18984); class Response extends Readable { constructor(statusCode, headers, body, url) { @@ -87330,7 +73515,7 @@ exports.logLevels = logLevels; /***/ }), /***/ 57109: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -87340,18 +73525,20 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _globalthis = _interopRequireDefault(__webpack_require__(35553)); +var _detectNode = _interopRequireDefault(__nccwpck_require__(7192)); -var _detectNode = _interopRequireDefault(__webpack_require__(7192)); +var _globalthis = _interopRequireDefault(__nccwpck_require__(35553)); -var _jsonStringifySafe = _interopRequireDefault(__webpack_require__(4211)); +var _jsonStringifySafe = _interopRequireDefault(__nccwpck_require__(4211)); -var _sprintfJs = __webpack_require__(74273); +var _sprintfJs = __nccwpck_require__(14792); -var _constants = __webpack_require__(17352); +var _constants = __nccwpck_require__(17352); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _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; }; return _extends.apply(this, arguments); } + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } @@ -87363,7 +73550,7 @@ let domain; if (_detectNode.default) { // eslint-disable-next-line global-require - domain = __webpack_require__(85229); + domain = __nccwpck_require__(85229); } const getParentDomainContext = () => { @@ -87389,7 +73576,7 @@ const getParentDomainContext = () => { let domainContext = {}; for (const parentRoarrContext of parentRoarrContexts) { - domainContext = _objectSpread({}, domainContext, {}, parentRoarrContext); + domainContext = _objectSpread(_objectSpread({}, domainContext), parentRoarrContext); } return domainContext; @@ -87431,14 +73618,36 @@ const createLogger = (onMessage, parentContext) => { let message; if (typeof a === 'string') { - context = _objectSpread({}, getFirstParentDomainContext(), {}, parentContext || {}); - message = (0, _sprintfJs.sprintf)(a, b, c, d, e, f, g, h, i, k); + context = _objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}); // eslint-disable-next-line id-length, object-property-newline + + const args = _extends({}, { + a, + b, + c, + d, + e, + f, + g, + h, + i, + k + }); + + const values = Object.keys(args).map(key => { + return args[key]; + }); // eslint-disable-next-line unicorn/no-reduce + + const hasOnlyOneParameterValued = 1 === values.reduce((accumulator, value) => { + // eslint-disable-next-line no-return-assign, no-param-reassign + return accumulator += typeof value === 'undefined' ? 0 : 1; + }, 0); + message = hasOnlyOneParameterValued ? (0, _sprintfJs.sprintf)('%s', a) : (0, _sprintfJs.sprintf)(a, b, c, d, e, f, g, h, i, k); } else { if (typeof b !== 'string') { throw new TypeError('Message must be a string.'); } - context = JSON.parse((0, _jsonStringifySafe.default)(_objectSpread({}, getFirstParentDomainContext(), {}, parentContext || {}, {}, a))); + context = JSON.parse((0, _jsonStringifySafe.default)(_objectSpread(_objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}), a))); message = (0, _sprintfJs.sprintf)(b, c, d, e, f, g, h, i, k); } @@ -87462,11 +73671,11 @@ const createLogger = (onMessage, parentContext) => { }, parentContext); } - return createLogger(onMessage, _objectSpread({}, getFirstParentDomainContext(), {}, parentContext, {}, context)); + return createLogger(onMessage, _objectSpread(_objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext), context)); }; log.getContext = () => { - return _objectSpread({}, getFirstParentDomainContext(), {}, parentContext || {}); + return _objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}); }; log.adopt = async (routine, context) => { @@ -87478,7 +73687,7 @@ const createLogger = (onMessage, parentContext) => { return adoptedDomain.run(() => { // $FlowFixMe adoptedDomain.roarr = { - context: _objectSpread({}, getParentDomainContext(), {}, context) + context: _objectSpread(_objectSpread({}, getParentDomainContext()), context) }; return routine(); }); @@ -87505,7 +73714,7 @@ exports.default = _default; /***/ }), /***/ 78539: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -87515,7 +73724,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _constants = __webpack_require__(17352); +var _constants = __nccwpck_require__(17352); const createMockLogger = (onMessage, parentContext) => { // eslint-disable-next-line id-length, unicorn/prevent-abbreviations, no-unused-vars @@ -87588,7 +73797,7 @@ exports.default = _default; /***/ }), /***/ 403: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -87598,13 +73807,13 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _semverCompare = _interopRequireDefault(__webpack_require__(61413)); +var _detectNode = _interopRequireDefault(__nccwpck_require__(7192)); -var _detectNode = _interopRequireDefault(__webpack_require__(7192)); +var _semverCompare = _interopRequireDefault(__nccwpck_require__(61413)); -var _package = __webpack_require__(40695); +var _package = __nccwpck_require__(40695); -var _createNodeWriter = _interopRequireDefault(__webpack_require__(19112)); +var _createNodeWriter = _interopRequireDefault(__nccwpck_require__(19112)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -87626,15 +73835,15 @@ const createRoarrInititialGlobalState = currentState => { versions.sort(_semverCompare.default); - let newState = _objectSpread({ + let newState = _objectSpread(_objectSpread({ sequence: 0 - }, currentState, { + }, currentState), {}, { versions }); if (_detectNode.default) { if (currentIsLatestVersion || !newState.write) { - newState = _objectSpread({}, newState, {}, (0, _createNodeWriter.default)()); + newState = _objectSpread(_objectSpread({}, newState), (0, _createNodeWriter.default)()); } } @@ -87648,7 +73857,7 @@ exports.default = _default; /***/ }), /***/ 4627: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -87675,11 +73884,11 @@ Object.defineProperty(exports, "createRoarrInititialGlobalState", ({ } })); -var _createLogger = _interopRequireDefault(__webpack_require__(57109)); +var _createLogger = _interopRequireDefault(__nccwpck_require__(57109)); -var _createMockLogger = _interopRequireDefault(__webpack_require__(78539)); +var _createMockLogger = _interopRequireDefault(__nccwpck_require__(78539)); -var _createRoarrInititialGlobalState = _interopRequireDefault(__webpack_require__(403)); +var _createRoarrInititialGlobalState = _interopRequireDefault(__nccwpck_require__(403)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map @@ -87687,7 +73896,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ }), /***/ 30786: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -87695,20 +73904,21 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.default = void 0; +exports.default = exports.ROARR = void 0; -var _boolean = __webpack_require__(8436); +var _boolean = __nccwpck_require__(8436); -var _globalthis = _interopRequireDefault(__webpack_require__(35553)); +var _detectNode = _interopRequireDefault(__nccwpck_require__(7192)); -var _detectNode = _interopRequireDefault(__webpack_require__(7192)); +var _globalthis = _interopRequireDefault(__nccwpck_require__(35553)); -var _factories = __webpack_require__(4627); +var _factories = __nccwpck_require__(4627); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const globalThis = (0, _globalthis.default)(); -globalThis.ROARR = (0, _factories.createRoarrInititialGlobalState)(globalThis.ROARR || {}); +const ROARR = globalThis.ROARR = (0, _factories.createRoarrInititialGlobalState)(globalThis.ROARR || {}); +exports.ROARR = ROARR; let logFactory = _factories.createLogger; if (_detectNode.default) { @@ -87721,28 +73931,266 @@ if (_detectNode.default) { } var _default = logFactory(message => { - if (globalThis.ROARR.write) { + if (ROARR.write) { // Stringify message as soon as it is received to prevent // properties of the context from being modified by reference. const body = JSON.stringify(message); - globalThis.ROARR.write(body); + ROARR.write(body); } }); exports.default = _default; //# sourceMappingURL=log.js.map +/***/ }), + +/***/ 14792: +/***/ ((__unused_webpack_module, exports) => { + +/* global window, exports, define */ + +!function() { + 'use strict' + + var re = { + not_string: /[^s]/, + not_bool: /[^t]/, + not_type: /[^T]/, + not_primitive: /[^v]/, + number: /[diefg]/, + numeric_arg: /[bcdiefguxX]/, + json: /[j]/, + not_json: /[^j]/, + text: /^[^\x25]+/, + modulo: /^\x25{2}/, + placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, + key: /^([a-z_][a-z_\d]*)/i, + key_access: /^\.([a-z_][a-z_\d]*)/i, + index_access: /^\[(\d+)\]/, + sign: /^[+-]/ + } + + function sprintf(key) { + // `arguments` is not an array, but should be fine for this call + return sprintf_format(sprintf_parse(key), arguments) + } + + function vsprintf(fmt, argv) { + return sprintf.apply(null, [fmt].concat(argv || [])) + } + + function sprintf_format(parse_tree, argv) { + var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign + for (i = 0; i < tree_length; i++) { + if (typeof parse_tree[i] === 'string') { + output += parse_tree[i] + } + else if (typeof parse_tree[i] === 'object') { + ph = parse_tree[i] // convenience purposes only + if (ph.keys) { // keyword argument + arg = argv[cursor] + for (k = 0; k < ph.keys.length; k++) { + if (arg == undefined) { + throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1])) + } + arg = arg[ph.keys[k]] + } + } + else if (ph.param_no) { // positional argument (explicit) + arg = argv[ph.param_no] + } + else { // positional argument (implicit) + arg = argv[cursor++] + } + + if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) { + arg = arg() + } + + if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) { + throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg)) + } + + if (re.number.test(ph.type)) { + is_positive = arg >= 0 + } + + switch (ph.type) { + case 'b': + arg = parseInt(arg, 10).toString(2) + break + case 'c': + arg = String.fromCharCode(parseInt(arg, 10)) + break + case 'd': + case 'i': + arg = parseInt(arg, 10) + break + case 'j': + arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0) + break + case 'e': + arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential() + break + case 'f': + arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg) + break + case 'g': + arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg) + break + case 'o': + arg = (parseInt(arg, 10) >>> 0).toString(8) + break + case 's': + arg = String(arg) + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 't': + arg = String(!!arg) + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'T': + arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase() + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'u': + arg = parseInt(arg, 10) >>> 0 + break + case 'v': + arg = arg.valueOf() + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'x': + arg = (parseInt(arg, 10) >>> 0).toString(16) + break + case 'X': + arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase() + break + } + if (re.json.test(ph.type)) { + output += arg + } + else { + if (re.number.test(ph.type) && (!is_positive || ph.sign)) { + sign = is_positive ? '+' : '-' + arg = arg.toString().replace(re.sign, '') + } + else { + sign = '' + } + pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' ' + pad_length = ph.width - (sign + arg).length + pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : '' + output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg) + } + } + } + return output + } + + var sprintf_cache = Object.create(null) + + function sprintf_parse(fmt) { + if (sprintf_cache[fmt]) { + return sprintf_cache[fmt] + } + + var _fmt = fmt, match, parse_tree = [], arg_names = 0 + while (_fmt) { + if ((match = re.text.exec(_fmt)) !== null) { + parse_tree.push(match[0]) + } + else if ((match = re.modulo.exec(_fmt)) !== null) { + parse_tree.push('%') + } + else if ((match = re.placeholder.exec(_fmt)) !== null) { + if (match[2]) { + arg_names |= 1 + var field_list = [], replacement_field = match[2], field_match = [] + if ((field_match = re.key.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { + if ((field_match = re.key_access.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + } + else if ((field_match = re.index_access.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + } + else { + throw new SyntaxError('[sprintf] failed to parse named argument key') + } + } + } + else { + throw new SyntaxError('[sprintf] failed to parse named argument key') + } + match[2] = field_list + } + else { + arg_names |= 2 + } + if (arg_names === 3) { + throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported') + } + + parse_tree.push( + { + placeholder: match[0], + param_no: match[1], + keys: match[2], + sign: match[3], + pad_char: match[4], + align: match[5], + width: match[6], + precision: match[7], + type: match[8] + } + ) + } + else { + throw new SyntaxError('[sprintf] unexpected placeholder') + } + _fmt = _fmt.substring(match[0].length) + } + return sprintf_cache[fmt] = parse_tree + } + + /** + * export to either browser or node.js + */ + /* eslint-disable quote-props */ + if (true) { + exports.sprintf = sprintf + exports.vsprintf = vsprintf + } + if (typeof window !== 'undefined') { + window['sprintf'] = sprintf + window['vsprintf'] = vsprintf + + if (typeof define === 'function' && define['amd']) { + define(function() { + return { + 'sprintf': sprintf, + 'vsprintf': vsprintf + } + }) + } + } + /* eslint-enable quote-props */ +}(); // eslint-disable-line + + /***/ }), /***/ 52340: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /* eslint-disable node/no-deprecated-api */ -var buffer = __webpack_require__(64293) +var buffer = __nccwpck_require__(64293) var Buffer = buffer.Buffer var safer = {} @@ -87817,73 +74265,6 @@ if (!safer.constants) { module.exports = safer -/***/ }), - -/***/ 22752: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/*jshint node:true*/ - - -/** - * Replaces characters in strings that are illegal/unsafe for filenames. - * Unsafe characters are either removed or replaced by a substitute set - * in the optional `options` object. - * - * Illegal Characters on Various Operating Systems - * / ? < > \ : * | " - * https://kb.acronis.com/content/39790 - * - * Unicode Control codes - * C0 0x00-0x1f & C1 (0x80-0x9f) - * http://en.wikipedia.org/wiki/C0_and_C1_control_codes - * - * Reserved filenames on Unix-based systems (".", "..") - * Reserved filenames in Windows ("CON", "PRN", "AUX", "NUL", "COM1", - * "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", - * "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", and - * "LPT9") case-insesitively and with or without filename extensions. - * - * Capped at 255 characters in length. - * http://unix.stackexchange.com/questions/32795/what-is-the-maximum-allowed-filename-and-folder-size-with-ecryptfs - * - * @param {String} input Original filename - * @param {Object} options {replacement: String | Function } - * @return {String} Sanitized filename - */ - -var truncate = __webpack_require__(81786); - -var illegalRe = /[\/\?<>\\:\*\|"]/g; -var controlRe = /[\x00-\x1f\x80-\x9f]/g; -var reservedRe = /^\.+$/; -var windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i; -var windowsTrailingRe = /[\. ]+$/; - -function sanitize(input, replacement) { - if (typeof input !== 'string') { - throw new Error('Input must be string'); - } - var sanitized = input - .replace(illegalRe, replacement) - .replace(controlRe, replacement) - .replace(reservedRe, replacement) - .replace(windowsReservedRe, replacement) - .replace(windowsTrailingRe, replacement); - return truncate(sanitized, 255); -} - -module.exports = function (input, options) { - var replacement = (options && options.replacement) || ''; - var output = sanitize(input, replacement); - if (replacement === '') { - return output; - } - return sanitize(output, ''); -}; - - /***/ }), /***/ 61413: @@ -87907,7 +74288,7 @@ module.exports = function cmp (a, b) { /***/ }), /***/ 34777: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const ANY = Symbol('SemVer ANY') // hoisted class for cyclic dependency @@ -87916,12 +74297,7 @@ class Comparator { return ANY } constructor (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + options = parseOptions(options) if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { @@ -88043,27 +74419,23 @@ class Comparator { module.exports = Comparator -const {re, t} = __webpack_require__(64841) -const cmp = __webpack_require__(71128) -const debug = __webpack_require__(15909) -const SemVer = __webpack_require__(95271) -const Range = __webpack_require__(45636) +const parseOptions = __nccwpck_require__(5748) +const {re, t} = __nccwpck_require__(64841) +const cmp = __nccwpck_require__(71128) +const debug = __nccwpck_require__(15909) +const SemVer = __nccwpck_require__(95271) +const Range = __nccwpck_require__(45636) /***/ }), /***/ 45636: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // hoisted class for cyclic dependency class Range { constructor (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + options = parseOptions(options) if (range instanceof Range) { if ( @@ -88103,6 +74475,24 @@ class Range { throw new TypeError(`Invalid SemVer Range: ${range}`) } + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) + this.set = [first] + else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } + this.format() } @@ -88121,8 +74511,17 @@ class Range { } parseRange (range) { - const loose = this.options.loose range = range.trim() + + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = Object.keys(this.options).join(',') + const memoKey = `parseRange:${memoOpts}:${range}` + const cached = cache.get(memoKey) + if (cached) + return cached + + const loose = this.options.loose // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) @@ -88144,15 +74543,33 @@ class Range { // ready to be split into comparators. const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - return range + const rangeList = range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) + // >=0.0.0 is equivalent to * .map(comp => replaceGTE0(comp, this.options)) // in loose mode, throw out any that are not valid comparators .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) .map(comp => new Comparator(comp, this.options)) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const l = rangeList.length + const rangeMap = new Map() + for (const comp of rangeList) { + if (isNullSet(comp)) + return [comp] + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) + rangeMap.delete('') + + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result } intersects (range, options) { @@ -88201,16 +74618,23 @@ class Range { } module.exports = Range -const Comparator = __webpack_require__(34777) -const debug = __webpack_require__(15909) -const SemVer = __webpack_require__(95271) +const LRU = __nccwpck_require__(85069) +const cache = new LRU({ max: 1000 }) + +const parseOptions = __nccwpck_require__(5748) +const Comparator = __nccwpck_require__(34777) +const debug = __nccwpck_require__(15909) +const SemVer = __nccwpck_require__(95271) const { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace -} = __webpack_require__(64841) +} = __nccwpck_require__(64841) + +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' // take a set of comparators and determine whether there // exists a version which can satisfy it @@ -88523,21 +74947,18 @@ const testSet = (set, version, options) => { /***/ }), /***/ 95271: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const debug = __webpack_require__(15909) -const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(57549) -const { re, t } = __webpack_require__(64841) +const debug = __nccwpck_require__(15909) +const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(57549) +const { re, t } = __nccwpck_require__(64841) -const { compareIdentifiers } = __webpack_require__(7675) +const parseOptions = __nccwpck_require__(5748) +const { compareIdentifiers } = __nccwpck_require__(7675) class SemVer { constructor (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + options = parseOptions(options) + if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { @@ -88820,9 +75241,9 @@ module.exports = SemVer /***/ }), /***/ 65271: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const parse = __webpack_require__(60663) +const parse = __nccwpck_require__(60663) const clean = (version, options) => { const s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null @@ -88833,14 +75254,14 @@ module.exports = clean /***/ }), /***/ 71128: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const eq = __webpack_require__(89348) -const neq = __webpack_require__(33678) -const gt = __webpack_require__(20209) -const gte = __webpack_require__(68758) -const lt = __webpack_require__(86197) -const lte = __webpack_require__(16768) +const eq = __nccwpck_require__(89348) +const neq = __nccwpck_require__(33678) +const gt = __nccwpck_require__(20209) +const gte = __nccwpck_require__(68758) +const lt = __nccwpck_require__(86197) +const lte = __nccwpck_require__(16768) const cmp = (a, op, b, loose) => { switch (op) { @@ -88888,11 +75309,11 @@ module.exports = cmp /***/ }), /***/ 51194: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) -const parse = __webpack_require__(60663) -const {re, t} = __webpack_require__(64841) +const SemVer = __nccwpck_require__(95271) +const parse = __nccwpck_require__(60663) +const {re, t} = __nccwpck_require__(64841) const coerce = (version, options) => { if (version instanceof SemVer) { @@ -88946,9 +75367,9 @@ module.exports = coerce /***/ }), /***/ 86587: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const compareBuild = (a, b, loose) => { const versionA = new SemVer(a, loose) const versionB = new SemVer(b, loose) @@ -88960,9 +75381,9 @@ module.exports = compareBuild /***/ }), /***/ 43525: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const compareLoose = (a, b) => compare(a, b, true) module.exports = compareLoose @@ -88970,9 +75391,9 @@ module.exports = compareLoose /***/ }), /***/ 23681: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)) @@ -88982,10 +75403,10 @@ module.exports = compare /***/ }), /***/ 16893: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const parse = __webpack_require__(60663) -const eq = __webpack_require__(89348) +const parse = __nccwpck_require__(60663) +const eq = __nccwpck_require__(89348) const diff = (version1, version2) => { if (eq(version1, version2)) { @@ -89012,9 +75433,9 @@ module.exports = diff /***/ }), /***/ 89348: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const eq = (a, b, loose) => compare(a, b, loose) === 0 module.exports = eq @@ -89022,9 +75443,9 @@ module.exports = eq /***/ }), /***/ 20209: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const gt = (a, b, loose) => compare(a, b, loose) > 0 module.exports = gt @@ -89032,9 +75453,9 @@ module.exports = gt /***/ }), /***/ 68758: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const gte = (a, b, loose) => compare(a, b, loose) >= 0 module.exports = gte @@ -89042,9 +75463,9 @@ module.exports = gte /***/ }), /***/ 98039: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const inc = (version, release, options, identifier) => { if (typeof (options) === 'string') { @@ -89064,9 +75485,9 @@ module.exports = inc /***/ }), /***/ 86197: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const lt = (a, b, loose) => compare(a, b, loose) < 0 module.exports = lt @@ -89074,9 +75495,9 @@ module.exports = lt /***/ }), /***/ 16768: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const lte = (a, b, loose) => compare(a, b, loose) <= 0 module.exports = lte @@ -89084,9 +75505,9 @@ module.exports = lte /***/ }), /***/ 70672: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const major = (a, loose) => new SemVer(a, loose).major module.exports = major @@ -89094,9 +75515,9 @@ module.exports = major /***/ }), /***/ 895: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const minor = (a, loose) => new SemVer(a, loose).minor module.exports = minor @@ -89104,9 +75525,9 @@ module.exports = minor /***/ }), /***/ 33678: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const neq = (a, b, loose) => compare(a, b, loose) !== 0 module.exports = neq @@ -89114,19 +75535,15 @@ module.exports = neq /***/ }), /***/ 60663: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const {MAX_LENGTH} = __webpack_require__(57549) -const { re, t } = __webpack_require__(64841) -const SemVer = __webpack_require__(95271) +const {MAX_LENGTH} = __nccwpck_require__(57549) +const { re, t } = __nccwpck_require__(64841) +const SemVer = __nccwpck_require__(95271) +const parseOptions = __nccwpck_require__(5748) const parse = (version, options) => { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + options = parseOptions(options) if (version instanceof SemVer) { return version @@ -89158,9 +75575,9 @@ module.exports = parse /***/ }), /***/ 10561: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const patch = (a, loose) => new SemVer(a, loose).patch module.exports = patch @@ -89168,9 +75585,9 @@ module.exports = patch /***/ }), /***/ 83545: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const parse = __webpack_require__(60663) +const parse = __nccwpck_require__(60663) const prerelease = (version, options) => { const parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null @@ -89181,9 +75598,9 @@ module.exports = prerelease /***/ }), /***/ 7980: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const rcompare = (a, b, loose) => compare(b, a, loose) module.exports = rcompare @@ -89191,9 +75608,9 @@ module.exports = rcompare /***/ }), /***/ 17796: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compareBuild = __webpack_require__(86587) +const compareBuild = __nccwpck_require__(86587) const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) module.exports = rsort @@ -89201,9 +75618,9 @@ module.exports = rsort /***/ }), /***/ 60822: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Range = __webpack_require__(45636) +const Range = __nccwpck_require__(45636) const satisfies = (version, range, options) => { try { range = new Range(range, options) @@ -89218,9 +75635,9 @@ module.exports = satisfies /***/ }), /***/ 62000: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compareBuild = __webpack_require__(86587) +const compareBuild = __nccwpck_require__(86587) const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) module.exports = sort @@ -89228,9 +75645,9 @@ module.exports = sort /***/ }), /***/ 36312: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const parse = __webpack_require__(60663) +const parse = __nccwpck_require__(60663) const valid = (version, options) => { const v = parse(version, options) return v ? v.version : null @@ -89241,55 +75658,55 @@ module.exports = valid /***/ }), /***/ 19618: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // just pre-load all the stuff that index.js lazily exports -const internalRe = __webpack_require__(64841) +const internalRe = __nccwpck_require__(64841) module.exports = { re: internalRe.re, src: internalRe.src, tokens: internalRe.t, - SEMVER_SPEC_VERSION: __webpack_require__(57549).SEMVER_SPEC_VERSION, - SemVer: __webpack_require__(95271), - compareIdentifiers: __webpack_require__(7675).compareIdentifiers, - rcompareIdentifiers: __webpack_require__(7675).rcompareIdentifiers, - parse: __webpack_require__(60663), - valid: __webpack_require__(36312), - clean: __webpack_require__(65271), - inc: __webpack_require__(98039), - diff: __webpack_require__(16893), - major: __webpack_require__(70672), - minor: __webpack_require__(895), - patch: __webpack_require__(10561), - prerelease: __webpack_require__(83545), - compare: __webpack_require__(23681), - rcompare: __webpack_require__(7980), - compareLoose: __webpack_require__(43525), - compareBuild: __webpack_require__(86587), - sort: __webpack_require__(62000), - rsort: __webpack_require__(17796), - gt: __webpack_require__(20209), - lt: __webpack_require__(86197), - eq: __webpack_require__(89348), - neq: __webpack_require__(33678), - gte: __webpack_require__(68758), - lte: __webpack_require__(16768), - cmp: __webpack_require__(71128), - coerce: __webpack_require__(51194), - Comparator: __webpack_require__(34777), - Range: __webpack_require__(45636), - satisfies: __webpack_require__(60822), - toComparators: __webpack_require__(2959), - maxSatisfying: __webpack_require__(48180), - minSatisfying: __webpack_require__(21448), - minVersion: __webpack_require__(76368), - validRange: __webpack_require__(87472), - outside: __webpack_require__(40332), - gtr: __webpack_require__(37284), - ltr: __webpack_require__(97777), - intersects: __webpack_require__(3624), - simplifyRange: __webpack_require__(67251), - subset: __webpack_require__(41455), + SEMVER_SPEC_VERSION: __nccwpck_require__(57549).SEMVER_SPEC_VERSION, + SemVer: __nccwpck_require__(95271), + compareIdentifiers: __nccwpck_require__(7675).compareIdentifiers, + rcompareIdentifiers: __nccwpck_require__(7675).rcompareIdentifiers, + parse: __nccwpck_require__(60663), + valid: __nccwpck_require__(36312), + clean: __nccwpck_require__(65271), + inc: __nccwpck_require__(98039), + diff: __nccwpck_require__(16893), + major: __nccwpck_require__(70672), + minor: __nccwpck_require__(895), + patch: __nccwpck_require__(10561), + prerelease: __nccwpck_require__(83545), + compare: __nccwpck_require__(23681), + rcompare: __nccwpck_require__(7980), + compareLoose: __nccwpck_require__(43525), + compareBuild: __nccwpck_require__(86587), + sort: __nccwpck_require__(62000), + rsort: __nccwpck_require__(17796), + gt: __nccwpck_require__(20209), + lt: __nccwpck_require__(86197), + eq: __nccwpck_require__(89348), + neq: __nccwpck_require__(33678), + gte: __nccwpck_require__(68758), + lte: __nccwpck_require__(16768), + cmp: __nccwpck_require__(71128), + coerce: __nccwpck_require__(51194), + Comparator: __nccwpck_require__(34777), + Range: __nccwpck_require__(45636), + satisfies: __nccwpck_require__(60822), + toComparators: __nccwpck_require__(2959), + maxSatisfying: __nccwpck_require__(48180), + minSatisfying: __nccwpck_require__(21448), + minVersion: __nccwpck_require__(76368), + validRange: __nccwpck_require__(87472), + outside: __nccwpck_require__(40332), + gtr: __nccwpck_require__(37284), + ltr: __nccwpck_require__(97777), + intersects: __nccwpck_require__(3624), + simplifyRange: __nccwpck_require__(67251), + subset: __nccwpck_require__(41455), } @@ -89363,13 +75780,31 @@ module.exports = { } +/***/ }), + +/***/ 5748: +/***/ ((module) => { + +// parse out just the options we care about so we always get a consistent +// obj with keys in a consistent order. +const opts = ['includePrerelease', 'loose', 'rtl'] +const parseOptions = options => + !options ? {} + : typeof options !== 'object' ? { loose: true } + : opts.filter(k => options[k]).reduce((options, k) => { + options[k] = true + return options + }, {}) +module.exports = parseOptions + + /***/ }), /***/ 64841: -/***/ ((module, exports, __webpack_require__) => { +/***/ ((module, exports, __nccwpck_require__) => { -const { MAX_SAFE_COMPONENT_LENGTH } = __webpack_require__(57549) -const debug = __webpack_require__(15909) +const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(57549) +const debug = __nccwpck_require__(15909) exports = module.exports = {} // The actual regexps go on exports.re @@ -89555,10 +75990,10 @@ createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') /***/ }), /***/ 37284: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Determine if version is greater than all the versions possible in the range. -const outside = __webpack_require__(40332) +const outside = __nccwpck_require__(40332) const gtr = (version, range, options) => outside(version, range, '>', options) module.exports = gtr @@ -89566,9 +76001,9 @@ module.exports = gtr /***/ }), /***/ 3624: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Range = __webpack_require__(45636) +const Range = __nccwpck_require__(45636) const intersects = (r1, r2, options) => { r1 = new Range(r1, options) r2 = new Range(r2, options) @@ -89580,9 +76015,9 @@ module.exports = intersects /***/ }), /***/ 97777: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const outside = __webpack_require__(40332) +const outside = __nccwpck_require__(40332) // Determine if version is less than all the versions possible in the range const ltr = (version, range, options) => outside(version, range, '<', options) module.exports = ltr @@ -89591,10 +76026,10 @@ module.exports = ltr /***/ }), /***/ 48180: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) -const Range = __webpack_require__(45636) +const SemVer = __nccwpck_require__(95271) +const Range = __nccwpck_require__(45636) const maxSatisfying = (versions, range, options) => { let max = null @@ -89623,10 +76058,10 @@ module.exports = maxSatisfying /***/ }), /***/ 21448: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) -const Range = __webpack_require__(45636) +const SemVer = __nccwpck_require__(95271) +const Range = __nccwpck_require__(45636) const minSatisfying = (versions, range, options) => { let min = null let minSV = null @@ -89654,11 +76089,11 @@ module.exports = minSatisfying /***/ }), /***/ 76368: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) -const Range = __webpack_require__(45636) -const gt = __webpack_require__(20209) +const SemVer = __nccwpck_require__(95271) +const Range = __nccwpck_require__(45636) +const gt = __nccwpck_require__(20209) const minVersion = (range, loose) => { range = new Range(range, loose) @@ -89677,6 +76112,7 @@ const minVersion = (range, loose) => { for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] + let setMin = null comparators.forEach((comparator) => { // Clone to avoid manipulating the comparator's semver object. const compver = new SemVer(comparator.semver.version) @@ -89691,8 +76127,8 @@ const minVersion = (range, loose) => { /* fallthrough */ case '': case '>=': - if (!minver || gt(minver, compver)) { - minver = compver + if (!setMin || gt(compver, setMin)) { + setMin = compver } break case '<': @@ -89704,6 +76140,8 @@ const minVersion = (range, loose) => { throw new Error(`Unexpected operation: ${comparator.operator}`) } }) + if (setMin && (!minver || gt(minver, setMin))) + minver = setMin } if (minver && range.test(minver)) { @@ -89718,17 +76156,17 @@ module.exports = minVersion /***/ }), /***/ 40332: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) -const Comparator = __webpack_require__(34777) +const SemVer = __nccwpck_require__(95271) +const Comparator = __nccwpck_require__(34777) const {ANY} = Comparator -const Range = __webpack_require__(45636) -const satisfies = __webpack_require__(60822) -const gt = __webpack_require__(20209) -const lt = __webpack_require__(86197) -const lte = __webpack_require__(16768) -const gte = __webpack_require__(68758) +const Range = __nccwpck_require__(45636) +const satisfies = __nccwpck_require__(60822) +const gt = __nccwpck_require__(20209) +const lt = __nccwpck_require__(86197) +const lte = __nccwpck_require__(16768) +const gte = __nccwpck_require__(68758) const outside = (version, range, hilo, options) => { version = new SemVer(version, options) @@ -89754,7 +76192,7 @@ const outside = (version, range, hilo, options) => { throw new TypeError('Must provide a hilo val of "<" or ">"') } - // If it satisifes the range it is not outside + // If it satisfies the range it is not outside if (satisfies(version, range, options)) { return false } @@ -89805,13 +76243,13 @@ module.exports = outside /***/ }), /***/ 67251: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // given a set of versions and a range, create a "simplified" range // that includes the same versions that the original range does // If the original range is shorter than the simplified one, return that. -const satisfies = __webpack_require__(60822) -const compare = __webpack_require__(23681) +const satisfies = __nccwpck_require__(60822) +const compare = __nccwpck_require__(23681) module.exports = (versions, range, options) => { const set = [] let min = null @@ -89856,12 +76294,12 @@ module.exports = (versions, range, options) => { /***/ }), /***/ 41455: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Range = __webpack_require__(45636) -const { ANY } = __webpack_require__(34777) -const satisfies = __webpack_require__(60822) -const compare = __webpack_require__(23681) +const Range = __nccwpck_require__(45636) +const { ANY } = __nccwpck_require__(34777) +const satisfies = __nccwpck_require__(60822) +const compare = __nccwpck_require__(23681) // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: // - Every simple range `r1, r2, ...` is a subset of some `R1, R2, ...` @@ -89881,15 +76319,18 @@ const compare = __webpack_require__(23681) // - If EQ satisfies every C, return true // - Else return false // - If GT -// - If GT is lower than any > or >= comp in C, return false +// - If GT.semver is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false // - If LT -// - If LT.semver is greater than that of any > comp in C, return false +// - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false // - If any C is a = range, and GT or LT are set, return false // - Else return true const subset = (sub, dom, options) => { + if (sub === dom) + return true + sub = new Range(sub, options) dom = new Range(dom, options) let sawNonNull = false @@ -89912,6 +76353,9 @@ const subset = (sub, dom, options) => { } const simpleSubset = (sub, dom, options) => { + if (sub === dom) + return true + if (sub.length === 1 && sub[0].semver === ANY) return dom.length === 1 && dom[0].semver === ANY @@ -89950,6 +76394,7 @@ const simpleSubset = (sub, dom, options) => { if (!satisfies(eq, String(c), options)) return false } + return true } @@ -89961,7 +76406,7 @@ const simpleSubset = (sub, dom, options) => { if (gt) { if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) - if (higher === c) + if (higher === c && higher !== gt) return false } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) return false @@ -89969,7 +76414,7 @@ const simpleSubset = (sub, dom, options) => { if (lt) { if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) - if (lower === c) + if (lower === c && lower !== lt) return false } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) return false @@ -90018,9 +76463,9 @@ module.exports = subset /***/ }), /***/ 2959: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Range = __webpack_require__(45636) +const Range = __nccwpck_require__(45636) // Mostly just for testing and legacy API reasons const toComparators = (range, options) => @@ -90033,9 +76478,9 @@ module.exports = toComparators /***/ }), /***/ 87472: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Range = __webpack_require__(45636) +const Range = __nccwpck_require__(45636) const validRange = (range, options) => { try { // Return '*' instead of '' so that truthiness works. @@ -90051,28 +76496,42 @@ module.exports = validRange /***/ }), /***/ 81224: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module) => { "use strict"; -const {inspect} = __webpack_require__(31669); class NonError extends Error { constructor(message) { - super(inspect(message)); - this.name = 'NonError'; - Error.captureStackTrace(this, NonError); + super(NonError._prepareSuperMessage(message)); + Object.defineProperty(this, 'name', { + value: 'NonError', + configurable: true, + writable: true + }); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, NonError); + } + } + + static _prepareSuperMessage(message) { + try { + return JSON.stringify(message); + } catch (_) { + return String(message); + } } } const commonProperties = [ - 'name', - 'message', - 'stack', - 'code' + {property: 'name', enumerable: false}, + {property: 'message', enumerable: false}, + {property: 'stack', enumerable: false}, + {property: 'code', enumerable: true} ]; -const destroyCircular = (from, seen, to_) => { +const destroyCircular = ({from, seen, to_, forceEnumerable}) => { const to = to_ || (Array.isArray(from) ? [] : {}); seen.push(from); @@ -90088,16 +76547,21 @@ const destroyCircular = (from, seen, to_) => { } if (!seen.includes(from[key])) { - to[key] = destroyCircular(from[key], seen.slice()); + to[key] = destroyCircular({from: from[key], seen: seen.slice(), forceEnumerable}); continue; } to[key] = '[Circular]'; } - for (const property of commonProperties) { + for (const {property, enumerable} of commonProperties) { if (typeof from[property] === 'string') { - to[property] = from[property]; + Object.defineProperty(to, property, { + value: from[property], + enumerable: forceEnumerable ? true : enumerable, + configurable: true, + writable: true + }); } } @@ -90106,7 +76570,7 @@ const destroyCircular = (from, seen, to_) => { const serializeError = value => { if (typeof value === 'object' && value !== null) { - return destroyCircular(value, []); + return destroyCircular({from: value, seen: [], forceEnumerable: true}); } // People sometimes throw things besides Error objects… @@ -90125,7 +76589,7 @@ const deserializeError = value => { if (typeof value === 'object' && value !== null && !Array.isArray(value)) { const newError = new Error(); - destroyCircular(value, [], newError); + destroyCircular({from: value, seen: [], to_: newError}); return newError; } @@ -90141,11 +76605,11 @@ module.exports = { /***/ }), /***/ 95598: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const shebangRegex = __webpack_require__(99829); +const shebangRegex = __nccwpck_require__(99829); module.exports = (string = '') => { const match = string.match(shebangRegex); @@ -90178,16 +76642,16 @@ module.exports = /^#!(.*)/; /***/ }), /***/ 22317: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Note: since nyc uses this module to output coverage, any lines // that are in the direct sync flow of nyc's outputCoverage are // ignored, since we can never get coverage for them. -var assert = __webpack_require__(42357) -var signals = __webpack_require__(12935) +var assert = __nccwpck_require__(42357) +var signals = __nccwpck_require__(12935) var isWin = /^win/i.test(process.platform) -var EE = __webpack_require__(28614) +var EE = __nccwpck_require__(28614) /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter @@ -90408,7 +76872,7 @@ if (process.platform === 'linux') { /***/ }), /***/ 94922: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* Copyright spdx-correct.js contributors @@ -90425,8 +76889,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -var parse = __webpack_require__(37258) -var spdxLicenseIds = __webpack_require__(94063) +var parse = __nccwpck_require__(37258) +var spdxLicenseIds = __nccwpck_require__(94063) function valid (string) { try { @@ -90779,13 +77243,13 @@ function upgradeGPLs (value) { /***/ }), /***/ 37258: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var scan = __webpack_require__(42429) -var parse = __webpack_require__(90757) +var scan = __nccwpck_require__(42429) +var parse = __nccwpck_require__(90757) module.exports = function (source) { return parse(scan(source)) @@ -90941,15 +77405,15 @@ module.exports = function (tokens) { /***/ }), /***/ 42429: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; var licenses = [] - .concat(__webpack_require__(94063)) - .concat(__webpack_require__(19324)) -var exceptions = __webpack_require__(83904) + .concat(__nccwpck_require__(94063)) + .concat(__nccwpck_require__(19324)) +var exceptions = __nccwpck_require__(83904) module.exports = function (source) { var index = 0 @@ -91079,264 +77543,387 @@ module.exports = function (source) { /***/ }), -/***/ 74273: -/***/ ((__unused_webpack_module, exports) => { +/***/ 90937: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/* global window, exports, define */ +"use strict"; +// 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. -!function() { - 'use strict' - var re = { - not_string: /[^s]/, - not_bool: /[^t]/, - not_type: /[^T]/, - not_primitive: /[^v]/, - number: /[diefg]/, - numeric_arg: /[bcdiefguxX]/, - json: /[j]/, - not_json: /[^j]/, - text: /^[^\x25]+/, - modulo: /^\x25{2}/, - placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, - key: /^([a-z_][a-z_\d]*)/i, - key_access: /^\.([a-z_][a-z_\d]*)/i, - index_access: /^\[(\d+)\]/, - sign: /^[+-]/ - } - function sprintf(key) { - // `arguments` is not an array, but should be fine for this call - return sprintf_format(sprintf_parse(key), arguments) - } +/**/ - function vsprintf(fmt, argv) { - return sprintf.apply(null, [fmt].concat(argv || [])) - } +var Buffer = __nccwpck_require__(84996).Buffer; +/**/ - function sprintf_format(parse_tree, argv) { - var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign - for (i = 0; i < tree_length; i++) { - if (typeof parse_tree[i] === 'string') { - output += parse_tree[i] - } - else if (typeof parse_tree[i] === 'object') { - ph = parse_tree[i] // convenience purposes only - if (ph.keys) { // keyword argument - arg = argv[cursor] - for (k = 0; k < ph.keys.length; k++) { - if (arg == undefined) { - throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1])) - } - arg = arg[ph.keys[k]] - } - } - else if (ph.param_no) { // positional argument (explicit) - arg = argv[ph.param_no] - } - else { // positional argument (implicit) - arg = argv[cursor++] - } +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; - if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) { - arg = arg() - } +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; - if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) { - throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg)) - } +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} - if (re.number.test(ph.type)) { - is_positive = arg >= 0 - } +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.s = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} - switch (ph.type) { - case 'b': - arg = parseInt(arg, 10).toString(2) - break - case 'c': - arg = String.fromCharCode(parseInt(arg, 10)) - break - case 'd': - case 'i': - arg = parseInt(arg, 10) - break - case 'j': - arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0) - break - case 'e': - arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential() - break - case 'f': - arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg) - break - case 'g': - arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg) - break - case 'o': - arg = (parseInt(arg, 10) >>> 0).toString(8) - break - case 's': - arg = String(arg) - arg = (ph.precision ? arg.substring(0, ph.precision) : arg) - break - case 't': - arg = String(!!arg) - arg = (ph.precision ? arg.substring(0, ph.precision) : arg) - break - case 'T': - arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase() - arg = (ph.precision ? arg.substring(0, ph.precision) : arg) - break - case 'u': - arg = parseInt(arg, 10) >>> 0 - break - case 'v': - arg = arg.valueOf() - arg = (ph.precision ? arg.substring(0, ph.precision) : arg) - break - case 'x': - arg = (parseInt(arg, 10) >>> 0).toString(16) - break - case 'X': - arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase() - break - } - if (re.json.test(ph.type)) { - output += arg - } - else { - if (re.number.test(ph.type) && (!is_positive || ph.sign)) { - sign = is_positive ? '+' : '-' - arg = arg.toString().replace(re.sign, '') - } - else { - sign = '' - } - pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' ' - pad_length = ph.width - (sign + arg).length - pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : '' - output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg) - } - } - } - return output - } +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; - var sprintf_cache = Object.create(null) +StringDecoder.prototype.end = utf8End; - function sprintf_parse(fmt) { - if (sprintf_cache[fmt]) { - return sprintf_cache[fmt] - } +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; - var _fmt = fmt, match, parse_tree = [], arg_names = 0 - while (_fmt) { - if ((match = re.text.exec(_fmt)) !== null) { - parse_tree.push(match[0]) - } - else if ((match = re.modulo.exec(_fmt)) !== null) { - parse_tree.push('%') - } - else if ((match = re.placeholder.exec(_fmt)) !== null) { - if (match[2]) { - arg_names |= 1 - var field_list = [], replacement_field = match[2], field_match = [] - if ((field_match = re.key.exec(replacement_field)) !== null) { - field_list.push(field_match[1]) - while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { - if ((field_match = re.key_access.exec(replacement_field)) !== null) { - field_list.push(field_match[1]) - } - else if ((field_match = re.index_access.exec(replacement_field)) !== null) { - field_list.push(field_match[1]) - } - else { - throw new SyntaxError('[sprintf] failed to parse named argument key') - } - } - } - else { - throw new SyntaxError('[sprintf] failed to parse named argument key') - } - match[2] = field_list - } - else { - arg_names |= 2 - } - if (arg_names === 3) { - throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported') - } +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; - parse_tree.push( - { - placeholder: match[0], - param_no: match[1], - keys: match[2], - sign: match[3], - pad_char: match[4], - align: match[5], - width: match[6], - precision: match[7], - type: match[8] - } - ) - } - else { - throw new SyntaxError('[sprintf] unexpected placeholder') - } - _fmt = _fmt.substring(match[0].length) - } - return sprintf_cache[fmt] = parse_tree +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; } + return nb; + } + return 0; +} - /** - * export to either browser or node.js - */ - /* eslint-disable quote-props */ - if (true) { - exports.sprintf = sprintf - exports.vsprintf = vsprintf +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; } - if (typeof window !== 'undefined') { - window['sprintf'] = sprintf - window['vsprintf'] = vsprintf + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} - if (typeof define === 'function' && define['amd']) { - define(function() { - return { - 'sprintf': sprintf, - 'vsprintf': vsprintf - } - }) - } +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } } - /* eslint-enable quote-props */ -}(); // eslint-disable-line + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} /***/ }), -/***/ 61778: -/***/ ((module) => { +/***/ 84996: +/***/ ((module, exports, __nccwpck_require__) => { -"use strict"; +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = __nccwpck_require__(64293) +var Buffer = buffer.Buffer -module.exports = function (str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase(); - }); -}; +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} /***/ }), /***/ 26301: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const ansiRegex = __webpack_require__(89979); +const ansiRegex = __nccwpck_require__(89979); module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; @@ -91494,11 +78081,11 @@ module.exports = (jsonString, options = {}) => { /***/ }), /***/ 77901: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var escapeStringRegexp = __webpack_require__(5813); +var escapeStringRegexp = __nccwpck_require__(5813); module.exports = function (str, sub) { if (typeof str !== 'string' || typeof sub !== 'string') { @@ -91510,26 +78097,10 @@ module.exports = function (str, sub) { }; -/***/ }), - -/***/ 36889: -/***/ ((module) => { - -"use strict"; - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(/^((?:\w+:)?\/\/)(?:[^@\/]+@)/, '$1'); -}; - - /***/ }), /***/ 85076: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* Copyright 2016, 2017, 2019 Mark Lee and contributors @@ -91547,11 +78118,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -const debug = __webpack_require__(30787)('sumchecker') -const crypto = __webpack_require__(76417) -const fs = __webpack_require__(35747) -const path = __webpack_require__(85622) -const { promisify } = __webpack_require__(31669) +const debug = __nccwpck_require__(30787)('sumchecker') +const crypto = __nccwpck_require__(76417) +const fs = __nccwpck_require__(35747) +const path = __nccwpck_require__(85622) +const { promisify } = __nccwpck_require__(31669) const readFile = promisify(fs.readFile) @@ -91691,13 +78262,13 @@ module.exports = sumchecker /***/ }), /***/ 28106: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const tty = __webpack_require__(33867); -const hasFlag = __webpack_require__(31306); +const os = __nccwpck_require__(12087); +const tty = __nccwpck_require__(33867); +const hasFlag = __nccwpck_require__(58379); const {env} = process; @@ -91777,7 +78348,7 @@ function supportsColor(haveStream, streamIsTTY) { } if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } @@ -91788,10 +78359,6 @@ function supportsColor(haveStream, streamIsTTY) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } - if ('GITHUB_ACTIONS' in env) { - return 1; - } - if (env.COLORTERM === 'truecolor') { return 3; } @@ -91835,30 +78402,14 @@ module.exports = { }; -/***/ }), - -/***/ 31306: -/***/ ((module) => { - -"use strict"; - - -module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -}; - - /***/ }), /***/ 40081: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {Readable} = __webpack_require__(92413); +const {Readable} = __nccwpck_require__(92413); module.exports = input => ( new Readable({ @@ -91870,336 +78421,14 @@ module.exports = input => ( ); -/***/ }), - -/***/ 1353: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/*! - * to-regex-range - * - * Copyright (c) 2015-present, Jon Schlinkert. - * Released under the MIT License. - */ - - - -const isNumber = __webpack_require__(41255); - -const toRegexRange = (min, max, options) => { - if (isNumber(min) === false) { - throw new TypeError('toRegexRange: expected the first argument to be a number'); - } - - if (max === void 0 || min === max) { - return String(min); - } - - if (isNumber(max) === false) { - throw new TypeError('toRegexRange: expected the second argument to be a number.'); - } - - let opts = { relaxZeros: true, ...options }; - if (typeof opts.strictZeros === 'boolean') { - opts.relaxZeros = opts.strictZeros === false; - } - - let relax = String(opts.relaxZeros); - let shorthand = String(opts.shorthand); - let capture = String(opts.capture); - let wrap = String(opts.wrap); - let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; - - if (toRegexRange.cache.hasOwnProperty(cacheKey)) { - return toRegexRange.cache[cacheKey].result; - } - - let a = Math.min(min, max); - let b = Math.max(min, max); - - if (Math.abs(a - b) === 1) { - let result = min + '|' + max; - if (opts.capture) { - return `(${result})`; - } - if (opts.wrap === false) { - return result; - } - return `(?:${result})`; - } - - let isPadded = hasPadding(min) || hasPadding(max); - let state = { min, max, a, b }; - let positives = []; - let negatives = []; - - if (isPadded) { - state.isPadded = isPadded; - state.maxLen = String(state.max).length; - } - - if (a < 0) { - let newMin = b < 0 ? Math.abs(b) : 1; - negatives = splitToPatterns(newMin, Math.abs(a), state, opts); - a = state.a = 0; - } - - if (b >= 0) { - positives = splitToPatterns(a, b, state, opts); - } - - state.negatives = negatives; - state.positives = positives; - state.result = collatePatterns(negatives, positives, opts); - - if (opts.capture === true) { - state.result = `(${state.result})`; - } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { - state.result = `(?:${state.result})`; - } - - toRegexRange.cache[cacheKey] = state; - return state.result; -}; - -function collatePatterns(neg, pos, options) { - let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; - let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; - let intersected = filterPatterns(neg, pos, '-?', true, options) || []; - let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); - return subpatterns.join('|'); -} - -function splitToRanges(min, max) { - let nines = 1; - let zeros = 1; - - let stop = countNines(min, nines); - let stops = new Set([max]); - - while (min <= stop && stop <= max) { - stops.add(stop); - nines += 1; - stop = countNines(min, nines); - } - - stop = countZeros(max + 1, zeros) - 1; - - while (min < stop && stop <= max) { - stops.add(stop); - zeros += 1; - stop = countZeros(max + 1, zeros) - 1; - } - - stops = [...stops]; - stops.sort(compare); - return stops; -} - -/** - * Convert a range to a regex pattern - * @param {Number} `start` - * @param {Number} `stop` - * @return {String} - */ - -function rangeToPattern(start, stop, options) { - if (start === stop) { - return { pattern: start, count: [], digits: 0 }; - } - - let zipped = zip(start, stop); - let digits = zipped.length; - let pattern = ''; - let count = 0; - - for (let i = 0; i < digits; i++) { - let [startDigit, stopDigit] = zipped[i]; - - if (startDigit === stopDigit) { - pattern += startDigit; - - } else if (startDigit !== '0' || stopDigit !== '9') { - pattern += toCharacterClass(startDigit, stopDigit, options); - - } else { - count++; - } - } - - if (count) { - pattern += options.shorthand === true ? '\\d' : '[0-9]'; - } - - return { pattern, count: [count], digits }; -} - -function splitToPatterns(min, max, tok, options) { - let ranges = splitToRanges(min, max); - let tokens = []; - let start = min; - let prev; - - for (let i = 0; i < ranges.length; i++) { - let max = ranges[i]; - let obj = rangeToPattern(String(start), String(max), options); - let zeros = ''; - - if (!tok.isPadded && prev && prev.pattern === obj.pattern) { - if (prev.count.length > 1) { - prev.count.pop(); - } - - prev.count.push(obj.count[0]); - prev.string = prev.pattern + toQuantifier(prev.count); - start = max + 1; - continue; - } - - if (tok.isPadded) { - zeros = padZeros(max, tok, options); - } - - obj.string = zeros + obj.pattern + toQuantifier(obj.count); - tokens.push(obj); - start = max + 1; - prev = obj; - } - - return tokens; -} - -function filterPatterns(arr, comparison, prefix, intersection, options) { - let result = []; - - for (let ele of arr) { - let { string } = ele; - - // only push if _both_ are negative... - if (!intersection && !contains(comparison, 'string', string)) { - result.push(prefix + string); - } - - // or _both_ are positive - if (intersection && contains(comparison, 'string', string)) { - result.push(prefix + string); - } - } - return result; -} - -/** - * Zip strings - */ - -function zip(a, b) { - let arr = []; - for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); - return arr; -} - -function compare(a, b) { - return a > b ? 1 : b > a ? -1 : 0; -} - -function contains(arr, key, val) { - return arr.some(ele => ele[key] === val); -} - -function countNines(min, len) { - return Number(String(min).slice(0, -len) + '9'.repeat(len)); -} - -function countZeros(integer, zeros) { - return integer - (integer % Math.pow(10, zeros)); -} - -function toQuantifier(digits) { - let [start = 0, stop = ''] = digits; - if (stop || start > 1) { - return `{${start + (stop ? ',' + stop : '')}}`; - } - return ''; -} - -function toCharacterClass(a, b, options) { - return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; -} - -function hasPadding(str) { - return /^-?(0+)\d/.test(str); -} - -function padZeros(value, tok, options) { - if (!tok.isPadded) { - return value; - } - - let diff = Math.abs(tok.maxLen - String(value).length); - let relax = options.relaxZeros !== false; - - switch (diff) { - case 0: - return ''; - case 1: - return relax ? '0?' : '0'; - case 2: - return relax ? '0{0,2}' : '00'; - default: { - return relax ? `0{0,${diff}}` : `0{${diff}}`; - } - } -} - -/** - * Cache - */ - -toRegexRange.cache = {}; -toRegexRange.clearCache = () => (toRegexRange.cache = {}); - -/** - * Expose `toRegexRange` - */ - -module.exports = toRegexRange; - - -/***/ }), - -/***/ 41255: -/***/ ((module) => { - -"use strict"; -/*! - * is-number - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. - */ - - - -module.exports = function(num) { - if (typeof num === 'number') { - return num - num === 0; - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); - } - return false; -}; - - /***/ }), /***/ 33533: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var escapeStringRegexp = __webpack_require__(5813); +var escapeStringRegexp = __nccwpck_require__(5813); module.exports = function (str, target) { if (typeof str !== 'string' || typeof target !== 'string') { @@ -92210,93 +78439,29 @@ module.exports = function (str, target) { }; -/***/ }), - -/***/ 81786: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var truncate = __webpack_require__(7573); -var getLength = Buffer.byteLength.bind(Buffer); -module.exports = truncate.bind(null, getLength); - - -/***/ }), - -/***/ 7573: -/***/ ((module) => { - -"use strict"; - - -function isHighSurrogate(codePoint) { - return codePoint >= 0xd800 && codePoint <= 0xdbff; -} - -function isLowSurrogate(codePoint) { - return codePoint >= 0xdc00 && codePoint <= 0xdfff; -} - -// Truncate string by size in bytes -module.exports = function truncate(getLength, string, byteLength) { - if (typeof string !== "string") { - throw new Error("Input must be string"); - } - - var charLength = string.length; - var curByteLength = 0; - var codePoint; - var segment; - - for (var i = 0; i < charLength; i += 1) { - codePoint = string.charCodeAt(i); - segment = string[i]; - - if (isHighSurrogate(codePoint) && isLowSurrogate(string.charCodeAt(i + 1))) { - i += 1; - segment += string[i]; - } - - curByteLength += getLength(segment); - - if (curByteLength === byteLength) { - return string.slice(0, i + 1); - } - else if (curByteLength > byteLength) { - return string.slice(0, i - segment.length + 1); - } - } - - return string; -}; - - - /***/ }), /***/ 57951: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __webpack_require__(22030); +module.exports = __nccwpck_require__(22030); /***/ }), /***/ 22030: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var net = __webpack_require__(11631); -var tls = __webpack_require__(4016); -var http = __webpack_require__(98605); -var https = __webpack_require__(57211); -var events = __webpack_require__(28614); -var assert = __webpack_require__(42357); -var util = __webpack_require__(31669); +var net = __nccwpck_require__(11631); +var tls = __nccwpck_require__(4016); +var http = __nccwpck_require__(98605); +var https = __nccwpck_require__(57211); +var events = __nccwpck_require__(28614); +var assert = __nccwpck_require__(42357); +var util = __nccwpck_require__(31669); exports.httpOverHttp = httpOverHttp; @@ -92567,9 +78732,10 @@ exports.fromCallback = function (fn) { if (typeof args[args.length - 1] === 'function') fn.apply(this, args) else { return new Promise((resolve, reject) => { - fn.apply( + fn.call( this, - args.concat([(err, res) => err ? reject(err) : resolve(res)]) + ...args, + (err, res) => (err != null) ? reject(err) : resolve(res) ) }) } @@ -92588,12 +78754,12 @@ exports.fromPromise = function (fn) { /***/ }), /***/ 83530: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const url = __webpack_require__(78835); -const prependHttp = __webpack_require__(32979); +const url = __nccwpck_require__(78835); +const prependHttp = __nccwpck_require__(32979); module.exports = (input, options) => { if (typeof input !== 'string') { @@ -92605,13 +78771,26 @@ module.exports = (input, options) => { }; +/***/ }), + +/***/ 92262: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = __nccwpck_require__(31669).deprecate; + + /***/ }), /***/ 52078: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var parse = __webpack_require__(37258); -var correct = __webpack_require__(94922); +var parse = __nccwpck_require__(37258); +var correct = __nccwpck_require__(94922); var genericWarning = ( 'license should be ' + @@ -92758,13 +78937,13 @@ module.exports = [ /***/ }), /***/ 25997: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var defaults = __webpack_require__(36250) -var combining = __webpack_require__(34965) +var defaults = __nccwpck_require__(36250) +var combining = __nccwpck_require__(34965) var DEFAULTS = { nul: 0, @@ -92865,15 +79044,15 @@ function bisearch(ucs) { /***/ }), /***/ 67753: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' -const path = __webpack_require__(85622) +const path = __nccwpck_require__(85622) const COLON = isWindows ? ';' : ':' -const isexe = __webpack_require__(52607) +const isexe = __nccwpck_require__(52607) const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) @@ -93034,20 +79213,470 @@ function wrappy (fn, cb) { } +/***/ }), + +/***/ 5216: +/***/ ((module) => { + +"use strict"; + +module.exports = function (Yallist) { + Yallist.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value + } + } +} + + +/***/ }), + +/***/ 3652: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self +} + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length-- + node.next = null + node.prev = null + node.list = null + + return next +} + +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length++ +} + +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length++ +} + +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined + } + + var res = this.tail.value + this.tail = this.tail.prev + if (this.tail) { + this.tail.next = null + } else { + this.head = null + } + this.length-- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) { + return undefined + } + + var res = this.head.value + this.head = this.head.next + if (this.head) { + this.head.prev = null + } else { + this.tail = null + } + this.length-- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.splice = function (start, deleteCount, ...nodes) { + if (start > this.length) { + start = this.length - 1 + } + if (start < 0) { + start = this.length + start; + } + + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next + } + + var ret = [] + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value) + walker = this.removeNode(walker) + } + if (walker === null) { + walker = this.tail + } + + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev + } + + for (var i = 0; i < nodes.length; i++) { + walker = insert(this, walker, nodes[i]) + } + return ret; +} + +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this +} + +function insert (self, node, value) { + var inserted = node === self.head ? + new Node(value, null, node, self) : + new Node(value, node, node.next, self) + + if (inserted.next === null) { + self.tail = inserted + } + if (inserted.prev === null) { + self.head = inserted + } + + self.length++ + + return inserted +} + +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } +} + +try { + // add if support for Symbol.iterator is present + __nccwpck_require__(5216)(Yallist) +} catch (er) {} + + /***/ }), /***/ 8245: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -var fs = __webpack_require__(35747); -var zlib = __webpack_require__(78761); -var fd_slicer = __webpack_require__(92104); -var crc32 = __webpack_require__(59832); -var util = __webpack_require__(31669); -var EventEmitter = __webpack_require__(28614).EventEmitter; -var Transform = __webpack_require__(92413).Transform; -var PassThrough = __webpack_require__(92413).PassThrough; -var Writable = __webpack_require__(92413).Writable; +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(35747); +var zlib = __nccwpck_require__(78761); +var fd_slicer = __nccwpck_require__(92104); +var crc32 = __nccwpck_require__(59832); +var util = __nccwpck_require__(31669); +var EventEmitter = __nccwpck_require__(28614).EventEmitter; +var Transform = __nccwpck_require__(92413).Transform; +var PassThrough = __nccwpck_require__(92413).PassThrough; +var Writable = __nccwpck_require__(92413).Writable; exports.open = open; exports.fromFd = fromFd; @@ -93840,7 +80469,7 @@ function defaultCallback(err) { /***/ }), /***/ 1590: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; /** @@ -93849,35 +80478,28 @@ function defaultCallback(err) { * @module aegir/utils */ -const { constants, createBrotliCompress, createGzip } = __webpack_require__(78761) -const os = __webpack_require__(12087) -const ora = __webpack_require__(5420) -const extract = __webpack_require__(2933) -const stripComments = __webpack_require__(96241) -const stripBom = __webpack_require__(16639) -const { download } = __webpack_require__(37196) -const path = __webpack_require__(85622) -const findUp = __webpack_require__(20219) -const readPkgUp = __webpack_require__(45730) -const fs = __webpack_require__(66272) -const execa = __webpack_require__(51737) -const pascalcase = __webpack_require__(27255) -const ghPages = __webpack_require__(56179) -const { promisify } = __webpack_require__(31669) - -const publishPages = promisify(ghPages.publish) - -const { packageJson: pkg, path: pkgPath } = readPkgUp.sync({ +const { constants, createBrotliCompress, createGzip } = __nccwpck_require__(78761) +const os = __nccwpck_require__(12087) +const ora = __nccwpck_require__(5420) +const extract = __nccwpck_require__(2933) +const stripComments = __nccwpck_require__(96241) +const stripBom = __nccwpck_require__(16639) +const { download } = __nccwpck_require__(37196) +const path = __nccwpck_require__(85622) +const readPkgUp = __nccwpck_require__(45730) +const fs = __nccwpck_require__(66272) +const execa = __nccwpck_require__(51737) + +const { + packageJson: pkg, + path: pkgPath +} = readPkgUp.sync({ cwd: fs.realpathSync(process.cwd()) }) -const PKG_FILE = 'package.json' const DIST_FOLDER = 'dist' const SRC_FOLDER = 'src' +const TEST_FOLDER = 'test' -exports.paths = { - dist: DIST_FOLDER, - src: SRC_FOLDER -} exports.pkg = pkg // TODO: get this from aegir package.json exports.browserslist = '>1% or node >=10 and not ie 11 and not dead' @@ -93887,6 +80509,18 @@ exports.hasFile = (...p) => fs.existsSync(exports.fromRoot(...p)) exports.fromAegir = (...p) => path.join(__dirname, '..', ...p) exports.hasTsconfig = exports.hasFile('tsconfig.json') +exports.paths = { + dist: this.fromRoot(DIST_FOLDER), + src: this.fromRoot(SRC_FOLDER), + test: this.fromRoot(TEST_FOLDER), + package: pkgPath +} + +/** + * Parse json with comments or empty + * + * @param {string} contents + */ exports.parseJson = (contents) => { const data = stripComments(stripBom(contents)) @@ -93898,82 +80532,13 @@ exports.parseJson = (contents) => { return JSON.parse(data) } -exports.readJson = (filePath) => { - return exports.parseJson(fs.readFileSync(filePath, { encoding: 'utf-8' })) -} - -exports.publishDocs = () => { - return publishPages( - 'docs', - { - dotfiles: true, - message: 'chore: update documentation' - } - ) -} - -/** - * Get package version - * - * @returns {string} - version - */ -exports.pkgVersion = async () => { - const { - version - } = await fs.readJson(exports.getPathToPkg()) - return version -} - -/** - * Gets the top level path of the project aegir is executed in. - * - * @returns {string} - base path - */ -exports.getBasePath = () => { - return process.cwd() -} - -exports.getPathToPkg = () => { - return path.join(exports.getBasePath(), PKG_FILE) -} - -exports.getPathToDist = () => { - return path.join(exports.getBasePath(), DIST_FOLDER) -} - -exports.getUserConfigPath = () => { - return findUp('.aegir.js') -} - -exports.getUserConfig = () => { - let conf = {} - try { - const path = exports.getUserConfigPath() - if (!path) { - return {} - } - conf = __webpack_require__(1039)(path) - } catch (err) { - console.error(err) // eslint-disable-line no-console - } - return conf -} - /** - * Converts the given name from something like `peer-id` to `PeerId`. + * Read JSON file * - * @param {string} name - lib name in kebab - * @returns {string} - lib name in pascal - */ -exports.getLibraryName = (name) => { - return pascalcase(name) -} - -/** - * Get the absolute path to `node_modules` for aegir itself + * @param {string | number | Buffer | import("url").URL} filePath */ -exports.getPathToNodeModules = () => { - return path.resolve(__dirname, '../node_modules') +exports.readJson = (filePath) => { + return exports.parseJson(fs.readFileSync(filePath, { encoding: 'utf-8' })) } /** @@ -93987,6 +80552,7 @@ exports.getListrConfig = () => { } } +// @ts-ignore exports.hook = (env, key) => (ctx) => { if (ctx && ctx.hooks) { if (ctx.hooks[env] && ctx.hooks[env][key]) { @@ -94000,6 +80566,11 @@ exports.hook = (env, key) => (ctx) => { return Promise.resolve() } +/** + * @param {string} command + * @param {string[] | undefined} args + * @param {any} options + */ exports.exec = (command, args, options = {}) => { const result = execa(command, args, options) @@ -94031,7 +80602,7 @@ function getPlatformPath () { } exports.getElectron = async () => { - const pkg = __webpack_require__(28524) + const pkg = __nccwpck_require__(28524) const version = pkg.devDependencies.electron.slice(1) const spinner = ora(`Downloading electron: ${version}`).start() const zipPath = await download(version) @@ -94044,6 +80615,9 @@ exports.getElectron = async () => { return electronPath } +/** + * @param {fs.PathLike} path + */ exports.brotliSize = (path) => { return new Promise((resolve, reject) => { let size = 0 @@ -94062,6 +80636,9 @@ exports.brotliSize = (path) => { }) } +/** + * @param {fs.PathLike} path + */ exports.gzipSize = (path) => { return new Promise((resolve, reject) => { let size = 0 @@ -94143,7 +80720,15 @@ module.exports = JSON.parse("{\"dots\":{\"interval\":80,\"frames\":[\"⠋\",\" /***/ }), -/***/ 50354: +/***/ 66256: +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse("{\"name\":\"got\",\"version\":\"9.6.0\",\"description\":\"Simplified HTTP requests\",\"license\":\"MIT\",\"repository\":\"sindresorhus/got\",\"main\":\"source\",\"engines\":{\"node\":\">=8.6\"},\"scripts\":{\"test\":\"xo && nyc ava\",\"release\":\"np\"},\"files\":[\"source\"],\"keywords\":[\"http\",\"https\",\"get\",\"got\",\"url\",\"uri\",\"request\",\"util\",\"utility\",\"simple\",\"curl\",\"wget\",\"fetch\",\"net\",\"network\",\"electron\"],\"dependencies\":{\"@sindresorhus/is\":\"^0.14.0\",\"@szmarczak/http-timer\":\"^1.1.2\",\"cacheable-request\":\"^6.0.0\",\"decompress-response\":\"^3.3.0\",\"duplexer3\":\"^0.1.4\",\"get-stream\":\"^4.1.0\",\"lowercase-keys\":\"^1.0.1\",\"mimic-response\":\"^1.0.1\",\"p-cancelable\":\"^1.0.0\",\"to-readable-stream\":\"^1.0.0\",\"url-parse-lax\":\"^3.0.0\"},\"devDependencies\":{\"ava\":\"^1.1.0\",\"coveralls\":\"^3.0.0\",\"delay\":\"^4.1.0\",\"form-data\":\"^2.3.3\",\"get-port\":\"^4.0.0\",\"np\":\"^3.1.0\",\"nyc\":\"^13.1.0\",\"p-event\":\"^2.1.0\",\"pem\":\"^1.13.2\",\"proxyquire\":\"^2.0.1\",\"sinon\":\"^7.2.2\",\"slow-stream\":\"0.0.4\",\"tempfile\":\"^2.0.0\",\"tempy\":\"^0.2.1\",\"tough-cookie\":\"^3.0.0\",\"xo\":\"^0.24.0\"},\"ava\":{\"concurrency\":4},\"browser\":{\"decompress-response\":false,\"electron\":false}}"); + +/***/ }), + +/***/ 52777: /***/ ((module) => { "use strict"; @@ -94151,7 +80736,7 @@ module.exports = JSON.parse("[[\"8740\",\"䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅 /***/ }), -/***/ 13768: +/***/ 1351: /***/ ((module) => { "use strict"; @@ -94159,7 +80744,7 @@ module.exports = JSON.parse("[[\"0\",\"\\u0000\",127,\"€\"],[\"8140\",\"丂丄 /***/ }), -/***/ 67726: +/***/ 86401: /***/ ((module) => { "use strict"; @@ -94167,7 +80752,7 @@ module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"8141\",\"갂갃갅갆 /***/ }), -/***/ 47428: +/***/ 23940: /***/ ((module) => { "use strict"; @@ -94175,7 +80760,7 @@ module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"a140\",\" ,、。 /***/ }), -/***/ 34674: +/***/ 84777: /***/ ((module) => { "use strict"; @@ -94183,7 +80768,7 @@ module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"8ea1\",\"。\",62],[\"a /***/ }), -/***/ 80139: +/***/ 9630: /***/ ((module) => { "use strict"; @@ -94191,7 +80776,7 @@ module.exports = JSON.parse("{\"uChars\":[128,165,169,178,184,216,226,235,238,24 /***/ }), -/***/ 19416: +/***/ 17559: /***/ ((module) => { "use strict"; @@ -94199,7 +80784,7 @@ module.exports = JSON.parse("[[\"a140\",\"\",62],[\"a180\",\"\",32],[\"a24 /***/ }), -/***/ 24438: +/***/ 8075: /***/ ((module) => { "use strict"; @@ -94207,11 +80792,11 @@ module.exports = JSON.parse("[[\"0\",\"\\u0000\",128],[\"a1\",\"。\",62],[\"814 /***/ }), -/***/ 66256: +/***/ 74986: /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"name\":\"got\",\"version\":\"9.6.0\",\"description\":\"Simplified HTTP requests\",\"license\":\"MIT\",\"repository\":\"sindresorhus/got\",\"main\":\"source\",\"engines\":{\"node\":\">=8.6\"},\"scripts\":{\"test\":\"xo && nyc ava\",\"release\":\"np\"},\"files\":[\"source\"],\"keywords\":[\"http\",\"https\",\"get\",\"got\",\"url\",\"uri\",\"request\",\"util\",\"utility\",\"simple\",\"curl\",\"wget\",\"fetch\",\"net\",\"network\",\"electron\"],\"dependencies\":{\"@sindresorhus/is\":\"^0.14.0\",\"@szmarczak/http-timer\":\"^1.1.2\",\"cacheable-request\":\"^6.0.0\",\"decompress-response\":\"^3.3.0\",\"duplexer3\":\"^0.1.4\",\"get-stream\":\"^4.1.0\",\"lowercase-keys\":\"^1.0.1\",\"mimic-response\":\"^1.0.1\",\"p-cancelable\":\"^1.0.0\",\"to-readable-stream\":\"^1.0.0\",\"url-parse-lax\":\"^3.0.0\"},\"devDependencies\":{\"ava\":\"^1.1.0\",\"coveralls\":\"^3.0.0\",\"delay\":\"^4.1.0\",\"form-data\":\"^2.3.3\",\"get-port\":\"^4.0.0\",\"np\":\"^3.1.0\",\"nyc\":\"^13.1.0\",\"p-event\":\"^2.1.0\",\"pem\":\"^1.13.2\",\"proxyquire\":\"^2.0.1\",\"sinon\":\"^7.2.2\",\"slow-stream\":\"0.0.4\",\"tempfile\":\"^2.0.0\",\"tempy\":\"^0.2.1\",\"tough-cookie\":\"^3.0.0\",\"xo\":\"^0.24.0\"},\"ava\":{\"concurrency\":4},\"browser\":{\"decompress-response\":false,\"electron\":false}}"); +module.exports = JSON.parse("{\"assert\":true,\"assert/strict\":\">= 15\",\"async_hooks\":\">= 8\",\"buffer_ieee754\":\"< 0.9.7\",\"buffer\":true,\"child_process\":true,\"cluster\":true,\"console\":true,\"constants\":true,\"crypto\":true,\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"diagnostics_channel\":\">= 15.1\",\"dns\":true,\"dns/promises\":\">= 15\",\"domain\":\">= 0.7.12\",\"events\":true,\"freelist\":\"< 6\",\"fs\":true,\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"_http_agent\":\">= 0.11.1\",\"_http_client\":\">= 0.11.1\",\"_http_common\":\">= 0.11.1\",\"_http_incoming\":\">= 0.11.1\",\"_http_outgoing\":\">= 0.11.1\",\"_http_server\":\">= 0.11.1\",\"http\":true,\"http2\":\">= 8.8\",\"https\":true,\"inspector\":\">= 8.0.0\",\"_linklist\":\"< 8\",\"module\":true,\"net\":true,\"node-inspect/lib/_inspect\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6.0 && < 12\",\"os\":true,\"path\":true,\"path/posix\":\">= 15.3\",\"path/win32\":\">= 15.3\",\"perf_hooks\":\">= 8.5\",\"process\":\">= 1\",\"punycode\":true,\"querystring\":true,\"readline\":true,\"repl\":true,\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"_stream_transform\":\">= 0.9.4\",\"_stream_wrap\":\">= 1.4.1\",\"_stream_passthrough\":\">= 0.9.4\",\"_stream_readable\":\">= 0.9.4\",\"_stream_writable\":\">= 0.9.4\",\"stream\":true,\"stream/promises\":\">= 15\",\"string_decoder\":true,\"sys\":[\">= 0.6 && < 0.7\",\">= 0.8\"],\"timers\":true,\"timers/promises\":\">= 15\",\"_tls_common\":\">= 0.11.13\",\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"tls\":true,\"trace_events\":\">= 10\",\"tty\":true,\"url\":true,\"util\":true,\"util/types\":\">= 15.3\",\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/consarray\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/logreader\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8\":\">= 1\",\"vm\":true,\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"zlib\":true}"); /***/ }), @@ -94235,7 +80820,7 @@ module.exports = JSON.parse("{\"repositories\":\"'repositories' (plural) Not sup /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"assert\":true,\"async_hooks\":\">= 8\",\"buffer_ieee754\":\"< 0.9.7\",\"buffer\":true,\"child_process\":true,\"cluster\":true,\"console\":true,\"constants\":true,\"crypto\":true,\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"dns\":true,\"domain\":true,\"events\":true,\"freelist\":\"< 6\",\"fs\":true,\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"_http_agent\":\">= 0.11.1\",\"_http_client\":\">= 0.11.1\",\"_http_common\":\">= 0.11.1\",\"_http_incoming\":\">= 0.11.1\",\"_http_outgoing\":\">= 0.11.1\",\"_http_server\":\">= 0.11.1\",\"http\":true,\"http2\":\">= 8.8\",\"https\":true,\"inspector\":\">= 8.0.0\",\"_linklist\":\"< 8\",\"module\":true,\"net\":true,\"node-inspect/lib/_inspect\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6.0 && < 12\",\"os\":true,\"path\":true,\"perf_hooks\":\">= 8.5\",\"process\":\">= 1\",\"punycode\":true,\"querystring\":true,\"readline\":true,\"repl\":true,\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"_stream_transform\":\">= 0.9.4\",\"_stream_wrap\":\">= 1.4.1\",\"_stream_passthrough\":\">= 0.9.4\",\"_stream_readable\":\">= 0.9.4\",\"_stream_writable\":\">= 0.9.4\",\"stream\":true,\"string_decoder\":true,\"sys\":true,\"timers\":true,\"_tls_common\":\">= 0.11.13\",\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"tls\":true,\"trace_events\":\">= 10\",\"tty\":true,\"url\":true,\"util\":true,\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/consarray\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/logreader\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8\":\">= 1\",\"vm\":true,\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"zlib\":true}"); +module.exports = JSON.parse("{\"assert\":true,\"assert/strict\":\">= 15\",\"async_hooks\":\">= 8\",\"buffer_ieee754\":\"< 0.9.7\",\"buffer\":true,\"child_process\":true,\"cluster\":true,\"console\":true,\"constants\":true,\"crypto\":true,\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"diagnostics_channel\":\">= 15.1\",\"dns\":true,\"dns/promises\":\">= 15\",\"domain\":\">= 0.7.12\",\"events\":true,\"freelist\":\"< 6\",\"fs\":true,\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"_http_agent\":\">= 0.11.1\",\"_http_client\":\">= 0.11.1\",\"_http_common\":\">= 0.11.1\",\"_http_incoming\":\">= 0.11.1\",\"_http_outgoing\":\">= 0.11.1\",\"_http_server\":\">= 0.11.1\",\"http\":true,\"http2\":\">= 8.8\",\"https\":true,\"inspector\":\">= 8.0.0\",\"_linklist\":\"< 8\",\"module\":true,\"net\":true,\"node-inspect/lib/_inspect\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6.0 && < 12\",\"os\":true,\"path\":true,\"perf_hooks\":\">= 8.5\",\"process\":\">= 1\",\"punycode\":true,\"querystring\":true,\"readline\":true,\"repl\":true,\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"_stream_transform\":\">= 0.9.4\",\"_stream_wrap\":\">= 1.4.1\",\"_stream_passthrough\":\">= 0.9.4\",\"_stream_readable\":\">= 0.9.4\",\"_stream_writable\":\">= 0.9.4\",\"stream\":true,\"stream/promises\":\">= 15\",\"string_decoder\":true,\"sys\":[\">= 0.6 && < 0.7\",\">= 0.8\"],\"timers\":true,\"timers/promises\":\">= 15\",\"_tls_common\":\">= 0.11.13\",\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"tls\":true,\"trace_events\":\">= 10\",\"tty\":true,\"url\":true,\"util\":true,\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/consarray\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/logreader\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8\":\">= 1\",\"vm\":true,\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"zlib\":true}"); /***/ }), @@ -94243,7 +80828,7 @@ module.exports = JSON.parse("{\"assert\":true,\"async_hooks\":\">= 8\",\"buffer_ /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"author\":{\"email\":\"gajus@gajus.com\",\"name\":\"Gajus Kuizinas\",\"url\":\"http://gajus.com\"},\"ava\":{\"babel\":{\"compileAsTests\":[\"test/helpers/**/*\"]},\"files\":[\"test/roarr/**/*\"],\"require\":[\"@babel/register\"]},\"dependencies\":{\"boolean\":\"^3.0.0\",\"detect-node\":\"^2.0.4\",\"globalthis\":\"^1.0.1\",\"json-stringify-safe\":\"^5.0.1\",\"semver-compare\":\"^1.0.0\",\"sprintf-js\":\"^1.1.2\"},\"description\":\"JSON logger for Node.js and browser.\",\"devDependencies\":{\"@ava/babel\":\"^1.0.0\",\"@babel/cli\":\"^7.8.4\",\"@babel/core\":\"^7.8.4\",\"@babel/node\":\"^7.8.4\",\"@babel/plugin-transform-flow-strip-types\":\"^7.8.3\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.8.3\",\"ava\":\"^3.1.0\",\"babel-plugin-istanbul\":\"^6.0.0\",\"babel-plugin-transform-export-default-name\":\"^2.0.4\",\"coveralls\":\"^3.0.9\",\"domain-parent\":\"^1.0.0\",\"eslint\":\"^6.8.0\",\"eslint-config-canonical\":\"^18.1.0\",\"flow-bin\":\"^0.117.0\",\"flow-copy-source\":\"^2.0.9\",\"gitdown\":\"^3.1.2\",\"husky\":\"^4.2.1\",\"nyc\":\"^15.0.0\",\"semantic-release\":\"^17.0.1\"},\"engines\":{\"node\":\">=8.0\"},\"husky\":{\"hooks\":{\"pre-commit\":\"npm run lint && npm run test && npm run build\",\"pre-push\":\"gitdown ./.README/README.md --output-file ./README.md --check\"}},\"keywords\":[\"log\",\"logger\",\"json\"],\"main\":\"./dist/log.js\",\"name\":\"roarr\",\"nyc\":{\"include\":[\"src/**/*.js\"],\"instrument\":false,\"reporter\":[\"text-lcov\"],\"require\":[\"@babel/register\"],\"sourceMap\":false},\"license\":\"BSD-3-Clause\",\"repository\":{\"type\":\"git\",\"url\":\"git@github.com:gajus/roarr.git\"},\"scripts\":{\"build\":\"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist\",\"create-readme\":\"gitdown ./.README/README.md --output-file ./README.md\",\"dev\":\"NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --watch\",\"lint\":\"eslint ./src ./test && flow\",\"test\":\"NODE_ENV=test ava --serial --verbose\"},\"version\":\"2.15.3\"}"); +module.exports = JSON.parse("{\"author\":{\"email\":\"gajus@gajus.com\",\"name\":\"Gajus Kuizinas\",\"url\":\"http://gajus.com\"},\"ava\":{\"babel\":{\"compileAsTests\":[\"test/helpers/**/*\"]},\"files\":[\"test/roarr/**/*\"],\"require\":[\"@babel/register\"]},\"dependencies\":{\"boolean\":\"^3.0.1\",\"detect-node\":\"^2.0.4\",\"globalthis\":\"^1.0.1\",\"json-stringify-safe\":\"^5.0.1\",\"semver-compare\":\"^1.0.0\",\"sprintf-js\":\"^1.1.2\"},\"description\":\"JSON logger for Node.js and browser.\",\"devDependencies\":{\"@ava/babel\":\"^1.0.1\",\"@babel/cli\":\"^7.11.6\",\"@babel/core\":\"^7.11.6\",\"@babel/node\":\"^7.10.5\",\"@babel/plugin-transform-flow-strip-types\":\"^7.10.4\",\"@babel/preset-env\":\"^7.11.5\",\"@babel/register\":\"^7.11.5\",\"ava\":\"^3.12.1\",\"babel-plugin-istanbul\":\"^6.0.0\",\"babel-plugin-transform-export-default-name\":\"^2.0.4\",\"coveralls\":\"^3.1.0\",\"domain-parent\":\"^1.0.0\",\"eslint\":\"^7.9.0\",\"eslint-config-canonical\":\"^24.1.1\",\"flow-bin\":\"^0.133.0\",\"flow-copy-source\":\"^2.0.9\",\"gitdown\":\"^3.1.3\",\"husky\":\"^4.3.0\",\"nyc\":\"^15.1.0\",\"semantic-release\":\"^17.1.1\"},\"engines\":{\"node\":\">=8.0\"},\"husky\":{\"hooks\":{\"pre-commit\":\"npm run lint && npm run test && npm run build\",\"pre-push\":\"gitdown ./.README/README.md --output-file ./README.md --check\"}},\"keywords\":[\"log\",\"logger\",\"json\"],\"main\":\"./dist/log.js\",\"name\":\"roarr\",\"nyc\":{\"include\":[\"src/**/*.js\"],\"instrument\":false,\"reporter\":[\"text-lcov\"],\"require\":[\"@babel/register\"],\"sourceMap\":false},\"license\":\"BSD-3-Clause\",\"repository\":{\"type\":\"git\",\"url\":\"git@github.com:gajus/roarr.git\"},\"scripts\":{\"build\":\"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist\",\"create-readme\":\"gitdown ./.README/README.md --output-file ./README.md\",\"dev\":\"NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --watch\",\"lint\":\"eslint ./src ./test && flow\",\"test\":\"NODE_ENV=test ava --serial --verbose\"},\"version\":\"2.15.4\"}"); /***/ }), @@ -94259,7 +80844,7 @@ module.exports = JSON.parse("[\"389-exception\",\"Autoconf-exception-2.0\",\"Aut /***/ ((module) => { "use strict"; -module.exports = JSON.parse("[\"AGPL-1.0\",\"AGPL-3.0\",\"GFDL-1.1\",\"GFDL-1.2\",\"GFDL-1.3\",\"GPL-1.0\",\"GPL-2.0\",\"GPL-2.0-with-GCC-exception\",\"GPL-2.0-with-autoconf-exception\",\"GPL-2.0-with-bison-exception\",\"GPL-2.0-with-classpath-exception\",\"GPL-2.0-with-font-exception\",\"GPL-3.0\",\"GPL-3.0-with-GCC-exception\",\"GPL-3.0-with-autoconf-exception\",\"LGPL-2.0\",\"LGPL-2.1\",\"LGPL-3.0\",\"Nunit\",\"StandardML-NJ\",\"eCos-2.0\",\"wxWindows\"]"); +module.exports = JSON.parse("[\"AGPL-1.0\",\"AGPL-3.0\",\"BSD-2-Clause-FreeBSD\",\"BSD-2-Clause-NetBSD\",\"GFDL-1.1\",\"GFDL-1.2\",\"GFDL-1.3\",\"GPL-1.0\",\"GPL-2.0\",\"GPL-2.0-with-GCC-exception\",\"GPL-2.0-with-autoconf-exception\",\"GPL-2.0-with-bison-exception\",\"GPL-2.0-with-classpath-exception\",\"GPL-2.0-with-font-exception\",\"GPL-3.0\",\"GPL-3.0-with-GCC-exception\",\"GPL-3.0-with-autoconf-exception\",\"LGPL-2.0\",\"LGPL-2.1\",\"LGPL-3.0\",\"Nunit\",\"StandardML-NJ\",\"eCos-2.0\",\"wxWindows\"]"); /***/ }), @@ -94267,7 +80852,7 @@ module.exports = JSON.parse("[\"AGPL-1.0\",\"AGPL-3.0\",\"GFDL-1.1\",\"GFDL-1.2\ /***/ ((module) => { "use strict"; -module.exports = JSON.parse("[\"0BSD\",\"AAL\",\"ADSL\",\"AFL-1.1\",\"AFL-1.2\",\"AFL-2.0\",\"AFL-2.1\",\"AFL-3.0\",\"AGPL-1.0-only\",\"AGPL-1.0-or-later\",\"AGPL-3.0-only\",\"AGPL-3.0-or-later\",\"AMDPLPA\",\"AML\",\"AMPAS\",\"ANTLR-PD\",\"APAFML\",\"APL-1.0\",\"APSL-1.0\",\"APSL-1.1\",\"APSL-1.2\",\"APSL-2.0\",\"Abstyles\",\"Adobe-2006\",\"Adobe-Glyph\",\"Afmparse\",\"Aladdin\",\"Apache-1.0\",\"Apache-1.1\",\"Apache-2.0\",\"Artistic-1.0\",\"Artistic-1.0-Perl\",\"Artistic-1.0-cl8\",\"Artistic-2.0\",\"BSD-1-Clause\",\"BSD-2-Clause\",\"BSD-2-Clause-FreeBSD\",\"BSD-2-Clause-NetBSD\",\"BSD-2-Clause-Patent\",\"BSD-3-Clause\",\"BSD-3-Clause-Attribution\",\"BSD-3-Clause-Clear\",\"BSD-3-Clause-LBNL\",\"BSD-3-Clause-No-Nuclear-License\",\"BSD-3-Clause-No-Nuclear-License-2014\",\"BSD-3-Clause-No-Nuclear-Warranty\",\"BSD-3-Clause-Open-MPI\",\"BSD-4-Clause\",\"BSD-4-Clause-UC\",\"BSD-Protection\",\"BSD-Source-Code\",\"BSL-1.0\",\"Bahyph\",\"Barr\",\"Beerware\",\"BitTorrent-1.0\",\"BitTorrent-1.1\",\"BlueOak-1.0.0\",\"Borceux\",\"CATOSL-1.1\",\"CC-BY-1.0\",\"CC-BY-2.0\",\"CC-BY-2.5\",\"CC-BY-3.0\",\"CC-BY-4.0\",\"CC-BY-NC-1.0\",\"CC-BY-NC-2.0\",\"CC-BY-NC-2.5\",\"CC-BY-NC-3.0\",\"CC-BY-NC-4.0\",\"CC-BY-NC-ND-1.0\",\"CC-BY-NC-ND-2.0\",\"CC-BY-NC-ND-2.5\",\"CC-BY-NC-ND-3.0\",\"CC-BY-NC-ND-4.0\",\"CC-BY-NC-SA-1.0\",\"CC-BY-NC-SA-2.0\",\"CC-BY-NC-SA-2.5\",\"CC-BY-NC-SA-3.0\",\"CC-BY-NC-SA-4.0\",\"CC-BY-ND-1.0\",\"CC-BY-ND-2.0\",\"CC-BY-ND-2.5\",\"CC-BY-ND-3.0\",\"CC-BY-ND-4.0\",\"CC-BY-SA-1.0\",\"CC-BY-SA-2.0\",\"CC-BY-SA-2.5\",\"CC-BY-SA-3.0\",\"CC-BY-SA-4.0\",\"CC-PDDC\",\"CC0-1.0\",\"CDDL-1.0\",\"CDDL-1.1\",\"CDLA-Permissive-1.0\",\"CDLA-Sharing-1.0\",\"CECILL-1.0\",\"CECILL-1.1\",\"CECILL-2.0\",\"CECILL-2.1\",\"CECILL-B\",\"CECILL-C\",\"CERN-OHL-1.1\",\"CERN-OHL-1.2\",\"CNRI-Jython\",\"CNRI-Python\",\"CNRI-Python-GPL-Compatible\",\"CPAL-1.0\",\"CPL-1.0\",\"CPOL-1.02\",\"CUA-OPL-1.0\",\"Caldera\",\"ClArtistic\",\"Condor-1.1\",\"Crossword\",\"CrystalStacker\",\"Cube\",\"D-FSL-1.0\",\"DOC\",\"DSDP\",\"Dotseqn\",\"ECL-1.0\",\"ECL-2.0\",\"EFL-1.0\",\"EFL-2.0\",\"EPL-1.0\",\"EPL-2.0\",\"EUDatagrid\",\"EUPL-1.0\",\"EUPL-1.1\",\"EUPL-1.2\",\"Entessa\",\"ErlPL-1.1\",\"Eurosym\",\"FSFAP\",\"FSFUL\",\"FSFULLR\",\"FTL\",\"Fair\",\"Frameworx-1.0\",\"FreeImage\",\"GFDL-1.1-only\",\"GFDL-1.1-or-later\",\"GFDL-1.2-only\",\"GFDL-1.2-or-later\",\"GFDL-1.3-only\",\"GFDL-1.3-or-later\",\"GL2PS\",\"GPL-1.0-only\",\"GPL-1.0-or-later\",\"GPL-2.0-only\",\"GPL-2.0-or-later\",\"GPL-3.0-only\",\"GPL-3.0-or-later\",\"Giftware\",\"Glide\",\"Glulxe\",\"HPND\",\"HPND-sell-variant\",\"HaskellReport\",\"IBM-pibs\",\"ICU\",\"IJG\",\"IPA\",\"IPL-1.0\",\"ISC\",\"ImageMagick\",\"Imlib2\",\"Info-ZIP\",\"Intel\",\"Intel-ACPI\",\"Interbase-1.0\",\"JPNIC\",\"JSON\",\"JasPer-2.0\",\"LAL-1.2\",\"LAL-1.3\",\"LGPL-2.0-only\",\"LGPL-2.0-or-later\",\"LGPL-2.1-only\",\"LGPL-2.1-or-later\",\"LGPL-3.0-only\",\"LGPL-3.0-or-later\",\"LGPLLR\",\"LPL-1.0\",\"LPL-1.02\",\"LPPL-1.0\",\"LPPL-1.1\",\"LPPL-1.2\",\"LPPL-1.3a\",\"LPPL-1.3c\",\"Latex2e\",\"Leptonica\",\"LiLiQ-P-1.1\",\"LiLiQ-R-1.1\",\"LiLiQ-Rplus-1.1\",\"Libpng\",\"Linux-OpenIB\",\"MIT\",\"MIT-0\",\"MIT-CMU\",\"MIT-advertising\",\"MIT-enna\",\"MIT-feh\",\"MITNFA\",\"MPL-1.0\",\"MPL-1.1\",\"MPL-2.0\",\"MPL-2.0-no-copyleft-exception\",\"MS-PL\",\"MS-RL\",\"MTLL\",\"MakeIndex\",\"MirOS\",\"Motosoto\",\"Multics\",\"Mup\",\"NASA-1.3\",\"NBPL-1.0\",\"NCSA\",\"NGPL\",\"NLOD-1.0\",\"NLPL\",\"NOSL\",\"NPL-1.0\",\"NPL-1.1\",\"NPOSL-3.0\",\"NRL\",\"NTP\",\"Naumen\",\"Net-SNMP\",\"NetCDF\",\"Newsletr\",\"Nokia\",\"Noweb\",\"OCCT-PL\",\"OCLC-2.0\",\"ODC-By-1.0\",\"ODbL-1.0\",\"OFL-1.0\",\"OFL-1.1\",\"OGL-UK-1.0\",\"OGL-UK-2.0\",\"OGL-UK-3.0\",\"OGTSL\",\"OLDAP-1.1\",\"OLDAP-1.2\",\"OLDAP-1.3\",\"OLDAP-1.4\",\"OLDAP-2.0\",\"OLDAP-2.0.1\",\"OLDAP-2.1\",\"OLDAP-2.2\",\"OLDAP-2.2.1\",\"OLDAP-2.2.2\",\"OLDAP-2.3\",\"OLDAP-2.4\",\"OLDAP-2.5\",\"OLDAP-2.6\",\"OLDAP-2.7\",\"OLDAP-2.8\",\"OML\",\"OPL-1.0\",\"OSET-PL-2.1\",\"OSL-1.0\",\"OSL-1.1\",\"OSL-2.0\",\"OSL-2.1\",\"OSL-3.0\",\"OpenSSL\",\"PDDL-1.0\",\"PHP-3.0\",\"PHP-3.01\",\"Parity-6.0.0\",\"Plexus\",\"PostgreSQL\",\"Python-2.0\",\"QPL-1.0\",\"Qhull\",\"RHeCos-1.1\",\"RPL-1.1\",\"RPL-1.5\",\"RPSL-1.0\",\"RSA-MD\",\"RSCPL\",\"Rdisc\",\"Ruby\",\"SAX-PD\",\"SCEA\",\"SGI-B-1.0\",\"SGI-B-1.1\",\"SGI-B-2.0\",\"SHL-0.5\",\"SHL-0.51\",\"SISSL\",\"SISSL-1.2\",\"SMLNJ\",\"SMPPL\",\"SNIA\",\"SPL-1.0\",\"SSPL-1.0\",\"SWL\",\"Saxpath\",\"Sendmail\",\"Sendmail-8.23\",\"SimPL-2.0\",\"Sleepycat\",\"Spencer-86\",\"Spencer-94\",\"Spencer-99\",\"SugarCRM-1.1.3\",\"TAPR-OHL-1.0\",\"TCL\",\"TCP-wrappers\",\"TMate\",\"TORQUE-1.1\",\"TOSL\",\"TU-Berlin-1.0\",\"TU-Berlin-2.0\",\"UPL-1.0\",\"Unicode-DFS-2015\",\"Unicode-DFS-2016\",\"Unicode-TOU\",\"Unlicense\",\"VOSTROM\",\"VSL-1.0\",\"Vim\",\"W3C\",\"W3C-19980720\",\"W3C-20150513\",\"WTFPL\",\"Watcom-1.0\",\"Wsuipa\",\"X11\",\"XFree86-1.1\",\"XSkat\",\"Xerox\",\"Xnet\",\"YPL-1.0\",\"YPL-1.1\",\"ZPL-1.1\",\"ZPL-2.0\",\"ZPL-2.1\",\"Zed\",\"Zend-2.0\",\"Zimbra-1.3\",\"Zimbra-1.4\",\"Zlib\",\"blessing\",\"bzip2-1.0.5\",\"bzip2-1.0.6\",\"copyleft-next-0.3.0\",\"copyleft-next-0.3.1\",\"curl\",\"diffmark\",\"dvipdfm\",\"eGenix\",\"gSOAP-1.3b\",\"gnuplot\",\"iMatix\",\"libpng-2.0\",\"libtiff\",\"mpich2\",\"psfrag\",\"psutils\",\"xinetd\",\"xpp\",\"zlib-acknowledgement\"]"); +module.exports = JSON.parse("[\"0BSD\",\"AAL\",\"ADSL\",\"AFL-1.1\",\"AFL-1.2\",\"AFL-2.0\",\"AFL-2.1\",\"AFL-3.0\",\"AGPL-1.0-only\",\"AGPL-1.0-or-later\",\"AGPL-3.0-only\",\"AGPL-3.0-or-later\",\"AMDPLPA\",\"AML\",\"AMPAS\",\"ANTLR-PD\",\"ANTLR-PD-fallback\",\"APAFML\",\"APL-1.0\",\"APSL-1.0\",\"APSL-1.1\",\"APSL-1.2\",\"APSL-2.0\",\"Abstyles\",\"Adobe-2006\",\"Adobe-Glyph\",\"Afmparse\",\"Aladdin\",\"Apache-1.0\",\"Apache-1.1\",\"Apache-2.0\",\"Artistic-1.0\",\"Artistic-1.0-Perl\",\"Artistic-1.0-cl8\",\"Artistic-2.0\",\"BSD-1-Clause\",\"BSD-2-Clause\",\"BSD-2-Clause-Patent\",\"BSD-2-Clause-Views\",\"BSD-3-Clause\",\"BSD-3-Clause-Attribution\",\"BSD-3-Clause-Clear\",\"BSD-3-Clause-LBNL\",\"BSD-3-Clause-No-Nuclear-License\",\"BSD-3-Clause-No-Nuclear-License-2014\",\"BSD-3-Clause-No-Nuclear-Warranty\",\"BSD-3-Clause-Open-MPI\",\"BSD-4-Clause\",\"BSD-4-Clause-UC\",\"BSD-Protection\",\"BSD-Source-Code\",\"BSL-1.0\",\"BUSL-1.1\",\"Bahyph\",\"Barr\",\"Beerware\",\"BitTorrent-1.0\",\"BitTorrent-1.1\",\"BlueOak-1.0.0\",\"Borceux\",\"CAL-1.0\",\"CAL-1.0-Combined-Work-Exception\",\"CATOSL-1.1\",\"CC-BY-1.0\",\"CC-BY-2.0\",\"CC-BY-2.5\",\"CC-BY-3.0\",\"CC-BY-3.0-AT\",\"CC-BY-3.0-US\",\"CC-BY-4.0\",\"CC-BY-NC-1.0\",\"CC-BY-NC-2.0\",\"CC-BY-NC-2.5\",\"CC-BY-NC-3.0\",\"CC-BY-NC-4.0\",\"CC-BY-NC-ND-1.0\",\"CC-BY-NC-ND-2.0\",\"CC-BY-NC-ND-2.5\",\"CC-BY-NC-ND-3.0\",\"CC-BY-NC-ND-3.0-IGO\",\"CC-BY-NC-ND-4.0\",\"CC-BY-NC-SA-1.0\",\"CC-BY-NC-SA-2.0\",\"CC-BY-NC-SA-2.5\",\"CC-BY-NC-SA-3.0\",\"CC-BY-NC-SA-4.0\",\"CC-BY-ND-1.0\",\"CC-BY-ND-2.0\",\"CC-BY-ND-2.5\",\"CC-BY-ND-3.0\",\"CC-BY-ND-4.0\",\"CC-BY-SA-1.0\",\"CC-BY-SA-2.0\",\"CC-BY-SA-2.0-UK\",\"CC-BY-SA-2.5\",\"CC-BY-SA-3.0\",\"CC-BY-SA-3.0-AT\",\"CC-BY-SA-4.0\",\"CC-PDDC\",\"CC0-1.0\",\"CDDL-1.0\",\"CDDL-1.1\",\"CDLA-Permissive-1.0\",\"CDLA-Sharing-1.0\",\"CECILL-1.0\",\"CECILL-1.1\",\"CECILL-2.0\",\"CECILL-2.1\",\"CECILL-B\",\"CECILL-C\",\"CERN-OHL-1.1\",\"CERN-OHL-1.2\",\"CERN-OHL-P-2.0\",\"CERN-OHL-S-2.0\",\"CERN-OHL-W-2.0\",\"CNRI-Jython\",\"CNRI-Python\",\"CNRI-Python-GPL-Compatible\",\"CPAL-1.0\",\"CPL-1.0\",\"CPOL-1.02\",\"CUA-OPL-1.0\",\"Caldera\",\"ClArtistic\",\"Condor-1.1\",\"Crossword\",\"CrystalStacker\",\"Cube\",\"D-FSL-1.0\",\"DOC\",\"DSDP\",\"Dotseqn\",\"ECL-1.0\",\"ECL-2.0\",\"EFL-1.0\",\"EFL-2.0\",\"EPICS\",\"EPL-1.0\",\"EPL-2.0\",\"EUDatagrid\",\"EUPL-1.0\",\"EUPL-1.1\",\"EUPL-1.2\",\"Entessa\",\"ErlPL-1.1\",\"Eurosym\",\"FSFAP\",\"FSFUL\",\"FSFULLR\",\"FTL\",\"Fair\",\"Frameworx-1.0\",\"FreeImage\",\"GFDL-1.1-invariants-only\",\"GFDL-1.1-invariants-or-later\",\"GFDL-1.1-no-invariants-only\",\"GFDL-1.1-no-invariants-or-later\",\"GFDL-1.1-only\",\"GFDL-1.1-or-later\",\"GFDL-1.2-invariants-only\",\"GFDL-1.2-invariants-or-later\",\"GFDL-1.2-no-invariants-only\",\"GFDL-1.2-no-invariants-or-later\",\"GFDL-1.2-only\",\"GFDL-1.2-or-later\",\"GFDL-1.3-invariants-only\",\"GFDL-1.3-invariants-or-later\",\"GFDL-1.3-no-invariants-only\",\"GFDL-1.3-no-invariants-or-later\",\"GFDL-1.3-only\",\"GFDL-1.3-or-later\",\"GL2PS\",\"GLWTPL\",\"GPL-1.0-only\",\"GPL-1.0-or-later\",\"GPL-2.0-only\",\"GPL-2.0-or-later\",\"GPL-3.0-only\",\"GPL-3.0-or-later\",\"Giftware\",\"Glide\",\"Glulxe\",\"HPND\",\"HPND-sell-variant\",\"HTMLTIDY\",\"HaskellReport\",\"Hippocratic-2.1\",\"IBM-pibs\",\"ICU\",\"IJG\",\"IPA\",\"IPL-1.0\",\"ISC\",\"ImageMagick\",\"Imlib2\",\"Info-ZIP\",\"Intel\",\"Intel-ACPI\",\"Interbase-1.0\",\"JPNIC\",\"JSON\",\"JasPer-2.0\",\"LAL-1.2\",\"LAL-1.3\",\"LGPL-2.0-only\",\"LGPL-2.0-or-later\",\"LGPL-2.1-only\",\"LGPL-2.1-or-later\",\"LGPL-3.0-only\",\"LGPL-3.0-or-later\",\"LGPLLR\",\"LPL-1.0\",\"LPL-1.02\",\"LPPL-1.0\",\"LPPL-1.1\",\"LPPL-1.2\",\"LPPL-1.3a\",\"LPPL-1.3c\",\"Latex2e\",\"Leptonica\",\"LiLiQ-P-1.1\",\"LiLiQ-R-1.1\",\"LiLiQ-Rplus-1.1\",\"Libpng\",\"Linux-OpenIB\",\"MIT\",\"MIT-0\",\"MIT-CMU\",\"MIT-advertising\",\"MIT-enna\",\"MIT-feh\",\"MIT-open-group\",\"MITNFA\",\"MPL-1.0\",\"MPL-1.1\",\"MPL-2.0\",\"MPL-2.0-no-copyleft-exception\",\"MS-PL\",\"MS-RL\",\"MTLL\",\"MakeIndex\",\"MirOS\",\"Motosoto\",\"MulanPSL-1.0\",\"MulanPSL-2.0\",\"Multics\",\"Mup\",\"NASA-1.3\",\"NBPL-1.0\",\"NCGL-UK-2.0\",\"NCSA\",\"NGPL\",\"NIST-PD\",\"NIST-PD-fallback\",\"NLOD-1.0\",\"NLPL\",\"NOSL\",\"NPL-1.0\",\"NPL-1.1\",\"NPOSL-3.0\",\"NRL\",\"NTP\",\"NTP-0\",\"Naumen\",\"Net-SNMP\",\"NetCDF\",\"Newsletr\",\"Nokia\",\"Noweb\",\"O-UDA-1.0\",\"OCCT-PL\",\"OCLC-2.0\",\"ODC-By-1.0\",\"ODbL-1.0\",\"OFL-1.0\",\"OFL-1.0-RFN\",\"OFL-1.0-no-RFN\",\"OFL-1.1\",\"OFL-1.1-RFN\",\"OFL-1.1-no-RFN\",\"OGC-1.0\",\"OGL-Canada-2.0\",\"OGL-UK-1.0\",\"OGL-UK-2.0\",\"OGL-UK-3.0\",\"OGTSL\",\"OLDAP-1.1\",\"OLDAP-1.2\",\"OLDAP-1.3\",\"OLDAP-1.4\",\"OLDAP-2.0\",\"OLDAP-2.0.1\",\"OLDAP-2.1\",\"OLDAP-2.2\",\"OLDAP-2.2.1\",\"OLDAP-2.2.2\",\"OLDAP-2.3\",\"OLDAP-2.4\",\"OLDAP-2.5\",\"OLDAP-2.6\",\"OLDAP-2.7\",\"OLDAP-2.8\",\"OML\",\"OPL-1.0\",\"OSET-PL-2.1\",\"OSL-1.0\",\"OSL-1.1\",\"OSL-2.0\",\"OSL-2.1\",\"OSL-3.0\",\"OpenSSL\",\"PDDL-1.0\",\"PHP-3.0\",\"PHP-3.01\",\"PSF-2.0\",\"Parity-6.0.0\",\"Parity-7.0.0\",\"Plexus\",\"PolyForm-Noncommercial-1.0.0\",\"PolyForm-Small-Business-1.0.0\",\"PostgreSQL\",\"Python-2.0\",\"QPL-1.0\",\"Qhull\",\"RHeCos-1.1\",\"RPL-1.1\",\"RPL-1.5\",\"RPSL-1.0\",\"RSA-MD\",\"RSCPL\",\"Rdisc\",\"Ruby\",\"SAX-PD\",\"SCEA\",\"SGI-B-1.0\",\"SGI-B-1.1\",\"SGI-B-2.0\",\"SHL-0.5\",\"SHL-0.51\",\"SISSL\",\"SISSL-1.2\",\"SMLNJ\",\"SMPPL\",\"SNIA\",\"SPL-1.0\",\"SSH-OpenSSH\",\"SSH-short\",\"SSPL-1.0\",\"SWL\",\"Saxpath\",\"Sendmail\",\"Sendmail-8.23\",\"SimPL-2.0\",\"Sleepycat\",\"Spencer-86\",\"Spencer-94\",\"Spencer-99\",\"SugarCRM-1.1.3\",\"TAPR-OHL-1.0\",\"TCL\",\"TCP-wrappers\",\"TMate\",\"TORQUE-1.1\",\"TOSL\",\"TU-Berlin-1.0\",\"TU-Berlin-2.0\",\"UCL-1.0\",\"UPL-1.0\",\"Unicode-DFS-2015\",\"Unicode-DFS-2016\",\"Unicode-TOU\",\"Unlicense\",\"VOSTROM\",\"VSL-1.0\",\"Vim\",\"W3C\",\"W3C-19980720\",\"W3C-20150513\",\"WTFPL\",\"Watcom-1.0\",\"Wsuipa\",\"X11\",\"XFree86-1.1\",\"XSkat\",\"Xerox\",\"Xnet\",\"YPL-1.0\",\"YPL-1.1\",\"ZPL-1.1\",\"ZPL-2.0\",\"ZPL-2.1\",\"Zed\",\"Zend-2.0\",\"Zimbra-1.3\",\"Zimbra-1.4\",\"Zlib\",\"blessing\",\"bzip2-1.0.5\",\"bzip2-1.0.6\",\"copyleft-next-0.3.0\",\"copyleft-next-0.3.1\",\"curl\",\"diffmark\",\"dvipdfm\",\"eGenix\",\"etalab-2.0\",\"gSOAP-1.3b\",\"gnuplot\",\"iMatix\",\"libpng-2.0\",\"libselinux-1.0\",\"libtiff\",\"mpich2\",\"psfrag\",\"psutils\",\"xinetd\",\"xpp\",\"zlib-acknowledgement\"]"); /***/ }), @@ -94275,22 +80860,7 @@ module.exports = JSON.parse("[\"0BSD\",\"AAL\",\"ADSL\",\"AFL-1.1\",\"AFL-1.2\", /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"name\":\"aegir\",\"version\":\"28.2.0\",\"description\":\"JavaScript project management\",\"keywords\":[\"webpack\",\"standard\",\"lint\",\"build\"],\"homepage\":\"https://github.com/ipfs/aegir\",\"bugs\":\"https://github.com/ipfs/aegir/issues\",\"license\":\"MIT\",\"leadMaintainer\":\"Hugo Dias \",\"files\":[\"cmds\",\"utils\",\"src\",\"cli.js\",\"fixtures.js\"],\"main\":\"cli.js\",\"browser\":{\"fs\":false,\"./src/fixtures.js\":\"./src/fixtures.browser.js\"},\"bin\":{\"aegir\":\"cli.js\"},\"repository\":\"github:ipfs/aegir\",\"scripts\":{\"lint\":\"node cli.js lint\",\"test:node\":\"node cli.js test -t node\",\"test:browser\":\"node cli.js test -t browser webworker\",\"test:acceptance\":\"./test/acceptance.sh\",\"test\":\"npm run test:node && npm run test:browser\",\"coverage\":\"node cli.js coverage -t node\",\"watch\":\"node cli.js test -t node --watch\",\"release\":\"node cli.js release --no-test --no-build\",\"release-minor\":\"node cli.js release --no-build --no-test --type minor\",\"release-major\":\"node cli.js release --no-build --no-test --type major\"},\"dependencies\":{\"@achingbrain/dependency-check\":\"^4.1.0\",\"@babel/cli\":\"^7.12.1\",\"@babel/core\":\"^7.12.3\",\"@babel/plugin-transform-regenerator\":\"^7.12.1\",\"@babel/plugin-transform-runtime\":\"^7.12.1\",\"@babel/preset-env\":\"^7.12.1\",\"@babel/preset-typescript\":\"^7.12.1\",\"@babel/register\":\"^7.12.1\",\"@babel/runtime\":\"^7.12.5\",\"@commitlint/cli\":\"^11.0.0\",\"@commitlint/config-conventional\":\"^11.0.0\",\"@commitlint/lint\":\"^11.0.0\",\"@commitlint/load\":\"^11.0.0\",\"@commitlint/read\":\"^11.0.0\",\"@commitlint/travis-cli\":\"^11.0.0\",\"@electron/get\":\"^1.10.0\",\"@polka/send-type\":\"^0.5.2\",\"@types/mocha\":\"^8.0.4\",\"@types/node\":\"^14.14.8\",\"aegir-typedoc-theme\":\"^0.1.0\",\"babel-loader\":\"^8.2.1\",\"buffer\":\"^6.0.2\",\"bytes\":\"^3.1.0\",\"camelcase\":\"^6.2.0\",\"chai\":\"^4.2.0\",\"chai-as-promised\":\"^7.1.1\",\"chai-subset\":\"^1.6.0\",\"chalk\":\"^4.1.0\",\"conventional-changelog\":\"^3.1.24\",\"conventional-github-releaser\":\"^3.1.5\",\"cors\":\"^2.8.5\",\"cosmiconfig\":\"^7.0.0\",\"dirty-chai\":\"^2.0.1\",\"electron-mocha\":\"^9.3.2\",\"eslint\":\"^7.11.0\",\"eslint-config-ipfs\":\"^0.1.0\",\"execa\":\"^4.1.0\",\"extract-zip\":\"^2.0.1\",\"findup-sync\":\"^4.0.0\",\"fs-extra\":\"^9.0.1\",\"gh-pages\":\"^3.1.0\",\"git-authors-cli\":\"^1.0.31\",\"git-validate\":\"^2.2.4\",\"globby\":\"^11.0.1\",\"ipfs-utils\":\"^5.0.0\",\"it-glob\":\"~0.0.10\",\"json-loader\":\"~0.5.7\",\"karma\":\"^5.2.3\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-cli\":\"^2.0.0\",\"karma-firefox-launcher\":\"^2.1.0\",\"karma-mocha\":\"^2.0.1\",\"karma-mocha-reporter\":\"^2.2.5\",\"karma-mocha-webworker\":\"^1.3.0\",\"karma-sourcemap-loader\":\"~0.3.8\",\"karma-webpack\":\"4.0.2\",\"listr\":\"~0.14.2\",\"merge-options\":\"^3.0.3\",\"mocha\":\"^8.2.1\",\"npm-package-json-lint\":\"^5.1.0\",\"nyc\":\"^15.1.0\",\"ora\":\"^5.1.0\",\"p-map\":\"^4.0.0\",\"pascalcase\":\"^1.0.0\",\"polka\":\"^0.5.2\",\"premove\":\"^3.0.1\",\"prompt-promise\":\"^1.0.3\",\"read-pkg-up\":\"^7.0.1\",\"semver\":\"^7.3.2\",\"simple-git\":\"^2.22.0\",\"strip-bom\":\"^4.0.0\",\"strip-json-comments\":\"^3.1.1\",\"terser-webpack-plugin\":\"^3.0.5\",\"typedoc\":\"^0.19.2\",\"typescript\":\"^4.0.5\",\"update-notifier\":\"^5.0.0\",\"webpack\":\"^4.43.0\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.3.10\",\"webpack-merge\":\"^4.2.2\",\"yargs\":\"^16.1.1\",\"yargs-parser\":\"^20.2.3\"},\"devDependencies\":{\"electron\":\"^11.0.1\",\"iso-url\":\"^1.0.0\",\"mock-require\":\"^3.0.2\",\"sinon\":\"^9.2.1\"},\"engines\":{\"node\":\">=10.0.0\",\"npm\":\">=6.0.0\"},\"browserslist\":[\">1%\",\"last 2 versions\",\"Firefox ESR\",\"not ie < 11\"],\"eslintConfig\":{\"extends\":\"ipfs\"},\"contributors\":[\"dignifiedquire \",\"Hugo Dias \",\"victorbjelkholm \",\"David Dias \",\"Alex Potsides \",\"Volker Mische \",\"Alan Shaw \",\"Dmitriy Ryajov \",\"Jacob Heun \",\"Francis Yuen \",\"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ \",\"Henrique Dias \",\"Irakli Gozalishvili \",\"Maciej Krüger \",\"Adam Uhlíř \",\"Alberto Elias \",\"Diogo Silva \",\"Garren Smith \",\"Hector Sanjuan \",\"JGAntunes \",\"Jakub Sztandera \",\"Marcin Rataj \",\"Michael Garvin \",\"Mikeal Rogers \",\"Stephen Whitmore \",\"Vasco Santos \",\"0xflotus <0xflotus@gmail.com>\"]}"); - -/***/ }), - -/***/ 1039: -/***/ ((module) => { - -function webpackEmptyContext(req) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; -} -webpackEmptyContext.keys = () => []; -webpackEmptyContext.resolve = webpackEmptyContext; -webpackEmptyContext.id = 1039; -module.exports = webpackEmptyContext; +module.exports = JSON.parse("{\"name\":\"aegir\",\"version\":\"30.3.0\",\"description\":\"JavaScript project management\",\"keywords\":[\"webpack\",\"standard\",\"lint\",\"build\"],\"homepage\":\"https://github.com/ipfs/aegir\",\"bugs\":\"https://github.com/ipfs/aegir/issues\",\"license\":\"MIT\",\"leadMaintainer\":\"Hugo Dias \",\"files\":[\"dist/utils\",\"cmds\",\"utils\",\"src\",\"cli.js\",\"fixtures.js\"],\"main\":\"cli.js\",\"browser\":{\"fs\":false,\"./src/fixtures.js\":\"./src/fixtures.browser.js\"},\"bin\":{\"aegir\":\"cli.js\"},\"typesVersions\":{\"*\":{\"utils/*\":[\"dist/utils/*\"]}},\"repository\":\"github:ipfs/aegir\",\"scripts\":{\"prepare\":\"tsc -p tsconfig-types.json\",\"lint\":\"node cli.js lint\",\"test:node\":\"node cli.js test -t node\",\"test:browser\":\"node cli.js test -t browser webworker\",\"test:acceptance\":\"./test/acceptance.sh\",\"test\":\"npm run test:node && npm run test:browser\",\"coverage\":\"node cli.js coverage -t node\",\"watch\":\"node cli.js test -t node --watch\",\"release\":\"node cli.js release --no-docs --no-test --no-build\",\"release-minor\":\"node cli.js release --no-docs --no-build --no-test --type minor\",\"release-major\":\"node cli.js release --no-docs --no-build --no-test --type major\"},\"dependencies\":{\"@achingbrain/dependency-check\":\"^4.1.0\",\"@babel/core\":\"^7.12.13\",\"@babel/preset-env\":\"^7.12.13\",\"@babel/preset-typescript\":\"^7.12.7\",\"@babel/register\":\"^7.12.10\",\"@commitlint/cli\":\"^11.0.0\",\"@commitlint/config-conventional\":\"^11.0.0\",\"@commitlint/lint\":\"^11.0.0\",\"@commitlint/load\":\"^11.0.0\",\"@commitlint/read\":\"^11.0.0\",\"@commitlint/travis-cli\":\"^11.0.0\",\"@electron/get\":\"^1.12.3\",\"@polka/send-type\":\"^0.5.2\",\"@types/chai\":\"^4.2.14\",\"@types/chai-as-promised\":\"^7.1.3\",\"@types/chai-subset\":\"^1.3.3\",\"@types/dirty-chai\":\"^2.0.2\",\"@types/mocha\":\"^8.2.0\",\"@types/node\":\"^14.14.22\",\"@types/sinon\":\"^9.0.10\",\"buffer\":\"^6.0.3\",\"bytes\":\"^3.1.0\",\"camelcase\":\"^6.2.0\",\"chai\":\"^4.2.0\",\"chai-as-promised\":\"^7.1.1\",\"chai-subset\":\"^1.6.0\",\"chalk\":\"^4.1.0\",\"conventional-changelog\":\"^3.1.24\",\"conventional-github-releaser\":\"^3.1.5\",\"cors\":\"^2.8.5\",\"dirty-chai\":\"^2.0.1\",\"electron-mocha\":\"^10.0.0\",\"esbuild\":\"^0.8.39\",\"eslint\":\"^7.18.0\",\"eslint-config-ipfs\":\"^2.0.0\",\"execa\":\"^5.0.0\",\"extract-zip\":\"^2.0.1\",\"fs-extra\":\"^9.1.0\",\"gh-pages\":\"^3.1.0\",\"git-authors-cli\":\"^1.0.33\",\"git-validate\":\"^2.2.4\",\"globby\":\"^11.0.2\",\"ipfs-utils\":\"^6.0.0\",\"it-glob\":\"~0.0.10\",\"lilconfig\":\"^2.0.2\",\"listr\":\"~0.14.2\",\"merge-options\":\"^3.0.4\",\"mocha\":\"^8.2.1\",\"npm-package-json-lint\":\"^5.1.0\",\"nyc\":\"^15.1.0\",\"ora\":\"^5.3.0\",\"p-map\":\"^4.0.0\",\"pascalcase\":\"^1.0.0\",\"playwright-test\":\"hugomrdias/playwright-test#feat/esbuild\",\"polka\":\"^0.5.2\",\"premove\":\"^3.0.1\",\"prompt-promise\":\"^1.0.3\",\"read-pkg-up\":\"^7.0.1\",\"semver\":\"^7.3.4\",\"simple-git\":\"^2.28.0\",\"strip-bom\":\"^4.0.0\",\"strip-json-comments\":\"^3.1.1\",\"typedoc\":\"^0.20.17\",\"typescript\":\"4.1.x\",\"update-notifier\":\"^5.0.0\",\"yargs\":\"^16.2.0\",\"yargs-parser\":\"^20.2.3\"},\"devDependencies\":{\"@types/bytes\":\"^3.1.0\",\"@types/eslint\":\"^7.2.6\",\"@types/fs-extra\":\"^9.0.6\",\"@types/gh-pages\":\"^3.0.0\",\"@types/listr\":\"^0.14.2\",\"@types/polka\":\"^0.5.2\",\"@types/semver\":\"^7.3.4\",\"@types/yargs\":\"^16.0.0\",\"electron\":\"^11.2.0\",\"iso-url\":\"^1.0.0\",\"sinon\":\"^9.2.3\"},\"engines\":{\"node\":\">=12.0.0\",\"npm\":\">=6.0.0\"},\"browserslist\":[\">1%\",\"last 2 versions\",\"Firefox ESR\",\"not ie < 11\"],\"eslintConfig\":{\"extends\":\"ipfs\"},\"contributors\":[\"dignifiedquire \",\"Hugo Dias \",\"victorbjelkholm \",\"David Dias \",\"Alex Potsides \",\"Volker Mische \",\"Alan Shaw \",\"Jacob Heun \",\"Dmitriy Ryajov \",\"Irakli Gozalishvili \",\"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ \",\"Henrique Dias \",\"Francis Yuen \",\"Maciej Krüger \",\"Adam Uhlíř \",\"Alberto Elias \",\"Diogo Silva \",\"Garren Smith \",\"Hector Sanjuan \",\"JGAntunes \",\"Jakub Sztandera \",\"Marcin Rataj \",\"Michael Garvin \",\"Mikeal Rogers \",\"Stephen Whitmore \",\"Vasco Santos \",\"0xflotus <0xflotus@gmail.com>\"]}"); /***/ }), @@ -94406,14 +80976,6 @@ module.exports = require("perf_hooks");; /***/ }), -/***/ 94213: -/***/ ((module) => { - -"use strict"; -module.exports = require("punycode");; - -/***/ }), - /***/ 51058: /***/ ((module) => { @@ -94484,7 +81046,7 @@ module.exports = require("zlib");; /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function -/******/ function __webpack_require__(moduleId) { +/******/ function __nccwpck_require__(moduleId) { /******/ // Check if module is in cache /******/ if(__webpack_module_cache__[moduleId]) { /******/ return __webpack_module_cache__[moduleId].exports; @@ -94499,7 +81061,7 @@ module.exports = require("zlib");; /******/ // Execute the module function /******/ var threw = true; /******/ try { -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); /******/ threw = false; /******/ } finally { /******/ if(threw) delete __webpack_module_cache__[moduleId]; @@ -94513,14 +81075,9 @@ module.exports = require("zlib");; /******/ } /******/ /************************************************************************/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) -/******/ })(); -/******/ /******/ /* webpack/runtime/node module decorator */ /******/ (() => { -/******/ __webpack_require__.nmd = (module) => { +/******/ __nccwpck_require__.nmd = (module) => { /******/ module.paths = []; /******/ if (!module.children) module.children = []; /******/ return module; @@ -94529,10 +81086,10 @@ module.exports = require("zlib");; /******/ /******/ /* webpack/runtime/compat */ /******/ -/******/ __webpack_require__.ab = __dirname + "/";/************************************************************************/ +/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/ /******/ // module exports must be returned from runtime so entry inlining is disabled /******/ // startup /******/ // Load entry module and return exports -/******/ return __webpack_require__(32932); +/******/ return __nccwpck_require__(32932); /******/ })() ; \ No newline at end of file diff --git a/actions/bundle-size/package.json b/actions/bundle-size/package.json index 246e5b293..072992936 100644 --- a/actions/bundle-size/package.json +++ b/actions/bundle-size/package.json @@ -8,15 +8,15 @@ "build": "ncc build index.js" }, "dependencies": { - "@actions/artifact": "^0.4.1", + "@actions/artifact": "^0.5.0", "@actions/core": "^1.2.6", "@actions/exec": "^1.0.3", "@actions/github": "^4.0.0", - "execa": "^4.1.0", - "globby": "^11.0.0", + "execa": "^5.0.0", + "globby": "^11.0.2", "read-pkg-up": "^7.0.1" }, "devDependencies": { - "@vercel/ncc": "^0.25.1" + "@vercel/ncc": "^0.27.0" } } diff --git a/actions/bundle-size/utils.js b/actions/bundle-size/utils.js index eedc7f7b2..0dc2e4ada 100644 --- a/actions/bundle-size/utils.js +++ b/actions/bundle-size/utils.js @@ -31,8 +31,9 @@ const sizeCheck = async (octokit, context, baseDir) => { try { check = await checkCreate(octokit, context, checkName) + console.log('🚀 ~ file: utils.js ~ line 34 ~ sizeCheck ~ check', check) - const out = await execa(aegirExec, ['build', '-b'], { + const out = await execa(aegirExec, ['build', '-b', '--no-types'], { cwd: baseDir, localDir: '.', preferLocal: true, From 6917d5c67d63f5c4355c2c5f5b66d15375d9e5d3 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 5 Feb 2021 13:09:29 +0000 Subject: [PATCH 05/43] fix: future node builtin check --- src/build/index.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/build/index.js b/src/build/index.js index cf732e267..a74fee7e9 100644 --- a/src/build/index.js +++ b/src/build/index.js @@ -68,6 +68,28 @@ module.exports = async (argv) => { */ const build = async (argv) => { const outfile = path.join(paths.dist, 'index.js') + // const nodeBuiltIns = { + // util: [], + // sys: [], + // events: [], + // stream: [], + // path: [], + // querystring: [], + // punycode: [], + // url: [], + // string_decoder: [], + // http: [], + // https: [], + // os: [], + // assert: [], + // constants: [], + // timers: [], + // vm: [], + // zlib: [], + // tty: [], + // domain: [] + + // } await esbuild.build(merge( { entryPoints: [fromRoot('src', argv.tsRepo ? 'index.ts' : 'index.js')], @@ -79,12 +101,27 @@ const build = async (argv) => { globalName: pascalcase(pkg.name), metafile: argv.bundlesize ? path.join(paths.dist, 'stats.json') : undefined, outfile, + // plugins: [ + // { + // name: 'node built ins', + // setup (build) { + // const keys = Object.keys(nodeBuiltIns) + // for (const k of keys) { + // build.onResolve({ filter: new RegExp(`^${k}$`) }, (args) => { + // nodeBuiltIns[k].push(args.importer) + // return null + // }) + // } + // } + // } + // ], define: { 'process.env.NODE_ENV': '"production"' } }, userConfig.build.config )) + // console.log('🚀 ~ file: index.js ~ line 75 ~ build ~ nodeBuiltIns', nodeBuiltIns) return outfile } From 453c80f0d455b8c1a2603a227309c24e5fb14459 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 5 Feb 2021 15:03:59 +0000 Subject: [PATCH 06/43] fix: update action --- actions/bundle-size/dist/index.js | 1 - actions/bundle-size/utils.js | 1 - 2 files changed, 2 deletions(-) diff --git a/actions/bundle-size/dist/index.js b/actions/bundle-size/dist/index.js index 5b7f75d95..e1df29010 100644 --- a/actions/bundle-size/dist/index.js +++ b/actions/bundle-size/dist/index.js @@ -33277,7 +33277,6 @@ const sizeCheck = async (octokit, context, baseDir) => { try { check = await checkCreate(octokit, context, checkName) - console.log('🚀 ~ file: utils.js ~ line 34 ~ sizeCheck ~ check', check) const out = await execa(aegirExec, ['build', '-b', '--no-types'], { cwd: baseDir, diff --git a/actions/bundle-size/utils.js b/actions/bundle-size/utils.js index 0dc2e4ada..ad9388cfa 100644 --- a/actions/bundle-size/utils.js +++ b/actions/bundle-size/utils.js @@ -31,7 +31,6 @@ const sizeCheck = async (octokit, context, baseDir) => { try { check = await checkCreate(octokit, context, checkName) - console.log('🚀 ~ file: utils.js ~ line 34 ~ sizeCheck ~ check', check) const out = await execa(aegirExec, ['build', '-b', '--no-types'], { cwd: baseDir, From 3237ad6b40e5136a47eefd6bd50706653b5adaae Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 7 Feb 2021 11:08:09 +0000 Subject: [PATCH 07/43] fix: action types --- actions/bundle-size/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/actions/bundle-size/utils.js b/actions/bundle-size/utils.js index ad9388cfa..680939596 100644 --- a/actions/bundle-size/utils.js +++ b/actions/bundle-size/utils.js @@ -10,7 +10,10 @@ const { pkg } = require('../../src/utils') const aegirExec = pkg.name === 'aegir' ? './cli.js' : 'aegir' -/** @typedef {import("@actions/github").context } Context */ +/** + * @typedef {import("@actions/github").context } Context + * @typedef {ReturnType} Github + */ /** * Bundle Size Check From 19b73019cc68d4bbe731b6cc856b0f536f06a1dc Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 11 Feb 2021 13:05:49 +0000 Subject: [PATCH 08/43] fix: electron lock, esbuild-register, node cov with c8, check cmd --- cli.js | 12 +-- cmds/check.js | 169 +++++++++++++++++++++++++++++++++++++++++ cmds/docs.js | 8 +- cmds/test.js | 72 +++++++++--------- package.json | 11 +-- src/build/index.js | 38 +-------- src/config/register.js | 21 ----- src/config/user.js | 9 +++ src/docs/index.js | 4 +- src/test/browser.js | 79 +++++++++++-------- src/test/electron.js | 88 +++++++++++---------- src/test/index.js | 61 ++++++++++++--- src/test/node.js | 137 ++++++++++++++------------------- src/types.ts | 69 +++++++++++++++-- src/utils.js | 25 +++++- 15 files changed, 517 insertions(+), 286 deletions(-) create mode 100644 cmds/check.js delete mode 100644 src/config/register.js diff --git a/cli.js b/cli.js index 79e107abc..5df55fcd1 100755 --- a/cli.js +++ b/cli.js @@ -8,7 +8,7 @@ process.on('unhandledRejection', (err) => { }) const updateNotifier = require('update-notifier') -const chalk = require('chalk') +const kleur = require('kleur') const pkg = require('./package.json') updateNotifier({ @@ -40,18 +40,12 @@ cli alias: 'd', default: userConfig.debug }) - // TODO remove after webpack 5 upgrade - .options('node', { - type: 'boolean', - describe: 'Flag to control if bundler should inject node globals or built-ins.', - default: userConfig.node - }) .options('ts-repo', { type: 'boolean', describe: 'Enable support for Typescript repos.', default: userConfig.tsRepo }) - .group(['help', 'version', 'debug', 'node', 'ts-repo'], 'Global Options:') + .group(['help', 'version', 'debug', 'ts-repo'], 'Global Options:') .demandCommand(1, 'You need at least one command.') .wrap(cli.terminalWidth()) .parserConfiguration({ 'populate--': true }) @@ -62,7 +56,7 @@ cli const args = cli.fail((msg, err, yargs) => { if (msg) { yargs.showHelp() - console.error(chalk.red(msg)) + console.error(kleur.red(msg)) } if (err) { diff --git a/cmds/check.js b/cmds/check.js new file mode 100644 index 000000000..188e7a76b --- /dev/null +++ b/cmds/check.js @@ -0,0 +1,169 @@ +/* eslint-disable guard-for-in */ +/* eslint-disable max-depth */ +/* eslint-disable no-console */ +'use strict' +const esbuild = require('esbuild') +const fs = require('fs-extra') +const findPkg = require('read-pkg-up') +const kleur = require('kleur') +const { userConfig } = require('../src/config/user') +const path = require('path') +const { fromRoot, paths } = require('../src/utils') +const merge = require('merge-options').bind({ + ignoreUndefined: true, + concatArrays: true +}) +module.exports = { + command: 'check', + desc: 'Check project', + builder: {}, + handler (argv) { + return checkBuiltins(argv) + } +} + +const checkBuiltins = async (argv) => { + const outfile = path.join(paths.dist, 'index.js') + const metafile = path.join(paths.dist, 'stats.json') + const nodeBuiltIns = { + util: [], + sys: [], + events: [], + stream: [], + path: [], + querystring: [], + punycode: [], + url: [], + string_decoder: [], + http: [], + https: [], + os: [], + assert: [], + constants: [], + timers: [], + vm: [], + zlib: [], + tty: [], + domain: [] + } + const nodePlugin = { + name: 'node built ins', + setup (build) { + for (const k of Object.keys(nodeBuiltIns)) { + build.onResolve({ filter: new RegExp(`^${k}$`) }, (args) => { + nodeBuiltIns[k].push(args.importer) + return null + }) + } + } + } + + await esbuild.build( + merge( + { + entryPoints: [ + fromRoot('src', argv.tsRepo ? 'index.ts' : 'index.js') + ], + bundle: true, + mainFields: ['browser', 'module', 'main'], + sourcemap: true, + minify: false, + metafile, + outfile, + plugins: [nodePlugin], + define: { + 'process.env.NODE_ENV': '"production"' + } + }, + userConfig.build.config + ) + ) + + const { outputs } = fs.readJSONSync(metafile) + + await findBuiltins(nodeBuiltIns) + findDuplicates(outputs['dist/index.js'].inputs) +} + +const findDuplicates = async (inputs) => { + const files = Object.keys(inputs) + const packages = {} + for (const file of files) { + if (file.includes('node_modules') && !file.includes('empty:')) { + const parts = file.split('/') + const last = parts.lastIndexOf('node_modules') + let name + let path + if (parts[last + 1].startsWith('@')) { + name = parts[last + 1] + '/' + parts[last + 2] + path = parts.slice(0, last + 3) + } else { + name = parts[last + 1] + path = parts.slice(0, last + 2) + } + + if (packages[name]) { + packages[name].add(path.join('/')) + } else { + packages[name] = new Set() + packages[name].add(path.join('/')) + } + } + } + + // we have all the packages + console.log(kleur.red('Dependencies duplication')) + for (const key in packages) { + const imports = packages[key] + if (imports.size > 1) { + console.log(kleur.red(key)) + for (const file of imports) { + const out = await findPkg({ cwd: file }) + console.log(kleur.dim(file), kleur.blue(out.packageJson.version)) + } + } + } +} + +const findBuiltins = async (nodeBuiltIns) => { + const packages = {} + // eslint-disable-next-line guard-for-in + for (const builtin in nodeBuiltIns) { + for (const importer of nodeBuiltIns[builtin]) { + const out = await findPkg({ cwd: importer }) + let isOk = false + if (out) { + if (out.packageJson.dependencies) { + const deps = Object.keys(out.packageJson.dependencies) + if (deps.includes(builtin)) { + isOk = true + } + } + + if (!isOk && out.packageJson.browser) { + const deps = Object.keys(out.packageJson.browser) + if (deps.includes(builtin)) { + isOk = true + } + } + } + if (!isOk) { + if (!packages[builtin]) { + packages[builtin] = new Set() + } + const relativePath = path.relative( + process.cwd(), + importer + ) + packages[builtin].add(relativePath) + } + } + } + + if (Object.keys(packages).length > 0) { + console.log(kleur.red('Files missing node built-ins dependencies')) + console.log(packages) + } else { + console.log(kleur.green('All inputs register dependencies or polyfills for node built-ins.')) + } +} diff --git a/cmds/docs.js b/cmds/docs.js index a091837a3..14cd2cff9 100644 --- a/cmds/docs.js +++ b/cmds/docs.js @@ -1,6 +1,9 @@ 'use strict' const { userConfig } = require('../src/config/user') - +/** + * @typedef {import("yargs").Argv} Argv + * @typedef {import("yargs").Arguments} Arguments + */ const EPILOG = ` Typescript config file is required to generated docs. Try \`aegir ts --preset config > tsconfig.json\` ` @@ -8,6 +11,9 @@ Typescript config file is required to generated docs. Try \`aegir ts --preset co module.exports = { command: 'docs', desc: 'Generate documentation from TS type declarations.', + /** + * @param {Argv} yargs + */ builder: yargs => { yargs .epilog(EPILOG) diff --git a/cmds/test.js b/cmds/test.js index b061e6237..13acffea9 100644 --- a/cmds/test.js +++ b/cmds/test.js @@ -1,73 +1,68 @@ 'use strict' +const { userConfig } = require('../src/config/user') +/** + * @typedef {import("yargs").Argv} Argv + * @typedef {import("yargs").Arguments} Arguments + */ const EPILOG = ` By default browser tests run in Chrome headless. -Browser testing with Karma supports options forwarding with '--' for more info check https://karma-runner.github.io/3.0/config/configuration-file.html +Browser testing with playwright-test supports options forwarding with '--' for more info check https://github.com/hugomrdias/playwright-test#options ` module.exports = { command: 'test', desc: 'Test your code in different environments', + /** + * @param {Argv} yargs + */ builder: (yargs) => { yargs .epilog(EPILOG) - .example('aegir test -t webworker', 'Run tests in the browser with Karma inside a webworker.') - .example('aegir test -t browser -- --browsers Firefox,Chrome,Safari', 'Tell Karma to run tests in several browsers at the same time.') - .example('aegir test -w -t browser -- --browsers Chrome', 'Debug tests with watch mode and tell Karma to open Chrome in a non-headless mode.') + .example( + 'aegir test -t webworker', + 'Run tests in the browser inside a webworker.' + ) + .example( + 'aegir test -t browser -- --browser firefox', + 'Tell `playwright-test` to run tests in firefox.' + ) + .example( + 'aegir test -w -t browser -- --browser webkit --debug', + 'Debug tests with watch mode and tell `playwright-test` to open webkit in a non-headless mode.' + ) .example( 'aegir test -t electron-renderer -- --interactive', 'Debug electron renderer test with a persistent window.' ) + .example( + 'aegir test -t node --cov && npx nyc report', + 'Run test with coverage enabled and report to the terminal.' + ) .options({ - 100: { - describe: 'Check coverage and validate 100% was covered.', - type: 'boolean', - default: false - }, target: { alias: 't', describe: 'In which target environment to execute the tests', type: 'array', choices: ['node', 'browser', 'webworker', 'electron-main', 'electron-renderer'], - default: ['node', 'browser', 'webworker'] - }, - verbose: { - describe: 'Print verbose test output', - type: 'boolean', - default: false + default: userConfig.test.target }, watch: { alias: 'w', describe: 'Watch files for changes and rerun tests', type: 'boolean', - default: false + default: userConfig.test.watch }, files: { alias: 'f', describe: 'Custom globs for files to test', type: 'array', - default: [] - }, - parallel: { - alias: 'p', - describe: 'Run tests in parallel (only available in node)', - type: 'boolean', - default: true + default: userConfig.test.files }, timeout: { describe: 'The default time a single test has to run', type: 'number', - default: 5000 - }, - exit: { - describe: 'Force shutdown of the event loop after test run: mocha will call process.exit', - type: 'boolean', - default: true - }, - colors: { - describe: 'Enable colors on output', - type: 'boolean', - default: true + default: userConfig.test.timeout }, grep: { alias: 'g', @@ -78,12 +73,17 @@ module.exports = { alias: 'b', describe: 'Mocha should bail once a test fails', type: 'boolean', - default: false + default: userConfig.test.bail }, progress: { describe: 'Use progress reporters on mocha and karma', type: 'boolean', - default: false + default: userConfig.test.progress + }, + cov: { + describe: 'Enable coverage output. Output is already in Istanbul JSON format and can be uploaded directly to codecov.', + type: 'boolean', + default: userConfig.test.cov } }) }, diff --git a/package.json b/package.json index 0134a8159..ac727f063 100644 --- a/package.json +++ b/package.json @@ -51,10 +51,6 @@ }, "dependencies": { "@achingbrain/dependency-check": "^4.1.0", - "@babel/core": "^7.12.13", - "@babel/preset-env": "^7.12.13", - "@babel/preset-typescript": "^7.12.7", - "@babel/register": "^7.12.10", "@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^11.0.0", "@commitlint/lint": "^11.0.0", @@ -72,18 +68,20 @@ "@types/sinon": "^9.0.10", "buffer": "^6.0.3", "bytes": "^3.1.0", + "c8": "^7.5.0", "camelcase": "^6.2.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "chai-subset": "^1.6.0", - "chalk": "^4.1.0", "conventional-changelog": "^3.1.24", "conventional-github-releaser": "^3.1.5", "copyfiles": "^2.4.1", "cors": "^2.8.5", "dirty-chai": "^2.0.1", "electron-mocha": "^10.0.0", + "env-paths": "^2.2.0", "esbuild": "^0.8.39", + "esbuild-register": "^2.0.0", "eslint": "^7.18.0", "eslint-config-ipfs": "^2.0.0", "execa": "^5.0.0", @@ -95,6 +93,7 @@ "globby": "^11.0.2", "ipfs-utils": "^6.0.0", "it-glob": "~0.0.10", + "kleur": "^4.1.4", "lilconfig": "^2.0.2", "listr": "~0.14.2", "merge-options": "^3.0.4", @@ -108,6 +107,7 @@ "polka": "^0.5.2", "premove": "^3.0.1", "prompt-promise": "^1.0.3", + "proper-lockfile": "^4.1.2", "read-pkg-up": "^7.0.1", "semver": "^7.3.4", "simple-git": "^2.28.0", @@ -126,6 +126,7 @@ "@types/gh-pages": "^3.0.0", "@types/listr": "^0.14.2", "@types/polka": "^0.5.2", + "@types/proper-lockfile": "^4.1.1", "@types/semver": "^7.3.4", "@types/yargs": "^16.0.0", "electron": "^11.2.0", diff --git a/src/build/index.js b/src/build/index.js index a74fee7e9..684409550 100644 --- a/src/build/index.js +++ b/src/build/index.js @@ -67,29 +67,8 @@ module.exports = async (argv) => { * @param {GlobalOptions & BuildOptions} argv */ const build = async (argv) => { - const outfile = path.join(paths.dist, 'index.js') - // const nodeBuiltIns = { - // util: [], - // sys: [], - // events: [], - // stream: [], - // path: [], - // querystring: [], - // punycode: [], - // url: [], - // string_decoder: [], - // http: [], - // https: [], - // os: [], - // assert: [], - // constants: [], - // timers: [], - // vm: [], - // zlib: [], - // tty: [], - // domain: [] + const outfile = path.join(paths.dist, 'index.min.js') - // } await esbuild.build(merge( { entryPoints: [fromRoot('src', argv.tsRepo ? 'index.ts' : 'index.js')], @@ -101,27 +80,12 @@ const build = async (argv) => { globalName: pascalcase(pkg.name), metafile: argv.bundlesize ? path.join(paths.dist, 'stats.json') : undefined, outfile, - // plugins: [ - // { - // name: 'node built ins', - // setup (build) { - // const keys = Object.keys(nodeBuiltIns) - // for (const k of keys) { - // build.onResolve({ filter: new RegExp(`^${k}$`) }, (args) => { - // nodeBuiltIns[k].push(args.importer) - // return null - // }) - // } - // } - // } - // ], define: { 'process.env.NODE_ENV': '"production"' } }, userConfig.build.config )) - // console.log('🚀 ~ file: index.js ~ line 75 ~ build ~ nodeBuiltIns', nodeBuiltIns) return outfile } diff --git a/src/config/register.js b/src/config/register.js deleted file mode 100644 index 6acc5ab23..000000000 --- a/src/config/register.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' - -require('@babel/register')({ - extensions: ['.ts'], - presets: [ - [ - '@babel/preset-env', - { - modules: 'commonjs', - bugfixes: true, - targets: { node: true } - } - ], - [ - '@babel/preset-typescript', - { - allowNamespaces: true - } - ] - ] -}) diff --git a/src/config/user.js b/src/config/user.js index 38b095319..520016dfc 100644 --- a/src/config/user.js +++ b/src/config/user.js @@ -73,6 +73,15 @@ const config = (searchFrom) => { hooks: {}, // test cmd options test: { + runner: 'node', + target: ['node', 'browser', 'webworker'], + watch: false, + files: [], + timeout: 5000, + grep: '', + bail: false, + progress: false, + cov: false, browser: { config: {} } diff --git a/src/docs/index.js b/src/docs/index.js index e8636b206..37925fa41 100644 --- a/src/docs/index.js +++ b/src/docs/index.js @@ -1,7 +1,7 @@ 'use strict' const Listr = require('listr') -const chalk = require('chalk') +const kleur = require('kleur') const execa = require('execa') const fs = require('fs-extra') const path = require('path') @@ -40,7 +40,7 @@ const docs = async (ctx, task) => { } if (!hasTsconfig) { // eslint-disable-next-line no-console - console.error(chalk.yellow('Documentation requires typescript config.\nTry running `aegir ts --preset config > tsconfig.json`')) + console.error(kleur.yellow('Documentation requires typescript config.\nTry running `aegir ts --preset config > tsconfig.json`')) return } // run typedoc diff --git a/src/test/browser.js b/src/test/browser.js index d833267e8..abc5e1288 100644 --- a/src/test/browser.js +++ b/src/test/browser.js @@ -4,50 +4,63 @@ const execa = require('execa') const { hook, fromAegir } = require('../utils') const merge = require('merge-options') -/** @typedef { import("execa").Options} ExecaOptions */ +/** + * @typedef {import("execa").Options} ExecaOptions + * @typedef {import('./../types').TestOptions} TestOptions + * @typedef {import('./../types').GlobalOptions} GlobalOptions + */ -module.exports = (argv, execaOptions) => { +/** + * + * @param {TestOptions & GlobalOptions} argv + * @param {ExecaOptions} execaOptions + */ +module.exports = async (argv, execaOptions) => { const extra = argv['--'] ? argv['--'] : [] - const forwardOptions = [ + const forwardOptions = /** @type {string[]} */([ ...extra, argv.timeout && `--timeout=${argv.timeout}`, argv.grep && `--grep=${argv.grep}`, argv.bail && '--bail' - ].filter(Boolean) + ].filter(Boolean)) const watch = argv.watch ? ['--watch'] : [] + const cov = argv.cov ? ['--cov'] : [] const files = argv.files.length > 0 - ? [ - ...argv.files - ] + ? argv.files : [ '**/*.spec.{js,ts}', 'test/browser.{js,ts}' ] - return hook('browser', 'pre')(argv.userConfig) - .then((hook = {}) => { - return execa('pw-test', - [ - ...files, - '--mode', argv.webworker ? 'worker' : 'main', - ...watch, - '--config', fromAegir('src/config/pw-test.js'), - ...forwardOptions - ], - merge( - { - env: { - AEGIR_RUNNER: argv.webworker ? 'worker' : 'main', - NODE_ENV: process.env.NODE_ENV || 'test', - ...hook.env - }, - preferLocal: true, - localDir: path.join(__dirname, '../..'), - stdio: 'inherit' - }, - execaOptions - ) - ) - }) - .then(() => hook('browser', 'post')(argv.userConfig)) + // pre hook + const pre = await hook('browser', 'pre')(argv.config.hooks) + const preEnv = pre && pre.env ? pre.env : {} + + // run pw-test + await execa('pw-test', + [ + ...files, + '--mode', argv.runner === 'browser' ? 'main' : 'worker', + ...watch, + ...cov, + '--config', fromAegir('src/config/pw-test.js'), + ...forwardOptions + ], + merge( + { + env: { + AEGIR_RUNNER: argv.runner, + NODE_ENV: process.env.NODE_ENV || 'test', + ...preEnv + }, + preferLocal: true, + localDir: path.join(__dirname, '../..'), + stdio: 'inherit' + }, + execaOptions + ) + ) + + // post hook + await hook('browser', 'pre')(argv.config.hooks) } diff --git a/src/test/electron.js b/src/test/electron.js index 0c6a3483c..9fea329a0 100644 --- a/src/test/electron.js +++ b/src/test/electron.js @@ -1,52 +1,56 @@ 'use strict' const path = require('path') const execa = require('execa') -const { hook, getElectron, fromAegir } = require('../utils') +const { hook, getElectron } = require('../utils') -module.exports = (argv) => { - const input = argv._.slice(1) +/** + * @typedef {import("execa").Options} ExecaOptions + * @typedef {import('./../types').TestOptions} TestOptions + * @typedef {import('./../types').GlobalOptions} GlobalOptions + */ +/** + * + * @param {TestOptions & GlobalOptions} argv + */ +module.exports = async (argv) => { const forwardOptions = argv['--'] ? argv['--'] : [] const watch = argv.watch ? ['--watch'] : [] - const files = argv.files.length ? [...argv.files] : ['test/**/*.spec.{js,ts}'] - const verbose = argv.verbose ? ['--log-level', 'debug'] : ['--log-level', 'error'] + const files = argv.files.length > 0 ? [...argv.files] : ['test/**/*.spec.{js,ts}'] const grep = argv.grep ? ['--grep', argv.grep] : [] - const invert = argv.invert ? ['--invert'] : [] const progress = argv.progress ? ['--reporter=progress'] : [] - const bail = argv.bail ? ['--bail', argv.bail] : [] - const timeout = argv.timeout ? ['--timeout', argv.timeout] : [] - const renderer = argv.renderer ? ['--renderer'] : [] - const ts = argv.tsRepo ? ['--require', fromAegir('src/config/register.js')] : [] + const bail = argv.bail ? ['--bail'] : [] + const timeout = argv.timeout ? [`--timeout=${argv.timeout}`] : [] + const renderer = argv.runner === 'electron-renderer' ? ['--renderer'] : [] + const ts = argv.tsRepo ? ['--require', require.resolve('esbuild-register')] : [] - return hook('browser', 'pre')(argv.userConfig) - .then((hook = {}) => Promise.all([hook, getElectron()])) - .then(([hook, electronPath]) => { - return execa('electron-mocha', [ - ...input, - ...files, - ...watch, - ...verbose, - ...grep, - ...invert, - ...progress, - ...bail, - ...timeout, - ...ts, - ['--colors'], - ['--full-trace'], - ...renderer, - ...forwardOptions - ], { - localDir: path.join(__dirname, '../..'), - preferLocal: true, - stdio: 'inherit', - env: { - NODE_ENV: process.env.NODE_ENV || 'test', - AEGIR_RUNNER: argv.renderer ? 'electron-renderer' : 'electron-main', - ELECTRON_PATH: electronPath, - AEGIR_TS: argv.tsRepo, - ...hook.env - } - }) - }) - .then(() => hook('browser', 'post')(argv.userConfig)) + // pre hook + const pre = await hook('browser', 'pre')(argv.config.hooks) + const preEnv = pre && pre.env ? pre.env : {} + const electronPath = await getElectron() + + await execa('electron-mocha', [ + ...files, + ...watch, + ...grep, + ...progress, + ...bail, + ...timeout, + ...ts, + '--colors', + '--full-trace', + ...renderer, + ...forwardOptions + ], { + localDir: path.join(__dirname, '../..'), + preferLocal: true, + stdio: 'inherit', + env: { + AEGIR_RUNNER: argv.runner, + NODE_ENV: process.env.NODE_ENV || 'test', + ELECTRON_PATH: electronPath, + ...preEnv + } + }) + // post hook + await hook('browser', 'pre')(argv.config.hooks) } diff --git a/src/test/index.js b/src/test/index.js index 0667b6383..f66c6a306 100644 --- a/src/test/index.js +++ b/src/test/index.js @@ -1,42 +1,81 @@ 'use strict' +const pmap = require('p-map') +const node = require('./node') +const browser = require('./browser') +const electron = require('./electron') + +/** + * @typedef {import("execa").Options} ExecaOptions + * @typedef {import('./../types').TestOptions} TestOptions + * @typedef {import('./../types').GlobalOptions} GlobalOptions + */ + const TASKS = [ { title: 'Test Node.js', - task: (opts, execaOptions) => require('./node')(opts, execaOptions), + task: node, + /** + * @param {TestOptions & GlobalOptions} ctx + */ enabled: (ctx) => ctx.target.includes('node') }, { title: 'Test Browser', - task: require('./browser'), + /** + * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions + */ + task: (opts, execaOptions) => browser({ ...opts, runner: 'browser' }, execaOptions), + /** + * @param {TestOptions & GlobalOptions} ctx + */ enabled: (ctx) => ctx.target.includes('browser') }, { title: 'Test Webworker', - task: (opts, execaOptions) => require('./browser')(Object.assign(opts, { webworker: true }), execaOptions), + /** + * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions + */ + task: (opts, execaOptions) => browser({ ...opts, runner: 'webworker' }, execaOptions), + /** + * @param {TestOptions & GlobalOptions} ctx + */ enabled: (ctx) => ctx.target.includes('webworker') }, { title: 'Test Electron Main', - task: (opts) => require('./electron')(Object.assign(opts, { renderer: false })), + /** + * @param {TestOptions & GlobalOptions} opts + */ + task: (opts) => electron({ ...opts, runner: 'electron-main' }), + /** + * @param {TestOptions & GlobalOptions} ctx + */ enabled: (ctx) => ctx.target.includes('electron-main') }, { title: 'Test Electron Renderer', - task: (opts) => require('./electron')(Object.assign(opts, { renderer: true })), + /** + * @param {TestOptions & GlobalOptions} opts + */ + task: (opts) => electron({ ...opts, runner: 'electron-renderer' }), + /** + * @param {TestOptions & GlobalOptions} ctx + */ enabled: (ctx) => ctx.target.includes('electron-renderer') } ] module.exports = { + /** + * + * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions + */ run (opts, execaOptions) { - const { userConfig } = require('../config/user') - const pmap = require('p-map') - - // TODO remove hooks and just use opts.userConfig - opts.hooks = userConfig.hooks - opts.userConfig = userConfig return pmap(TASKS, (task) => { if (!task.enabled(opts)) { return Promise.resolve() diff --git a/src/test/node.js b/src/test/node.js index 8a2b75d1d..f0ac82493 100644 --- a/src/test/node.js +++ b/src/test/node.js @@ -2,105 +2,84 @@ const execa = require('execa') const path = require('path') -const { hook, fromAegir } = require('../utils') +const { hook } = require('../utils') const merge = require('merge-options') -const DEFAULT_TIMEOUT = global.DEFAULT_TIMEOUT || 5 * 1000 - -/** @typedef { import("execa").Options} ExecaOptions */ - -function testNode (argv, execaOptions) { - let exec = 'mocha' - const env = { - NODE_ENV: 'test', - AEGIR_RUNNER: 'node', - AEGIR_TS: argv.tsRepo - } - const timeout = argv.timeout || DEFAULT_TIMEOUT - - let args = [ - argv.progress && '--reporter=progress', +/** + * @typedef {import("execa").Options} ExecaOptions + * @typedef {import('./../types').TestOptions} TestOptions + * @typedef {import('./../types').GlobalOptions} GlobalOptions + */ + +/** + * + * @param {TestOptions & GlobalOptions} argv + * @param {ExecaOptions} execaOptions + */ +async function testNode (argv, execaOptions) { + const exec = argv.cov ? 'c8' : 'mocha' + const progress = argv.progress ? ['--reporter=progress'] : [] + const covArgs = argv.cov + ? [ + '--reporter', 'json', + '--report-dir', '.nyc_output', + '--clean', + 'mocha' + ] + : [] + const files = argv.files.length > 0 + ? argv.files + : [ + 'test/node.{js,ts}', + 'test/**/*.spec.{js,ts}' + ] + + const args = [ + ...covArgs, + ...files, + ...progress, '--ui', 'bdd', - '--timeout', timeout - ].filter(Boolean) - - let files = [ - 'test/node.{js,ts}', - 'test/**/*.spec.{js,ts}' + `--timeout=${argv.timeout}` ] - if (argv.colors) { - args.push('--colors') - } else { - args.push('--no-colors') - } - if (argv.grep) { args.push(`--grep=${argv.grep}`) } - if (argv.invert) { - args.push('--invert') - } - - if (argv.files && argv.files.length > 0) { - files = argv.files - } - - if (argv.verbose) { - args.push('--verbose') - } - if (argv.watch) { args.push('--watch') } - if (argv.exit) { - args.push('--exit') - } - if (argv.bail) { args.push('--bail') } if (argv.tsRepo) { - args.push(...['--require', fromAegir('src/config/register.js')]) - } - - const postHook = hook('node', 'post') - const preHook = hook('node', 'pre') - - if (argv['100']) { - args = [ - '--check-coverage', - '--branches=100', - '--functions=100', - '--lines=100', - '--statements=100', - exec - ].concat(args) - exec = 'nyc' + args.push(...['--require', require.resolve('esbuild-register')]) } - return preHook(argv) - .then((hook = {}) => { - return execa(exec, - args.concat(files.map((p) => path.normalize(p))), - merge( - { - env: { - ...env, - ...hook.env - }, - preferLocal: true, - localDir: path.join(__dirname, '../..'), - stdio: 'inherit' - }, - execaOptions - ) - ) - }) - .then(() => postHook(argv)) + // pre hook + const pre = await hook('node', 'pre')(argv.config.hooks) + const preEnv = pre && pre.env ? pre.env : {} + + // run mocha + await execa(exec, args, + merge( + { + env: { + AEGIR_RUNNER: 'node', + NODE_ENV: process.env.NODE_ENV || 'test', + ...preEnv + }, + preferLocal: true, + localDir: path.join(__dirname, '../..'), + stdio: 'inherit' + }, + execaOptions + ) + ) + // post hook + await hook('node', 'post')(argv.config.hooks) } module.exports = testNode diff --git a/src/types.ts b/src/types.ts index 63fe49c70..21c6ac97a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -21,6 +21,11 @@ interface Options extends GlobalOptions { * Options for the `lint` command */ lint: LintOptions + /** + * Options for the `test` command + */ + test: TestOptions + } interface GlobalOptions { @@ -28,10 +33,6 @@ interface GlobalOptions { * Show debug output. */ debug: boolean - /** - * Flag to control if bundler should inject node globals or built-ins. - */ - node: boolean /** * Enable support for Typescript repos. */ @@ -41,11 +42,18 @@ interface GlobalOptions { * Forward options to pass to the backend command populated by yargs parser */ '--'?: string[] - /** * CLI Input */ '_'?: string + /** + * Hooks + */ + hooks: any + /** + * Full config from configuration file + */ + config: Options } interface BuildOptions { @@ -112,11 +120,60 @@ interface LintOptions { silent: boolean } +interface TestOptions { + /** + * In which target environment to execute the tests + */ + target: Array<'node' | 'browser' | 'webworker' | 'electron-main' | 'electron-renderer'> + /** + * Watch files for changes and rerun tests + */ + watch: boolean + /** + * Custom globs for files to test + */ + files: string[] + /** + * The default time a single test has to run + */ + timeout: number + /** + * Limit tests to those whose names match given pattern + */ + grep: string + /** + * Bail once a test fails + */ + bail: boolean + /** + * Use progress reporters + */ + progress: boolean + /** + * Enable coverage output + */ + cov: boolean + /** + * Runner enviroment + */ + runner: 'node' | 'browser' | 'webworker' | 'electron-main' | 'electron-renderer' + /** + * Browser options + */ + browser: { + /** + * playwright-test config + */ + config: any + } +} + export type { Options, GlobalOptions, BuildOptions, TSOptions, DocsOptions, - LintOptions + LintOptions, + TestOptions } diff --git a/src/utils.js b/src/utils.js index fdd1cba91..262f03f6e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -15,7 +15,8 @@ const path = require('path') const readPkgUp = require('read-pkg-up') const fs = require('fs-extra') const execa = require('execa') - +const envPaths = require('env-paths')('aegir', { suffix: '' }) +const lockfile = require('proper-lockfile') const { packageJson: pkg, path: pkgPath @@ -27,8 +28,6 @@ const SRC_FOLDER = 'src' const TEST_FOLDER = 'test' exports.pkg = pkg -// TODO: get this from aegir package.json -exports.browserslist = '>1% or node >=10 and not ie 11 and not dead' exports.repoDirectory = path.dirname(pkgPath) exports.fromRoot = (...p) => path.join(exports.repoDirectory, ...p) exports.hasFile = (...p) => fs.existsSync(exports.fromRoot(...p)) @@ -129,6 +128,23 @@ function getPlatformPath () { exports.getElectron = async () => { const pkg = require('./../package.json') + + const lockfilePath = path.join(envPaths.cache, '__electron-lock') + fs.mkdirpSync(envPaths.cache) + const releaseLock = await lockfile.lock(envPaths.cache, { + retries: { + retries: 10, + // Retry 20 times during 10 minutes with + // exponential back-off. + // See documentation at: https://www.npmjs.com/package/retry#retrytimeoutsoptions + factor: 1.27579 + }, + onCompromised: (err) => { + throw new Error(`${err.message} Path: ${lockfilePath}`) + }, + lockfilePath + }) + const version = pkg.devDependencies.electron.slice(1) const spinner = ora(`Downloading electron: ${version}`).start() const zipPath = await download(version) @@ -137,7 +153,8 @@ exports.getElectron = async () => { spinner.text = 'Extracting electron to system cache' await extract(zipPath, { dir: path.dirname(zipPath) }) } - spinner.succeed('Electron ready to use') + spinner.stop() + await releaseLock() return electronPath } From add8ef4abe980f7f0d39ed1e9c67a463bf5bcd44 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 11 Feb 2021 15:13:33 +0000 Subject: [PATCH 09/43] fix: umd and global --- src/build/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/build/index.js b/src/build/index.js index 684409550..46b39bf9d 100644 --- a/src/build/index.js +++ b/src/build/index.js @@ -68,7 +68,7 @@ module.exports = async (argv) => { */ const build = async (argv) => { const outfile = path.join(paths.dist, 'index.min.js') - + const globalName = pascalcase(pkg.name) await esbuild.build(merge( { entryPoints: [fromRoot('src', argv.tsRepo ? 'index.ts' : 'index.js')], @@ -77,10 +77,12 @@ const build = async (argv) => { mainFields: ['browser', 'module', 'main'], sourcemap: argv.bundlesize, minify: true, - globalName: pascalcase(pkg.name), + globalName, + footer: `globalThis.${globalName} = ${globalName}`, metafile: argv.bundlesize ? path.join(paths.dist, 'stats.json') : undefined, outfile, define: { + global: 'globalThis', 'process.env.NODE_ENV': '"production"' } }, From 21d5639ec425d5b4a654d3e1609075e5eda25d9c Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 11 Feb 2021 15:43:52 +0000 Subject: [PATCH 10/43] fix: fix hooks --- src/test/browser.js | 4 ++-- src/test/electron.js | 4 ++-- src/test/node.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/browser.js b/src/test/browser.js index abc5e1288..2dc3a7215 100644 --- a/src/test/browser.js +++ b/src/test/browser.js @@ -33,7 +33,7 @@ module.exports = async (argv, execaOptions) => { ] // pre hook - const pre = await hook('browser', 'pre')(argv.config.hooks) + const pre = await hook('browser', 'pre')(argv.config) const preEnv = pre && pre.env ? pre.env : {} // run pw-test @@ -62,5 +62,5 @@ module.exports = async (argv, execaOptions) => { ) // post hook - await hook('browser', 'pre')(argv.config.hooks) + await hook('browser', 'pre')(argv.config) } diff --git a/src/test/electron.js b/src/test/electron.js index 9fea329a0..f6246282d 100644 --- a/src/test/electron.js +++ b/src/test/electron.js @@ -24,7 +24,7 @@ module.exports = async (argv) => { const ts = argv.tsRepo ? ['--require', require.resolve('esbuild-register')] : [] // pre hook - const pre = await hook('browser', 'pre')(argv.config.hooks) + const pre = await hook('browser', 'pre')(argv.config) const preEnv = pre && pre.env ? pre.env : {} const electronPath = await getElectron() @@ -52,5 +52,5 @@ module.exports = async (argv) => { } }) // post hook - await hook('browser', 'pre')(argv.config.hooks) + await hook('browser', 'pre')(argv.config) } diff --git a/src/test/node.js b/src/test/node.js index f0ac82493..e80a648e2 100644 --- a/src/test/node.js +++ b/src/test/node.js @@ -59,7 +59,7 @@ async function testNode (argv, execaOptions) { } // pre hook - const pre = await hook('node', 'pre')(argv.config.hooks) + const pre = await hook('node', 'pre')(argv.config) const preEnv = pre && pre.env ? pre.env : {} // run mocha @@ -79,7 +79,7 @@ async function testNode (argv, execaOptions) { ) ) // post hook - await hook('node', 'post')(argv.config.hooks) + await hook('node', 'post')(argv.config) } module.exports = testNode From 98bf44d2f0e84fd4b6e927d5e59d532de09bd529 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 11 Feb 2021 16:55:42 +0000 Subject: [PATCH 11/43] fix: fix hooks --- src/test/browser.js | 2 +- src/test/electron.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/browser.js b/src/test/browser.js index 2dc3a7215..b94c4ce53 100644 --- a/src/test/browser.js +++ b/src/test/browser.js @@ -62,5 +62,5 @@ module.exports = async (argv, execaOptions) => { ) // post hook - await hook('browser', 'pre')(argv.config) + await hook('browser', 'post')(argv.config) } diff --git a/src/test/electron.js b/src/test/electron.js index f6246282d..5deb71f5c 100644 --- a/src/test/electron.js +++ b/src/test/electron.js @@ -52,5 +52,5 @@ module.exports = async (argv) => { } }) // post hook - await hook('browser', 'pre')(argv.config) + await hook('browser', 'post')(argv.config) } From 26c26472fb7696ef6658fb75dc294f668d461fdd Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 12 Feb 2021 11:37:19 +0000 Subject: [PATCH 12/43] fix: foward options for mocha --- src/test/node.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/node.js b/src/test/node.js index e80a648e2..20d2f4b4d 100644 --- a/src/test/node.js +++ b/src/test/node.js @@ -58,6 +58,10 @@ async function testNode (argv, execaOptions) { args.push(...['--require', require.resolve('esbuild-register')]) } + if (argv['--']) { + args.push(...argv['--']) + } + // pre hook const pre = await hook('node', 'pre')(argv.config) const preEnv = pre && pre.env ? pre.env : {} From 5260ccb236cdfee0e79238dd13b3a8535859d955 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 12 Feb 2021 12:15:13 +0000 Subject: [PATCH 13/43] fix: update deps --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ac727f063..f2fee6660 100644 --- a/package.json +++ b/package.json @@ -59,12 +59,12 @@ "@commitlint/travis-cli": "^11.0.0", "@electron/get": "^1.12.3", "@polka/send-type": "^0.5.2", - "@types/chai": "^4.2.14", + "@types/chai": "^4.2.15", "@types/chai-as-promised": "^7.1.3", "@types/chai-subset": "^1.3.3", "@types/dirty-chai": "^2.0.2", "@types/mocha": "^8.2.0", - "@types/node": "^14.14.22", + "@types/node": "^14.14.27", "@types/sinon": "^9.0.10", "buffer": "^6.0.3", "bytes": "^3.1.0", @@ -80,7 +80,7 @@ "dirty-chai": "^2.0.1", "electron-mocha": "^10.0.0", "env-paths": "^2.2.0", - "esbuild": "^0.8.39", + "esbuild": "^0.8.44", "esbuild-register": "^2.0.0", "eslint": "^7.18.0", "eslint-config-ipfs": "^2.0.0", @@ -97,7 +97,7 @@ "lilconfig": "^2.0.2", "listr": "~0.14.2", "merge-options": "^3.0.4", - "mocha": "^8.2.1", + "mocha": "^8.3.0", "npm-package-json-lint": "^5.1.0", "nyc": "^15.1.0", "ora": "^5.3.0", @@ -113,8 +113,8 @@ "simple-git": "^2.28.0", "strip-bom": "^4.0.0", "strip-json-comments": "^3.1.1", - "typedoc": "^0.20.17", - "typescript": "4.1.x", + "typedoc": "^0.20.24", + "typescript": "4.1.5", "update-notifier": "^5.0.0", "yargs": "^16.2.0", "yargs-parser": "^20.2.3" @@ -122,7 +122,7 @@ "devDependencies": { "@types/bytes": "^3.1.0", "@types/eslint": "^7.2.6", - "@types/fs-extra": "^9.0.6", + "@types/fs-extra": "^9.0.7", "@types/gh-pages": "^3.0.0", "@types/listr": "^0.14.2", "@types/polka": "^0.5.2", From e8b4e9ff6d85b0ec4efa47729141138bbea75d8b Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 12 Feb 2021 16:32:36 +0000 Subject: [PATCH 14/43] fix: remove c8 tmp from nyc_output --- package.json | 1 + src/test/node.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/package.json b/package.json index f2fee6660..dd7991dd2 100644 --- a/package.json +++ b/package.json @@ -113,6 +113,7 @@ "simple-git": "^2.28.0", "strip-bom": "^4.0.0", "strip-json-comments": "^3.1.1", + "tempy": "^1.0.0", "typedoc": "^0.20.24", "typescript": "4.1.5", "update-notifier": "^5.0.0", diff --git a/src/test/node.js b/src/test/node.js index 20d2f4b4d..43e5c61ab 100644 --- a/src/test/node.js +++ b/src/test/node.js @@ -2,6 +2,7 @@ const execa = require('execa') const path = require('path') +const tempy = require('tempy') const { hook } = require('../utils') const merge = require('merge-options') @@ -23,6 +24,7 @@ async function testNode (argv, execaOptions) { ? [ '--reporter', 'json', '--report-dir', '.nyc_output', + '--temp-directory', tempy.directory(), '--clean', 'mocha' ] From 944adddfd213da44677e1099b35d3ee4d4449d58 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 12 Feb 2021 17:33:20 +0000 Subject: [PATCH 15/43] chore: update action --- actions/bundle-size/dist/index.js | 1091 ++++++++++++++++++++++++----- 1 file changed, 925 insertions(+), 166 deletions(-) diff --git a/actions/bundle-size/dist/index.js b/actions/bundle-size/dist/index.js index e1df29010..2dbe9fa39 100644 --- a/actions/bundle-size/dist/index.js +++ b/actions/bundle-size/dist/index.js @@ -33256,7 +33256,10 @@ const { pkg } = __nccwpck_require__(1590) const aegirExec = pkg.name === 'aegir' ? './cli.js' : 'aegir' -/** @typedef {import("@actions/github").context } Context */ +/** + * @typedef {import("@actions/github").context } Context + * @typedef {ReturnType} Github + */ /** * Bundle Size Check @@ -35806,10 +35809,10 @@ var __rest = (this && this.__rest) || function (s, e) { Object.defineProperty(exports, "__esModule", ({ value: true })); const debug_1 = __nccwpck_require__(30787); const env_paths_1 = __nccwpck_require__(47727); -const filenamify = __nccwpck_require__(25686); const fs = __nccwpck_require__(93070); const path = __nccwpck_require__(85622); const url = __nccwpck_require__(78835); +const crypto = __nccwpck_require__(76417); const d = debug_1.default('@electron/get:cache'); const defaultCacheRoot = env_paths_1.default('electron', { suffix: '', @@ -35818,11 +35821,18 @@ class Cache { constructor(cacheRoot = defaultCacheRoot) { this.cacheRoot = cacheRoot; } + static getCacheDirectory(downloadUrl) { + const parsedDownloadUrl = url.parse(downloadUrl); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { search, hash, pathname } = parsedDownloadUrl, rest = __rest(parsedDownloadUrl, ["search", "hash", "pathname"]); + const strippedUrl = url.format(Object.assign(Object.assign({}, rest), { pathname: path.dirname(pathname || 'electron') })); + return crypto + .createHash('sha256') + .update(strippedUrl) + .digest('hex'); + } getCachePath(downloadUrl, fileName) { - const _a = url.parse(downloadUrl), { search, hash } = _a, rest = __rest(_a, ["search", "hash"]); - const strippedUrl = url.format(rest); - const sanitizedUrl = filenamify(strippedUrl, { maxLength: 255, replacement: '' }); - return path.resolve(this.cacheRoot, sanitizedUrl, fileName); + return path.resolve(this.cacheRoot, Cache.getCacheDirectory(downloadUrl), fileName); } async getPathForFileInCache(url, fileName) { const cachePath = this.getCachePath(url, fileName); @@ -35890,6 +35900,7 @@ class GotDownloader { total: 100, }); // https://github.com/visionmedia/node-progress/issues/159 + // eslint-disable-next-line @typescript-eslint/no-explicit-any bar.start = start; } }, PROGRESS_BAR_DELAY_IN_SECONDS * 1000); @@ -36034,16 +36045,6 @@ const d = debug_1.default('@electron/get:index'); if (process.env.ELECTRON_GET_USE_PROXY) { proxy_1.initializeProxy(); } -/** - * Downloads a specific version of Electron and returns an absolute path to a - * ZIP file. - * - * @param version - The version of Electron you want to download - */ -function download(version, options) { - return downloadArtifact(Object.assign(Object.assign({}, options), { version, platform: process.platform, arch: process.arch, artifactName: 'electron' })); -} -exports.download = download; /** * Downloads an artifact from an Electron release and returns an absolute path * to the downloaded file. @@ -36126,6 +36127,16 @@ async function downloadArtifact(_artifactDetails) { }); } exports.downloadArtifact = downloadArtifact; +/** + * Downloads a specific version of Electron and returns an absolute path to a + * ZIP file. + * + * @param version - The version of Electron you want to download + */ +function download(version, options) { + return downloadArtifact(Object.assign(Object.assign({}, options), { version, platform: process.platform, arch: process.arch, artifactName: 'electron' })); +} +exports.download = download; //# sourceMappingURL=index.js.map /***/ }), @@ -36210,20 +36221,13 @@ function uname() { .trim(); } exports.uname = uname; -/** - * Generates an architecture name that would be used in an Electron or Node.js - * download file name, from the `process` module information. - */ -function getHostArch() { - return getNodeArch(process.arch); -} -exports.getHostArch = getHostArch; /** * Generates an architecture name that would be used in an Electron or Node.js * download file name. */ function getNodeArch(arch) { if (arch === 'arm') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any switch (process.config.variables.arm_version) { case '6': return uname(); @@ -36235,6 +36239,14 @@ function getNodeArch(arch) { return arch; } exports.getNodeArch = getNodeArch; +/** + * Generates an architecture name that would be used in an Electron or Node.js + * download file name, from the `process` module information. + */ +function getHostArch() { + return getNodeArch(process.arch); +} +exports.getHostArch = getHostArch; function ensureIsTruthyString(obj, key) { if (!obj[key] || typeof obj[key] !== 'string') { throw new Error(`Expected property "${key}" to be provided as a string but it was not`); @@ -41095,7 +41107,7 @@ BufferList.prototype._match = function (offset, search) { return this.slice(offset, offset + byteLength)[m](0, byteLength) } } else { - BufferList.prototype[m] = function (offset) { + BufferList.prototype[m] = function (offset = 0) { return this.slice(offset, offset + methods[m])[m](0) } } @@ -47169,99 +47181,6 @@ function createFromFd(fd, options) { } -/***/ }), - -/***/ 66521: -/***/ ((module) => { - -"use strict"; - -/* eslint-disable no-control-regex */ -// TODO: remove parens when Node.js 6 is targeted. Node.js 4 barfs at it. -module.exports = () => (/[<>:"\/\\|?*\x00-\x1F]/g); -module.exports.windowsNames = () => (/^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i); - - -/***/ }), - -/***/ 47915: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const path = __nccwpck_require__(85622); -const filenamify = __nccwpck_require__(91631); - -const filenamifyPath = (filePath, options) => { - filePath = path.resolve(filePath); - return path.join(path.dirname(filePath), filenamify(path.basename(filePath), options)); -}; - -module.exports = filenamifyPath; - - -/***/ }), - -/***/ 91631: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const trimRepeated = __nccwpck_require__(33533); -const filenameReservedRegex = __nccwpck_require__(66521); -const stripOuter = __nccwpck_require__(77901); - -// Doesn't make sense to have longer filenames -const MAX_FILENAME_LENGTH = 100; - -const reControlChars = /[\u0000-\u001f\u0080-\u009f]/g; // eslint-disable-line no-control-regex -const reRelativePath = /^\.+/; - -const filenamify = (string, options = {}) => { - if (typeof string !== 'string') { - throw new TypeError('Expected a string'); - } - - const replacement = options.replacement === undefined ? '!' : options.replacement; - - if (filenameReservedRegex().test(replacement) && reControlChars.test(replacement)) { - throw new Error('Replacement string cannot contain reserved filename characters'); - } - - string = string.replace(filenameReservedRegex(), replacement); - string = string.replace(reControlChars, replacement); - string = string.replace(reRelativePath, replacement); - - if (replacement.length > 0) { - string = trimRepeated(string, replacement); - string = string.length > 1 ? stripOuter(string, replacement) : string; - } - - string = filenameReservedRegex.windowsNames().test(string) ? string + replacement : string; - string = string.slice(0, typeof options.maxLength === 'number' ? options.maxLength : MAX_FILENAME_LENGTH); - - return string; -}; - -module.exports = filenamify; - - -/***/ }), - -/***/ 25686: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const filenamify = __nccwpck_require__(91631); -const filenamifyPath = __nccwpck_require__(47915); - -const filenamifyCombined = filenamify; -filenamifyCombined.path = filenamifyPath; - -module.exports = filenamify; - - /***/ }), /***/ 2885: @@ -52800,12 +52719,16 @@ module.exports = url => { module.exports = clone +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) - var copy = { __proto__: obj.__proto__ } + var copy = { __proto__: getPrototypeOf(obj) } else var copy = Object.create(null) @@ -52994,6 +52917,25 @@ function patch (fs) { } } + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 + } + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([fs$copyFile, [src, dest, flags, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + var fs$readdir = fs.readdir fs.readdir = readdir function readdir (path, options, cb) { @@ -53324,10 +53266,14 @@ try { process.cwd() } catch (er) {} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) } module.exports = patch @@ -53442,7 +53388,7 @@ function patch (fs) { } // This ensures `util.promisify` works as it does for native `fs.read`. - read.__proto__ = fs$read + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) return read })(fs.read) @@ -69251,6 +69197,560 @@ ProgressBar.prototype.terminate = function () { }; +/***/ }), + +/***/ 92123: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const lockfile = __nccwpck_require__(40156); +const { toPromise, toSync, toSyncOptions } = __nccwpck_require__(77950); + +async function lock(file, options) { + const release = await toPromise(lockfile.lock)(file, options); + + return toPromise(release); +} + +function lockSync(file, options) { + const release = toSync(lockfile.lock)(file, toSyncOptions(options)); + + return toSync(release); +} + +function unlock(file, options) { + return toPromise(lockfile.unlock)(file, options); +} + +function unlockSync(file, options) { + return toSync(lockfile.unlock)(file, toSyncOptions(options)); +} + +function check(file, options) { + return toPromise(lockfile.check)(file, options); +} + +function checkSync(file, options) { + return toSync(lockfile.check)(file, toSyncOptions(options)); +} + +module.exports = lock; +module.exports.lock = lock; +module.exports.unlock = unlock; +module.exports.lockSync = lockSync; +module.exports.unlockSync = unlockSync; +module.exports.check = check; +module.exports.checkSync = checkSync; + + +/***/ }), + +/***/ 77950: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(82161); + +function createSyncFs(fs) { + const methods = ['mkdir', 'realpath', 'stat', 'rmdir', 'utimes']; + const newFs = { ...fs }; + + methods.forEach((method) => { + newFs[method] = (...args) => { + const callback = args.pop(); + let ret; + + try { + ret = fs[`${method}Sync`](...args); + } catch (err) { + return callback(err); + } + + callback(null, ret); + }; + }); + + return newFs; +} + +// ---------------------------------------------------------- + +function toPromise(method) { + return (...args) => new Promise((resolve, reject) => { + args.push((err, result) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + + method(...args); + }); +} + +function toSync(method) { + return (...args) => { + let err; + let result; + + args.push((_err, _result) => { + err = _err; + result = _result; + }); + + method(...args); + + if (err) { + throw err; + } + + return result; + }; +} + +function toSyncOptions(options) { + // Shallow clone options because we are oging to mutate them + options = { ...options }; + + // Transform fs to use the sync methods instead + options.fs = createSyncFs(options.fs || fs); + + // Retries are not allowed because it requires the flow to be sync + if ( + (typeof options.retries === 'number' && options.retries > 0) || + (options.retries && typeof options.retries.retries === 'number' && options.retries.retries > 0) + ) { + throw Object.assign(new Error('Cannot use retries with the sync api'), { code: 'ESYNC' }); + } + + return options; +} + +module.exports = { + toPromise, + toSync, + toSyncOptions, +}; + + +/***/ }), + +/***/ 40156: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const path = __nccwpck_require__(85622); +const fs = __nccwpck_require__(82161); +const retry = __nccwpck_require__(59454); +const onExit = __nccwpck_require__(22317); +const mtimePrecision = __nccwpck_require__(79200); + +const locks = {}; + +function getLockFile(file, options) { + return options.lockfilePath || `${file}.lock`; +} + +function resolveCanonicalPath(file, options, callback) { + if (!options.realpath) { + return callback(null, path.resolve(file)); + } + + // Use realpath to resolve symlinks + // It also resolves relative paths + options.fs.realpath(file, callback); +} + +function acquireLock(file, options, callback) { + const lockfilePath = getLockFile(file, options); + + // Use mkdir to create the lockfile (atomic operation) + options.fs.mkdir(lockfilePath, (err) => { + if (!err) { + // At this point, we acquired the lock! + // Probe the mtime precision + return mtimePrecision.probe(lockfilePath, options.fs, (err, mtime, mtimePrecision) => { + // If it failed, try to remove the lock.. + /* istanbul ignore if */ + if (err) { + options.fs.rmdir(lockfilePath, () => {}); + + return callback(err); + } + + callback(null, mtime, mtimePrecision); + }); + } + + // If error is not EEXIST then some other error occurred while locking + if (err.code !== 'EEXIST') { + return callback(err); + } + + // Otherwise, check if lock is stale by analyzing the file mtime + if (options.stale <= 0) { + return callback(Object.assign(new Error('Lock file is already being held'), { code: 'ELOCKED', file })); + } + + options.fs.stat(lockfilePath, (err, stat) => { + if (err) { + // Retry if the lockfile has been removed (meanwhile) + // Skip stale check to avoid recursiveness + if (err.code === 'ENOENT') { + return acquireLock(file, { ...options, stale: 0 }, callback); + } + + return callback(err); + } + + if (!isLockStale(stat, options)) { + return callback(Object.assign(new Error('Lock file is already being held'), { code: 'ELOCKED', file })); + } + + // If it's stale, remove it and try again! + // Skip stale check to avoid recursiveness + removeLock(file, options, (err) => { + if (err) { + return callback(err); + } + + acquireLock(file, { ...options, stale: 0 }, callback); + }); + }); + }); +} + +function isLockStale(stat, options) { + return stat.mtime.getTime() < Date.now() - options.stale; +} + +function removeLock(file, options, callback) { + // Remove lockfile, ignoring ENOENT errors + options.fs.rmdir(getLockFile(file, options), (err) => { + if (err && err.code !== 'ENOENT') { + return callback(err); + } + + callback(); + }); +} + +function updateLock(file, options) { + const lock = locks[file]; + + // Just for safety, should never happen + /* istanbul ignore if */ + if (lock.updateTimeout) { + return; + } + + lock.updateDelay = lock.updateDelay || options.update; + lock.updateTimeout = setTimeout(() => { + lock.updateTimeout = null; + + // Stat the file to check if mtime is still ours + // If it is, we can still recover from a system sleep or a busy event loop + options.fs.stat(lock.lockfilePath, (err, stat) => { + const isOverThreshold = lock.lastUpdate + options.stale < Date.now(); + + // If it failed to update the lockfile, keep trying unless + // the lockfile was deleted or we are over the threshold + if (err) { + if (err.code === 'ENOENT' || isOverThreshold) { + return setLockAsCompromised(file, lock, Object.assign(err, { code: 'ECOMPROMISED' })); + } + + lock.updateDelay = 1000; + + return updateLock(file, options); + } + + const isMtimeOurs = lock.mtime.getTime() === stat.mtime.getTime(); + + if (!isMtimeOurs) { + return setLockAsCompromised( + file, + lock, + Object.assign( + new Error('Unable to update lock within the stale threshold'), + { code: 'ECOMPROMISED' } + )); + } + + const mtime = mtimePrecision.getMtime(lock.mtimePrecision); + + options.fs.utimes(lock.lockfilePath, mtime, mtime, (err) => { + const isOverThreshold = lock.lastUpdate + options.stale < Date.now(); + + // Ignore if the lock was released + if (lock.released) { + return; + } + + // If it failed to update the lockfile, keep trying unless + // the lockfile was deleted or we are over the threshold + if (err) { + if (err.code === 'ENOENT' || isOverThreshold) { + return setLockAsCompromised(file, lock, Object.assign(err, { code: 'ECOMPROMISED' })); + } + + lock.updateDelay = 1000; + + return updateLock(file, options); + } + + // All ok, keep updating.. + lock.mtime = mtime; + lock.lastUpdate = Date.now(); + lock.updateDelay = null; + updateLock(file, options); + }); + }); + }, lock.updateDelay); + + // Unref the timer so that the nodejs process can exit freely + // This is safe because all acquired locks will be automatically released + // on process exit + + // We first check that `lock.updateTimeout.unref` exists because some users + // may be using this module outside of NodeJS (e.g., in an electron app), + // and in those cases `setTimeout` return an integer. + /* istanbul ignore else */ + if (lock.updateTimeout.unref) { + lock.updateTimeout.unref(); + } +} + +function setLockAsCompromised(file, lock, err) { + // Signal the lock has been released + lock.released = true; + + // Cancel lock mtime update + // Just for safety, at this point updateTimeout should be null + /* istanbul ignore if */ + if (lock.updateTimeout) { + clearTimeout(lock.updateTimeout); + } + + if (locks[file] === lock) { + delete locks[file]; + } + + lock.options.onCompromised(err); +} + +// ---------------------------------------------------------- + +function lock(file, options, callback) { + /* istanbul ignore next */ + options = { + stale: 10000, + update: null, + realpath: true, + retries: 0, + fs, + onCompromised: (err) => { throw err; }, + ...options, + }; + + options.retries = options.retries || 0; + options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries; + options.stale = Math.max(options.stale || 0, 2000); + options.update = options.update == null ? options.stale / 2 : options.update || 0; + options.update = Math.max(Math.min(options.update, options.stale / 2), 1000); + + // Resolve to a canonical file path + resolveCanonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } + + // Attempt to acquire the lock + const operation = retry.operation(options.retries); + + operation.attempt(() => { + acquireLock(file, options, (err, mtime, mtimePrecision) => { + if (operation.retry(err)) { + return; + } + + if (err) { + return callback(operation.mainError()); + } + + // We now own the lock + const lock = locks[file] = { + lockfilePath: getLockFile(file, options), + mtime, + mtimePrecision, + options, + lastUpdate: Date.now(), + }; + + // We must keep the lock fresh to avoid staleness + updateLock(file, options); + + callback(null, (releasedCallback) => { + if (lock.released) { + return releasedCallback && + releasedCallback(Object.assign(new Error('Lock is already released'), { code: 'ERELEASED' })); + } + + // Not necessary to use realpath twice when unlocking + unlock(file, { ...options, realpath: false }, releasedCallback); + }); + }); + }); + }); +} + +function unlock(file, options, callback) { + options = { + fs, + realpath: true, + ...options, + }; + + // Resolve to a canonical file path + resolveCanonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } + + // Skip if the lock is not acquired + const lock = locks[file]; + + if (!lock) { + return callback(Object.assign(new Error('Lock is not acquired/owned by you'), { code: 'ENOTACQUIRED' })); + } + + lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update + lock.released = true; // Signal the lock has been released + delete locks[file]; // Delete from locks + + removeLock(file, options, callback); + }); +} + +function check(file, options, callback) { + options = { + stale: 10000, + realpath: true, + fs, + ...options, + }; + + options.stale = Math.max(options.stale || 0, 2000); + + // Resolve to a canonical file path + resolveCanonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } + + // Check if lockfile exists + options.fs.stat(getLockFile(file, options), (err, stat) => { + if (err) { + // If does not exist, file is not locked. Otherwise, callback with error + return err.code === 'ENOENT' ? callback(null, false) : callback(err); + } + + // Otherwise, check if lock is stale by analyzing the file mtime + return callback(null, !isLockStale(stat, options)); + }); + }); +} + +function getLocks() { + return locks; +} + +// Remove acquired locks on exit +/* istanbul ignore next */ +onExit(() => { + for (const file in locks) { + const options = locks[file].options; + + try { options.fs.rmdirSync(getLockFile(file, options)); } catch (e) { /* Empty */ } + } +}); + +module.exports.lock = lock; +module.exports.unlock = unlock; +module.exports.check = check; +module.exports.getLocks = getLocks; + + +/***/ }), + +/***/ 79200: +/***/ ((module) => { + +"use strict"; + + +const cacheSymbol = Symbol(); + +function probe(file, fs, callback) { + const cachedPrecision = fs[cacheSymbol]; + + if (cachedPrecision) { + return fs.stat(file, (err, stat) => { + /* istanbul ignore if */ + if (err) { + return callback(err); + } + + callback(null, stat.mtime, cachedPrecision); + }); + } + + // Set mtime by ceiling Date.now() to seconds + 5ms so that it's "not on the second" + const mtime = new Date((Math.ceil(Date.now() / 1000) * 1000) + 5); + + fs.utimes(file, mtime, mtime, (err) => { + /* istanbul ignore if */ + if (err) { + return callback(err); + } + + fs.stat(file, (err, stat) => { + /* istanbul ignore if */ + if (err) { + return callback(err); + } + + const precision = stat.mtime.getTime() % 1000 === 0 ? 's' : 'ms'; + + // Cache the precision in a non-enumerable way + Object.defineProperty(fs, cacheSymbol, { value: precision }); + + callback(null, stat.mtime, precision); + }); + }); +} + +function getMtime(precision) { + let now = Date.now(); + + if (precision === 's') { + now = Math.ceil(now / 1000) * 1000; + } + + return new Date(now); +} + +module.exports.probe = probe; +module.exports.getMtime = getMtime; + + /***/ }), /***/ 98051: @@ -73488,6 +73988,285 @@ class Response extends Readable { module.exports = Response; +/***/ }), + +/***/ 59454: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(1839); + +/***/ }), + +/***/ 1839: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var RetryOperation = __nccwpck_require__(8730); + +exports.operation = function(options) { + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref, + maxRetryTime: options && options.maxRetryTime + }); +}; + +exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout'); + } + + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this.createTimeout(i, opts)); + } + + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + + // sort the array numerically ascending + timeouts.sort(function(a,b) { + return a - b; + }); + + return timeouts; +}; + +exports.createTimeout = function(attempt, opts) { + var random = (opts.randomize) + ? (Math.random() + 1) + : 1; + + var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + + return timeout; +}; + +exports.wrap = function(obj, options, methods) { + if (options instanceof Array) { + methods = options; + options = null; + } + + if (!methods) { + methods = []; + for (var key in obj) { + if (typeof obj[key] === 'function') { + methods.push(key); + } + } + } + + for (var i = 0; i < methods.length; i++) { + var method = methods[i]; + var original = obj[method]; + + obj[method] = function retryWrapper(original) { + var op = exports.operation(options); + var args = Array.prototype.slice.call(arguments, 1); + var callback = args.pop(); + + args.push(function(err) { + if (op.retry(err)) { + return; + } + if (err) { + arguments[0] = op.mainError(); + } + callback.apply(this, arguments); + }); + + op.attempt(function() { + original.apply(obj, args); + }); + }.bind(obj, original); + obj[method].options = options; + } +}; + + +/***/ }), + +/***/ 8730: +/***/ ((module) => { + +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + + this._originalTimeouts = JSON.parse(JSON.stringify(timeouts)); + this._timeouts = timeouts; + this._options = options || {}; + this._maxRetryTime = options && options.maxRetryTime || Infinity; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; + this._operationStart = null; + + if (this._options.forever) { + this._cachedTimeouts = this._timeouts.slice(0); + } +} +module.exports = RetryOperation; + +RetryOperation.prototype.reset = function() { + this._attempts = 1; + this._timeouts = this._originalTimeouts; +} + +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + +RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!err) { + return false; + } + var currentTime = new Date().getTime(); + if (err && currentTime - this._operationStart >= this._maxRetryTime) { + this._errors.unshift(new Error('RetryOperation timeout occurred')); + return false; + } + + this._errors.push(err); + + var timeout = this._timeouts.shift(); + if (timeout === undefined) { + if (this._cachedTimeouts) { + // retry forever, only keep last error + this._errors.splice(this._errors.length - 1, this._errors.length); + this._timeouts = this._cachedTimeouts.slice(0); + timeout = this._timeouts.shift(); + } else { + return false; + } + } + + var self = this; + var timer = setTimeout(function() { + self._attempts++; + + if (self._operationTimeoutCb) { + self._timeout = setTimeout(function() { + self._operationTimeoutCb(self._attempts); + }, self._operationTimeout); + + if (self._options.unref) { + self._timeout.unref(); + } + } + + self._fn(self._attempts); + }, timeout); + + if (this._options.unref) { + timer.unref(); + } + + return true; +}; + +RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + + var self = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self._operationTimeoutCb(); + }, self._operationTimeout); + } + + this._operationStart = new Date().getTime(); + + this._fn(this._attempts); +}; + +RetryOperation.prototype.try = function(fn) { + console.log('Using RetryOperation.try() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = function(fn) { + console.log('Using RetryOperation.start() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = RetryOperation.prototype.try; + +RetryOperation.prototype.errors = function() { + return this._errors; +}; + +RetryOperation.prototype.attempts = function() { + return this._attempts; +}; + +RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + + for (var i = 0; i < this._errors.length; i++) { + var error = this._errors[i]; + var message = error.message; + var count = (counts[message] || 0) + 1; + + counts[message] = count; + + if (count >= mainErrorCount) { + mainError = error; + mainErrorCount = count; + } + } + + return mainError; +}; + + /***/ }), /***/ 17352: @@ -78077,25 +78856,6 @@ module.exports = (jsonString, options = {}) => { }; -/***/ }), - -/***/ 77901: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -var escapeStringRegexp = __nccwpck_require__(5813); - -module.exports = function (str, sub) { - if (typeof str !== 'string' || typeof sub !== 'string') { - throw new TypeError(); - } - - sub = escapeStringRegexp(sub); - return str.replace(new RegExp('^' + sub + '|' + sub + '$', 'g'), ''); -}; - - /***/ }), /***/ 85076: @@ -78420,24 +79180,6 @@ module.exports = input => ( ); -/***/ }), - -/***/ 33533: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -var escapeStringRegexp = __nccwpck_require__(5813); - -module.exports = function (str, target) { - if (typeof str !== 'string' || typeof target !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(new RegExp('(?:' + escapeStringRegexp(target) + '){2,}', 'g'), target); -}; - - /***/ }), /***/ 57951: @@ -80488,7 +81230,8 @@ const path = __nccwpck_require__(85622) const readPkgUp = __nccwpck_require__(45730) const fs = __nccwpck_require__(66272) const execa = __nccwpck_require__(51737) - +const envPaths = __nccwpck_require__(47727)('aegir', { suffix: '' }) +const lockfile = __nccwpck_require__(92123) const { packageJson: pkg, path: pkgPath @@ -80500,8 +81243,6 @@ const SRC_FOLDER = 'src' const TEST_FOLDER = 'test' exports.pkg = pkg -// TODO: get this from aegir package.json -exports.browserslist = '>1% or node >=10 and not ie 11 and not dead' exports.repoDirectory = path.dirname(pkgPath) exports.fromRoot = (...p) => path.join(exports.repoDirectory, ...p) exports.hasFile = (...p) => fs.existsSync(exports.fromRoot(...p)) @@ -80602,6 +81343,23 @@ function getPlatformPath () { exports.getElectron = async () => { const pkg = __nccwpck_require__(28524) + + const lockfilePath = path.join(envPaths.cache, '__electron-lock') + fs.mkdirpSync(envPaths.cache) + const releaseLock = await lockfile.lock(envPaths.cache, { + retries: { + retries: 10, + // Retry 20 times during 10 minutes with + // exponential back-off. + // See documentation at: https://www.npmjs.com/package/retry#retrytimeoutsoptions + factor: 1.27579 + }, + onCompromised: (err) => { + throw new Error(`${err.message} Path: ${lockfilePath}`) + }, + lockfilePath + }) + const version = pkg.devDependencies.electron.slice(1) const spinner = ora(`Downloading electron: ${version}`).start() const zipPath = await download(version) @@ -80610,7 +81368,8 @@ exports.getElectron = async () => { spinner.text = 'Extracting electron to system cache' await extract(zipPath, { dir: path.dirname(zipPath) }) } - spinner.succeed('Electron ready to use') + spinner.stop() + await releaseLock() return electronPath } @@ -80859,7 +81618,7 @@ module.exports = JSON.parse("[\"0BSD\",\"AAL\",\"ADSL\",\"AFL-1.1\",\"AFL-1.2\", /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"name\":\"aegir\",\"version\":\"30.3.0\",\"description\":\"JavaScript project management\",\"keywords\":[\"webpack\",\"standard\",\"lint\",\"build\"],\"homepage\":\"https://github.com/ipfs/aegir\",\"bugs\":\"https://github.com/ipfs/aegir/issues\",\"license\":\"MIT\",\"leadMaintainer\":\"Hugo Dias \",\"files\":[\"dist/utils\",\"cmds\",\"utils\",\"src\",\"cli.js\",\"fixtures.js\"],\"main\":\"cli.js\",\"browser\":{\"fs\":false,\"./src/fixtures.js\":\"./src/fixtures.browser.js\"},\"bin\":{\"aegir\":\"cli.js\"},\"typesVersions\":{\"*\":{\"utils/*\":[\"dist/utils/*\"]}},\"repository\":\"github:ipfs/aegir\",\"scripts\":{\"prepare\":\"tsc -p tsconfig-types.json\",\"lint\":\"node cli.js lint\",\"test:node\":\"node cli.js test -t node\",\"test:browser\":\"node cli.js test -t browser webworker\",\"test:acceptance\":\"./test/acceptance.sh\",\"test\":\"npm run test:node && npm run test:browser\",\"coverage\":\"node cli.js coverage -t node\",\"watch\":\"node cli.js test -t node --watch\",\"release\":\"node cli.js release --no-docs --no-test --no-build\",\"release-minor\":\"node cli.js release --no-docs --no-build --no-test --type minor\",\"release-major\":\"node cli.js release --no-docs --no-build --no-test --type major\"},\"dependencies\":{\"@achingbrain/dependency-check\":\"^4.1.0\",\"@babel/core\":\"^7.12.13\",\"@babel/preset-env\":\"^7.12.13\",\"@babel/preset-typescript\":\"^7.12.7\",\"@babel/register\":\"^7.12.10\",\"@commitlint/cli\":\"^11.0.0\",\"@commitlint/config-conventional\":\"^11.0.0\",\"@commitlint/lint\":\"^11.0.0\",\"@commitlint/load\":\"^11.0.0\",\"@commitlint/read\":\"^11.0.0\",\"@commitlint/travis-cli\":\"^11.0.0\",\"@electron/get\":\"^1.12.3\",\"@polka/send-type\":\"^0.5.2\",\"@types/chai\":\"^4.2.14\",\"@types/chai-as-promised\":\"^7.1.3\",\"@types/chai-subset\":\"^1.3.3\",\"@types/dirty-chai\":\"^2.0.2\",\"@types/mocha\":\"^8.2.0\",\"@types/node\":\"^14.14.22\",\"@types/sinon\":\"^9.0.10\",\"buffer\":\"^6.0.3\",\"bytes\":\"^3.1.0\",\"camelcase\":\"^6.2.0\",\"chai\":\"^4.2.0\",\"chai-as-promised\":\"^7.1.1\",\"chai-subset\":\"^1.6.0\",\"chalk\":\"^4.1.0\",\"conventional-changelog\":\"^3.1.24\",\"conventional-github-releaser\":\"^3.1.5\",\"cors\":\"^2.8.5\",\"dirty-chai\":\"^2.0.1\",\"electron-mocha\":\"^10.0.0\",\"esbuild\":\"^0.8.39\",\"eslint\":\"^7.18.0\",\"eslint-config-ipfs\":\"^2.0.0\",\"execa\":\"^5.0.0\",\"extract-zip\":\"^2.0.1\",\"fs-extra\":\"^9.1.0\",\"gh-pages\":\"^3.1.0\",\"git-authors-cli\":\"^1.0.33\",\"git-validate\":\"^2.2.4\",\"globby\":\"^11.0.2\",\"ipfs-utils\":\"^6.0.0\",\"it-glob\":\"~0.0.10\",\"lilconfig\":\"^2.0.2\",\"listr\":\"~0.14.2\",\"merge-options\":\"^3.0.4\",\"mocha\":\"^8.2.1\",\"npm-package-json-lint\":\"^5.1.0\",\"nyc\":\"^15.1.0\",\"ora\":\"^5.3.0\",\"p-map\":\"^4.0.0\",\"pascalcase\":\"^1.0.0\",\"playwright-test\":\"hugomrdias/playwright-test#feat/esbuild\",\"polka\":\"^0.5.2\",\"premove\":\"^3.0.1\",\"prompt-promise\":\"^1.0.3\",\"read-pkg-up\":\"^7.0.1\",\"semver\":\"^7.3.4\",\"simple-git\":\"^2.28.0\",\"strip-bom\":\"^4.0.0\",\"strip-json-comments\":\"^3.1.1\",\"typedoc\":\"^0.20.17\",\"typescript\":\"4.1.x\",\"update-notifier\":\"^5.0.0\",\"yargs\":\"^16.2.0\",\"yargs-parser\":\"^20.2.3\"},\"devDependencies\":{\"@types/bytes\":\"^3.1.0\",\"@types/eslint\":\"^7.2.6\",\"@types/fs-extra\":\"^9.0.6\",\"@types/gh-pages\":\"^3.0.0\",\"@types/listr\":\"^0.14.2\",\"@types/polka\":\"^0.5.2\",\"@types/semver\":\"^7.3.4\",\"@types/yargs\":\"^16.0.0\",\"electron\":\"^11.2.0\",\"iso-url\":\"^1.0.0\",\"sinon\":\"^9.2.3\"},\"engines\":{\"node\":\">=12.0.0\",\"npm\":\">=6.0.0\"},\"browserslist\":[\">1%\",\"last 2 versions\",\"Firefox ESR\",\"not ie < 11\"],\"eslintConfig\":{\"extends\":\"ipfs\"},\"contributors\":[\"dignifiedquire \",\"Hugo Dias \",\"victorbjelkholm \",\"David Dias \",\"Alex Potsides \",\"Volker Mische \",\"Alan Shaw \",\"Jacob Heun \",\"Dmitriy Ryajov \",\"Irakli Gozalishvili \",\"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ \",\"Henrique Dias \",\"Francis Yuen \",\"Maciej Krüger \",\"Adam Uhlíř \",\"Alberto Elias \",\"Diogo Silva \",\"Garren Smith \",\"Hector Sanjuan \",\"JGAntunes \",\"Jakub Sztandera \",\"Marcin Rataj \",\"Michael Garvin \",\"Mikeal Rogers \",\"Stephen Whitmore \",\"Vasco Santos \",\"0xflotus <0xflotus@gmail.com>\"]}"); +module.exports = JSON.parse("{\"name\":\"aegir\",\"version\":\"30.3.0\",\"description\":\"JavaScript project management\",\"keywords\":[\"webpack\",\"standard\",\"lint\",\"build\"],\"homepage\":\"https://github.com/ipfs/aegir\",\"bugs\":\"https://github.com/ipfs/aegir/issues\",\"license\":\"MIT\",\"leadMaintainer\":\"Hugo Dias \",\"files\":[\"dist/utils\",\"cmds\",\"utils\",\"src\",\"cli.js\",\"fixtures.js\"],\"main\":\"cli.js\",\"browser\":{\"fs\":false,\"./src/fixtures.js\":\"./src/fixtures.browser.js\"},\"bin\":{\"aegir\":\"cli.js\"},\"typesVersions\":{\"*\":{\"utils/*\":[\"dist/utils/*\"]}},\"repository\":\"github:ipfs/aegir\",\"scripts\":{\"prepare\":\"tsc -p tsconfig-types.json\",\"lint\":\"node cli.js lint\",\"test:node\":\"node cli.js test -t node\",\"test:browser\":\"node cli.js test -t browser webworker\",\"test:acceptance\":\"./test/acceptance.sh\",\"test\":\"npm run test:node && npm run test:browser\",\"coverage\":\"node cli.js coverage -t node\",\"watch\":\"node cli.js test -t node --watch\",\"release\":\"node cli.js release --no-docs --no-test --no-build\",\"release-minor\":\"node cli.js release --no-docs --no-build --no-test --type minor\",\"release-major\":\"node cli.js release --no-docs --no-build --no-test --type major\"},\"dependencies\":{\"@achingbrain/dependency-check\":\"^4.1.0\",\"@commitlint/cli\":\"^11.0.0\",\"@commitlint/config-conventional\":\"^11.0.0\",\"@commitlint/lint\":\"^11.0.0\",\"@commitlint/load\":\"^11.0.0\",\"@commitlint/read\":\"^11.0.0\",\"@commitlint/travis-cli\":\"^11.0.0\",\"@electron/get\":\"^1.12.3\",\"@polka/send-type\":\"^0.5.2\",\"@types/chai\":\"^4.2.15\",\"@types/chai-as-promised\":\"^7.1.3\",\"@types/chai-subset\":\"^1.3.3\",\"@types/dirty-chai\":\"^2.0.2\",\"@types/mocha\":\"^8.2.0\",\"@types/node\":\"^14.14.27\",\"@types/sinon\":\"^9.0.10\",\"buffer\":\"^6.0.3\",\"bytes\":\"^3.1.0\",\"c8\":\"^7.5.0\",\"camelcase\":\"^6.2.0\",\"chai\":\"^4.2.0\",\"chai-as-promised\":\"^7.1.1\",\"chai-subset\":\"^1.6.0\",\"conventional-changelog\":\"^3.1.24\",\"conventional-github-releaser\":\"^3.1.5\",\"copyfiles\":\"^2.4.1\",\"cors\":\"^2.8.5\",\"dirty-chai\":\"^2.0.1\",\"electron-mocha\":\"^10.0.0\",\"env-paths\":\"^2.2.0\",\"esbuild\":\"^0.8.44\",\"esbuild-register\":\"^2.0.0\",\"eslint\":\"^7.18.0\",\"eslint-config-ipfs\":\"^2.0.0\",\"execa\":\"^5.0.0\",\"extract-zip\":\"^2.0.1\",\"fs-extra\":\"^9.1.0\",\"gh-pages\":\"^3.1.0\",\"git-authors-cli\":\"^1.0.33\",\"git-validate\":\"^2.2.4\",\"globby\":\"^11.0.2\",\"ipfs-utils\":\"^6.0.0\",\"it-glob\":\"~0.0.10\",\"kleur\":\"^4.1.4\",\"lilconfig\":\"^2.0.2\",\"listr\":\"~0.14.2\",\"merge-options\":\"^3.0.4\",\"mocha\":\"^8.3.0\",\"npm-package-json-lint\":\"^5.1.0\",\"nyc\":\"^15.1.0\",\"ora\":\"^5.3.0\",\"p-map\":\"^4.0.0\",\"pascalcase\":\"^1.0.0\",\"playwright-test\":\"hugomrdias/playwright-test#feat/esbuild\",\"polka\":\"^0.5.2\",\"premove\":\"^3.0.1\",\"prompt-promise\":\"^1.0.3\",\"proper-lockfile\":\"^4.1.2\",\"read-pkg-up\":\"^7.0.1\",\"semver\":\"^7.3.4\",\"simple-git\":\"^2.28.0\",\"strip-bom\":\"^4.0.0\",\"strip-json-comments\":\"^3.1.1\",\"tempy\":\"^1.0.0\",\"typedoc\":\"^0.20.24\",\"typescript\":\"4.1.5\",\"update-notifier\":\"^5.0.0\",\"yargs\":\"^16.2.0\",\"yargs-parser\":\"^20.2.3\"},\"devDependencies\":{\"@types/bytes\":\"^3.1.0\",\"@types/eslint\":\"^7.2.6\",\"@types/fs-extra\":\"^9.0.7\",\"@types/gh-pages\":\"^3.0.0\",\"@types/listr\":\"^0.14.2\",\"@types/polka\":\"^0.5.2\",\"@types/proper-lockfile\":\"^4.1.1\",\"@types/semver\":\"^7.3.4\",\"@types/yargs\":\"^16.0.0\",\"electron\":\"^11.2.0\",\"iso-url\":\"^1.0.0\",\"sinon\":\"^9.2.3\"},\"engines\":{\"node\":\">=12.0.0\",\"npm\":\">=6.0.0\"},\"browserslist\":[\">1%\",\"last 2 versions\",\"Firefox ESR\",\"not ie < 11\"],\"eslintConfig\":{\"extends\":\"ipfs\"},\"contributors\":[\"dignifiedquire \",\"Hugo Dias \",\"victorbjelkholm \",\"David Dias \",\"Alex Potsides \",\"Volker Mische \",\"Alan Shaw \",\"Jacob Heun \",\"Dmitriy Ryajov \",\"Irakli Gozalishvili \",\"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ \",\"Henrique Dias \",\"Francis Yuen \",\"Maciej Krüger \",\"Adam Uhlíř \",\"Alberto Elias \",\"Diogo Silva \",\"Garren Smith \",\"Hector Sanjuan \",\"JGAntunes \",\"Jakub Sztandera \",\"Marcin Rataj \",\"Michael Garvin \",\"Mikeal Rogers \",\"Stephen Whitmore \",\"Vasco Santos \",\"0xflotus <0xflotus@gmail.com>\"]}"); /***/ }), From c91c715f7586e9f2555d3e1457b36480f2548d02 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sat, 13 Feb 2021 11:35:23 +0000 Subject: [PATCH 16/43] fix: types --- cmds/docs.js | 1 - cmds/test.js | 1 - package.json | 1 + test/lint.js | 12 ++++++++++++ test/utils/echo-server.js | 2 ++ utils/echo-server.js | 39 ++++++++++++++++++++------------------- 6 files changed, 35 insertions(+), 21 deletions(-) diff --git a/cmds/docs.js b/cmds/docs.js index 14cd2cff9..16413d2bd 100644 --- a/cmds/docs.js +++ b/cmds/docs.js @@ -2,7 +2,6 @@ const { userConfig } = require('../src/config/user') /** * @typedef {import("yargs").Argv} Argv - * @typedef {import("yargs").Arguments} Arguments */ const EPILOG = ` Typescript config file is required to generated docs. Try \`aegir ts --preset config > tsconfig.json\` diff --git a/cmds/test.js b/cmds/test.js index 13acffea9..db7b7e760 100644 --- a/cmds/test.js +++ b/cmds/test.js @@ -2,7 +2,6 @@ const { userConfig } = require('../src/config/user') /** * @typedef {import("yargs").Argv} Argv - * @typedef {import("yargs").Arguments} Arguments */ const EPILOG = ` diff --git a/package.json b/package.json index dd7991dd2..1968591f2 100644 --- a/package.json +++ b/package.json @@ -122,6 +122,7 @@ }, "devDependencies": { "@types/bytes": "^3.1.0", + "@types/cors": "^2.8.9", "@types/eslint": "^7.2.6", "@types/fs-extra": "^9.0.7", "@types/gh-pages": "^3.0.0", diff --git a/test/lint.js b/test/lint.js index 644c45858..60816eefb 100644 --- a/test/lint.js +++ b/test/lint.js @@ -10,6 +10,9 @@ const { userConfig } = require('../src/config/user') const TEMP_FOLDER = path.join(__dirname, '../node_modules/.temp-test') +/** + * @param {{ [s: string]: any; } | ArrayLike} project + */ const setupProject = async (project) => { const tmpDir = path.join(TEMP_FOLDER, `test-${Math.random()}`) await fs.promises.mkdir(tmpDir) @@ -19,6 +22,9 @@ const setupProject = async (project) => { process.chdir(tmpDir) } +/** + * @param {never[]} deps + */ const setupProjectWithDeps = deps => setupProject({ 'package.json': JSON.stringify({ name: 'my-project', @@ -26,11 +32,17 @@ const setupProjectWithDeps = deps => setupProject({ }) }) +/** + * @param {{ [s: string]: any; } | ArrayLike} project + */ const projectShouldPassLint = async (project) => { await setupProject(project) await lint(userConfig.lint) } +/** + * @param {{ [s: string]: any; } | ArrayLike} project + */ const projectShouldFailLint = async (project) => { await setupProject(project) let failed = false diff --git a/test/utils/echo-server.js b/test/utils/echo-server.js index 44988d64c..e7722cc72 100644 --- a/test/utils/echo-server.js +++ b/test/utils/echo-server.js @@ -5,10 +5,12 @@ const http = require('ipfs-utils/src/http') const { Buffer } = require('buffer') const { expect } = require('../../utils/chai') const EchoServer = require('../../utils/echo-server') +// @ts-ignore const { format } = require('iso-url') describe('echo server spec', () => { const echo = new EchoServer() + /** @type {string} */ let url before(async () => { diff --git a/utils/echo-server.js b/utils/echo-server.js index 3298ec056..d6c0d7b90 100644 --- a/utils/echo-server.js +++ b/utils/echo-server.js @@ -1,6 +1,6 @@ -// @ts-nocheck 'use strict' +// @ts-ignore const send = require('@polka/send-type') const polka = require('polka') const cors = require('cors') @@ -21,6 +21,8 @@ class EchoServer { this.port = options.port || 3000 this.host = options.host || '127.0.0.1' this.started = false + this.server = http.createServer() + this.polka = polka({ server: this.server }) } async start () { @@ -28,24 +30,23 @@ class EchoServer { if (this.options.findPort !== false) { this.port = await getPort(this.port) } - this.server = http.createServer() - this.polka = polka({ server: this.server }) - .use(cors()) - .use('/redirect', (req, res) => { - send(res, 302, null, { Location: req.query.to }) - }) - .all('/echo/query', (req, res) => { - send(res, 200, req.query) - }) - .all('/echo/headers', (req, res) => { - send(res, 200, req.headers) - }) - .all('/echo', (req, res) => { - send(res, 200, req) - }) - .all('/download', (req, res) => { - send(res, 200, Buffer.from(req.query.data || '')) - }) + this.polka.use(cors()) + this.polka.use('/redirect', (req, res) => { + send(res, 302, null, { Location: req.query.to }) + }) + this.polka.all('/echo/query', (req, res) => { + send(res, 200, req.query) + }) + this.polka.all('/echo/headers', (req, res) => { + send(res, 200, req.headers) + }) + this.polka.all('/echo', (req, res) => { + send(res, 200, req) + }) + this.polka.all('/download', (req, res) => { + // @ts-ignore + send(res, 200, Buffer.from(req.query.data || '')) + }) const listen = new Promise((resolve, reject) => { this.server.once('error', reject) From 1001e00070b4f6f0dc012347175a6056605c399a Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sat, 13 Feb 2021 11:35:47 +0000 Subject: [PATCH 17/43] fix: check more types --- tsconfig.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 0c91f476f..9ec070960 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,10 @@ }, "include": [ "src", - "test" + "test", + "utils" + ], + "exclude": [ + "test/fixtures" ] } From 1e93fe137cdf082ebb7919cc19b58281f7523b58 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sat, 13 Feb 2021 11:36:10 +0000 Subject: [PATCH 18/43] docs: improve description for types preset --- cmds/ts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds/ts.js b/cmds/ts.js index 49d0754e4..4e3b2f779 100644 --- a/cmds/ts.js +++ b/cmds/ts.js @@ -4,7 +4,7 @@ const { userConfig } = require('../src/config/user') const EPILOG = ` Presets: \`check\` Runs the type checker with your local config (without writing any files). . -\`types\` Emits type declarations to \`dist\` folder. +\`types\` Emits type declarations, copies a any .d.ts files or a types folder to \`dist\` folder. \`config\` Prints base config to stdout. Note: From 853ea8691d46bb355293f7a7671c749e4f85a282 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 15 Feb 2021 15:11:36 +0000 Subject: [PATCH 19/43] fix: types and release cmd --- .github/workflows/main.yml | 5 +- cli.js | 9 +- cmds/release.js | 59 +++---- package.json | 11 +- src/checks/commitlint-travis.js | 18 ++ src/config/user.js | 27 ++- src/dependency-check.js | 21 ++- src/docs/index.js | 4 +- src/fixtures.browser.js | 14 +- src/fixtures.js | 16 +- src/publish-rc/index.js | 6 + src/release/bump.js | 10 +- src/release/changelog.js | 11 ++ src/release/commit.js | 3 +- src/release/contributors.js | 7 +- src/release/github.js | 7 + src/release/index.js | 156 +++++++++++------- src/release/prerelease.js | 38 +++-- src/release/publish.js | 21 ++- src/release/push.js | 10 +- src/release/tag.js | 3 +- src/test-dependant/index.js | 77 +++++++-- src/test/browser.js | 4 +- src/test/electron.js | 58 ++++--- src/test/index.js | 13 +- src/test/node.js | 4 +- src/ts/typedoc-plugin.js | 10 +- src/{types.ts => types.d.ts} | 61 ++++++- src/update-last-successful-build/index.js | 9 + src/update-rc/index.js | 24 ++- src/update-release-branch-lockfiles/index.js | 3 + src/utils.js | 42 +++++ test/acceptance.sh | 55 ------ .../custom-config-package-json/package.json | 2 +- test/config/user.js | 9 +- test/dependants.js | 72 ++++---- test/dependency-check.js | 8 +- test/fixtures.js | 2 +- .../dependency-check/fail-prod/index.js | 1 + test/fixtures/dependency-check/fail/index.js | 1 + .../pass-certain-files/derp/foo.js | 1 + .../pass-certain-files/index.js | 1 + test/fixtures/dependency-check/pass/index.js | 1 + .../with-aegir-config/index.js | 1 + .../monorepo/packages/submodule/test.js | 1 + test/fixtures/test-dependant/project/test.js | 1 + test/lint.js | 30 +++- test/utils/echo-server.js | 10 +- tsconfig.json | 6 +- 49 files changed, 631 insertions(+), 332 deletions(-) rename src/{types.ts => types.d.ts} (73%) delete mode 100755 test/acceptance.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de2ff7258..7a5b44bfe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,7 @@ jobs: - uses: actions/checkout@v2 - run: npm install - run: npm run lint + - run: ./cli.js ts -p check - name: dependencies run: ./cli.js dep-check -- -i aegir test-node: @@ -24,7 +25,7 @@ jobs: with: node-version: ${{ matrix.node }} - run: yarn - - run: npx nyc --reporter=lcov npm run test:node -- --bail + - run: npm run test:node -- --bail --cov - uses: codecov/codecov-action@v1 test-chrome: needs: check @@ -39,4 +40,4 @@ jobs: steps: - uses: actions/checkout@v2 - run: yarn - - run: npm run test:browser -- -- --browsers FirefoxHeadless \ No newline at end of file + - run: npm run test:browser -- -- --browser firefox \ No newline at end of file diff --git a/cli.js b/cli.js index 5df55fcd1..f3a6579a6 100755 --- a/cli.js +++ b/cli.js @@ -12,8 +12,7 @@ const kleur = require('kleur') const pkg = require('./package.json') updateNotifier({ - pkg: pkg, - isGlobal: false + pkg: pkg }).notify() const cli = require('yargs') @@ -24,11 +23,11 @@ cli .usage('Usage: $0 [options]') .example('$0 build', 'Runs the build command to bundle JS code for the browser.') .example('npx $0 build', 'Can be used with `npx` to use a local version') - .example('$0 test -t webworker -- --browsers Firefox', 'If the command supports `--` can be used to forward options to the underlying tool.') - .example('npm test -- -- --browsers Firefox', 'If `npm test` translates to `aegir test -t browser` and you want to forward options you need to use `-- --` instead.') + .example('$0 test -t webworker -- --browser firefox', 'If the command supports `--` can be used to forward options to the underlying tool.') + .example('npm test -- -- --browser firefox', 'If `npm test` translates to `aegir test -t browser` and you want to forward options you need to use `-- --` instead.') .epilog('Use `$0 --help` to learn more about each command.') .middleware((yargs) => { - yargs.config = userConfig + yargs.fileConfig = userConfig }) .commandDir('cmds') .help() diff --git a/cmds/release.js b/cmds/release.js index b88aebb5c..5b37637bb 100644 --- a/cmds/release.js +++ b/cmds/release.js @@ -1,105 +1,96 @@ 'use strict' +const { userConfig } = require('../src/config/user') + module.exports = { command: 'release', desc: 'Release your code onto the world', builder: { - target: { - alias: 't', - describe: 'In which target environment to execute the tests', - type: 'array', - choices: ['node', 'browser', 'webworker'], - default: ['node', 'browser', 'webworker'] - }, build: { describe: 'Run build tasks before release', type: 'boolean', - default: true + default: userConfig.release.build }, test: { describe: 'Run test tasks before release', type: 'boolean', - default: true + default: userConfig.release.test }, lint: { describe: 'Run lint task before release', type: 'boolean', - default: true + default: userConfig.release.lint }, contributors: { describe: 'Update contributors based on the git history', type: 'boolean', - default: true + default: userConfig.release.contributors }, bump: { describe: 'Bump the package version', type: 'boolean', - default: true + default: userConfig.release.bump }, changelog: { describe: 'Generate or update the CHANGELOG.md', type: 'boolean', - default: true + default: userConfig.release.changelog }, publish: { describe: 'Publish to npm', type: 'boolean', - default: true + default: userConfig.release.publish }, commit: { describe: 'Commit changes to git', type: 'boolean', - default: true + default: userConfig.release.commit }, tag: { describe: 'Create release tag in git', type: 'boolean', - default: true + default: userConfig.release.tag }, push: { describe: 'Push changes to GitHub', type: 'boolean', - default: true + default: userConfig.release.push }, ghrelease: { describe: 'Generate GitHub release', type: 'boolean', - default: true + default: userConfig.release.ghrelease }, docs: { describe: 'Generate and publish documentation', type: 'boolean', - default: true + default: userConfig.release.docs }, ghtoken: { describe: 'Access token for generating GitHub releases', type: 'string', - default: '' + default: userConfig.release.ghtoken }, type: { describe: 'The type of version bump for this release', type: 'string', choices: ['major', 'minor', 'patch', 'prepatch', 'preminor', 'premajor', 'prerelease'], - default: 'patch' + default: userConfig.release.type }, preid: { describe: 'The prerelease identifier', - type: 'string' - }, - files: { - alias: 'f', - describe: 'Custom globs for files to test', - type: 'array', - default: [] - }, - exit: { - describe: 'force shutdown of the event loop after test run: mocha will call process.exit', - type: 'boolean', - default: true + type: 'string', + default: userConfig.release.preid }, 'dist-tag': { describe: 'The npm tag to publish to', - type: 'string' + type: 'string', + default: userConfig.release.distTag + }, + remote: { + describe: 'Git remote', + type: 'string', + default: userConfig.release.remote } }, handler (argv) { diff --git a/package.json b/package.json index 1968591f2..3c97996ce 100644 --- a/package.json +++ b/package.json @@ -41,10 +41,7 @@ "lint": "node cli.js lint", "test:node": "node cli.js test -t node", "test:browser": "node cli.js test -t browser webworker", - "test:acceptance": "./test/acceptance.sh", "test": "npm run test:node && npm run test:browser", - "coverage": "node cli.js coverage -t node", - "watch": "node cli.js test -t node --watch", "release": "node cli.js release --no-docs --no-test --no-build", "release-minor": "node cli.js release --no-docs --no-build --no-test --type minor", "release-major": "node cli.js release --no-docs --no-build --no-test --type major" @@ -103,10 +100,9 @@ "ora": "^5.3.0", "p-map": "^4.0.0", "pascalcase": "^1.0.0", - "playwright-test": "hugomrdias/playwright-test#feat/esbuild", + "playwright-test": "^2.0.0", "polka": "^0.5.2", "premove": "^3.0.1", - "prompt-promise": "^1.0.3", "proper-lockfile": "^4.1.2", "read-pkg-up": "^7.0.1", "semver": "^7.3.4", @@ -122,21 +118,24 @@ }, "devDependencies": { "@types/bytes": "^3.1.0", + "@types/conventional-changelog": "^3.1.0", "@types/cors": "^2.8.9", "@types/eslint": "^7.2.6", "@types/fs-extra": "^9.0.7", "@types/gh-pages": "^3.0.0", "@types/listr": "^0.14.2", + "@types/pascalcase": "^1.0.0", "@types/polka": "^0.5.2", "@types/proper-lockfile": "^4.1.1", "@types/semver": "^7.3.4", + "@types/update-notifier": "^5.0.0", "@types/yargs": "^16.0.0", "electron": "^11.2.0", "iso-url": "^1.0.0", "sinon": "^9.2.3" }, "engines": { - "node": ">=12.0.0", + "node": ">=14.0.0", "npm": ">=6.0.0" }, "browserslist": [ diff --git a/src/checks/commitlint-travis.js b/src/checks/commitlint-travis.js index d55a9554b..1d62e7a2c 100644 --- a/src/checks/commitlint-travis.js +++ b/src/checks/commitlint-travis.js @@ -1,6 +1,7 @@ 'use strict' const execa = require('execa') +// @ts-ignore const commitlint = require('@commitlint/cli') // Allow to override used bins for testing purposes @@ -43,15 +44,24 @@ module.exports = async function main () { const [start, end] = RANGE.split('.').filter(Boolean) await lint(['--from', start, '--to', end]) } else { + // @ts-ignore const input = await log(COMMIT) await lint([], { input }) } } +/** + * @param {any[] | readonly string[] | undefined} args + * @param {any} [options] + */ function git (args, options) { return execa(GIT, args, Object.assign({}, { stdio: 'inherit' }, options)) } +/** + * + * @param {*} param0 + */ async function fetch ({ name, url }) { await git(['remote', 'add', name, url]) await git(['fetch', name, '--quiet']) @@ -64,6 +74,10 @@ async function isClean () { return !(result.stdout && result.stdout.trim()) } +/** + * @param {string[]} args + * @param {{ input: string; } | undefined} [options] + */ function lint (args, options) { return execa( COMMITLINT || commitlint, @@ -72,10 +86,14 @@ function lint (args, options) { '@commitlint/config-conventional', ...args ], + // @ts-ignore Object.assign({}, { stdio: ['pipe', 'inherit', 'inherit'] }, options) ) } +/** + * @param {string} hash + */ async function log (hash) { const result = await execa('git', [ 'log', diff --git a/src/config/user.js b/src/config/user.js index 520016dfc..80999e41c 100644 --- a/src/config/user.js +++ b/src/config/user.js @@ -63,12 +63,10 @@ const config = (searchFrom) => { throw new Error('Error finding your config file.') } - /** @type {Options} */ - const conf = merge( + const conf = /** @type {Options} */(merge( { // global options debug: false, - node: false, tsRepo: false, hooks: {}, // test cmd options @@ -116,18 +114,39 @@ const config = (searchFrom) => { publish: false, entryPoint: 'src/index.js' }, + // ts cmd options ts: { preset: undefined, include: [], copyFrom: 'src/**/*.d.ts', copyTo: 'dist' + }, + // release cmd options + release: { + build: true, + test: true, + lint: true, + contributors: true, + bump: true, + changelog: true, + publish: true, + commit: true, + tag: true, + push: true, + ghrelease: true, + docs: true, + ghtoken: '', + type: 'patch', + preid: undefined, + distTag: 'latest', + remote: 'origin' } }, userConfig, { hooks: normalizeHooks(userConfig.hooks) } - ) + )) return conf } diff --git a/src/dependency-check.js b/src/dependency-check.js index 32a98c5a3..4651d7cff 100644 --- a/src/dependency-check.js +++ b/src/dependency-check.js @@ -4,8 +4,8 @@ const path = require('path') const execa = require('execa') const merge = require('merge-options') -/** @typedef { import("execa").Options} ExecaOptions */ -/** @typedef { import("execa").ExecaChildProcess} ExecaChildProcess */ +/** @typedef {import("execa").Options} ExecaOptions */ +/** @typedef {import("execa").ExecaChildProcess} ExecaChildProcess */ const defaultInput = [ 'package.json', @@ -21,8 +21,8 @@ const commandNames = ['dependency-check', 'dep-check', 'dep'] * Returns true if the user invoked the command with non-flag or * optional args * - * @param {Array} input - input files maybe passed by the user, maybe defaults - * @param {Array} processArgs - process.argv or similar + * @param {string[]} input - input files maybe passed by the user, maybe defaults + * @param {string[]} processArgs - process.argv or similar * @returns {boolean} */ const hasPassedFileArgs = (input, processArgs) => { @@ -40,14 +40,15 @@ const hasPassedFileArgs = (input, processArgs) => { /** * Check dependencies * - * @param {object} argv - Command line arguments passed to the process. - * @param {Array} processArgs - Unparsed command line arguments used to start the process + * @param {*} argv - Command line arguments passed to the process. + * @param {string[]} processArgs - Unparsed command line arguments used to start the process * @param {ExecaOptions} execaOptions - execa options. * @returns {ExecaChildProcess} - Child process that does dependency check. */ const check = (argv = { _: [], input: [], ignore: [] }, processArgs = [], execaOptions) => { const forwardOptions = argv['--'] ? argv['--'] : [] let input = argv.input + /** @type {string[]} */ const ignore = argv.ignore if (argv.productionOnly) { @@ -93,6 +94,8 @@ const check = (argv = { _: [], input: [], ignore: [] }, processArgs = [], execaO ) } -module.exports = check -module.exports.defaultInput = defaultInput -module.exports.commandNames = commandNames +module.exports = { + check, + defaultInput, + commandNames +} diff --git a/src/docs/index.js b/src/docs/index.js index 37925fa41..4885235a9 100644 --- a/src/docs/index.js +++ b/src/docs/index.js @@ -88,7 +88,7 @@ const TASKS = new Listr( }, { title: 'Generating documentation', - task: docs + task: (ctx, task) => docs({ debug: ctx.debug, tsRepo: ctx.tsRepo, ...ctx.config.docs }, task) }, { title: 'Publish to GitHub Pages', @@ -97,7 +97,7 @@ const TASKS = new Listr( } ], { - renderer: 'default' + renderer: 'verbose' } ) diff --git a/src/fixtures.browser.js b/src/fixtures.browser.js index 5973b7938..f62d66927 100644 --- a/src/fixtures.browser.js +++ b/src/fixtures.browser.js @@ -2,8 +2,13 @@ 'use strict' const { Buffer } = require('buffer') -// note: filePath needs to be relative to the module root -module.exports = function loadFixtures (filePath, module) { +/** + * note: filePath needs to be relative to the module root + * + * @param {string} filePath + * @param {string} module + */ +function loadFixtures (filePath, module) { if (module) { filePath = module + '/' + filePath } @@ -12,6 +17,9 @@ module.exports = function loadFixtures (filePath, module) { // @dignifiedquire: I know this is considered bad practice (syncXhr), but it // makes testing life so much nicer! +/** + * @param {string} filePath + */ function syncXhr (filePath) { const target = filePath @@ -33,3 +41,5 @@ function syncXhr (filePath) { throw new Error(`Could not get the Fixture: ${filePath}`) } } + +module.exports = loadFixtures diff --git a/src/fixtures.js b/src/fixtures.js index 3a73929a5..84c455d93 100644 --- a/src/fixtures.js +++ b/src/fixtures.js @@ -1,14 +1,19 @@ 'use strict' const path = require('path') +const fs = require('fs') -// note: filePath needs to be relative to the module root -module.exports = function loadFixtures (filePath, module) { +/** + * note: filePath needs to be relative to the module root + * + * @param {string} filePath + * @param {string} [module] + */ +function loadFixtures (filePath, module = '') { if (module) { filePath = path.join(module, filePath) } - const fs = require('fs') const paths = [ path.join(process.cwd(), filePath), path.join(process.cwd(), 'node_modules', filePath), @@ -24,10 +29,15 @@ module.exports = function loadFixtures (filePath, module) { return fs.readFileSync(resourcePath) } +/** + * @param {string} filePath + */ function resolve (filePath) { try { return require.resolve(filePath) } catch (error) { // ignore error + return filePath } } +module.exports = loadFixtures diff --git a/src/publish-rc/index.js b/src/publish-rc/index.js index 88b895d2d..3ff6ba895 100644 --- a/src/publish-rc/index.js +++ b/src/publish-rc/index.js @@ -7,6 +7,9 @@ const path = require('path') const release = require('../release') const semver = require('semver') +/** + * @param {{ branch: string; remote: string; type: 'major' | 'minor' | 'patch'; prefix: any; preId: any; distTag: any; ghtoken: any; }} opts + */ async function publishRc (opts) { try { console.info(`Removing local copy of ${opts.branch}`) // eslint-disable-line no-console @@ -35,6 +38,7 @@ async function publishRc (opts) { console.info('Found version number', pkg.version) // eslint-disable-line no-console const version = pkg.version const newVersion = semver.inc(version, opts.type) + // @ts-ignore const newVersionBranch = `${opts.prefix}v${newVersion.split('.').filter((sub, i) => { return i < 2 }).join('.')}.x` @@ -48,11 +52,13 @@ async function publishRc (opts) { if (version.includes('-')) { // already a pre${opts.type}, change from prepatch, preminor, etc to 'prerelease' // e.g. 0.38.0-pre.1 -> 0.38.0-rc.0 + // @ts-ignore opts.type = 'release' } console.info('Creating', opts.preId) // eslint-disable-line no-console await release({ + // @ts-ignore type: `pre${opts.type}`, preid: opts.preId, 'dist-tag': opts.distTag, diff --git a/src/release/bump.js b/src/release/bump.js index 3a5a3ab7f..e257d2391 100644 --- a/src/release/bump.js +++ b/src/release/bump.js @@ -6,8 +6,13 @@ const fs = require('fs-extra') const { paths } = require('../utils') /** - * @param {{ type: any; preid: any; }} ctx - * @param {{ title: string; }} task + * @typedef {import('./../types').ReleaseOptions} ReleaseOptions + * @typedef {import('listr').ListrTaskWrapper} ListrTask + */ + +/** + * @param {{ type: ReleaseOptions["type"]; preid: ReleaseOptions["preid"]; }} ctx + * @param {ListrTask} task */ function bump (ctx, task) { const { type, preid } = ctx @@ -16,7 +21,6 @@ function bump (ctx, task) { .then((pkg) => { const version = pkg.version const newVersion = semver.inc(version, type, preid) - task.title += `: v${version} -> v${newVersion}` pkg.version = newVersion diff --git a/src/release/changelog.js b/src/release/changelog.js index e98b9dc15..a0f8ae2a8 100644 --- a/src/release/changelog.js +++ b/src/release/changelog.js @@ -4,11 +4,22 @@ const conventionalChangelog = require('conventional-changelog') const fs = require('fs-extra') const path = require('path') +/** + * @typedef {import('./../types').ReleaseOptions} ReleaseOptions + * @typedef {import('listr').ListrTaskWrapper} ListrTask + */ + +/** + * + * @param {*} ctx + * @param {ListrTask} task + */ function changelog (ctx, task) { const changelogPath = path.join(process.cwd(), 'CHANGELOG.md') const releaseCount = fs.existsSync(changelogPath) ? 1 : 0 + /** @type {Buffer} */ let current if (releaseCount === 0) { diff --git a/src/release/commit.js b/src/release/commit.js index 8ef292dd4..fa421e8e8 100644 --- a/src/release/commit.js +++ b/src/release/commit.js @@ -1,11 +1,12 @@ 'use strict' const git = require('simple-git/promise')(process.cwd()) -const { pkg } = require('../utils') +const { readJson, paths } = require('../utils') const files = ['package.json', 'CHANGELOG.md'] async function commit () { + const pkg = readJson(paths.package) await git.add(files) await git.commit( diff --git a/src/release/contributors.js b/src/release/contributors.js index 771e2c912..da9d1cef2 100644 --- a/src/release/contributors.js +++ b/src/release/contributors.js @@ -2,10 +2,13 @@ const git = require('simple-git/promise')(process.cwd()) const execa = require('execa') -const { paths } = require('../utils') +const { paths, fromAegir } = require('../utils') const contributors = async () => { - await execa('git-authors-cli', ['--print', 'false']) + await execa('git-authors-cli', ['--print', 'false'], { + localDir: fromAegir(), + preferLocal: true + }) const res = await git.status() diff --git a/src/release/github.js b/src/release/github.js index 6ef432721..f6aabb3a1 100644 --- a/src/release/github.js +++ b/src/release/github.js @@ -1,8 +1,15 @@ 'use strict' +// @ts-ignore const conventionalGithubReleaser = require('conventional-github-releaser') const { promisify } = require('util') +/** + * Github release + * + * @param {{ ghtoken: string; }} opts + * @returns {Promise} + */ function github (opts) { return promisify(conventionalGithubReleaser)({ type: 'oauth', diff --git a/src/release/index.js b/src/release/index.js index 242acf2fc..5ba16c3e9 100644 --- a/src/release/index.js +++ b/src/release/index.js @@ -5,8 +5,8 @@ const Listr = require('listr') const lint = require('../lint') const test = require('../test') const build = require('../build') -const utils = require('../utils') const docs = require('../docs') +const { userConfig } = require('./../config/user') const releaseChecks = require('./prerelease') const bump = require('./bump') @@ -18,71 +18,101 @@ const github = require('./github') const publish = require('./publish') const push = require('./push') -function release (opts) { - const tasks = new Listr([ - { - title: 'Lint', - task: (ctx) => lint({ ...ctx, silent: true }), - enabled: (ctx) => ctx.lint - }, - { - title: 'Test', - task: (ctx) => test.run({ ...ctx, progress: true }), - enabled: (ctx) => ctx.test - }, - { - title: 'Bump Version', - task: bump, - enabled: (ctx) => ctx.bump - }, - { - title: 'Build', - task: (ctx) => build(ctx), - enabled: (ctx) => ctx.build - }, - { - title: 'Update Contributors', - task: contributors, - enabled: (ctx) => ctx.contributors - }, - { - title: 'Generate Changelog', - task: changelog, - enabled: (ctx) => ctx.changelog - }, - { - title: 'Commit to Git', - task: commit, - enabled: (ctx) => ctx.commit - }, - { - title: 'Tag release', - task: tag, - enabled: (ctx) => ctx.tag - }, - { - title: 'Push to GitHub', - task: push, - enabled: (ctx) => ctx.push - }, - { - title: 'Generate GitHub Release', - task: github, - enabled: (ctx) => ctx.ghrelease - }, - { - title: 'Publish documentation', - task: () => docs, - enabled: (ctx) => ctx.docs - }, +/** + * @typedef {import('./../types').ReleaseOptions} ReleaseOptions + * @typedef {import('./../types').GlobalOptions} GlobalOptions + */ + +/** + * Release command + * + * @param {GlobalOptions & ReleaseOptions} opts + */ +async function release (opts) { + const globalOptions = { debug: opts.debug, tsRepo: opts.tsRepo } + const tasks = new Listr( + [ + { + title: 'Lint', + task: () => lint({ ...globalOptions, ...userConfig.lint, silent: true }), + enabled: (ctx) => ctx.lint + }, + { + title: 'Test', + task: () => + test.run( + { + ...globalOptions, + ...userConfig.test + }, + { + stdio: 'ignore' + } + ), + enabled: (ctx) => ctx.test + }, + { + title: 'Bump Version', + task: (ctx, task) => + bump({ type: opts.type, preid: opts.preid }, task), + enabled: (ctx) => ctx.bump + }, + { + title: 'Build', + task: () => build({ + ...globalOptions, + ...userConfig.build + }), + enabled: (ctx) => ctx.build + }, + { + title: 'Update Contributors', + task: contributors, + enabled: (ctx) => ctx.contributors + }, + { + title: 'Generate Changelog', + task: changelog, + enabled: (ctx) => ctx.changelog + }, + { + title: 'Commit to Git', + task: commit, + enabled: (ctx) => ctx.commit + }, + { + title: 'Tag release', + task: tag, + enabled: (ctx) => ctx.tag + }, + { + title: 'Push to GitHub', + task: push, + enabled: (ctx) => ctx.push + }, + { + title: 'Generate GitHub Release', + task: () => github({ ghtoken: opts.ghtoken }), + enabled: (ctx) => ctx.ghrelease + }, + { + title: 'Publish documentation', + task: () => docs, + enabled: (ctx) => ctx.docs + }, + { + title: 'Publish to npm', + task: (ctx, task) => publish(opts, task), + enabled: (ctx) => ctx.publish + } + ], { - title: 'Publish to npm', - task: publish, - enabled: (ctx) => ctx.publish + renderer: 'verbose' } - ], utils.getListrConfig()) + ) - return releaseChecks(opts).then(() => tasks.run(opts)) + await releaseChecks(opts) + return tasks.run(opts) } module.exports = release diff --git a/src/release/prerelease.js b/src/release/prerelease.js index 54b9dc64c..d3a49f4fb 100644 --- a/src/release/prerelease.js +++ b/src/release/prerelease.js @@ -2,17 +2,15 @@ const execa = require('execa') -// Check if there are valid GitHub credentials for publishing this module -function validGh (opts) { - if (!opts.ghrelease) { - return Promise.resolve(true) +/** + * Check if there are valid GitHub credentials for publishing this module + * + * @param {{ ghrelease: boolean; ghtoken: string; }} opts + */ +async function validGh (opts) { + if (opts.ghrelease && !opts.ghtoken) { + throw new Error('Missing GitHub access token. Have you set `AEGIR_GHTOKEN`?') } - - if (!opts.ghtoken) { - return Promise.reject(new Error('Missing GitHub access token. ' + - 'Have you set `AEGIR_GHTOKEN`?')) - } - return Promise.resolve() } // Is the current git workspace dirty? @@ -24,14 +22,20 @@ async function isDirty () { } } -// Validate that all requirements are met before starting the release -// - No dirty git -// - github token for github release, if github release is enabled +/** + * Validate that all requirements are met before starting the release + * - No dirty git + * - github token for github release, if github release is enabled + * + * @param {{ ghrelease: boolean; ghtoken: string; }} opts + */ function prerelease (opts) { - return Promise.all([ - isDirty(), - validGh(opts) - ]) + return Promise.all( + [ + isDirty(), + validGh(opts) + ] + ) } module.exports = prerelease diff --git a/src/release/publish.js b/src/release/publish.js index 67eba34d8..90f22198b 100644 --- a/src/release/publish.js +++ b/src/release/publish.js @@ -1,14 +1,22 @@ 'use strict' const execa = require('execa') -const prompt = require('prompt-promise') +const { otp } = require('../utils') +/** + * @typedef {import('./../types').ReleaseOptions} ReleaseOptions + * @typedef {import('listr').ListrTaskWrapper} ListrTask + */ +/** + * @param {{ distTag: ReleaseOptions["distTag"], type: ReleaseOptions["type"] }} ctx + * @param {ListrTask} task + */ function publish (ctx, task) { let publishArgs = ['publish'] - let distTag = ctx['dist-tag'] + let distTag = ctx.distTag // Prevent accidental publish of prerelease to "latest" - if (ctx.type.startsWith('pre') && !distTag) { + if (ctx.type.startsWith('pre') && distTag === 'latest') { distTag = 'next' } @@ -18,10 +26,11 @@ function publish (ctx, task) { } return execa('npm', publishArgs) - .catch(error => { + .catch(async (error) => { if (error.toString().includes('provide a one-time password')) { - return prompt.password('Enter an npm OTP: ') - .then(otp => execa('npm', publishArgs.concat('--otp', otp.trim()))) + const code = await otp() + task.title += '. Trying again with OTP.' + return await execa('npm', publishArgs.concat('--otp', code)) } throw error diff --git a/src/release/push.js b/src/release/push.js index af776645f..6195e50a7 100644 --- a/src/release/push.js +++ b/src/release/push.js @@ -3,18 +3,20 @@ const git = require('simple-git/promise')(process.cwd()) const execa = require('execa') +/** + * @param {{ remote: string; }} opts + */ async function push (opts) { - const remote = opts.remote || 'origin' const branch = (await execa('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: process.cwd() })).stdout return git.push( - remote, + opts.remote, branch, { // Linter and tests were already run by previous steps - '--no-verify': true, - '--tags': true + '--no-verify': null, + '--tags': null } ) } diff --git a/src/release/tag.js b/src/release/tag.js index ff8086735..2c495200c 100644 --- a/src/release/tag.js +++ b/src/release/tag.js @@ -2,9 +2,10 @@ const git = require('simple-git/promise')(process.cwd()) -const { pkg } = require('../utils') +const { paths, readJson } = require('../utils') async function tag () { + const pkg = readJson(paths.package) await git.addTag(`v${pkg.version}`) } diff --git a/src/test-dependant/index.js b/src/test-dependant/index.js index e7b37744b..fb9dcb8e8 100644 --- a/src/test-dependant/index.js +++ b/src/test-dependant/index.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ 'use strict' const path = require('path') @@ -8,47 +9,78 @@ const { const fs = require('fs-extra') const glob = require('it-glob') +/** + * @param {string} name + * @param {{ dependencies: any; }} pkg + */ const isDep = (name, pkg) => { return Object.keys(pkg.dependencies || {}).filter(dep => dep === name).pop() } +/** + * @param {string} name + * @param {{ devDependencies: any; }} pkg + */ const isDevDep = (name, pkg) => { return Object.keys(pkg.devDependencies || {}).filter(dep => dep === name).pop() } +/** + * @param {string} name + * @param {{ optionalDendencies: any; }} pkg + */ const isOptionalDep = (name, pkg) => { return Object.keys(pkg.optionalDendencies || {}).filter(dep => dep === name).pop() } +/** + * @param {string} name + * @param {any} pkg + */ const dependsOn = (name, pkg) => { return isDep(name, pkg) || isDevDep(name, pkg) || isOptionalDep(name, pkg) } +/** + * @param {string} targetDir + */ const isMonoRepo = (targetDir) => { return fs.existsSync(path.join(targetDir, 'lerna.json')) } +/** + * @param {string} targetDir + */ const hasNpmLock = (targetDir) => { return fs.existsSync(path.join(targetDir, 'package-lock.json')) || fs.existsSync(path.join(targetDir, 'npm-shrinkwrap.json')) } +/** + * @param {string} targetDir + */ const hasYarnLock = (targetDir) => { return fs.existsSync(path.join(targetDir, 'yarn.lock')) } +/** + * @param {string} message + */ const printFailureMessage = (message) => { - console.info('-------------------------------------------------------------------') // eslint-disable-line no-console - console.info('') // eslint-disable-line no-console - console.info(message) // eslint-disable-line no-console - console.info('') // eslint-disable-line no-console - console.info('Dependant project has not been tested with updated dependencies') // eslint-disable-line no-console - console.info('') // eslint-disable-line no-console - console.info('-------------------------------------------------------------------') // eslint-disable-line no-console + console.info('-------------------------------------------------------------------') + console.info('') + console.info(message) + console.info('') + console.info('Dependant project has not been tested with updated dependencies') + console.info('') + console.info('-------------------------------------------------------------------') } +/** + * @param {string} targetDir + */ const installDependencies = async (targetDir) => { - console.info('Installing dependencies') // eslint-disable-line no-console + console.info('Installing dependencies') if (hasYarnLock(targetDir)) { await exec('yarn', ['install'], { cwd: targetDir @@ -64,6 +96,10 @@ const installDependencies = async (targetDir) => { } } +/** + * @param {string} targetDir + * @param {{ [x: string]: any; }} deps + */ const upgradeDependenciesInDir = async (targetDir, deps) => { const modulePkgPath = path.join(targetDir, 'package.json') const modulePkg = require(modulePkgPath) @@ -73,11 +109,11 @@ const upgradeDependenciesInDir = async (targetDir, deps) => { modulePkg.optionalDependencies = modulePkg.optionalDependencies || {} modulePkg.devDependencies = modulePkg.devDependencies || {} - console.info('Upgrading deps') // eslint-disable-line no-console + console.info('Upgrading deps') for (const dep of Object.keys(deps)) { const existingVersion = modulePkg.dependencies[dep] || modulePkg.peerDependencies[dep] || modulePkg.optionalDependencies[dep] || modulePkg.devDependencies[dep] - console.info('Upgrading', dep, 'from version', existingVersion, 'to', deps[dep]) // eslint-disable-line no-console + console.info('Upgrading', dep, 'from version', existingVersion, 'to', deps[dep]) if (modulePkg.dependencies[dep] || modulePkg.peerDependencies[dep] || modulePkg.optionalDependencies[dep]) { modulePkg.dependencies[dep] = deps[dep] @@ -93,6 +129,10 @@ const upgradeDependenciesInDir = async (targetDir, deps) => { }) } +/** + * @param {string} targetDir + * @param {{}} deps + */ const testModule = async (targetDir, deps) => { const pkgPath = path.join(targetDir, 'package.json') @@ -124,7 +164,7 @@ const testModule = async (targetDir, deps) => { cwd: targetDir }) } catch (err) { - printFailureMessage(`Failed to run the tests of ${modulePkg.name}, aborting`, err.message) + printFailureMessage(`Failed to run the tests of ${modulePkg.name}, aborting ${err.message}`) return } @@ -138,11 +178,19 @@ const testModule = async (targetDir, deps) => { }) } +/** + * @param {string} targetDir + * @param {any} deps + */ const testRepo = async (targetDir, deps) => { await installDependencies(targetDir) await testModule(targetDir, deps) } +/** + * @param {string} targetDir + * @param {any} deps + */ const testMonoRepo = async (targetDir, deps) => { await installDependencies(targetDir) @@ -178,10 +226,13 @@ const testMonoRepo = async (targetDir, deps) => { } } +/** + * @param {{ repo: string; branch: string; deps: any; }} opts + */ async function testDependant (opts) { const targetDir = path.join(os.tmpdir(), `test-dependant-${Date.now()}`) - console.info(`Cloning ${opts.repo} into ${targetDir}`) // eslint-disable-line no-console + console.info(`Cloning ${opts.repo} into ${targetDir}`) await exec('git', ['clone', opts.repo, targetDir], { quiet: true }) @@ -198,7 +249,7 @@ async function testDependant (opts) { await testRepo(targetDir, opts.deps) } - console.info(`Removing ${targetDir}`) // eslint-disable-line no-console + console.info(`Removing ${targetDir}`) await fs.remove(targetDir) } diff --git a/src/test/browser.js b/src/test/browser.js index b94c4ce53..658708ed6 100644 --- a/src/test/browser.js +++ b/src/test/browser.js @@ -33,7 +33,7 @@ module.exports = async (argv, execaOptions) => { ] // pre hook - const pre = await hook('browser', 'pre')(argv.config) + const pre = await hook('browser', 'pre')(argv.fileConfig) const preEnv = pre && pre.env ? pre.env : {} // run pw-test @@ -62,5 +62,5 @@ module.exports = async (argv, execaOptions) => { ) // post hook - await hook('browser', 'post')(argv.config) + await hook('browser', 'post')(argv.fileConfig) } diff --git a/src/test/electron.js b/src/test/electron.js index 5deb71f5c..609753a44 100644 --- a/src/test/electron.js +++ b/src/test/electron.js @@ -2,6 +2,7 @@ const path = require('path') const execa = require('execa') const { hook, getElectron } = require('../utils') +const merge = require('merge-options') /** * @typedef {import("execa").Options} ExecaOptions @@ -11,8 +12,9 @@ const { hook, getElectron } = require('../utils') /** * * @param {TestOptions & GlobalOptions} argv + * @param {ExecaOptions} execaOptions */ -module.exports = async (argv) => { +module.exports = async (argv, execaOptions) => { const forwardOptions = argv['--'] ? argv['--'] : [] const watch = argv.watch ? ['--watch'] : [] const files = argv.files.length > 0 ? [...argv.files] : ['test/**/*.spec.{js,ts}'] @@ -24,33 +26,37 @@ module.exports = async (argv) => { const ts = argv.tsRepo ? ['--require', require.resolve('esbuild-register')] : [] // pre hook - const pre = await hook('browser', 'pre')(argv.config) + const pre = await hook('browser', 'pre')(argv.fileConfig) const preEnv = pre && pre.env ? pre.env : {} const electronPath = await getElectron() - await execa('electron-mocha', [ - ...files, - ...watch, - ...grep, - ...progress, - ...bail, - ...timeout, - ...ts, - '--colors', - '--full-trace', - ...renderer, - ...forwardOptions - ], { - localDir: path.join(__dirname, '../..'), - preferLocal: true, - stdio: 'inherit', - env: { - AEGIR_RUNNER: argv.runner, - NODE_ENV: process.env.NODE_ENV || 'test', - ELECTRON_PATH: electronPath, - ...preEnv - } - }) + await execa('electron-mocha', + [ + ...files, + ...watch, + ...grep, + ...progress, + ...bail, + ...timeout, + ...ts, + '--colors', + '--full-trace', + ...renderer, + ...forwardOptions + ], + merge({ + localDir: path.join(__dirname, '../..'), + preferLocal: true, + stdio: 'inherit', + env: { + AEGIR_RUNNER: argv.runner, + NODE_ENV: process.env.NODE_ENV || 'test', + ELECTRON_PATH: electronPath, + ...preEnv + } + }, + execaOptions) + ) // post hook - await hook('browser', 'post')(argv.config) + await hook('browser', 'post')(argv.fileConfig) } diff --git a/src/test/index.js b/src/test/index.js index f66c6a306..6ba0bc63b 100644 --- a/src/test/index.js +++ b/src/test/index.js @@ -48,8 +48,9 @@ const TASKS = [ title: 'Test Electron Main', /** * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions */ - task: (opts) => electron({ ...opts, runner: 'electron-main' }), + task: (opts, execaOptions) => electron({ ...opts, runner: 'electron-main' }, execaOptions), /** * @param {TestOptions & GlobalOptions} ctx */ @@ -59,8 +60,9 @@ const TASKS = [ title: 'Test Electron Renderer', /** * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions */ - task: (opts) => electron({ ...opts, runner: 'electron-renderer' }), + task: (opts, execaOptions) => electron({ ...opts, runner: 'electron-renderer' }, execaOptions), /** * @param {TestOptions & GlobalOptions} ctx */ @@ -75,13 +77,14 @@ module.exports = { * @param {TestOptions & GlobalOptions} opts * @param {ExecaOptions} execaOptions */ - run (opts, execaOptions) { + run (opts, execaOptions = {}) { return pmap(TASKS, (task) => { if (!task.enabled(opts)) { return Promise.resolve() } - - console.log(task.title) // eslint-disable-line no-console + if (execaOptions.stdio !== 'ignore') { + console.log(task.title) // eslint-disable-line no-console + } return task.task(opts, execaOptions) }, { concurrency: 1 }) } diff --git a/src/test/node.js b/src/test/node.js index 43e5c61ab..088e2f713 100644 --- a/src/test/node.js +++ b/src/test/node.js @@ -65,7 +65,7 @@ async function testNode (argv, execaOptions) { } // pre hook - const pre = await hook('node', 'pre')(argv.config) + const pre = await hook('node', 'pre')(argv.fileConfig) const preEnv = pre && pre.env ? pre.env : {} // run mocha @@ -85,7 +85,7 @@ async function testNode (argv, execaOptions) { ) ) // post hook - await hook('node', 'post')(argv.config) + await hook('node', 'post')(argv.fileConfig) } module.exports = testNode diff --git a/src/ts/typedoc-plugin.js b/src/ts/typedoc-plugin.js index 3c875d8ff..68cc68e18 100644 --- a/src/ts/typedoc-plugin.js +++ b/src/ts/typedoc-plugin.js @@ -3,9 +3,14 @@ const { Converter } = require('typedoc/dist/lib/converter') const path = require('path') const fs = require('fs') -module.exports = function (PluginHost) { +/** + * + * @param {import("typedoc/dist/lib/utils").PluginHost} PluginHost + */ +const plugin = function (PluginHost) { const app = PluginHost.owner const pkg = path.join(process.cwd(), 'package.json') + /** @type {any} */ let pkgJson try { @@ -22,6 +27,7 @@ module.exports = function (PluginHost) { if (pkgJson && reflection.name === 'export=') { let name if (node) { + // @ts-ignore name = node.symbol.escapedName } reflection.name = `${name || 'default'}` @@ -29,3 +35,5 @@ module.exports = function (PluginHost) { } app.converter.on(Converter.EVENT_CREATE_DECLARATION, cb) } + +module.exports = plugin diff --git a/src/types.ts b/src/types.d.ts similarity index 73% rename from src/types.ts rename to src/types.d.ts index 21c6ac97a..3b2b57941 100644 --- a/src/types.ts +++ b/src/types.d.ts @@ -1,4 +1,4 @@ - +import type esbuild from 'esbuild' /** * Options for CLI and local file config * @@ -25,7 +25,10 @@ interface Options extends GlobalOptions { * Options for the `test` command */ test: TestOptions - + /** + * Options for the `release` command + */ + release: ReleaseOptions } interface GlobalOptions { @@ -49,11 +52,11 @@ interface GlobalOptions { /** * Hooks */ - hooks: any + hooks?: any /** * Full config from configuration file */ - config: Options + fileConfig?: Options } interface BuildOptions { @@ -70,9 +73,13 @@ interface BuildOptions { */ bundlesizeMax: string /** - * Build the Typescripts type declarations. + * Build the Typescript type declarations. */ types: boolean + /** + * esbuild build options + */ + config: esbuild.CommonOptions } interface TSOptions { @@ -168,6 +175,47 @@ interface TestOptions { } } +interface ReleaseOptions { + build: boolean + test: boolean + lint: boolean + contributors: boolean + bump: boolean + changelog: boolean + publish: boolean + commit: boolean + tag: boolean + push: boolean + /** + * Generate GitHub release + */ + ghrelease: boolean + /** + * Generate and publish documentation + */ + docs: boolean + /** + * Access token for generating GitHub releases + */ + ghtoken: string + /** + * The type of version bump for this release + */ + type: 'major' | 'minor' | 'patch' | 'prepatch' | 'preminor' | 'premajor' | 'prerelease' + /** + * Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. + */ + preid: string + /** + * The npm tag to publish to + */ + distTag: string + /** + * Git remote + */ + remote: string +} + export type { Options, GlobalOptions, @@ -175,5 +223,6 @@ export type { TSOptions, DocsOptions, LintOptions, - TestOptions + TestOptions, + ReleaseOptions } diff --git a/src/update-last-successful-build/index.js b/src/update-last-successful-build/index.js index 6ef7f2200..a85308ca1 100644 --- a/src/update-last-successful-build/index.js +++ b/src/update-last-successful-build/index.js @@ -10,12 +10,18 @@ async function findCurrentBranch () { return result.stdout.replace('ref: ', '').trim() } +/** + * @param {{ message?: string; branch?: any; remote: any; }} opts + */ async function findMasterCommit (opts) { const result = await exec('git', ['show-ref', '-s', `${opts.remote}/master`]) return result.stdout.trim() } +/** + * @param {{ message: string; branch: any; remote: string; }} opts + */ async function isHeadOfMaster (opts) { const master = await findMasterCommit(opts) const branch = await findCurrentBranch() @@ -24,6 +30,9 @@ async function isHeadOfMaster (opts) { return branch === 'refs/heads/master' || branch === master } +/** + * @param {{ message: string; branch: any; remote: string; }} opts + */ async function updateLastSuccessfulBuild (opts) { if (!isHeadOfMaster(opts)) { console.info('Will only run on the master branch') // eslint-disable-line no-console diff --git a/src/update-rc/index.js b/src/update-rc/index.js index b3b23b2fd..70dabd0d0 100644 --- a/src/update-rc/index.js +++ b/src/update-rc/index.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ 'use strict' const { @@ -5,11 +6,14 @@ const { } = require('../utils') const release = require('../release') +/** + * @param {{ branch: string; remote: any; preId: any; distTag: any; ghtoken: any; }} opts + */ async function updateRc (opts) { await exec('git', ['checkout', 'master']) try { - console.info(`Removing local copy of ${opts.branch}`) // eslint-disable-line no-console + console.info(`Removing local copy of ${opts.branch}`) await exec('git', ['branch', '-D', opts.branch]) } catch (err) { if (!err.message.includes(`branch '${opts.branch}' not found`)) { @@ -17,32 +21,36 @@ async function updateRc (opts) { } } - console.info('Fetching repo history') // eslint-disable-line no-console + console.info('Fetching repo history') await exec('git', ['fetch']) - console.info(`Checking out branch ${opts.branch}`) // eslint-disable-line no-console + console.info(`Checking out branch ${opts.branch}`) await exec('git', ['checkout', '--track', `${opts.remote}/${opts.branch}`]) - console.info('Removing dependencies') // eslint-disable-line no-console + console.info('Removing dependencies') await exec('rm', ['-rf', 'node_modules', 'package-lock.json']) - console.info('Installing dependencies') // eslint-disable-line no-console + console.info('Installing dependencies') await exec('npm', ['ci']) - console.info('Updating', opts.preId) // eslint-disable-line no-console + console.info('Updating', opts.preId) await release({ + debug: false, + tsRepo: false, type: 'prerelease', preid: opts.preId, - 'dist-tag': opts.distTag, + distTag: opts.distTag, build: false, test: false, lint: false, - docsFormats: ['html'], contributors: true, bump: true, changelog: true, publish: true, ghrelease: true, + commit: true, + tag: true, + push: true, docs: true, ghtoken: opts.ghtoken || process.env.AEGIR_GHTOKEN, remote: opts.remote diff --git a/src/update-release-branch-lockfiles/index.js b/src/update-release-branch-lockfiles/index.js index 9973198df..8ad265733 100644 --- a/src/update-release-branch-lockfiles/index.js +++ b/src/update-release-branch-lockfiles/index.js @@ -4,6 +4,9 @@ const { exec } = require('../utils') +/** + * @param {{ branch: string; remote: string; message: string; }} opts + */ async function updateReleaseBranchLockfiles (opts) { // when (eventually) run on CI, deps should already be present so need to // remove the lines that remove the node_modules folder diff --git a/src/utils.js b/src/utils.js index 262f03f6e..05aa824db 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ /** * Various utility methods used in AEgir. * @@ -12,13 +13,16 @@ const stripComments = require('strip-json-comments') const stripBom = require('strip-bom') const { download } = require('@electron/get') const path = require('path') +const readline = require('readline') const readPkgUp = require('read-pkg-up') const fs = require('fs-extra') const execa = require('execa') const envPaths = require('env-paths')('aegir', { suffix: '' }) const lockfile = require('proper-lockfile') const { + // @ts-ignore packageJson: pkg, + // @ts-ignore path: pkgPath } = readPkgUp.sync({ cwd: fs.realpathSync(process.cwd()) @@ -29,8 +33,17 @@ const TEST_FOLDER = 'test' exports.pkg = pkg exports.repoDirectory = path.dirname(pkgPath) +/** + * @param {string[]} p + */ exports.fromRoot = (...p) => path.join(exports.repoDirectory, ...p) +/** + * @param {string[]} p + */ exports.hasFile = (...p) => fs.existsSync(exports.fromRoot(...p)) +/** + * @param {string[]} p + */ exports.fromAegir = (...p) => path.join(__dirname, '..', ...p) exports.hasTsconfig = exports.hasFile('tsconfig.json') @@ -100,9 +113,11 @@ exports.exec = (command, args, options = {}) => { const result = execa(command, args, options) if (!options.quiet) { + // @ts-ignore result.stdout.pipe(process.stdout) } + // @ts-ignore result.stderr.pipe(process.stderr) return result @@ -127,6 +142,7 @@ function getPlatformPath () { } exports.getElectron = async () => { + // @ts-ignore const pkg = require('./../package.json') const lockfilePath = path.join(envPaths.cache, '__electron-lock') @@ -195,3 +211,29 @@ exports.gzipSize = (path) => { }) }) } + +exports.otp = () => { + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout + }) + const otp = [] + return new Promise((resolve, reject) => { + rl.question('OTP: ', answer => { + resolve(answer) + console.log('\n') + rl.close() + }) + // @ts-ignore + rl._writeToOutput = function _writeToOutput (k) { + otp.push(k) + if (otp.length === 6) { + // @ts-ignore + rl.write(null, { name: 'enter' }) + } else { + // @ts-ignore + rl.output.write('*') + } + } + }) +} diff --git a/test/acceptance.sh b/test/acceptance.sh deleted file mode 100755 index fc081f7af..000000000 --- a/test/acceptance.sh +++ /dev/null @@ -1,55 +0,0 @@ -#! /usr/bin/env bash - -# Acceptance test for making sure aegir works as we want it to - -set -e - -# Debug -# set -x - -echo "## Creating a link to current AEgir" -npm link - -echo "## Creating test directory" -TEST_DIR=$(mktemp -d) - -cd $TEST_DIR - -echo "## Cloning aegir-test-repo" -git clone https://github.com/ipfs/aegir-test-repo - -cd aegir-test-repo - -echo "## Installing dependencies for aegir-test-repo" -npm install - -echo "## Linking current AEgir into aegir-test-repo" -npm link aegir - -echo "## Running build command" -npm run build - -echo "## Making sure right files were created" - -if [ ! -d "dist" ]; then - echo "'dist/' directory wasn't created correctly " - exit 1 -fi - -if [ ! -e "dist/index.js" ]; then - echo "'dist/index.js' file wasn't created correctly " - exit 1 -fi - -if [ ! -e "dist/index.min.js" ]; then - echo "'dist/index.min.js' file wasn't created correctly " - exit 1 -fi - -if [ ! -e "dist/index.min.js.map" ]; then - echo "'dist/index.min.js.map' file wasn't created correctly " - exit 1 -fi - -echo "## Cleaning up" -rm -rf $TEST_DIR diff --git a/test/config/fixtures/custom-config-package-json/package.json b/test/config/fixtures/custom-config-package-json/package.json index 70ca3c2cf..a7f1f0962 100644 --- a/test/config/fixtures/custom-config-package-json/package.json +++ b/test/config/fixtures/custom-config-package-json/package.json @@ -1,6 +1,6 @@ { "name": "custom-config", "aegir": { - "custom": true + "debug": true } } \ No newline at end of file diff --git a/test/config/user.js b/test/config/user.js index 62fb4fbd0..0fbcf1053 100644 --- a/test/config/user.js +++ b/test/config/user.js @@ -6,7 +6,7 @@ const { config } = require('../../src/config/user') const path = require('path') describe('config - user', () => { - it('custom config', () => { + it('custom config', async () => { const conf = config(path.join(__dirname, 'fixtures/custom-config')) expect(conf).to.have.property('webpack').eql({ devtool: 'eval' @@ -18,9 +18,8 @@ describe('config - user', () => { expect(conf.hooks).to.have.nested.property('node.pre') expect(conf.hooks).to.have.nested.property('node.post') - return conf.hooks.browser.pre().then((res) => { - expect(res).to.eql('pre') - }) + const res = await conf.hooks.browser.pre() + expect(res).to.eql('pre') }) it('supports async hooks', async () => { const conf = config(path.join(__dirname, 'fixtures/custom-user-async-hooks')) @@ -29,6 +28,6 @@ describe('config - user', () => { }) it('supports async hooks', async () => { const conf = config(path.join(__dirname, 'fixtures/custom-config-package-json')) - expect(await conf.custom).to.ok() + expect(conf.debug).to.ok() }) }) diff --git a/test/dependants.js b/test/dependants.js index 9c221efe0..d0fbbb8ae 100644 --- a/test/dependants.js +++ b/test/dependants.js @@ -8,39 +8,53 @@ const path = require('path') const bin = require.resolve('../') const os = require('os') +/** @type {any} */ const dirs = {} -const git = { - init: async (name) => { - const source = path.join(__dirname, 'fixtures', 'test-dependant', name) - dirs[name] = path.join(os.tmpdir(), `repo-${Math.random()}`) +const git = + { + /** + * @param {string} name + */ + init: async (name) => { + const source = path.join(__dirname, 'fixtures', 'test-dependant', name) + dirs[name] = path.join(os.tmpdir(), `repo-${Math.random()}`) - await fs.mkdir(dirs[name]) - await fs.copy(source, dirs[name]) + await fs.mkdir(dirs[name]) + await fs.copy(source, dirs[name]) - await execa('git', ['init'], { - cwd: dirs[name] - }) - await execa('git', ['config', 'user.email', 'test@test.com'], { - cwd: dirs[name] - }) - await execa('git', ['config', 'user.name', 'test'], { - cwd: dirs[name] - }) - await git.add(name) - await git.commit(name, 'initial commit') - }, - add: async (name) => { - await execa('git', ['add', '-A'], { - cwd: dirs[name] - }) - }, - commit: async (name, message) => { - await execa('git', ['commit', '-m', message, '--no-gpg-sign'], { - cwd: dirs[name] - }) - } -} + await execa('git', ['init'], { + cwd: dirs[name] + }) + await execa('git', ['config', 'user.email', 'test@test.com'], { + cwd: dirs[name] + }) + await execa('git', ['config', 'user.name', 'test'], { + cwd: dirs[name] + }) + await git.add(name) + await git.commit(name, 'initial commit') + }, + /** + * + * @param {string} name + */ + add: async (name) => { + await execa('git', ['add', '-A'], { + cwd: dirs[name] + }) + }, + /** + * + * @param {string} name + * @param {string} message + */ + commit: async (name, message) => { + await execa('git', ['commit', '-m', message, '--no-gpg-sign'], { + cwd: dirs[name] + }) + } + } describe('dependants', function () { this.timeout(120000) diff --git a/test/dependency-check.js b/test/dependency-check.js index e1da06952..c018a0223 100644 --- a/test/dependency-check.js +++ b/test/dependency-check.js @@ -1,7 +1,7 @@ /* eslint-env mocha */ 'use strict' -const check = require('../src/dependency-check') +const { check, defaultInput } = require('../src/dependency-check') const { expect } = require('../utils/chai') const path = require('path') const merge = require('merge-options') @@ -12,13 +12,17 @@ const yargsv = (overrides = {}) => { _: [ 'dependency-check' ], - input: check.defaultInput, + input: defaultInput, ignore: [] } return merge(argv, overrides) } +/** + * + * @param {string[] | string} input + */ const argv = (input = []) => { return [ 'node', 'aegir', 'dependency-check' diff --git a/test/fixtures.js b/test/fixtures.js index 587086749..4399f4439 100644 --- a/test/fixtures.js +++ b/test/fixtures.js @@ -8,7 +8,7 @@ const path = require('path') describe('fixtures', () => { it('should load fixtures from dependencies', () => { const myFixture = loadFixture('package.json', 'mocha') - expect(JSON.parse(myFixture).name).to.be.eql('mocha') + expect(JSON.parse(myFixture.toString()).name).to.be.eql('mocha') }) it('should load local fixtures', () => { diff --git a/test/fixtures/dependency-check/fail-prod/index.js b/test/fixtures/dependency-check/fail-prod/index.js index 1745c39f3..2d603b5f0 100644 --- a/test/fixtures/dependency-check/fail-prod/index.js +++ b/test/fixtures/dependency-check/fail-prod/index.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' /* eslint-disable no-unused-vars */ const execa = require('execa') diff --git a/test/fixtures/dependency-check/fail/index.js b/test/fixtures/dependency-check/fail/index.js index 1745c39f3..2d603b5f0 100644 --- a/test/fixtures/dependency-check/fail/index.js +++ b/test/fixtures/dependency-check/fail/index.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' /* eslint-disable no-unused-vars */ const execa = require('execa') diff --git a/test/fixtures/dependency-check/pass-certain-files/derp/foo.js b/test/fixtures/dependency-check/pass-certain-files/derp/foo.js index 1745c39f3..2d603b5f0 100644 --- a/test/fixtures/dependency-check/pass-certain-files/derp/foo.js +++ b/test/fixtures/dependency-check/pass-certain-files/derp/foo.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' /* eslint-disable no-unused-vars */ const execa = require('execa') diff --git a/test/fixtures/dependency-check/pass-certain-files/index.js b/test/fixtures/dependency-check/pass-certain-files/index.js index 9ec021827..1b23eb4a9 100644 --- a/test/fixtures/dependency-check/pass-certain-files/index.js +++ b/test/fixtures/dependency-check/pass-certain-files/index.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' /* eslint-disable no-unused-vars */ const pico = require('pico') diff --git a/test/fixtures/dependency-check/pass/index.js b/test/fixtures/dependency-check/pass/index.js index 9fadebd1b..165acb9d5 100644 --- a/test/fixtures/dependency-check/pass/index.js +++ b/test/fixtures/dependency-check/pass/index.js @@ -1,4 +1,5 @@ 'use strict' /* eslint-disable no-unused-vars */ +// @ts-ignore const execa = require('execa') diff --git a/test/fixtures/dependency-check/with-aegir-config/index.js b/test/fixtures/dependency-check/with-aegir-config/index.js index 9ec021827..1b23eb4a9 100644 --- a/test/fixtures/dependency-check/with-aegir-config/index.js +++ b/test/fixtures/dependency-check/with-aegir-config/index.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' /* eslint-disable no-unused-vars */ const pico = require('pico') diff --git a/test/fixtures/test-dependant/monorepo/packages/submodule/test.js b/test/fixtures/test-dependant/monorepo/packages/submodule/test.js index e4bfac0af..79eb73902 100644 --- a/test/fixtures/test-dependant/monorepo/packages/submodule/test.js +++ b/test/fixtures/test-dependant/monorepo/packages/submodule/test.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' const pkg = require('it-all/package.json') diff --git a/test/fixtures/test-dependant/project/test.js b/test/fixtures/test-dependant/project/test.js index e4bfac0af..79eb73902 100644 --- a/test/fixtures/test-dependant/project/test.js +++ b/test/fixtures/test-dependant/project/test.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' const pkg = require('it-all/package.json') diff --git a/test/lint.js b/test/lint.js index 60816eefb..5e75073d1 100644 --- a/test/lint.js +++ b/test/lint.js @@ -37,7 +37,11 @@ const setupProjectWithDeps = deps => setupProject({ */ const projectShouldPassLint = async (project) => { await setupProject(project) - await lint(userConfig.lint) + await lint({ + debug: false, + tsRepo: false, + ...userConfig.lint + }) } /** @@ -47,7 +51,11 @@ const projectShouldFailLint = async (project) => { await setupProject(project) let failed = false try { - await lint(userConfig.lint) + await lint({ + debug: false, + tsRepo: false, + ...userConfig.lint + }) } catch (error) { failed = true expect(error.message).to.contain('Lint errors') @@ -69,7 +77,13 @@ describe('lint', () => { it('lint itself (aegir)', function () { this.timeout(20 * 1000) // slow ci is slow - return lint({ fix: false, silent: true, files: userConfig.lint.files }) + return lint({ + debug: false, + tsRepo: false, + fix: false, + silent: true, + files: userConfig.lint.files + }) }) it('should pass in user defined path globs', () => { @@ -82,6 +96,8 @@ describe('lint', () => { fs.writeFileSync(`${dir}/test-pass.js`, '\'use strict\'\n\nmodule.exports = {}\n') }) .then(() => lint({ + debug: false, + tsRepo: false, fix: false, silent: true, files: [`${dir}/*.js`] @@ -97,6 +113,8 @@ describe('lint', () => { fs.writeFileSync(`${dir}/test-fail.js`, '() .> {') await expect(lint({ + debug: false, + tsRepo: false, fix: false, silent: true, files: [`${dir}/*.js`] @@ -106,7 +124,11 @@ describe('lint', () => { it('should lint ts and js with different parsers rules', async () => { process.chdir(path.join(__dirname, './fixtures/js+ts/')) - await lint(userConfig.lint) + await lint({ + debug: false, + tsRepo: false, + ...userConfig.lint + }) }) it('should pass if no .eslintrc found and does not follows ipfs eslint rules', async () => { diff --git a/test/utils/echo-server.js b/test/utils/echo-server.js index e7722cc72..c9cd3dab6 100644 --- a/test/utils/echo-server.js +++ b/test/utils/echo-server.js @@ -15,7 +15,7 @@ describe('echo server spec', () => { before(async () => { await echo.start() - const { port, address } = echo.server.address() + const { port, address } = /** @type {import('node:net').AddressInfo} */(echo.server.address()) url = format({ protocol: 'http:', hostname: address, port }) }) @@ -27,13 +27,13 @@ describe('echo server spec', () => { }) it('get with search params', async () => { - const req = await http.get('echo/query', { base: url, searchParams: { test: 1 } }) + const req = await http.get('echo/query', { base: url, searchParams: new URLSearchParams({ test: '1' }) }) const res = await req.text() expect(res).to.be.eq('{"test":"1"}') }) it('get with redirect', async () => { - const req = await http.get('redirect', { base: url, searchParams: { to: `${url}/echo/query?test=1` } }) + const req = await http.get('redirect', { base: url, searchParams: new URLSearchParams({ to: `${url}/echo/query?test=1` }) }) const res = await req.text() expect(res).to.be.eq('{"test":"1"}') }) @@ -45,7 +45,7 @@ describe('echo server spec', () => { }) it('download endpoint with text', async () => { - const req = await http.get('download', { base: url, searchParams: { data: 'hello world' } }) + const req = await http.get('download', { base: url, searchParams: new URLSearchParams({ data: 'hello world' }) }) const res = await req.text() expect(res).to.be.eq('hello world') }) @@ -56,7 +56,7 @@ describe('echo server spec', () => { }) it('download endpoint with arraybuffer', async () => { - const req = await http.get('download', { base: url, searchParams: { data: 'hello world' } }) + const req = await http.get('download', { base: url, searchParams: new URLSearchParams({ data: 'hello world' }) }) const res = Buffer.from(await req.arrayBuffer()) expect(res).to.be.deep.eq(Buffer.from('hello world')) }) diff --git a/tsconfig.json b/tsconfig.json index 9ec070960..8c3c2e774 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,11 +4,11 @@ "outDir": "dist" }, "include": [ + "package.json", + "cli.js", + "fixtures.js", "src", "test", "utils" - ], - "exclude": [ - "test/fixtures" ] } From 4ef344f2512af2adc57a7cb742b9c840c41af7af Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 15 Feb 2021 15:15:16 +0000 Subject: [PATCH 20/43] fix: dep check cmd --- cmds/z-dependency-check.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmds/z-dependency-check.js b/cmds/z-dependency-check.js index a38d9b498..9fa0b1393 100644 --- a/cmds/z-dependency-check.js +++ b/cmds/z-dependency-check.js @@ -2,17 +2,17 @@ 'use strict' const ora = require('ora') -const depCheck = require('../src/dependency-check') +const { check, commandNames, defaultInput } = require('../src/dependency-check') const EPILOG = ` Supports options forwarding with '--' for more info check https://github.com/maxogden/dependency-check#cli-usage ` -const commandName = depCheck.commandNames[0] +const commandName = commandNames[0] module.exports = { command: `${commandName} [input...]`, - aliases: depCheck.commandNames.filter(name => name !== commandName), + aliases: commandNames.filter(name => name !== commandName), desc: 'Run `dependency-check` cli with aegir defaults.', builder: (yargs) => { yargs @@ -22,7 +22,7 @@ module.exports = { .positional('input', { describe: 'Files to check', type: 'array', - default: depCheck.defaultInput + default: defaultInput }) .option('p', { alias: 'production-only', @@ -41,7 +41,7 @@ module.exports = { const spinner = ora('Checking dependencies').start() try { - await depCheck(argv, process.argv) + await check(argv, process.argv) spinner.succeed() } catch (err) { spinner.fail() From e83ac97477e64b1df479bf07ee039a443a64c566 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 15 Feb 2021 15:27:55 +0000 Subject: [PATCH 21/43] fix: bundle size options --- cmds/build.js | 5 +- cmds/publish-rc.js | 42 -------- cmds/update-last-successful-build.js | 27 ----- cmds/update-rc.js | 32 ------ src/publish-rc/index.js | 80 --------------- src/update-last-successful-build/index.js | 100 ------------------- src/update-rc/index.js | 60 ----------- src/update-release-branch-lockfiles/index.js | 68 ------------- 8 files changed, 2 insertions(+), 412 deletions(-) delete mode 100644 cmds/publish-rc.js delete mode 100644 cmds/update-last-successful-build.js delete mode 100644 cmds/update-rc.js delete mode 100644 src/publish-rc/index.js delete mode 100644 src/update-last-successful-build/index.js delete mode 100644 src/update-rc/index.js delete mode 100644 src/update-release-branch-lockfiles/index.js diff --git a/cmds/build.js b/cmds/build.js index bb933ce0a..2fa47795b 100644 --- a/cmds/build.js +++ b/cmds/build.js @@ -26,13 +26,12 @@ module.exports = { bundlesize: { alias: 'b', type: 'boolean', - describe: 'Analyse bundle size. Default threshold is 100kB, you can override that in `.aegir.js` with the property `bundlesize.maxSize`.', + describe: 'Analyse bundle size.', default: userConfig.build.bundlesize }, bundlesizeMax: { - alias: 'b', type: 'boolean', - describe: 'Max threshold for the bundle size.', + describe: 'Max threshold for the bundle size. Default is 100kB.', default: userConfig.build.bundlesizeMax }, types: { diff --git a/cmds/publish-rc.js b/cmds/publish-rc.js deleted file mode 100644 index eb931e9ef..000000000 --- a/cmds/publish-rc.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict' - -module.exports = { - command: 'publish-rc', - desc: 'Publish a release candidate', - builder: { - branch: { - describe: 'Where the latest good build is', - type: 'string', - default: 'build/last-successful' - }, - remote: { - describe: 'Which remote to use', - type: 'string', - default: 'origin' - }, - distTag: { - describe: 'The dist tag to publish the rc as', - type: 'string', - default: 'next' - }, - preId: { - describe: 'What to call the rc', - type: 'string', - default: 'rc' - }, - type: { - describe: 'What sort of update this will be', - type: 'string', - default: 'minor' - }, - prefix: { - describe: 'What to prefix the branch name with', - type: 'string', - default: 'release/' - } - }, - handler (argv) { - const cmd = require('../src/publish-rc') - return cmd(argv) - } -} diff --git a/cmds/update-last-successful-build.js b/cmds/update-last-successful-build.js deleted file mode 100644 index 2a38c45b4..000000000 --- a/cmds/update-last-successful-build.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' - -module.exports = { - command: 'update-last-successful-build', - desc: 'Update last known good build branch', - builder: { - branch: { - describe: 'Which branch to update', - type: 'string', - default: 'build/last-successful' - }, - remote: { - describe: 'Which remote to use', - type: 'string', - default: 'origin' - }, - message: { - describe: 'The message to use when adding the shrinkwrap and yarn.lock file', - type: 'string', - default: 'chore: add lockfiles' - } - }, - handler (argv) { - const cmd = require('../src/update-last-successful-build') - return cmd(argv) - } -} diff --git a/cmds/update-rc.js b/cmds/update-rc.js deleted file mode 100644 index 9b0de6b95..000000000 --- a/cmds/update-rc.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' - -module.exports = { - command: 'update-rc ', - example: 'update-rc release/v0.38.x', - desc: 'Update a release candidate', - builder: { - branch: { - describe: 'Where the latest release branch is', - type: 'string' - }, - remote: { - describe: 'Which remote to use', - type: 'string', - default: 'origin' - }, - distTag: { - describe: 'The dist tag to publish the rc as', - type: 'string', - default: 'next' - }, - preId: { - describe: 'What to call the rc', - type: 'string', - default: 'rc' - } - }, - handler (argv) { - const cmd = require('../src/update-rc') - return cmd(argv) - } -} diff --git a/src/publish-rc/index.js b/src/publish-rc/index.js deleted file mode 100644 index 3ff6ba895..000000000 --- a/src/publish-rc/index.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict' - -const { - exec -} = require('../utils') -const path = require('path') -const release = require('../release') -const semver = require('semver') - -/** - * @param {{ branch: string; remote: string; type: 'major' | 'minor' | 'patch'; prefix: any; preId: any; distTag: any; ghtoken: any; }} opts - */ -async function publishRc (opts) { - try { - console.info(`Removing local copy of ${opts.branch}`) // eslint-disable-line no-console - await exec('git', ['branch', '-D', opts.branch]) - } catch (err) { - if (!err.message.includes(`branch '${opts.branch}' not found`)) { - throw err - } - } - - console.info('Fetching repo history') // eslint-disable-line no-console - await exec('git', ['fetch']) - - console.info(`Checking out branch ${opts.branch}`) // eslint-disable-line no-console - await exec('git', ['checkout', '--track', `${opts.remote}/${opts.branch}`]) - - console.info('Removing dependencies') // eslint-disable-line no-console - await exec('rm', ['-rf', 'node_modules', 'package-lock.json']) - - console.info('Installing dependencies') // eslint-disable-line no-console - await exec('npm', ['ci']) - - console.info('Reading version number') // eslint-disable-line no-console - const pkg = require(path.join(process.cwd(), 'package.json')) - - console.info('Found version number', pkg.version) // eslint-disable-line no-console - const version = pkg.version - const newVersion = semver.inc(version, opts.type) - // @ts-ignore - const newVersionBranch = `${opts.prefix}v${newVersion.split('.').filter((sub, i) => { - return i < 2 - }).join('.')}.x` - console.info('Creating release branch', newVersionBranch) // eslint-disable-line no-console - - await exec('git', ['checkout', '-b', newVersionBranch]) - await exec('git', ['push', opts.remote, `${newVersionBranch}:${newVersionBranch}`], { - quiet: true - }) - - if (version.includes('-')) { - // already a pre${opts.type}, change from prepatch, preminor, etc to 'prerelease' - // e.g. 0.38.0-pre.1 -> 0.38.0-rc.0 - // @ts-ignore - opts.type = 'release' - } - - console.info('Creating', opts.preId) // eslint-disable-line no-console - await release({ - // @ts-ignore - type: `pre${opts.type}`, - preid: opts.preId, - 'dist-tag': opts.distTag, - build: false, - test: false, - lint: false, - docsFormats: ['html'], - contributors: true, - bump: true, - changelog: true, - publish: true, - ghrelease: true, - docs: true, - ghtoken: opts.ghtoken || process.env.AEGIR_GHTOKEN, - remote: opts.remote - }) -} - -module.exports = publishRc diff --git a/src/update-last-successful-build/index.js b/src/update-last-successful-build/index.js deleted file mode 100644 index a85308ca1..000000000 --- a/src/update-last-successful-build/index.js +++ /dev/null @@ -1,100 +0,0 @@ -'use strict' - -const { - exec -} = require('../utils') - -async function findCurrentBranch () { - const result = await exec('cat', ['.git/HEAD']) - - return result.stdout.replace('ref: ', '').trim() -} - -/** - * @param {{ message?: string; branch?: any; remote: any; }} opts - */ -async function findMasterCommit (opts) { - const result = await exec('git', ['show-ref', '-s', `${opts.remote}/master`]) - - return result.stdout.trim() -} - -/** - * @param {{ message: string; branch: any; remote: string; }} opts - */ -async function isHeadOfMaster (opts) { - const master = await findMasterCommit(opts) - const branch = await findCurrentBranch() - - // we either have master checked out or a single commit - return branch === 'refs/heads/master' || branch === master -} - -/** - * @param {{ message: string; branch: any; remote: string; }} opts - */ -async function updateLastSuccessfulBuild (opts) { - if (!isHeadOfMaster(opts)) { - console.info('Will only run on the master branch') // eslint-disable-line no-console - - return - } - - console.info('Fetching latest') // eslint-disable-line no-console - await exec('git', ['fetch']) - - const tempBranch = 'update-branch-' + Date.now() - - console.info('Creating temp branch') // eslint-disable-line no-console - await exec('git', ['checkout', '-b', tempBranch]) - - console.info('Removing dependencies') // eslint-disable-line no-console - await exec('rm', ['-rf', 'node_modules', 'package-lock.json', 'yarn.lock', 'npm-shrinkwrap.json']) - - console.info('Installing dependencies') // eslint-disable-line no-console - await exec('npm', ['install', '--production']) - - console.info('Removing package-lock.json') // eslint-disable-line no-console - await exec('rm', ['-rf', 'package-lock.json']) // removing package-lock after install prevents dev deps being added to the shrinkwrap file - - console.info('Creating npm-shrinkwrap.json') // eslint-disable-line no-console - await exec('npm', ['shrinkwrap']) - - console.info('Creating yarn.lock') // eslint-disable-line no-console - await exec('yarn', [], { - env: { - NODE_ENV: 'production' - } - }) - - try { - console.info('Committing') // eslint-disable-line no-console - await exec('git', ['add', '-f', 'npm-shrinkwrap.json', 'yarn.lock']) - await exec('git', ['commit', '-m', opts.message]) - } catch (err) { - if (err.message.includes('nothing to commit, working tree clean')) { - console.info('No changes detected, nothing to do') // eslint-disable-line no-console - return - } - - throw err - } - - try { - console.info(`Deleting remote ${opts.branch} branch`) // eslint-disable-line no-console - await exec('git', ['push', opts.remote, `:${opts.branch}`], { - quiet: true - }) - } catch (err) { - if (!err.message.includes('remote ref does not exist')) { - throw err - } - } - - console.info(`Pushing ${opts.branch} branch`) // eslint-disable-line no-console - await exec('git', ['push', opts.remote, `${tempBranch}:${opts.branch}`], { - quiet: true - }) -} - -module.exports = updateLastSuccessfulBuild diff --git a/src/update-rc/index.js b/src/update-rc/index.js deleted file mode 100644 index 70dabd0d0..000000000 --- a/src/update-rc/index.js +++ /dev/null @@ -1,60 +0,0 @@ -/* eslint-disable no-console */ -'use strict' - -const { - exec -} = require('../utils') -const release = require('../release') - -/** - * @param {{ branch: string; remote: any; preId: any; distTag: any; ghtoken: any; }} opts - */ -async function updateRc (opts) { - await exec('git', ['checkout', 'master']) - - try { - console.info(`Removing local copy of ${opts.branch}`) - await exec('git', ['branch', '-D', opts.branch]) - } catch (err) { - if (!err.message.includes(`branch '${opts.branch}' not found`)) { - throw err - } - } - - console.info('Fetching repo history') - await exec('git', ['fetch']) - - console.info(`Checking out branch ${opts.branch}`) - await exec('git', ['checkout', '--track', `${opts.remote}/${opts.branch}`]) - - console.info('Removing dependencies') - await exec('rm', ['-rf', 'node_modules', 'package-lock.json']) - - console.info('Installing dependencies') - await exec('npm', ['ci']) - - console.info('Updating', opts.preId) - await release({ - debug: false, - tsRepo: false, - type: 'prerelease', - preid: opts.preId, - distTag: opts.distTag, - build: false, - test: false, - lint: false, - contributors: true, - bump: true, - changelog: true, - publish: true, - ghrelease: true, - commit: true, - tag: true, - push: true, - docs: true, - ghtoken: opts.ghtoken || process.env.AEGIR_GHTOKEN, - remote: opts.remote - }) -} - -module.exports = updateRc diff --git a/src/update-release-branch-lockfiles/index.js b/src/update-release-branch-lockfiles/index.js deleted file mode 100644 index 8ad265733..000000000 --- a/src/update-release-branch-lockfiles/index.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict' - -const { - exec -} = require('../utils') - -/** - * @param {{ branch: string; remote: string; message: string; }} opts - */ -async function updateReleaseBranchLockfiles (opts) { - // when (eventually) run on CI, deps should already be present so need to - // remove the lines that remove the node_modules folder - await exec('git', ['checkout', 'master']) - - try { - console.info(`Removing local copy of ${opts.branch}`) // eslint-disable-line no-console - await exec('git', ['branch', '-D', opts.branch]) - } catch (err) { - if (!err.message.includes(`branch '${opts.branch}' not found`)) { - throw err - } - } - - console.info('Fetching repo history') // eslint-disable-line no-console - await exec('git', ['fetch']) - - console.info(`Checking out branch ${opts.branch}`) // eslint-disable-line no-console - await exec('git', ['checkout', '--track', `${opts.remote}/${opts.branch}`]) - - console.info('Removing dependencies') // eslint-disable-line no-console - await exec('rm', ['-rf', 'node_modules', 'package-lock.json', 'yarn.lock', 'npm-shrinkwrap.json']) - - console.info('Installing dependencies') // eslint-disable-line no-console - await exec('npm', ['install', '--production']) - - console.info('Removing package-lock.json') // eslint-disable-line no-console - await exec('rm', ['-rf', 'package-lock.json']) // removing package-lock after install prevents dev deps being added to the shrinkwrap file - - console.info('Creating npm-shrinkwrap.json') // eslint-disable-line no-console - await exec('npm', ['shrinkwrap']) - - console.info('Creating yarn.lock') // eslint-disable-line no-console - await exec('yarn', [], { - env: { - NODE_ENV: 'production' - } - }) - - try { - console.info('Committing') // eslint-disable-line no-console - await exec('git', ['add', '-f', 'npm-shrinkwrap.json', 'yarn.lock']) - await exec('git', ['commit', '-m', opts.message]) - } catch (err) { - if (err.message.includes('nothing to commit, working tree clean')) { - console.info('No changes detected, nothing to do') // eslint-disable-line no-console - return - } - - throw err - } - - console.info(`Pushing ${opts.branch} branch`) // eslint-disable-line no-console - await exec('git', ['push', opts.remote, `${opts.branch}:${opts.branch}`], { - quiet: true - }) -} - -module.exports = updateReleaseBranchLockfiles From ee4bca3038cfbd837093970b899a9078466cfb4d Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 15 Feb 2021 19:26:07 +0000 Subject: [PATCH 22/43] fix: remove userConfig usage --- cmds/build.js | 6 +-- cmds/lint.js | 2 +- package.json | 10 ++--- src/build/index.js | 103 ++++++++++++++++++++++++------------------- src/docs/index.js | 15 ++++--- src/lint.js | 61 ++++++++++++++++--------- src/release/index.js | 58 ++++++++++++++++++------ src/ts/index.js | 3 +- src/types.d.ts | 2 +- test/lint.js | 18 +++++--- 10 files changed, 174 insertions(+), 104 deletions(-) diff --git a/cmds/build.js b/cmds/build.js index 2fa47795b..e32d8508e 100644 --- a/cmds/build.js +++ b/cmds/build.js @@ -30,8 +30,8 @@ module.exports = { default: userConfig.build.bundlesize }, bundlesizeMax: { - type: 'boolean', - describe: 'Max threshold for the bundle size. Default is 100kB.', + type: 'string', + describe: 'Max threshold for the bundle size.', default: userConfig.build.bundlesizeMax }, types: { @@ -47,6 +47,6 @@ module.exports = { */ handler (argv) { const build = require('../src/build') - return build(argv) + return build.run(argv) } } diff --git a/cmds/lint.js b/cmds/lint.js index 7a1331264..07ec54d96 100644 --- a/cmds/lint.js +++ b/cmds/lint.js @@ -23,6 +23,6 @@ module.exports = { }, handler (argv) { const lint = require('../src/lint') - return lint(argv) + return lint.run(argv) } } diff --git a/package.json b/package.json index 3c97996ce..83c2033aa 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@types/chai-subset": "^1.3.3", "@types/dirty-chai": "^2.0.2", "@types/mocha": "^8.2.0", - "@types/node": "^14.14.27", + "@types/node": "^14.14.28", "@types/sinon": "^9.0.10", "buffer": "^6.0.3", "bytes": "^3.1.0", @@ -77,7 +77,7 @@ "dirty-chai": "^2.0.1", "electron-mocha": "^10.0.0", "env-paths": "^2.2.0", - "esbuild": "^0.8.44", + "esbuild": "^0.8.46", "esbuild-register": "^2.0.0", "eslint": "^7.18.0", "eslint-config-ipfs": "^2.0.0", @@ -110,16 +110,16 @@ "strip-bom": "^4.0.0", "strip-json-comments": "^3.1.1", "tempy": "^1.0.0", - "typedoc": "^0.20.24", + "typedoc": "^0.20.25", "typescript": "4.1.5", "update-notifier": "^5.0.0", "yargs": "^16.2.0", - "yargs-parser": "^20.2.3" + "yargs-parser": "^20.2.5" }, "devDependencies": { "@types/bytes": "^3.1.0", "@types/conventional-changelog": "^3.1.0", - "@types/cors": "^2.8.9", + "@types/cors": "^2.8.10", "@types/eslint": "^7.2.6", "@types/fs-extra": "^9.0.7", "@types/gh-pages": "^3.0.0", diff --git a/src/build/index.js b/src/build/index.js index 46b39bf9d..00bad2566 100644 --- a/src/build/index.js +++ b/src/build/index.js @@ -1,5 +1,6 @@ /* eslint-disable no-console */ 'use strict' +const Listr = require('listr') const esbuild = require('esbuild') const path = require('path') const pascalcase = require('pascalcase') @@ -7,7 +8,6 @@ const bytes = require('bytes') const { premove: del } = require('premove') const { gzipSize, pkg, hasTsconfig, fromRoot, paths } = require('./../utils') const tsCmd = require('../ts') -const { userConfig } = require('../config/user') const merge = require('merge-options').bind({ ignoreUndefined: true, concatArrays: true @@ -16,51 +16,9 @@ const merge = require('merge-options').bind({ /** * @typedef {import("../types").GlobalOptions} GlobalOptions * @typedef {import("../types").BuildOptions} BuildOptions + * @typedef {import("listr").ListrTaskWrapper} Task */ -/** - * Build command - * - * @param {GlobalOptions & BuildOptions} argv - */ -module.exports = async (argv) => { - // Clean dist - await del(path.join(process.cwd(), 'dist')) - - if (argv.bundle) { - const outfile = await build(argv) - - if (argv.bundlesize) { - // @ts-ignore - if (userConfig.bundlesize && userConfig.bundlesize.maxSize) { - throw new Error('Config property `bundlesize.maxSize` is deprecated, use `build.bundlesizeMax`!') - } - const gzip = await gzipSize(outfile) - const maxsize = bytes(userConfig.build.bundlesizeMax) - const diff = gzip - maxsize - - console.log('Use https://www.bundle-buddy.com/ to load "./dist/stats.json".') - console.log(`Check previous sizes in https://bundlephobia.com/result?p=${pkg.name}@${pkg.version}`) - - if (diff > 0) { - throw new Error(`${bytes(gzip)} (▲${bytes(diff)} / ${bytes(maxsize)})`) - } else { - console.log(`${bytes(gzip)} (▼${bytes(diff)} / ${bytes(maxsize)})`) - } - } - } - - if (argv.types && hasTsconfig) { - await tsCmd({ - ...argv, - preset: 'types', - include: userConfig.ts.include, - copyTo: userConfig.ts.copyTo, - copyFrom: userConfig.ts.copyFrom - }) - } -} - /** * Build command * @@ -86,8 +44,63 @@ const build = async (argv) => { 'process.env.NODE_ENV': '"production"' } }, - userConfig.build.config + argv.fileConfig.build.config )) return outfile } + +const tasks = new Listr([ + { + title: 'Clean ./dist', + task: async () => del(path.join(process.cwd(), 'dist')) + }, + { + title: 'Bundle', + enabled: ctx => ctx.bundle, + /** + * + * @param {GlobalOptions & BuildOptions} ctx + * @param {Task} task + */ + task: async (ctx, task) => { + const outfile = await build(ctx) + + if (ctx.bundlesize) { + const gzip = await gzipSize(outfile) + const maxsize = bytes(ctx.bundlesizeMax) + const diff = gzip - maxsize + + task.output = 'Use https://www.bundle-buddy.com/ to load "./dist/stats.json".' + task.output = `Check previous sizes in https://bundlephobia.com/result?p=${pkg.name}@${pkg.version}` + + if (diff > 0) { + throw new Error(`${bytes(gzip)} (▲${bytes(diff)} / ${bytes(maxsize)})`) + } else { + task.output = `${bytes(gzip)} (▼${bytes(diff)} / ${bytes(maxsize)})` + } + } + } + }, + { + title: 'Generate types', + enabled: ctx => ctx.types && hasTsconfig, + /** + * @param {GlobalOptions & BuildOptions} ctx + * @param {Task} task + */ + task: async (ctx, task) => { + await tsCmd({ + debug: ctx.debug, + tsRepo: ctx.tsRepo, + fileConfig: ctx.fileConfig, + preset: 'types', + include: ctx.fileConfig.ts.include, + copyTo: ctx.fileConfig.ts.copyTo, + copyFrom: ctx.fileConfig.ts.copyFrom + }) + } + } +], { renderer: 'verbose' }) + +module.exports = tasks diff --git a/src/docs/index.js b/src/docs/index.js index 4885235a9..fd432db27 100644 --- a/src/docs/index.js +++ b/src/docs/index.js @@ -60,8 +60,8 @@ const docs = async (ctx, task) => { preferLocal: true } ) - proc.stdout?.on('data', chunk => { - task.output = chunk.toString() + proc.all?.on('data', chunk => { + task.output = chunk.toString().replace('\n', '') }) await proc @@ -80,7 +80,7 @@ const publishDocs = () => { ) } -const TASKS = new Listr( +const tasks = new Listr( [ { title: 'Clean ./docs', @@ -88,7 +88,12 @@ const TASKS = new Listr( }, { title: 'Generating documentation', - task: (ctx, task) => docs({ debug: ctx.debug, tsRepo: ctx.tsRepo, ...ctx.config.docs }, task) + /** + * + * @param {GlobalOptions & DocsOptions} ctx + * @param {Task} task + */ + task: docs }, { title: 'Publish to GitHub Pages', @@ -101,4 +106,4 @@ const TASKS = new Listr( } ) -module.exports = TASKS +module.exports = tasks diff --git a/src/lint.js b/src/lint.js index 8d125902d..2c59076eb 100644 --- a/src/lint.js +++ b/src/lint.js @@ -3,34 +3,51 @@ const globby = require('globby') const { ESLint } = require('eslint') +const Listr = require('listr') /** * @typedef {import("./types").GlobalOptions} GlobalOptions * @typedef {import("./types").LintOptions} LintOptions + * @typedef {import("listr").ListrTaskWrapper} Task * */ -/** - * - * @param {GlobalOptions & LintOptions} opts - */ -async function runLinter (opts) { - const eslint = new ESLint({ - fix: opts.fix, - baseConfig: { extends: 'ipfs' }, - useEslintrc: true - }) - const results = await eslint.lintFiles(await globby(opts.files)) - const formatter = await eslint.loadFormatter('unix') - if (opts.fix) { - await ESLint.outputFixes(results) - } - if (!opts.silent) { - console.log(formatter.format(results)) - } - if (ESLint.getErrorResults(results).length > 0) { - throw new Error('Lint errors') +const tasks = new Listr( + [ + { + title: 'Lint files', + /** + * + * @param {GlobalOptions & LintOptions} ctx + * @param {Task} task + */ + task: async (ctx, task) => { + const eslint = new ESLint({ + fix: ctx.fix, + baseConfig: { extends: 'ipfs' }, + useEslintrc: true + }) + const results = await eslint.lintFiles(await globby(ctx.files)) + const formatter = await eslint.loadFormatter('unix') + const hasErrors = ESLint.getErrorResults(results).length > 0 + + if (ctx.fix) { + await ESLint.outputFixes(results) + } + + if (!ctx.silent && hasErrors) { + console.error(formatter.format(results)) + } + + if (hasErrors) { + throw new Error('Lint errors') + } + } + } + ], + { + renderer: 'verbose' } -} +) -module.exports = runLinter +module.exports = tasks diff --git a/src/release/index.js b/src/release/index.js index 5ba16c3e9..2525b087f 100644 --- a/src/release/index.js +++ b/src/release/index.js @@ -4,10 +4,9 @@ const Listr = require('listr') const lint = require('../lint') const test = require('../test') +const ts = require('../ts') const build = require('../build') const docs = require('../docs') -const { userConfig } = require('./../config/user') - const releaseChecks = require('./prerelease') const bump = require('./bump') const changelog = require('./changelog') @@ -29,13 +28,35 @@ const push = require('./push') * @param {GlobalOptions & ReleaseOptions} opts */ async function release (opts) { - const globalOptions = { debug: opts.debug, tsRepo: opts.tsRepo } + const globalOptions = { + debug: opts.debug, + tsRepo: opts.tsRepo, + fileConfig: opts.fileConfig + } + const tasks = new Listr( [ { title: 'Lint', - task: () => lint({ ...globalOptions, ...userConfig.lint, silent: true }), - enabled: (ctx) => ctx.lint + task: () => { + lint.setRenderer('silent') + return lint.run({ + ...globalOptions, + ...opts.fileConfig.lint + }) + }, + enabled: () => opts.lint + }, + { + title: 'Types', + task: () => { + return ts({ + ...globalOptions, + ...opts.fileConfig.ts, + preset: 'check' + }) + }, + enabled: () => opts.lint }, { title: 'Test', @@ -43,7 +64,7 @@ async function release (opts) { test.run( { ...globalOptions, - ...userConfig.test + ...opts.fileConfig.test }, { stdio: 'ignore' @@ -59,11 +80,14 @@ async function release (opts) { }, { title: 'Build', - task: () => build({ - ...globalOptions, - ...userConfig.build - }), - enabled: (ctx) => ctx.build + enabled: (ctx) => ctx.build, + task: () => { + build.setRenderer('silent') + return build.run({ + ...globalOptions, + ...opts.fileConfig.build + }) + } }, { title: 'Update Contributors', @@ -96,9 +120,15 @@ async function release (opts) { enabled: (ctx) => ctx.ghrelease }, { - title: 'Publish documentation', - task: () => docs, - enabled: (ctx) => ctx.docs + title: 'Documentation', + task: () => { + docs.setRenderer('silent') + return docs.run({ + ...globalOptions, + ...opts.fileConfig.docs + }) + }, + enabled: () => opts.docs }, { title: 'Publish to npm', diff --git a/src/ts/index.js b/src/ts/index.js index 6dd9d2975..aa464de5c 100644 --- a/src/ts/index.js +++ b/src/ts/index.js @@ -12,7 +12,6 @@ const hasConfig = hasFile('tsconfig.json') * @typedef {import("yargs").Arguments} Arguments * @typedef {import("../types").GlobalOptions} GlobalOptions * @typedef {import("../types").TSOptions} TSOptions - * @typedef {import("../types").BuildOptions} BuildOptions * * @typedef {Object} Options * @property {"config" | "check" | "types"} preset @@ -26,7 +25,7 @@ const hasConfig = hasFile('tsconfig.json') /** * Typescript command * - * @param {GlobalOptions & TSOptions & BuildOptions} argv + * @param {GlobalOptions & TSOptions} argv */ module.exports = async (argv) => { /** @type {Options} */ diff --git a/src/types.d.ts b/src/types.d.ts index 3b2b57941..c3b45069e 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -56,7 +56,7 @@ interface GlobalOptions { /** * Full config from configuration file */ - fileConfig?: Options + fileConfig: Options } interface BuildOptions { diff --git a/test/lint.js b/test/lint.js index 5e75073d1..89029f800 100644 --- a/test/lint.js +++ b/test/lint.js @@ -37,7 +37,8 @@ const setupProjectWithDeps = deps => setupProject({ */ const projectShouldPassLint = async (project) => { await setupProject(project) - await lint({ + await lint.run({ + fileConfig: userConfig, debug: false, tsRepo: false, ...userConfig.lint @@ -51,7 +52,8 @@ const projectShouldFailLint = async (project) => { await setupProject(project) let failed = false try { - await lint({ + await lint.run({ + fileConfig: userConfig, debug: false, tsRepo: false, ...userConfig.lint @@ -77,7 +79,8 @@ describe('lint', () => { it('lint itself (aegir)', function () { this.timeout(20 * 1000) // slow ci is slow - return lint({ + return lint.run({ + fileConfig: userConfig, debug: false, tsRepo: false, fix: false, @@ -95,7 +98,8 @@ describe('lint', () => { fs.mkdirSync(dir) fs.writeFileSync(`${dir}/test-pass.js`, '\'use strict\'\n\nmodule.exports = {}\n') }) - .then(() => lint({ + .then(() => lint.run({ + fileConfig: userConfig, debug: false, tsRepo: false, fix: false, @@ -112,7 +116,8 @@ describe('lint', () => { fs.mkdirSync(dir) fs.writeFileSync(`${dir}/test-fail.js`, '() .> {') - await expect(lint({ + await expect(lint.run({ + fileConfig: userConfig, debug: false, tsRepo: false, fix: false, @@ -124,7 +129,8 @@ describe('lint', () => { it('should lint ts and js with different parsers rules', async () => { process.chdir(path.join(__dirname, './fixtures/js+ts/')) - await lint({ + await lint.run({ + fileConfig: userConfig, debug: false, tsRepo: false, ...userConfig.lint From b7b7ee4b57d0be796fb4df0ffeca2bf83818d8b6 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 15 Feb 2021 20:21:29 +0000 Subject: [PATCH 23/43] fix: move fixtures and export types --- cmds/update-release-branch-lockfiles.js | 26 ------------------------- fixtures.js | 3 --- package.json | 18 +++++++++++------ src/index.js | 6 ++++++ src/types.d.ts | 2 +- tsconfig-types.json | 1 + tsconfig.json | 1 - {src => utils}/fixtures.browser.js | 0 {src => utils}/fixtures.js | 0 9 files changed, 20 insertions(+), 37 deletions(-) delete mode 100644 cmds/update-release-branch-lockfiles.js delete mode 100644 fixtures.js rename {src => utils}/fixtures.browser.js (100%) rename {src => utils}/fixtures.js (100%) diff --git a/cmds/update-release-branch-lockfiles.js b/cmds/update-release-branch-lockfiles.js deleted file mode 100644 index e1289a4b4..000000000 --- a/cmds/update-release-branch-lockfiles.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict' - -module.exports = { - command: 'update-release-branch-lockfiles ', - desc: 'Updates the lockfiles for the release branch', - builder: { - branch: { - describe: 'Which branch to update', - type: 'string' - }, - remote: { - describe: 'Which remote to use', - type: 'string', - default: 'origin' - }, - message: { - describe: 'The message to use when adding the shrinkwrap and yarn.lock file', - type: 'string', - default: 'chore: add lockfiles' - } - }, - handler (argv) { - const cmd = require('../src/update-release-branch-lockfiles') - return cmd(argv) - } -} diff --git a/fixtures.js b/fixtures.js deleted file mode 100644 index 9816c700e..000000000 --- a/fixtures.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('./src/fixtures') diff --git a/package.json b/package.json index 83c2033aa..acd66cd67 100644 --- a/package.json +++ b/package.json @@ -13,31 +13,38 @@ "license": "MIT", "leadMaintainer": "Hugo Dias ", "files": [ - "dist/utils", + "dist", "cmds", "utils", "src", - "cli.js", - "fixtures.js" + "cli.js" ], "main": "cli.js", "browser": { "fs": false, - "./src/fixtures.js": "./src/fixtures.browser.js" + "./utils/fixtures.js": "./utils/fixtures.browser.js" }, "bin": { "aegir": "cli.js" }, + "types": "dist/src/index", "typesVersions": { "*": { "utils/*": [ "dist/utils/*" + ], + "src/*": [ + "dist/src/*", + "dist/src/*/index" + ], + "src/": [ + "dist/src/index" ] } }, "repository": "github:ipfs/aegir", "scripts": { - "prepare": "tsc -p tsconfig-types.json", + "prepare": "node cli.js ts -p types", "lint": "node cli.js lint", "test:node": "node cli.js test -t node", "test:browser": "node cli.js test -t browser webworker", @@ -86,7 +93,6 @@ "fs-extra": "^9.1.0", "gh-pages": "^3.1.0", "git-authors-cli": "^1.0.33", - "git-validate": "^2.2.4", "globby": "^11.0.2", "ipfs-utils": "^6.0.0", "it-glob": "~0.0.10", diff --git a/src/index.js b/src/index.js index c618df5ec..6ccf5ba66 100644 --- a/src/index.js +++ b/src/index.js @@ -1,2 +1,8 @@ /* eslint-disable no-console */ 'use strict' + +/** + * @typedef {import('./types').Options} Options + */ + +module.exports = {} diff --git a/src/types.d.ts b/src/types.d.ts index c3b45069e..3e0059a34 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -169,7 +169,7 @@ interface TestOptions { */ browser: { /** - * playwright-test config + * playwright-test config @see https://github.com/hugomrdias/playwright-test */ config: any } diff --git a/tsconfig-types.json b/tsconfig-types.json index 0fde05491..38ad97d2b 100644 --- a/tsconfig-types.json +++ b/tsconfig-types.json @@ -6,6 +6,7 @@ "emitDeclarationOnly": true }, "include": [ + "src/index.js", "utils" ] } diff --git a/tsconfig.json b/tsconfig.json index 8c3c2e774..7229b48c7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,6 @@ "include": [ "package.json", "cli.js", - "fixtures.js", "src", "test", "utils" diff --git a/src/fixtures.browser.js b/utils/fixtures.browser.js similarity index 100% rename from src/fixtures.browser.js rename to utils/fixtures.browser.js diff --git a/src/fixtures.js b/utils/fixtures.js similarity index 100% rename from src/fixtures.js rename to utils/fixtures.js From ce2bc87bbc8e31cd9cb60a59e29a663a36056bcc Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 15 Feb 2021 20:54:58 +0000 Subject: [PATCH 24/43] fix: move cmds to src and remove commit-lint --- cli.js | 2 +- cmds/z-commitlint.js | 43 ------- package.json | 6 - src/checks/commitlint-travis.js | 131 ---------------------- {cmds => src/cmds}/build.js | 7 +- {cmds => src/cmds}/check.js | 27 ++++- {cmds => src/cmds}/docs.js | 7 +- {cmds => src/cmds}/lint.js | 7 +- {cmds => src/cmds}/release.js | 7 +- {cmds => src/cmds}/test-dependant.js | 10 +- {cmds => src/cmds}/test.js | 7 +- {cmds => src/cmds}/ts.js | 14 ++- {cmds => src/cmds}/z-dependency-check.js | 13 ++- {cmds => src/cmds}/z-lint-package-json.js | 12 +- src/dependency-check.js | 4 +- test/browser.spec.js | 2 +- test/fixtures.js | 2 +- 17 files changed, 94 insertions(+), 207 deletions(-) delete mode 100644 cmds/z-commitlint.js delete mode 100644 src/checks/commitlint-travis.js rename {cmds => src/cmds}/build.js (86%) rename {cmds => src/cmds}/check.js (87%) rename {cmds => src/cmds}/docs.js (86%) rename {cmds => src/cmds}/lint.js (73%) rename {cmds => src/cmds}/release.js (92%) rename {cmds => src/cmds}/test-dependant.js (80%) rename {cmds => src/cmds}/test.js (93%) rename {cmds => src/cmds}/ts.js (83%) rename {cmds => src/cmds}/z-dependency-check.js (86%) rename {cmds => src/cmds}/z-lint-package-json.js (82%) diff --git a/cli.js b/cli.js index f3a6579a6..fb7b14246 100755 --- a/cli.js +++ b/cli.js @@ -29,7 +29,7 @@ cli .middleware((yargs) => { yargs.fileConfig = userConfig }) - .commandDir('cmds') + .commandDir('src/cmds') .help() .alias('help', 'h') .alias('version', 'v') diff --git a/cmds/z-commitlint.js b/cmds/z-commitlint.js deleted file mode 100644 index 59a1a29eb..000000000 --- a/cmds/z-commitlint.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict' -const path = require('path') -const execa = require('execa') -const commitlintTravis = require('../src/checks/commitlint-travis') - -const EPILOG = ` -Supports options forwarding with '--' for more info check https://conventional-changelog.github.io/commitlint/#/reference-cli -` - -module.exports = { - command: 'commitlint', - aliases: ['cl', 'commit'], - desc: 'Run `commitlint` cli with aegir defaults.', - builder: (yargs) => { - yargs - .epilog(EPILOG) - .example('npx aegir commitlint -- -E HUSKY_GIT_PARAMS', 'To use inside a package.json as a Husky commit-msg hook.') - .options({ - travis: { - describe: 'Run `commitlint` in Travis CI mode.', - boolean: true - } - }) - }, - handler (argv) { - if (argv.travis) { - return commitlintTravis() - } - - const input = argv._.slice(1) - const forwardOptions = argv['--'] ? argv['--'] : [] - return execa('commitlint', [ - '--extends', - '@commitlint/config-conventional', - ...input, - ...forwardOptions - ], { - stdio: 'inherit', - localDir: path.join(__dirname, '..'), - preferLocal: true - }) - } -} diff --git a/package.json b/package.json index acd66cd67..69666f6e5 100644 --- a/package.json +++ b/package.json @@ -55,12 +55,6 @@ }, "dependencies": { "@achingbrain/dependency-check": "^4.1.0", - "@commitlint/cli": "^11.0.0", - "@commitlint/config-conventional": "^11.0.0", - "@commitlint/lint": "^11.0.0", - "@commitlint/load": "^11.0.0", - "@commitlint/read": "^11.0.0", - "@commitlint/travis-cli": "^11.0.0", "@electron/get": "^1.12.3", "@polka/send-type": "^0.5.2", "@types/chai": "^4.2.15", diff --git a/src/checks/commitlint-travis.js b/src/checks/commitlint-travis.js deleted file mode 100644 index 1d62e7a2c..000000000 --- a/src/checks/commitlint-travis.js +++ /dev/null @@ -1,131 +0,0 @@ -'use strict' - -const execa = require('execa') -// @ts-ignore -const commitlint = require('@commitlint/cli') - -// Allow to override used bins for testing purposes -const GIT = process.env.TRAVIS_COMMITLINT_GIT_BIN || 'git' -const COMMITLINT = process.env.TRAVIS_COMMITLINT_BIN - -const REQUIRED = [ - 'TRAVIS_COMMIT', - 'TRAVIS_COMMIT_RANGE', - 'TRAVIS_EVENT_TYPE', - 'TRAVIS_REPO_SLUG', - 'TRAVIS_PULL_REQUEST_SLUG' -] - -const COMMIT = process.env.TRAVIS_COMMIT -const REPO_SLUG = process.env.TRAVIS_REPO_SLUG -const PR_SLUG = process.env.TRAVIS_PULL_REQUEST_SLUG || REPO_SLUG -const RANGE = process.env.TRAVIS_COMMIT_RANGE -const IS_PR = process.env.TRAVIS_EVENT_TYPE === 'pull_request' - -module.exports = async function main () { - validate() - - // Stash changes in working copy if needed - const pop = await stash() - - // Make base and source available as dedicated remotes - await Promise.all([ - () => fetch({ name: 'base', url: `https://github.com/${REPO_SLUG}.git` }), - IS_PR - ? () => fetch({ name: 'source', url: `https://github.com/${PR_SLUG}.git` }) - : async () => {} - ]) - - // Restore stashed changes if any - await pop() - - // Lint all commits in TRAVIS_COMMIT_RANGE if available - if (IS_PR && RANGE) { - const [start, end] = RANGE.split('.').filter(Boolean) - await lint(['--from', start, '--to', end]) - } else { - // @ts-ignore - const input = await log(COMMIT) - await lint([], { input }) - } -} - -/** - * @param {any[] | readonly string[] | undefined} args - * @param {any} [options] - */ -function git (args, options) { - return execa(GIT, args, Object.assign({}, { stdio: 'inherit' }, options)) -} - -/** - * - * @param {*} param0 - */ -async function fetch ({ name, url }) { - await git(['remote', 'add', name, url]) - await git(['fetch', name, '--quiet']) -} - -async function isClean () { - const result = await git(['status', '--porcelain'], { - stdio: ['pipe', 'pipe', 'pipe'] - }) - return !(result.stdout && result.stdout.trim()) -} - -/** - * @param {string[]} args - * @param {{ input: string; } | undefined} [options] - */ -function lint (args, options) { - return execa( - COMMITLINT || commitlint, - [ - '--extends', - '@commitlint/config-conventional', - ...args - ], - // @ts-ignore - Object.assign({}, { stdio: ['pipe', 'inherit', 'inherit'] }, options) - ) -} - -/** - * @param {string} hash - */ -async function log (hash) { - const result = await execa('git', [ - 'log', - '-n', - '1', - '--pretty=format:%B', - hash - ]) - return result.stdout -} - -async function stash () { - if (await isClean()) { - return async () => {} - } - await git(['stash', '-k', '-u', '--quiet']) - return () => git(['stash', 'pop', '--quiet']) -} - -function validate () { - if (process.env.CI !== 'true' || process.env.TRAVIS !== 'true') { - throw new Error( - '@commitlint/travis-cli is intended to be used on Travis CI' - ) - } - - const missing = REQUIRED.filter(envVar => !(envVar in process.env)) - - if (missing.length > 0) { - const stanza = missing.length > 1 ? 'they were not' : 'it was not' - throw new Error( - `Expected ${missing.join(', ')} to be defined globally, ${stanza}.` - ) - } -} diff --git a/cmds/build.js b/src/cmds/build.js similarity index 86% rename from cmds/build.js rename to src/cmds/build.js index e32d8508e..71a489691 100644 --- a/cmds/build.js +++ b/src/cmds/build.js @@ -1,5 +1,5 @@ 'use strict' -const { userConfig } = require('../src/config/user') +const { userConfig } = require('../config/user') /** * @typedef {import("yargs").Argv} Argv * @typedef {import("yargs").Arguments} Arguments @@ -42,11 +42,10 @@ module.exports = { }) }, /** - * - * @param {Arguments} argv + * @param {(import("../types").GlobalOptions & import("../types").BuildOptions) | undefined} argv */ handler (argv) { - const build = require('../src/build') + const build = require('../build') return build.run(argv) } } diff --git a/cmds/check.js b/src/cmds/check.js similarity index 87% rename from cmds/check.js rename to src/cmds/check.js index 188e7a76b..99c4d0e8d 100644 --- a/cmds/check.js +++ b/src/cmds/check.js @@ -6,9 +6,9 @@ const esbuild = require('esbuild') const fs = require('fs-extra') const findPkg = require('read-pkg-up') const kleur = require('kleur') -const { userConfig } = require('../src/config/user') +const { userConfig } = require('../config/user') const path = require('path') -const { fromRoot, paths } = require('../src/utils') +const { fromRoot, paths } = require('../utils') const merge = require('merge-options').bind({ ignoreUndefined: true, concatArrays: true @@ -17,14 +17,21 @@ module.exports = { command: 'check', desc: 'Check project', builder: {}, + /** + * @param {any} argv + */ handler (argv) { return checkBuiltins(argv) } } +/** + * @param {{ tsRepo: any; }} argv + */ const checkBuiltins = async (argv) => { const outfile = path.join(paths.dist, 'index.js') const metafile = path.join(paths.dist, 'stats.json') + /** @type {Record} */ const nodeBuiltIns = { util: [], sys: [], @@ -48,6 +55,10 @@ const checkBuiltins = async (argv) => { } const nodePlugin = { name: 'node built ins', + /** + * + * @param {import('esbuild').PluginBuild} build + */ setup (build) { for (const k of Object.keys(nodeBuiltIns)) { build.onResolve({ filter: new RegExp(`^${k}$`) }, (args) => { @@ -85,8 +96,12 @@ const checkBuiltins = async (argv) => { findDuplicates(outputs['dist/index.js'].inputs) } +/** + * @param {{}} inputs + */ const findDuplicates = async (inputs) => { const files = Object.keys(inputs) + /** @type {Record>} */ const packages = {} for (const file of files) { if (file.includes('node_modules') && !file.includes('empty:')) { @@ -119,13 +134,19 @@ const findDuplicates = async (inputs) => { console.log(kleur.red(key)) for (const file of imports) { const out = await findPkg({ cwd: file }) - console.log(kleur.dim(file), kleur.blue(out.packageJson.version)) + if (out) { + console.log(kleur.dim(file), kleur.blue(out.packageJson.version)) + } } } } } +/** + * @param {Record} nodeBuiltIns + */ const findBuiltins = async (nodeBuiltIns) => { + /** @type {Record>} */ const packages = {} // eslint-disable-next-line guard-for-in for (const builtin in nodeBuiltIns) { diff --git a/cmds/docs.js b/src/cmds/docs.js similarity index 86% rename from cmds/docs.js rename to src/cmds/docs.js index 16413d2bd..fa16f83a5 100644 --- a/cmds/docs.js +++ b/src/cmds/docs.js @@ -1,5 +1,5 @@ 'use strict' -const { userConfig } = require('../src/config/user') +const { userConfig } = require('../config/user') /** * @typedef {import("yargs").Argv} Argv */ @@ -34,8 +34,11 @@ module.exports = { } ) }, + /** + * @param {(import("../types").GlobalOptions & import("../types").DocsOptions) | undefined} argv + */ handler (argv) { - const docs = require('../src/docs') + const docs = require('../docs') return docs.run(argv) } } diff --git a/cmds/lint.js b/src/cmds/lint.js similarity index 73% rename from cmds/lint.js rename to src/cmds/lint.js index 07ec54d96..47ee34847 100644 --- a/cmds/lint.js +++ b/src/cmds/lint.js @@ -1,5 +1,5 @@ 'use strict' -const { userConfig } = require('../src/config/user') +const { userConfig } = require('../config/user') module.exports = { command: 'lint', desc: 'Lint all project files', @@ -21,8 +21,11 @@ module.exports = { default: userConfig.lint.silent } }, + /** + * @param {(import("../types").GlobalOptions & import("../types").LintOptions) | undefined} argv + */ handler (argv) { - const lint = require('../src/lint') + const lint = require('../lint') return lint.run(argv) } } diff --git a/cmds/release.js b/src/cmds/release.js similarity index 92% rename from cmds/release.js rename to src/cmds/release.js index 5b37637bb..982f2f8bc 100644 --- a/cmds/release.js +++ b/src/cmds/release.js @@ -1,6 +1,6 @@ 'use strict' -const { userConfig } = require('../src/config/user') +const { userConfig } = require('../config/user') module.exports = { command: 'release', @@ -93,8 +93,11 @@ module.exports = { default: userConfig.release.remote } }, + /** + * @param {import("../types").GlobalOptions & import("../types").ReleaseOptions} argv + */ handler (argv) { - const release = require('../src/release') + const release = require('../release') return release(argv) } } diff --git a/cmds/test-dependant.js b/src/cmds/test-dependant.js similarity index 80% rename from cmds/test-dependant.js rename to src/cmds/test-dependant.js index b5e8659b1..e88c218ea 100644 --- a/cmds/test-dependant.js +++ b/src/cmds/test-dependant.js @@ -18,11 +18,16 @@ module.exports = { }, deps: { describe: 'Other dependencies to override, e.g. --deps=foo@1.5.0,bar@2.4.1', + /** + * + * @param {string} val + */ coerce: (val) => { if (typeof val !== 'string') { return {} } + /** @type {Record} */ const deps = {} for (const dep of val.split(',')) { @@ -35,8 +40,11 @@ module.exports = { default: {} } }, + /** + * @param {{ repo: string; branch: string; deps: any; }} argv + */ handler (argv) { - const cmd = require('../src/test-dependant') + const cmd = require('../test-dependant') return cmd(argv) } } diff --git a/cmds/test.js b/src/cmds/test.js similarity index 93% rename from cmds/test.js rename to src/cmds/test.js index db7b7e760..a6048614a 100644 --- a/cmds/test.js +++ b/src/cmds/test.js @@ -1,5 +1,5 @@ 'use strict' -const { userConfig } = require('../src/config/user') +const { userConfig } = require('../config/user') /** * @typedef {import("yargs").Argv} Argv */ @@ -86,8 +86,11 @@ module.exports = { } }) }, + /** + * @param {import("../types").TestOptions & import("../types").GlobalOptions} argv + */ handler (argv) { - const test = require('../src/test') + const test = require('../test') return test.run(argv) } } diff --git a/cmds/ts.js b/src/cmds/ts.js similarity index 83% rename from cmds/ts.js rename to src/cmds/ts.js index 4e3b2f779..c14b908de 100644 --- a/cmds/ts.js +++ b/src/cmds/ts.js @@ -1,5 +1,9 @@ 'use strict' -const { userConfig } = require('../src/config/user') +const { userConfig } = require('../config/user') +/** + * @typedef {import("yargs").Argv} Argv + * @typedef {import("yargs").Arguments} Arguments + */ const EPILOG = ` Presets: @@ -15,6 +19,9 @@ Supports options forwarding with '--' for more info check https://www.typescript module.exports = { command: 'ts', desc: 'Typescript command with presets for specific tasks.', + /** + * @param {Argv} yargs + */ builder: (yargs) => { yargs .epilog(EPILOG) @@ -44,8 +51,11 @@ module.exports = { } }) }, + /** + * @param {import("../types").GlobalOptions & import("../types").TSOptions} argv + */ handler (argv) { - const ts = require('../src/ts') + const ts = require('../ts') return ts(argv) } } diff --git a/cmds/z-dependency-check.js b/src/cmds/z-dependency-check.js similarity index 86% rename from cmds/z-dependency-check.js rename to src/cmds/z-dependency-check.js index 9fa0b1393..da0106bdd 100644 --- a/cmds/z-dependency-check.js +++ b/src/cmds/z-dependency-check.js @@ -2,8 +2,10 @@ 'use strict' const ora = require('ora') -const { check, commandNames, defaultInput } = require('../src/dependency-check') - +const { check, commandNames, defaultInput } = require('../dependency-check') +/** + * @typedef {import("yargs").Argv} Argv + */ const EPILOG = ` Supports options forwarding with '--' for more info check https://github.com/maxogden/dependency-check#cli-usage ` @@ -14,6 +16,9 @@ module.exports = { command: `${commandName} [input...]`, aliases: commandNames.filter(name => name !== commandName), desc: 'Run `dependency-check` cli with aegir defaults.', + /** + * @param {Argv} yargs + */ builder: (yargs) => { yargs .epilog(EPILOG) @@ -21,6 +26,7 @@ module.exports = { .example('aegir dependency-check -- --unused --ignore typescript', 'To check unused packages in your repo, ignoring typescript.') .positional('input', { describe: 'Files to check', + // @ts-ignore type: 'array', default: defaultInput }) @@ -37,6 +43,9 @@ module.exports = { default: [] }) }, + /** + * @param {any} argv + */ async handler (argv) { const spinner = ora('Checking dependencies').start() diff --git a/cmds/z-lint-package-json.js b/src/cmds/z-lint-package-json.js similarity index 82% rename from cmds/z-lint-package-json.js rename to src/cmds/z-lint-package-json.js index 31281e345..2b14cb2de 100644 --- a/cmds/z-lint-package-json.js +++ b/src/cmds/z-lint-package-json.js @@ -2,8 +2,10 @@ const execa = require('execa') const path = require('path') -const { fromAegir, fromRoot } = require('../src/utils') - +const { fromAegir, fromRoot } = require('../utils') +/** + * @typedef {import("yargs").Argv} Argv + */ const EPILOG = ` Supports options forwarding with '--' for more info check https://github.com/tclindner/npm-package-json-lint#cli-commands-and-configuration ` @@ -12,10 +14,16 @@ module.exports = { command: 'lint-package-json', desc: 'Lint package.json with aegir defaults.', aliases: ['lint-package', 'lpj'], + /** + * @param {Argv} yargs + */ builder: (yargs) => { yargs .epilog(EPILOG) }, + /** + * @param {{ [x: string]: any; _: string | any[]; }} argv + */ handler (argv) { const input = argv._.slice(1) const forwardOptions = argv['--'] ? argv['--'] : [] diff --git a/src/dependency-check.js b/src/dependency-check.js index 4651d7cff..5169fe3f9 100644 --- a/src/dependency-check.js +++ b/src/dependency-check.js @@ -42,10 +42,10 @@ const hasPassedFileArgs = (input, processArgs) => { * * @param {*} argv - Command line arguments passed to the process. * @param {string[]} processArgs - Unparsed command line arguments used to start the process - * @param {ExecaOptions} execaOptions - execa options. + * @param {ExecaOptions} [execaOptions] - execa options. * @returns {ExecaChildProcess} - Child process that does dependency check. */ -const check = (argv = { _: [], input: [], ignore: [] }, processArgs = [], execaOptions) => { +const check = (argv = { _: [], input: [], ignore: [] }, processArgs = [], execaOptions = {}) => { const forwardOptions = argv['--'] ? argv['--'] : [] let input = argv.input /** @type {string[]} */ diff --git a/test/browser.spec.js b/test/browser.spec.js index ecfd56845..1e8f7ae45 100644 --- a/test/browser.spec.js +++ b/test/browser.spec.js @@ -1,7 +1,7 @@ /* eslint-env mocha */ 'use strict' -const loadFixture = require('../fixtures') +const loadFixture = require('../utils/fixtures') const expect = require('chai').expect describe('browser', () => { diff --git a/test/fixtures.js b/test/fixtures.js index 4399f4439..b12e67aa3 100644 --- a/test/fixtures.js +++ b/test/fixtures.js @@ -1,7 +1,7 @@ /* eslint-env mocha */ 'use strict' -const loadFixture = require('../fixtures') +const loadFixture = require('../utils/fixtures') const { expect } = require('../utils/chai') const path = require('path') From 8f7f4ae2a74031ff990970ebc3e66434acdee29d Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 18 Feb 2021 11:10:54 +0000 Subject: [PATCH 25/43] fix: umd bundle --- package.json | 7 ++----- src/build/index.js | 16 +++++++++++++++- tsconfig-types.json | 12 ------------ 3 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 tsconfig-types.json diff --git a/package.json b/package.json index 69666f6e5..b3a7d989c 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,7 @@ "scripts": { "prepare": "node cli.js ts -p types", "lint": "node cli.js lint", - "test:node": "node cli.js test -t node", - "test:browser": "node cli.js test -t browser webworker", - "test": "npm run test:node && npm run test:browser", + "test": "node cli.js ts -p check && node cli.js test", "release": "node cli.js release --no-docs --no-test --no-build", "release-minor": "node cli.js release --no-docs --no-build --no-test --type minor", "release-major": "node cli.js release --no-docs --no-build --no-test --type major" @@ -113,8 +111,7 @@ "typedoc": "^0.20.25", "typescript": "4.1.5", "update-notifier": "^5.0.0", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.5" + "yargs": "^16.2.0" }, "devDependencies": { "@types/bytes": "^3.1.0", diff --git a/src/build/index.js b/src/build/index.js index 00bad2566..3371e52d9 100644 --- a/src/build/index.js +++ b/src/build/index.js @@ -27,6 +27,19 @@ const merge = require('merge-options').bind({ const build = async (argv) => { const outfile = path.join(paths.dist, 'index.min.js') const globalName = pascalcase(pkg.name) + const umdPre = ` + (function (root, factory) { + if (typeof module === 'object' && module.exports) { + module.exports = factory(); + } else { + root.${globalName} = factory(); + } +}(typeof self !== 'undefined' ? self : this, function () { +` + const umdPost = ` +return ${globalName}; +})); +` await esbuild.build(merge( { entryPoints: [fromRoot('src', argv.tsRepo ? 'index.ts' : 'index.js')], @@ -36,7 +49,8 @@ const build = async (argv) => { sourcemap: argv.bundlesize, minify: true, globalName, - footer: `globalThis.${globalName} = ${globalName}`, + banner: umdPre, + footer: umdPost, metafile: argv.bundlesize ? path.join(paths.dist, 'stats.json') : undefined, outfile, define: { diff --git a/tsconfig-types.json b/tsconfig-types.json deleted file mode 100644 index 38ad97d2b..000000000 --- a/tsconfig-types.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "./src/config/tsconfig.aegir.json", - "compilerOptions": { - "outDir": "dist", - "noEmit": false, - "emitDeclarationOnly": true - }, - "include": [ - "src/index.js", - "utils" - ] -} From 3e09f88157e8eb5e4086904f726d1cc16e46d9f3 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 18 Feb 2021 13:00:24 +0000 Subject: [PATCH 26/43] feat: hooks --- src/config/user.js | 183 ++++++++---------- src/test/browser.js | 14 +- src/test/electron.js | 14 +- src/test/index.js | 6 +- src/test/node.js | 13 +- src/ts/index.js | 4 +- src/types.d.ts | 63 +++++- src/utils.js | 14 -- test/config/fixtures/custom-config/.aegir.js | 13 +- .../custom-user-async-hooks/.aegir.js | 10 +- test/config/user.js | 26 ++- 11 files changed, 176 insertions(+), 184 deletions(-) diff --git a/src/config/user.js b/src/config/user.js index 80999e41c..8be30831c 100644 --- a/src/config/user.js +++ b/src/config/user.js @@ -8,32 +8,85 @@ const merge = require('merge-options') * @typedef {import("./../types").Options} Options */ -/** - * - * @param {*} hooks - */ -function normalizeHooks (hooks = {}) { - const result = { +/** @type {Omit} */ +const defaults = { + // global options + debug: false, + tsRepo: false, + // test cmd options + test: { + runner: 'node', + target: ['node', 'browser', 'webworker'], + watch: false, + files: [], + timeout: 5000, + grep: '', + bail: false, + progress: false, + cov: false, browser: { - pre: () => Promise.resolve(), - post: () => Promise.resolve() + config: {} }, - node: { - pre: () => Promise.resolve(), - post: () => Promise.resolve() - } - } - - if (hooks.pre && hooks.post) { - result.browser.pre = hooks.pre - result.browser.post = hooks.post - result.node.pre = hooks.pre - result.node.post = hooks.post - - return result + before: async () => { return undefined }, + after: async () => {} + }, + // build cmd options + build: { + bundle: true, + bundlesize: false, + bundlesizeMax: '100kB', + types: true, + config: {} + }, + // linter cmd options + lint: { + silent: false, + fix: false, + files: [ + '*.{js,ts}', + 'bin/**', + 'config/**/*.{js,ts}', + 'test/**/*.{js,ts}', + 'src/**/*.{js,ts}', + 'tasks/**/*.{js,ts}', + 'benchmarks/**/*.{js,ts}', + 'utils/**/*.{js,ts}', + '!**/node_modules/**', + '!**/*.d.ts' + ] + }, + // docs cmd options + docs: { + publish: false, + entryPoint: 'src/index.js' + }, + // ts cmd options + ts: { + preset: undefined, + include: [], + copyFrom: 'src/**/*.d.ts', + copyTo: 'dist' + }, + // release cmd options + release: { + build: true, + test: true, + lint: true, + contributors: true, + bump: true, + changelog: true, + publish: true, + commit: true, + tag: true, + push: true, + ghrelease: true, + docs: true, + ghtoken: '', + type: 'patch', + preid: undefined, + distTag: 'latest', + remote: 'origin' } - - return merge(result, hooks) } /** @@ -64,88 +117,8 @@ const config = (searchFrom) => { } const conf = /** @type {Options} */(merge( - { - // global options - debug: false, - tsRepo: false, - hooks: {}, - // test cmd options - test: { - runner: 'node', - target: ['node', 'browser', 'webworker'], - watch: false, - files: [], - timeout: 5000, - grep: '', - bail: false, - progress: false, - cov: false, - browser: { - config: {} - } - }, - // build cmd options - build: { - bundle: true, - bundlesize: false, - bundlesizeMax: '100kB', - types: true, - config: {} - }, - // linter cmd options - lint: { - silent: false, - fix: false, - files: [ - '*.{js,ts}', - 'bin/**', - 'config/**/*.{js,ts}', - 'test/**/*.{js,ts}', - 'src/**/*.{js,ts}', - 'tasks/**/*.{js,ts}', - 'benchmarks/**/*.{js,ts}', - 'utils/**/*.{js,ts}', - '!**/node_modules/**', - '!**/*.d.ts' - ] - }, - // docs cmd options - docs: { - publish: false, - entryPoint: 'src/index.js' - }, - // ts cmd options - ts: { - preset: undefined, - include: [], - copyFrom: 'src/**/*.d.ts', - copyTo: 'dist' - }, - // release cmd options - release: { - build: true, - test: true, - lint: true, - contributors: true, - bump: true, - changelog: true, - publish: true, - commit: true, - tag: true, - push: true, - ghrelease: true, - docs: true, - ghtoken: '', - type: 'patch', - preid: undefined, - distTag: 'latest', - remote: 'origin' - } - }, - userConfig, - { - hooks: normalizeHooks(userConfig.hooks) - } + defaults, + userConfig )) return conf diff --git a/src/test/browser.js b/src/test/browser.js index 658708ed6..f264148f7 100644 --- a/src/test/browser.js +++ b/src/test/browser.js @@ -1,7 +1,7 @@ 'use strict' const path = require('path') const execa = require('execa') -const { hook, fromAegir } = require('../utils') +const { fromAegir } = require('../utils') const merge = require('merge-options') /** @@ -32,9 +32,9 @@ module.exports = async (argv, execaOptions) => { 'test/browser.{js,ts}' ] - // pre hook - const pre = await hook('browser', 'pre')(argv.fileConfig) - const preEnv = pre && pre.env ? pre.env : {} + // before hook + const before = await argv.fileConfig.test.before(argv) + const beforeEnv = before && before.env ? before.env : {} // run pw-test await execa('pw-test', @@ -51,7 +51,7 @@ module.exports = async (argv, execaOptions) => { env: { AEGIR_RUNNER: argv.runner, NODE_ENV: process.env.NODE_ENV || 'test', - ...preEnv + ...beforeEnv }, preferLocal: true, localDir: path.join(__dirname, '../..'), @@ -61,6 +61,6 @@ module.exports = async (argv, execaOptions) => { ) ) - // post hook - await hook('browser', 'post')(argv.fileConfig) + // after hook + await argv.fileConfig.test.after(argv, before) } diff --git a/src/test/electron.js b/src/test/electron.js index 609753a44..3ecbd4f16 100644 --- a/src/test/electron.js +++ b/src/test/electron.js @@ -1,7 +1,7 @@ 'use strict' const path = require('path') const execa = require('execa') -const { hook, getElectron } = require('../utils') +const { getElectron } = require('../utils') const merge = require('merge-options') /** @@ -25,9 +25,9 @@ module.exports = async (argv, execaOptions) => { const renderer = argv.runner === 'electron-renderer' ? ['--renderer'] : [] const ts = argv.tsRepo ? ['--require', require.resolve('esbuild-register')] : [] - // pre hook - const pre = await hook('browser', 'pre')(argv.fileConfig) - const preEnv = pre && pre.env ? pre.env : {} + // before hook + const before = await argv.fileConfig.test.before(argv) + const beforeEnv = before && before.env ? before.env : {} const electronPath = await getElectron() await execa('electron-mocha', @@ -52,11 +52,11 @@ module.exports = async (argv, execaOptions) => { AEGIR_RUNNER: argv.runner, NODE_ENV: process.env.NODE_ENV || 'test', ELECTRON_PATH: electronPath, - ...preEnv + ...beforeEnv } }, execaOptions) ) - // post hook - await hook('browser', 'post')(argv.fileConfig) + // after hook + await argv.fileConfig.test.after(argv, before) } diff --git a/src/test/index.js b/src/test/index.js index 6ba0bc63b..a6d7b3966 100644 --- a/src/test/index.js +++ b/src/test/index.js @@ -14,7 +14,11 @@ const electron = require('./electron') const TASKS = [ { title: 'Test Node.js', - task: node, + /** + * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions + */ + task: (opts, execaOptions) => node({ ...opts, runner: 'node' }, execaOptions), /** * @param {TestOptions & GlobalOptions} ctx */ diff --git a/src/test/node.js b/src/test/node.js index 088e2f713..5e75282f8 100644 --- a/src/test/node.js +++ b/src/test/node.js @@ -3,7 +3,6 @@ const execa = require('execa') const path = require('path') const tempy = require('tempy') -const { hook } = require('../utils') const merge = require('merge-options') /** @@ -64,9 +63,9 @@ async function testNode (argv, execaOptions) { args.push(...argv['--']) } - // pre hook - const pre = await hook('node', 'pre')(argv.fileConfig) - const preEnv = pre && pre.env ? pre.env : {} + // before hook + const before = await argv.fileConfig.test.before(argv) + const beforeEnv = before && before.env ? before.env : {} // run mocha await execa(exec, args, @@ -75,7 +74,7 @@ async function testNode (argv, execaOptions) { env: { AEGIR_RUNNER: 'node', NODE_ENV: process.env.NODE_ENV || 'test', - ...preEnv + ...beforeEnv }, preferLocal: true, localDir: path.join(__dirname, '../..'), @@ -84,8 +83,8 @@ async function testNode (argv, execaOptions) { execaOptions ) ) - // post hook - await hook('node', 'post')(argv.fileConfig) + // after hook + await argv.fileConfig.test.after(argv, before) } module.exports = testNode diff --git a/src/ts/index.js b/src/ts/index.js index aa464de5c..8c0133d9c 100644 --- a/src/ts/index.js +++ b/src/ts/index.js @@ -14,7 +14,7 @@ const hasConfig = hasFile('tsconfig.json') * @typedef {import("../types").TSOptions} TSOptions * * @typedef {Object} Options - * @property {"config" | "check" | "types"} preset + * @property {"config" | "check" | "types" | undefined} preset * @property {string[]} forwardOptions - Extra options to forward to the backend * @property {string[]} extraInclude - Extra include files for the TS Config * @property {boolean} tsRepo - Typescript repo support. @@ -133,7 +133,7 @@ const types = async (userTSConfig, opts) => { declarationMap: true }, include: opts.extraInclude, - exclude: ['test'] + exclude: ['test', '.aegir.js'] } ]) ) diff --git a/src/types.d.ts b/src/types.d.ts index 3e0059a34..90d04883f 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -1,8 +1,6 @@ import type esbuild from 'esbuild' /** * Options for CLI and local file config - * - * */ interface Options extends GlobalOptions { /** @@ -31,6 +29,44 @@ interface Options extends GlobalOptions { release: ReleaseOptions } +/** + * Partial options for local file config + */ +interface PartialOptions { + /** + * Show debug output. + */ + debug?: boolean + /** + * Enable support for Typescript repos. + */ + tsRepo?: boolean + /** + * Options for the `build` command + */ + build?: Partial + /** + * Options for the `ts` command + */ + ts?: Partial + /** + * Options for the `docs` command + */ + docs?: Partial + /** + * Options for the `lint` command + */ + lint?: Partial + /** + * Options for the `test` command + */ + test?: Partial + /** + * Options for the `release` command + */ + release?: Partial +} + interface GlobalOptions { /** * Show debug output. @@ -49,10 +85,6 @@ interface GlobalOptions { * CLI Input */ '_'?: string - /** - * Hooks - */ - hooks?: any /** * Full config from configuration file */ @@ -86,7 +118,7 @@ interface TSOptions { /** * Preset to run. */ - preset: 'config' | 'check' | 'types' + preset: 'config' | 'check' | 'types' | undefined /** * Values are merged into the local TS config include property. */ @@ -173,6 +205,20 @@ interface TestOptions { */ config: any } + /** + * Before tests hook + */ + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + before: (options: GlobalOptions & TestOptions) => Promise + /** + * After tests hook + */ + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + after: (options: GlobalOptions & TestOptions, beforeResult: TestBeforeResult | void) => Promise +} + +interface TestBeforeResult { + env?: NodeJS.ProcessEnv } interface ReleaseOptions { @@ -205,7 +251,7 @@ interface ReleaseOptions { /** * Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. */ - preid: string + preid?: string /** * The npm tag to publish to */ @@ -217,6 +263,7 @@ interface ReleaseOptions { } export type { + PartialOptions, Options, GlobalOptions, BuildOptions, diff --git a/src/utils.js b/src/utils.js index 05aa824db..bdabd2462 100644 --- a/src/utils.js +++ b/src/utils.js @@ -90,20 +90,6 @@ exports.getListrConfig = () => { } } -// @ts-ignore -exports.hook = (env, key) => (ctx) => { - if (ctx && ctx.hooks) { - if (ctx.hooks[env] && ctx.hooks[env][key]) { - return ctx.hooks[env][key]() - } - if (ctx.hooks[key]) { - return ctx.hooks[key]() - } - } - - return Promise.resolve() -} - /** * @param {string} command * @param {string[] | undefined} args diff --git a/test/config/fixtures/custom-config/.aegir.js b/test/config/fixtures/custom-config/.aegir.js index ee8844250..a07a84c50 100644 --- a/test/config/fixtures/custom-config/.aegir.js +++ b/test/config/fixtures/custom-config/.aegir.js @@ -1,14 +1,3 @@ module.exports = { - webpack: { - devtool: 'eval' - }, - entry: 'src/main.js', - hooks: { - pre() { - return Promise.resolve('pre'); - }, - post() { - return Promise.resolve('post'); - } - } + }; diff --git a/test/config/fixtures/custom-user-async-hooks/.aegir.js b/test/config/fixtures/custom-user-async-hooks/.aegir.js index 138dd46d0..faaaaedec 100644 --- a/test/config/fixtures/custom-user-async-hooks/.aegir.js +++ b/test/config/fixtures/custom-user-async-hooks/.aegir.js @@ -1,15 +1,11 @@ module.exports = { - webpack: { - devtool: 'eval' - }, - entry: 'src/main.js', - hooks: { - async pre () { + test: { + async before () { await Promise.resolve() return 'pre done async' }, - async post () { + async after () { await Promise.resolve() return 'post done async' diff --git a/test/config/user.js b/test/config/user.js index 0fbcf1053..fd3423227 100644 --- a/test/config/user.js +++ b/test/config/user.js @@ -8,25 +8,23 @@ const path = require('path') describe('config - user', () => { it('custom config', async () => { const conf = config(path.join(__dirname, 'fixtures/custom-config')) - expect(conf).to.have.property('webpack').eql({ - devtool: 'eval' - }) - expect(conf).to.have.property('entry', 'src/main.js') + expect(conf).to.have.property('debug').eql(false) + expect(conf).to.have.property('tsRepo').eql(false) + expect(conf).to.have.nested.property('test.before') + expect(conf).to.have.nested.property('test.after') - expect(conf.hooks).to.have.nested.property('browser.pre') - expect(conf.hooks).to.have.nested.property('browser.post') - expect(conf.hooks).to.have.nested.property('node.pre') - expect(conf.hooks).to.have.nested.property('node.post') - - const res = await conf.hooks.browser.pre() - expect(res).to.eql('pre') + // @ts-ignore + const res = await conf.test.before() + expect(res).to.eql(undefined) }) it('supports async hooks', async () => { const conf = config(path.join(__dirname, 'fixtures/custom-user-async-hooks')) - expect(await conf.hooks.browser.pre()).to.eql('pre done async') - expect(await conf.hooks.browser.post()).to.eql('post done async') + // @ts-ignore + expect(await conf.test.before()).to.eql('pre done async') + // @ts-ignore + expect(await conf.test.after()).to.eql('post done async') }) - it('supports async hooks', async () => { + it('supports package.json aegir property', async () => { const conf = config(path.join(__dirname, 'fixtures/custom-config-package-json')) expect(conf.debug).to.ok() }) From c842d821dd6ad84f166a92331164d8403a8a3688 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 18 Feb 2021 14:19:00 +0000 Subject: [PATCH 27/43] fix: types --- src/index.js | 1 + src/types.d.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 6ccf5ba66..dcfa4d5e2 100644 --- a/src/index.js +++ b/src/index.js @@ -3,6 +3,7 @@ /** * @typedef {import('./types').Options} Options + * @typedef {import('./types').PartialOptions} PartialOptions */ module.exports = {} diff --git a/src/types.d.ts b/src/types.d.ts index 90d04883f..7a78d5a87 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -111,7 +111,7 @@ interface BuildOptions { /** * esbuild build options */ - config: esbuild.CommonOptions + config: esbuild.BuildOptions } interface TSOptions { From 5bc8f64fbc32f93ea148256f36c84af75300f25e Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 18 Feb 2021 17:53:41 +0000 Subject: [PATCH 28/43] fix: dependency check --- src/cmds/z-dependency-check.js | 17 ++++---- src/config/user.js | 19 +++++++++ src/dependency-check.js | 76 ++++------------------------------ src/types.d.ts | 30 +++++++++++++- 4 files changed, 65 insertions(+), 77 deletions(-) diff --git a/src/cmds/z-dependency-check.js b/src/cmds/z-dependency-check.js index da0106bdd..43c0b90f0 100644 --- a/src/cmds/z-dependency-check.js +++ b/src/cmds/z-dependency-check.js @@ -2,7 +2,8 @@ 'use strict' const ora = require('ora') -const { check, commandNames, defaultInput } = require('../dependency-check') +const { userConfig } = require('../config/user') +const { check } = require('../dependency-check') /** * @typedef {import("yargs").Argv} Argv */ @@ -10,11 +11,9 @@ const EPILOG = ` Supports options forwarding with '--' for more info check https://github.com/maxogden/dependency-check#cli-usage ` -const commandName = commandNames[0] - module.exports = { - command: `${commandName} [input...]`, - aliases: commandNames.filter(name => name !== commandName), + command: 'dependency-check [input...]', + aliases: ['dep-check', 'dep'], desc: 'Run `dependency-check` cli with aegir defaults.', /** * @param {Argv} yargs @@ -28,19 +27,19 @@ module.exports = { describe: 'Files to check', // @ts-ignore type: 'array', - default: defaultInput + default: userConfig.dependencyCheck.input }) .option('p', { alias: 'production-only', describe: 'Check production dependencies and paths only', type: 'boolean', - default: false + default: userConfig.dependencyCheck.productionOnly }) .option('i', { alias: 'ignore', describe: 'Ignore these dependencies when considering which are used and which are not', type: 'array', - default: [] + default: userConfig.dependencyCheck.ignore }) }, /** @@ -50,7 +49,7 @@ module.exports = { const spinner = ora('Checking dependencies').start() try { - await check(argv, process.argv) + await check(argv) spinner.succeed() } catch (err) { spinner.fail() diff --git a/src/config/user.js b/src/config/user.js index 8be30831c..c2d02c225 100644 --- a/src/config/user.js +++ b/src/config/user.js @@ -86,6 +86,25 @@ const defaults = { preid: undefined, distTag: 'latest', remote: 'origin' + }, + // dependency check cmd options + dependencyCheck: { + input: [ + 'package.json', + '.aegir.js', + 'src/**/*.js', + 'test/**/*.js', + 'benchmarks/**/*.js', + 'utils/**/*.js', + '!./test/fixtures/**/*.js' + ], + productionOnly: false, + productionInput: [ + 'package.json' + ], + ignore: [ + '@types/*' + ] } } diff --git a/src/dependency-check.js b/src/dependency-check.js index 5169fe3f9..10479a07f 100644 --- a/src/dependency-check.js +++ b/src/dependency-check.js @@ -4,84 +4,28 @@ const path = require('path') const execa = require('execa') const merge = require('merge-options') -/** @typedef {import("execa").Options} ExecaOptions */ -/** @typedef {import("execa").ExecaChildProcess} ExecaChildProcess */ - -const defaultInput = [ - 'package.json', - '.aegir.js*', - './test/**/*.js', - './src/**/*.js', - '!./test/fixtures/**/*.js' -] - -const commandNames = ['dependency-check', 'dep-check', 'dep'] - /** - * Returns true if the user invoked the command with non-flag or - * optional args - * - * @param {string[]} input - input files maybe passed by the user, maybe defaults - * @param {string[]} processArgs - process.argv or similar - * @returns {boolean} + * @typedef {import("execa").Options} ExecaOptions + * @typedef {import("./types").GlobalOptions} GlobalOptions + * @typedef {import("./types").DependencyCheckOptions} DependencyCheckOptions */ -const hasPassedFileArgs = (input, processArgs) => { - // if any of the passed paths are not in the process.argv used to invoke - // this command, we have been passed defaults and not user input - for (const path of input) { - if (!processArgs.includes(path)) { - return false - } - } - - return true -} /** * Check dependencies * - * @param {*} argv - Command line arguments passed to the process. - * @param {string[]} processArgs - Unparsed command line arguments used to start the process + * @param {GlobalOptions & DependencyCheckOptions} argv - Command line arguments passed to the process. * @param {ExecaOptions} [execaOptions] - execa options. - * @returns {ExecaChildProcess} - Child process that does dependency check. */ -const check = (argv = { _: [], input: [], ignore: [] }, processArgs = [], execaOptions = {}) => { +const check = (argv, execaOptions) => { const forwardOptions = argv['--'] ? argv['--'] : [] - let input = argv.input - /** @type {string[]} */ - const ignore = argv.ignore - - if (argv.productionOnly) { - if (!hasPassedFileArgs(input, processArgs)) { - input = [ - 'package.json', - './src/**/*.js' - ] - } - - forwardOptions.push('--no-dev') - } - - if (ignore.length) { - // this allows us to specify ignores on a per-module basis while also orchestrating the command across multiple modules. - // - // e.g. npm script in package.json: - // "dependency-check": "aegir dependency-check -i cross-env", - // - // .travis.yml: - // lerna run dependency-check -- -p -- --unused - // - // results in the following being run in the package: - // aegir dependency-check -i cross-env -p -- --unused - ignore.forEach(i => { - forwardOptions.push('-i', i) - }) - } + const input = argv.productionOnly ? argv.productionInput : argv.input + const noDev = argv.productionOnly ? ['--no-dev'] : [] return execa('dependency-check', [ ...input, '--missing', + ...noDev, ...forwardOptions ], merge( @@ -95,7 +39,5 @@ const check = (argv = { _: [], input: [], ignore: [] }, processArgs = [], execaO } module.exports = { - check, - defaultInput, - commandNames + check } diff --git a/src/types.d.ts b/src/types.d.ts index 7a78d5a87..78fb5907e 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -27,6 +27,10 @@ interface Options extends GlobalOptions { * Options for the `release` command */ release: ReleaseOptions + /** + * Options for the `dependency-check` command + */ + dependencyCheck: DependencyCheckOptions } /** @@ -65,6 +69,10 @@ interface PartialOptions { * Options for the `release` command */ release?: Partial + /** + * Options for the `dependency-check` command + */ + dependencyCheck?: DependencyCheckOptions } interface GlobalOptions { @@ -262,6 +270,25 @@ interface ReleaseOptions { remote: string } +interface DependencyCheckOptions { + /** + * Files to check + */ + input: string[] + /** + * Check production dependencies and paths only + */ + productionOnly: boolean + /** + * Ignore these dependencies when considering which are used and which are not + */ + ignore: string[] + /** + * Files to check when in production only mode + */ + productionInput: string[] +} + export type { PartialOptions, Options, @@ -271,5 +298,6 @@ export type { DocsOptions, LintOptions, TestOptions, - ReleaseOptions + ReleaseOptions, + DependencyCheckOptions } From 181abe54d7fe6c407a13f377ebe7bf32460be08c Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 18 Feb 2021 20:46:03 +0000 Subject: [PATCH 29/43] fix: dep-check ignore --- src/dependency-check.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dependency-check.js b/src/dependency-check.js index 10479a07f..cdb3fcf6f 100644 --- a/src/dependency-check.js +++ b/src/dependency-check.js @@ -20,12 +20,14 @@ const check = (argv, execaOptions) => { const forwardOptions = argv['--'] ? argv['--'] : [] const input = argv.productionOnly ? argv.productionInput : argv.input const noDev = argv.productionOnly ? ['--no-dev'] : [] + const ignore = argv.ignore.reduce((acc, i) => acc.concat('-i', i), /** @type {string[]} */([])) return execa('dependency-check', [ ...input, '--missing', ...noDev, + ...ignore, ...forwardOptions ], merge( From 169edb15f8d450c19f824c2281ab323e8d827edc Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 18 Feb 2021 21:01:47 +0000 Subject: [PATCH 30/43] fix: concat dep-check ignore defaults to input --- src/dependency-check.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dependency-check.js b/src/dependency-check.js index cdb3fcf6f..927d466a1 100644 --- a/src/dependency-check.js +++ b/src/dependency-check.js @@ -20,7 +20,9 @@ const check = (argv, execaOptions) => { const forwardOptions = argv['--'] ? argv['--'] : [] const input = argv.productionOnly ? argv.productionInput : argv.input const noDev = argv.productionOnly ? ['--no-dev'] : [] - const ignore = argv.ignore.reduce((acc, i) => acc.concat('-i', i), /** @type {string[]} */([])) + const ignore = argv.ignore + .concat(argv.fileConfig.dependencyCheck.ignore) + .reduce((acc, i) => acc.concat('-i', i), /** @type {string[]} */([])) return execa('dependency-check', [ From 6dedc098e91d86b5a4a39a32d25d8cfa9ffec55f Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 19 Feb 2021 11:28:58 +0000 Subject: [PATCH 31/43] fix: add migration and fix dep-check --- md/migration-to-v31.md | 223 +++++++++++++++++++++++++++++++++++++++ src/dependency-check.js | 25 +++-- test/dependency-check.js | 129 +++++++++++++--------- test/node.js | 1 - test/utils.js | 32 ------ 5 files changed, 318 insertions(+), 92 deletions(-) create mode 100644 md/migration-to-v31.md delete mode 100644 test/utils.js diff --git a/md/migration-to-v31.md b/md/migration-to-v31.md new file mode 100644 index 000000000..7b8c0f676 --- /dev/null +++ b/md/migration-to-v31.md @@ -0,0 +1,223 @@ +# Migration Guide + +## `typeVersions` should not be used unless strictly necessary + +We started `typeVersions` a while a ago as an hack to allow deep type imports inside the `src` folder, but this makes the TS compiler output wrong import statement in the `.d.ts` . + +Look into the link bellow for more info: + +- [https://github.com/ipfs/aegir/pull/717](https://github.com/ipfs/aegir/pull/717) +- [https://github.com/ipfs/aegir/blob/master/md/ts-jsdoc.md#getting-started](https://github.com/ipfs/aegir/blob/master/md/ts-jsdoc.md#getting-started) + +Actions: + +- Remove typeVersions and do a major release + +## `aegir ts -p docs` was removed in favor of `aegir docs` + +More info in this PR [https://github.com/ipfs/aegir/pull/727](https://github.com/ipfs/aegir/pull/727) + +Actions: + +- Change your script to the new command + +## `aegir docs` has a new flag + +The docs command has a new flag `entryPoint` to setup Typedoc, the defaults should work for most repos. + +Actions: + +- If your repo doesn't follow the standard structure change this new options accordingly. The default value is `src/index.js` + +## The `--ts` global flag was renamed to `--ts-repo` + +This flag enable support for repo using typescript, but with the work to improve configuration we ran into some name collision so this needed to be changed. + +Actions: + +- Change your scripts or configuration to the new flag + +> This is a global flag, you can define it in the configuration file once and all the commands will use it + +## Old npm dependencies semver linting removed + +We had this manual rule for a long time, but npm evolved and the current behaviour is exactly what this rule enforced. + +No action necessary + +## Config property `bundlesize.maxSize` removed + +Actions: + +- Update your config to use + +```jsx +{ + build: { + bundlesizeMax: '100kb' + } +} +``` + +## `types.ts` should not be used + +We were using `.ts` files to write complex types instead of using just JSDocs, but this makes the TS compiler parse these files as code files instead of been just types files and that causes problems in the types generated. + +Importing class types from `.js` files into `.ts` files generates the final `.d.ts` with wrong import statements to the source files instead of the types files. + +Actions: + +- Change the extension of all your `.ts` files to `.d.ts` + +The ts command will copy all `.d.ts` inside the `src` folder to the `dist` folder automatically, and there's two new options to configure custom paths when copying files. + +More info here [https://github.com/ipfs/aegir/blob/master/md/ts-jsdoc.md#3-use-a-typesdts-file](https://github.com/ipfs/aegir/blob/master/md/ts-jsdoc.md#3-use-a-typesdts-file) and here `aegir ts --help` + +## `--node` flag removed + +This flag was used to tell webpack to inject polyfills for node globals and builtins, this is no longer supported because we use esbuild now. + +Actions: + +- remove this flag from your scripts and configuration +- use your aegir configuration file to setup the bundler for the globals and builtin your code needs + +```jsx +// file: node-globals.js +// @ts-nocheck +export const { Buffer } = require('buffer') +export const process = require('process/browser') + +// file: .aegir.js +const esbuild = { + // this will inject all the named exports from 'node-globals.js' as globals + inject: [path.join(__dirname, '../../scripts/node-globals.js')], + plugins: [ + { + name: 'node built ins', // this will make the bundler resolve node builtins to the respective browser polyfill + setup (build) { + build.onResolve({ filter: /^stream$/ }, () => { + return { path: require.resolve('readable-stream') } + }) + } + } + ] +} + +module.exports = { + test: { + browser :{ + config: { + buildConfig: esbuild + } + } + }, + build: { + config: esbuild + } +} +``` + +- test your browser bundle especially for `process` usage + - the bundler will tell about unresolved packages like `require('fs')` and other errors + - running the browser tests will tell you about node globals that don't exist like `Buffer` + - `process` is special because it's polyfilled by the test runner but not by the bundler in `aegir build` + - `aegir build` only define the var `global` and `process.env.NODE_ENV` if you code needs process.nextTick etc you need to polyfill the full process object + +## Loading fixtures for browser tests + +The new browser test runner automatically serves the current folder (`process.cwd()`) to be accessible through HTTP. + +If you need to customise the folder to be served by the test runner use this config option `test.browser.config.assets` + +## Running tests in the browser + +Check the options for the new test runner here [https://github.com/hugomrdias/playwright-test#options](https://github.com/hugomrdias/playwright-test#options) these be forward directly from aegir + +Actions: + +- change from `aegir test -t browser -- --browsers FirefoxHeadless` to `aegir test -t browser -- --browser firefox` (options are: chromium, firefox, webkit) +- debug mode `aegir test -t browser -- --debug` + +## Codecov uploads + +There's no need to use nyc to instrument and generate reports for codecov anymore + +Action: + +- just add the `--cov` flag to your tests command + +## Some flags were removed from node mocha test command + +- —exit check what this did here [https://mochajs.org/#-exit](https://mochajs.org/#-exit), if you really need this (you shouldn't!) you can forward from aegir `aegir test -t node -- --exit` +- —invert this flag was mute because we didn't support the —fgrep flag, as always you can still forward it to mocha +- —verbose flag was removed mocha doesn't support it anymore +- —color was removed we always want pretty stuff 😂 +- —parallel was removed never worked + +## `fixtures` download util was moved to the utils folder + +Actions: + +- update your requires from `require('aegir/fixtures')` to `require('aegir/utils/fixture')` + +## git-validate removed from dependencies + +Actions: + +- you need to use git-validate or husky in your repo to continue using git hooks + +## commit-lint command removed + +We already discussed the usage of commit-lint and decided to stop using it. + +Actions: + +- remove commil-lint from you scripts + +## Hooks + +Hooks were removed in favor of two new test hooks `before` and `after` + +Actions: + +```jsx +// before +module.exports = { + hooks: { + async pre () { + await Promise.resolve() + + return 'pre done async' + }, + async post () { + await Promise.resolve() + + return 'post done async' + } + } +}; + +// now +module.exports = { + test: { + async before (testOptions) { + if(testOptions.runner === 'node') { + // run node specific setup + } + if(testOptions.runner === 'browser') { + // run browser specific setup + } + const server = new Server() + await server.start() + return { + env: { SERVER_URL: server.endpoint } + server +  } + }, + async after (testOptions, beforeReturn) { + await beforeReturn.server.stop() + } + } +}; +``` diff --git a/src/dependency-check.js b/src/dependency-check.js index 927d466a1..531d763de 100644 --- a/src/dependency-check.js +++ b/src/dependency-check.js @@ -10,6 +10,12 @@ const merge = require('merge-options') * @typedef {import("./types").DependencyCheckOptions} DependencyCheckOptions */ +/** + * @param {any} arr1 + * @param {any} arr2 + */ +const isDefaultInput = (arr1, arr2) => + JSON.stringify(arr1) === JSON.stringify(arr2) /** * Check dependencies * @@ -18,20 +24,19 @@ const merge = require('merge-options') */ const check = (argv, execaOptions) => { const forwardOptions = argv['--'] ? argv['--'] : [] - const input = argv.productionOnly ? argv.productionInput : argv.input + const input = + argv.productionOnly && + isDefaultInput(argv.fileConfig.dependencyCheck.input, argv.input) + ? argv.productionInput + : argv.input const noDev = argv.productionOnly ? ['--no-dev'] : [] const ignore = argv.ignore .concat(argv.fileConfig.dependencyCheck.ignore) - .reduce((acc, i) => acc.concat('-i', i), /** @type {string[]} */([])) + .reduce((acc, i) => acc.concat('-i', i), /** @type {string[]} */ ([])) - return execa('dependency-check', - [ - ...input, - '--missing', - ...noDev, - ...ignore, - ...forwardOptions - ], + return execa( + 'dependency-check', + [...input, '--missing', ...noDev, ...ignore, ...forwardOptions], merge( { localDir: path.join(__dirname, '..'), diff --git a/test/dependency-check.js b/test/dependency-check.js index c018a0223..8fa1d6c94 100644 --- a/test/dependency-check.js +++ b/test/dependency-check.js @@ -1,93 +1,124 @@ /* eslint-env mocha */ 'use strict' -const { check, defaultInput } = require('../src/dependency-check') +const { check } = require('../src/dependency-check') const { expect } = require('../utils/chai') const path = require('path') const merge = require('merge-options') +const { userConfig } = require('../src/config/user') // returns an object that looks like the yargs input const yargsv = (overrides = {}) => { const argv = { - _: [ - 'dependency-check' - ], - input: defaultInput, - ignore: [] + _: ['dependency-check'], + input: userConfig.dependencyCheck.input, + productionOnly: false, + productionInput: userConfig.dependencyCheck.productionInput, + ignore: [], + fileConfig: userConfig } return merge(argv, overrides) } -/** - * - * @param {string[] | string} input - */ -const argv = (input = []) => { - return [ - 'node', 'aegir', 'dependency-check' - ].concat(input) -} - describe('dependency check', () => { it('should fail for missing deps', async () => { - await expect(check(yargsv(), argv(), { - cwd: path.join(__dirname, 'fixtures/dependency-check/fail') - })).to.eventually.be.rejectedWith('execa') + await expect( + check(yargsv(), { + cwd: path.join(__dirname, 'fixtures/dependency-check/fail') + }) + ).to.eventually.be.rejectedWith('execa') }) it('should pass when there are no missing deps', async () => { - await expect(check(yargsv(), argv(), { - cwd: path.join(__dirname, 'fixtures/dependency-check/pass') - })).to.eventually.be.fulfilled() + await expect( + check(yargsv(), { + cwd: path.join(__dirname, 'fixtures/dependency-check/pass') + }) + ).to.eventually.be.fulfilled() }) it('should forward options', async () => { - await expect(check(yargsv({ '--': ['--unused'] }), argv(), { - cwd: path.join(__dirname, 'fixtures/dependency-check/pass') - })).to.eventually.be.rejectedWith('Modules in package.json not used in code: pico') + await expect( + check(yargsv({ '--': ['--unused'] }), { + cwd: path.join(__dirname, 'fixtures/dependency-check/pass') + }) + ).to.eventually.be.rejectedWith( + 'Modules in package.json not used in code: pico' + ) }) it('should fail for missing production deps', async () => { - await expect(check(yargsv({ productionOnly: true }), argv(), { - cwd: path.join(__dirname, 'fixtures/dependency-check/fail-prod') - })).to.eventually.be.rejectedWith('execa') + await expect( + check(yargsv({ productionOnly: true }), { + cwd: path.join(__dirname, 'fixtures/dependency-check/fail-prod') + }) + ).to.eventually.be.rejectedWith('execa') }) it('should pass for passed files', async () => { const file = 'derp/foo.js' - await expect(check(yargsv({ - input: [file] - }), argv(file), { - cwd: path.join(__dirname, 'fixtures/dependency-check/pass-certain-files') - })).to.eventually.be.fulfilled() + await expect( + check( + yargsv({ + input: [file] + }), + { + cwd: path.join( + __dirname, + 'fixtures/dependency-check/pass-certain-files' + ) + } + ) + ).to.eventually.be.fulfilled() }) it('should pass for passed production files', async () => { const file = 'derp/foo.js' - await expect(check(yargsv({ - productionOnly: true, - input: [file] - }), argv(file), { - cwd: path.join(__dirname, 'fixtures/dependency-check/pass-certain-files') - })).to.eventually.be.fulfilled() + await expect( + check( + yargsv({ + productionOnly: true, + input: [file] + }), + { + cwd: path.join( + __dirname, + 'fixtures/dependency-check/pass-certain-files' + ) + } + ) + ).to.eventually.be.fulfilled() }) it('should pass for ignored modules', async () => { - await expect(check(yargsv({ - ignore: ['execa'] - }), argv(), { - cwd: path.join(__dirname, 'fixtures/dependency-check/fail') - })).to.eventually.be.fulfilled() + await expect( + check( + yargsv({ + ignore: ['execa'] + }), + { + cwd: path.join(__dirname, 'fixtures/dependency-check/fail') + } + ) + ).to.eventually.be.fulfilled() }) it('should pass for modules used in .aegir.js', async () => { - await expect(check(yargsv({ - '--': ['--unused'] - }), argv(['--', '--unused']), { - cwd: path.join(__dirname, 'fixtures/dependency-check/with-aegir-config') - })).to.eventually.be.fulfilled() + await expect( + check( + yargsv({ + '--': ['--unused'] + }), + { + cwd: path.join( + __dirname, + 'fixtures/dependency-check/with-aegir-config' + ) + } + ) + ).to.eventually.be.fulfilled() }) }) diff --git a/test/node.js b/test/node.js index fa839510d..37fb17c47 100644 --- a/test/node.js +++ b/test/node.js @@ -1,6 +1,5 @@ 'use strict' -require('./utils') require('./lint') require('./fixtures') require('./dependants') diff --git a/test/utils.js b/test/utils.js deleted file mode 100644 index 1d0bf491b..000000000 --- a/test/utils.js +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-env mocha */ -'use strict' - -const { expect } = require('../utils/chai') - -const utils = require('../src/utils') - -describe('utils', () => { - it('hook', () => { - const res = utils.hook('node', 'pre')({ - hooks: { - node: { - pre () { - return Promise.resolve(10) - } - } - } - }) - - return Promise.all([ - res, - utils.hook('node', 'pre')({ hooks: {} }), - utils.hook('node', 'pre')({ hooks: { browser: { pre: {} } } }) - ]).then((results) => { - expect(results).to.eql([ - 10, - undefined, - undefined - ]) - }) - }) -}) From 9000abae849ff5a51ce7addf0e0b483dd4923a10 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 19 Feb 2021 11:47:25 +0000 Subject: [PATCH 32/43] fix: scripts --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index b3a7d989c..da7ba7a7f 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,8 @@ "prepare": "node cli.js ts -p types", "lint": "node cli.js lint", "test": "node cli.js ts -p check && node cli.js test", + "test:node": "node cli.js test -t node", + "test:browser": "node cli.js test -t browser -t webworker", "release": "node cli.js release --no-docs --no-test --no-build", "release-minor": "node cli.js release --no-docs --no-build --no-test --type minor", "release-major": "node cli.js release --no-docs --no-build --no-test --type major" From 9bbb44e8666e915f40dc619daaaabef598b2cde3 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 19 Feb 2021 12:04:23 +0000 Subject: [PATCH 33/43] fix: dep-check prod input --- src/dependency-check.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dependency-check.js b/src/dependency-check.js index 531d763de..37e7ffc3b 100644 --- a/src/dependency-check.js +++ b/src/dependency-check.js @@ -27,7 +27,7 @@ const check = (argv, execaOptions) => { const input = argv.productionOnly && isDefaultInput(argv.fileConfig.dependencyCheck.input, argv.input) - ? argv.productionInput + ? argv.fileConfig.dependencyCheck.productionInput : argv.input const noDev = argv.productionOnly ? ['--no-dev'] : [] const ignore = argv.ignore From ce16e7c24a3d7d8fdc8072cb827cb6af332aba3c Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 19 Feb 2021 12:14:50 +0000 Subject: [PATCH 34/43] fix: add src to dep-check prod input --- package.json | 2 +- src/config/user.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index da7ba7a7f..fc85576eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aegir", - "version": "30.3.0", + "version": "31.0.0-next0", "description": "JavaScript project management", "keywords": [ "webpack", diff --git a/src/config/user.js b/src/config/user.js index c2d02c225..51615fb3d 100644 --- a/src/config/user.js +++ b/src/config/user.js @@ -100,7 +100,8 @@ const defaults = { ], productionOnly: false, productionInput: [ - 'package.json' + 'package.json', + 'src/**/*.js' ], ignore: [ '@types/*' From 838c165e1c444640976745b711d8926f3f84633b Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 23 Feb 2021 12:56:33 +0000 Subject: [PATCH 35/43] fix: documentation --- .aegir.js | 10 +- README.md | 314 +++++++------------------------------- md/github-actions.md | 83 ++++++++++ md/ts-jsdoc.md | 5 +- package.json | 6 +- src/cmds/build.js | 1 - src/cmds/lint.js | 52 ++++--- src/cmds/release.js | 202 +++++++++++++----------- src/cmds/test.js | 4 +- src/config/user.js | 1 + src/release/index.js | 2 +- src/types.d.ts | 1 + utils/chai.js | 7 +- utils/echo-server.js | 31 ++++ utils/fixtures.browser.js | 35 ++++- utils/fixtures.js | 22 ++- utils/get-port.js | 10 +- 17 files changed, 413 insertions(+), 373 deletions(-) create mode 100644 md/github-actions.md diff --git a/.aegir.js b/.aegir.js index 913d85ea7..79be32206 100644 --- a/.aegir.js +++ b/.aegir.js @@ -1 +1,9 @@ -// Only for testing +/** @type {import("./src/types").PartialOptions} */ +module.exports = { + docs: { + entryPoint: 'utils' + }, + release: { + build: false + } +} \ No newline at end of file diff --git a/README.md b/README.md index 340a2db60..dbb575e13 100644 --- a/README.md +++ b/README.md @@ -11,27 +11,13 @@ ## ToC - [Project Structure](#project-structure) -- [CI](#ci) - - [Travis Setup](#travis-setup) - - [Github Action Setup](#github-action-setup) -- [Stack Requirements](#stack-requirements) +- [CLI](#cli) +- [Continuous Integration](#continuous-integration) - [Testing helpers](#testing-helpers) - - [Fixtures](#fixtures) - - [Echo Server](#echo-server) - - [Get Port](#get-port) -- [Tasks](#tasks) - - [Linting](#linting) - - [Testing](#testing) - - [Coverage](#coverage) - - [Node](#node) - - [Browser](#browser) - - [Building](#building) - - [Generating Webpack stats.json](#generating-webpack-statsjson) - - [Typescript](#typescript) - - [JSDoc Typescript support](#jsdoc-typescript-support) - - [Releasing](#releasing) - - [Scoped Github Token](#scoped-github-token) - - [Documentation](#documentation) +- [Typescript](#typescript) + - [JSDoc Typescript support](#jsdoc-typescript-support) + - [Native Typescript support](#native-typescript-support) + - [Release steps](#release-steps) - [License](#license) ## Project Structure @@ -42,7 +28,7 @@ replication and configuration overhead. All source code should be placed under `src`, with the main entry point being `src/index.js`. -All test files should be placed under `test`. Individual test files should end in `.spec.js` and setup files for the node and the browser should be `test/node.js` and `test/browser.js` respectively. +All test files should be placed under `test`. Individual test files should end in `.spec.js` and will be ran in all environments (node, browser, webworker, electron-main and electron-renderer). To run node specific tests a file named `test/node.js` should be used to require all node test files and the same thing for the other environments with a file named `test/browser.js`. Your `package.json` should have the following entries and should pass `aegir lint-package-json`. @@ -63,267 +49,85 @@ Your `package.json` should have the following entries and should pass `aegir lin } ``` -## CI -### Travis Setup -Check this tutorial https://github.com/ipfs/aegir/wiki/Travis-Setup +## CLI -### Github Action Setup -Check this tutorial https://github.com/ipfs/aegir/wiki/Github-Actions-Setup - -## Stack Requirements - -To bring you its many benefits, `aegir` requires - -- JS written in [Standard](https://github.com/feross/standard) style -- Tests written in [Mocha](https://github.com/mochajs/mocha) -- [Karma](https://github.com/karma-runner/karma) for browser tests - -## Testing helpers -In addition to running the tests `aegir` also provides several helpers to be used by the tests. - -#### Fixtures - -Loading fixture files in node and the browser can be painful, that's why aegir provides -a method to do this. For it to work you have to put your fixtures in the folder `test/fixtures`, and then - -```js -// test/awesome.spec.js -const loadFixture = require('aegir/fixtures') - -const myFixture = loadFixture('test/fixtures/largefixture') -``` - -The path to the fixture is relative to the module root. - -If you write a module like [interface-ipfs-core](https://github.com/ipfs/interface-ipfs-core) -which is to be consumed by other modules tests you need to pass in a third parameter such that -the server is able to serve the correct files. - -For example - -```js -// awesome-tests module -const loadFixture = require('aegir/fixtures') - -const myFixture = loadFixture('test/fixtures/coolfixture', 'awesome-tests') -``` - - -```js -// tests for module using the awesome-tests -require('awesome-tests') -``` - -```js -// .aegir.js file in the module using the awesome-tests module -'use strict' - -module.exports = { - karma: { - files: [{ - pattern: 'node_modules/awesome-tests/test/fixtures/**/*', - watched: false, - served: true, - included: false - }] - } -} -``` - -#### Echo Server -HTTP echo server for testing purposes. - -```js -const EchoServer = require('aegir/utils/echo-server') -const server = new EchoServer() -await server.start() - -// search params echo endpoint -const req = await fetch('http://127.0.0.1:3000/echo/query?test=one') -console.log(await req.text()) - -// body echo endpoint -const req = await fetch('http://127.0.0.1:3000/echo', { - method: 'POST', - body: '{"key": "value"}' -}) -console.log(await req.text()) - -// redirect endpoint -const req = await fetch('http://127.0.0.1:3000/redirect?to=http://127.0.0.1:3000/echo') -console.log(await req.text()) - -// download endpoint -const req = await fetch('http://127.0.0.1:3000/download?data=helloWorld') -console.log(await req.text()) - -await server.stop() - -``` - -#### Get Port -Helper to find an available port to put a server listening on. -```js -const getPort = require('aegir/utils/get-port') -const port = await getPort(3000, '127.0.0.1') -// if 3000 is available returns 3000 if not returns a free port. - -``` - -## Tasks - -### Linting - -Linting uses [eslint](http://eslint.org/) and [standard](https://github.com/feross/standard) -with [some custom rules](https://github.com/ipfs/eslint-config-aegir) to enforce some more strictness. - -You can run it using - -```bash -$ aegir lint -$ aegir lint-package-json -``` - -### Testing - -You can run it using +Run `aegir --help` ```bash -$ aegir test -``` +Usage: aegir [options] -There are also browser and node specific tasks +Commands: + aegir build Builds a browser bundle and TS type declarations from the `src` folder. + aegir check Check project + aegir docs Generate documentation from TS type declarations. + aegir lint Lint all project files + aegir release Release your code onto the world + aegir test-dependant [repo] Run the tests of an module that depends on this module to see if the current changes have caused a regression + aegir test Test your code in different environments + aegir ts Typescript command with presets for specific tasks. + aegir dependency-check [input...] Run `dependency-check` cli with aegir defaults. [aliases: dep-check, dep] + aegir lint-package-json Lint package.json with aegir defaults. [aliases: lint-package, lpj] + aegir completion generate completion script -```bash -$ aegir test --target node -$ aegir test --target browser -$ aegir test --target webworker -``` +Global Options: + -h, --help Show help [boolean] + -v, --version Show version number [boolean] + -d, --debug Show debug output. [boolean] [default: false] + --ts-repo Enable support for Typescript repos. [boolean] [default: false] +Examples: + aegir build Runs the build command to bundle JS code for the browser. + npx aegir build Can be used with `npx` to use a local version + aegir test -t webworker -- --browser firefox If the command supports `--` can be used to forward options to the underlying tool. + npm test -- -- --browser firefox If `npm test` translates to `aegir test -t browser` and you want to forward options you need to use `-- --` instead. -### Coverage - -#### Node -You can run your tests with `nyc` using - -```bash -$ npx nyc -s aegir test -t node -# to check the report locally -$ npx nyc report --reporter=html && open coverage/index.html -# or just for a text based reporter -$ npx nyc report +Use `aegir --help` to learn more about each command. ``` -#### Browser -> Not available yet PR open. -To auto publish coverage reports from Travis to Codecov add this to -your `.travis.yml` file. - -```yml -after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov -``` +## Continuous Integration +Check this template for Github Actions https://github.com/ipfs/aegir/blob/master/md/github-actions.md -### Building -The build command builds a browser bundle and TS type declarations from the `src` folder. - -```bash -$ aegir build --help -``` -This will build a browser ready version into `dist`, so after publishing the results will be available under - -``` -https://unpkg.com//dist/index.js -``` - -**Specifying a custom entry file for Webpack** - -By default, `aegir` uses `src/index.js` as the entry file for Webpack. You can customize which file to use as the entry point by specifying `entry` field in your user configuration file. To do this, create `.aegir.js` file in your project's root directory and add point the `entry` field to the file Webpack should use as the entry: - -```javascript -module.exports = { - entry: "src/browser-index.js", -} -``` +## Testing helpers +In addition to running the tests `aegir` also provides several helpers to be used by the tests. -Webpack will use the specified file as the entry point and output it to `dist/`, eg. `dist/browser-index.js`. +Check the [documentation](https://ipfs.github.io/aegir/) -If `.aegir.js` file is not present in the project, webpack will use `src/index.js` as the default entry file. -#### Generating Webpack stats.json +## Typescript -Pass the `--analyze` option to have Webpack generate a `stats.json` file for the bundle and save it in the project root (see https://webpack.js.org/api/stats/). e.g. +### JSDoc Typescript support ```bash -aegir build --analyze +aegir ts --help ``` -### Typescript +More documentation [here](https://github.com/ipfs/aegir/blob/master/md/ts-jsdoc.md) -#### JSDoc Typescript support +### Native Typescript support +For native typescript add `--ts-repo` to any command. ```bash -aegir ts --help +aegir build --ts-repo +aegir test --ts-repo ``` -The `ts` command provides type checking (via typescript) in javascript files with [JSDoc](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) annotations. - -### Releasing +### Release steps 1. Run linting -2. Run tests -3. Build everything +2. Run type check +3. Run tests 4. Bump the version in `package.json` -5. Generate a changelog based on the git log -6. Commit the version change & `CHANGELOG.md` -7. Create a git tag -8. Run `git push` to `origin/master` -9. Publish a release to Github releases -10. Generate documentation and push to github -11. Publish to npm - -```bash -# Major release -$ aegir release --type major -# Minor relase -$ aegir release --type minor -# Patch release -$ aegir release - -# Major prerelease (1.0.0 -> 2.0.0-rc.0) -$ aegir release --type premajor --preid rc --dist-tag next -# Minor prerelease (1.0.0 -> 1.1.0-rc.0) -$ aegir release --type preminor --preid rc --dist-tag next -# Patch prerelease (1.0.0 -> 1.0.1-rc.0) -$ aegir release --type prepatch --preid rc --dist-tag next - -# Increment prerelease (1.1.0-rc.0 -> 1.1.0-rc.1) -$ aegir release --type prerelease --preid rc --dist-tag next -``` - -> This requires `AEGIR_GHTOKEN` to be set. - -You can also specify the same targets as for `test`. - -If no `CHANGELOG.md` is present, one is generated the first time a release is done. - -You can skip all changelog generation and the github release by passing -in `--no-changelog`. - -If you want no documentation generation you can pass `--no-docs` to the release task to disable documentation builds. - -#### Scoped Github Token - -Performing a release involves creating new commits and tags and then pushing them back to the repository you are releasing from. In order to do this you should create a [GitHub personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) and store it in the environmental variable `AEGIR_GHTOKEN`. - -The only access scope it needs is `public_repo`. - -Be aware that by storing it in `~/.profile` or similar you will make it available to any program that runs on your computer. - -### Documentation - -You can use `aegir docs` to generate documentation, this command uses `aegir ts --preset docs` internally. +5. Build everything +6. Update contributors based on the git history +7. Generate a changelog based on the git log +8. Commit the version change & `CHANGELOG.md` +9. Create a git tag +10. Run `git push` to `origin/master` +11. Publish a release to Github releases +12. Generate documentation and push to Github Pages +13. Publish to npm ```bash -$ aegir docs --help +aegir release --help ``` ## License diff --git a/md/github-actions.md b/md/github-actions.md new file mode 100644 index 000000000..5ee87523a --- /dev/null +++ b/md/github-actions.md @@ -0,0 +1,83 @@ +Create a new file called `main.yml` inside `.github/workflows` with the following content: + +```yml +name: ci +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npx aegir lint + - run: npx aegir ts -p check + # or + # - uses: gozala/typescript-error-reporter-action@v1.0.8 + - run: npx aegir build + - run: npx aegir dep-check + - uses: ipfs/aegir/actions/bundle-size@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + test-node: + needs: check + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + node: [12, 14] + fail-fast: true + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - run: npm install + - run: npx aegir test -t node --bail --cov + - uses: codecov/codecov-action@v1 + test-chrome: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: microsoft/playwright-github-action@v1 + - run: npm install + - run: npx aegir test -t browser -t webworker --bail --cov + - uses: codecov/codecov-action@v1 + test-firefox: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: microsoft/playwright-github-action@v1 + - run: npm install + - run: npx aegir test -t browser -t webworker --bail -- --browser firefox + test-webkit: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: microsoft/playwright-github-action@v1 + - run: npm install + - run: npx aegir test -t browser -t webworker --bail -- --browser webkit + test-electron-main: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npx xvfb-maybe aegir test -t electron-main --bail + test-electron-renderer: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npx xvfb-maybe aegir test -t electron-renderer --bail +``` \ No newline at end of file diff --git a/md/ts-jsdoc.md b/md/ts-jsdoc.md index 364ee2cb2..f658d0190 100644 --- a/md/ts-jsdoc.md +++ b/md/ts-jsdoc.md @@ -246,6 +246,9 @@ const fs = require('fs') [Typescript official performance notes](https://github.com/microsoft/TypeScript/wiki/Performance) [TypeScript: Don’t Export const enums](https://ncjamieson.com/dont-export-const-enums/) [TypeScript: Prefer Interfaces](https://ncjamieson.com/prefer-interfaces/) +[Typescript Narrowing](https://www.typescriptlang.org/docs/handbook/2/narrowing.html) ## Resources -[TS with JSDoc Discussions](https://github.com/voxpelli/types-in-js) \ No newline at end of file +[TS with JSDoc Discussions](https://github.com/voxpelli/types-in-js) +[Tackling Typescript](https://exploringjs.com/tackling-ts/toc.html) +[Effective Typescript](https://effectivetypescript.com/) \ No newline at end of file diff --git a/package.json b/package.json index fc85576eb..cd081b671 100644 --- a/package.json +++ b/package.json @@ -49,9 +49,9 @@ "test": "node cli.js ts -p check && node cli.js test", "test:node": "node cli.js test -t node", "test:browser": "node cli.js test -t browser -t webworker", - "release": "node cli.js release --no-docs --no-test --no-build", - "release-minor": "node cli.js release --no-docs --no-build --no-test --type minor", - "release-major": "node cli.js release --no-docs --no-build --no-test --type major" + "release": "node cli.js release", + "release-minor": "node cli.js release --type minor", + "release-major": "node cli.js release --type major" }, "dependencies": { "@achingbrain/dependency-check": "^4.1.0", diff --git a/src/cmds/build.js b/src/cmds/build.js index 71a489691..54b4e608b 100644 --- a/src/cmds/build.js +++ b/src/cmds/build.js @@ -6,7 +6,6 @@ const { userConfig } = require('../config/user') */ const EPILOG = ` Output files will go into a "./dist" folder. -Supports options forwarding with '--' for more info check https://webpack.js.org/api/cli/ ` module.exports = { command: 'build', diff --git a/src/cmds/lint.js b/src/cmds/lint.js index 47ee34847..c022297d6 100644 --- a/src/cmds/lint.js +++ b/src/cmds/lint.js @@ -1,25 +1,43 @@ 'use strict' const { userConfig } = require('../config/user') + +/** + * @typedef {import("yargs").Argv} Argv + * @typedef {import("yargs").Arguments} Arguments + */ + +const EPILOG = ` +Linting uses eslint (http://eslint.org/) and standard(https://github.com/feross/standard) +with some custom rules(https://github.com/ipfs/eslint-config-aegir) to enforce some more strictness. +` + module.exports = { command: 'lint', desc: 'Lint all project files', - builder: { - fix: { - alias: 'f', - type: 'boolean', - describe: 'Automatically fix errors if possible.', - default: userConfig.lint.fix - }, - files: { - type: 'array', - describe: 'Files to lint.', - default: userConfig.lint.files - }, - silent: { - type: 'boolean', - describe: 'Disable eslint output.', - default: userConfig.lint.silent - } + /** + * @param {Argv} yargs + */ + builder: (yargs) => { + yargs + .epilog(EPILOG) + .options({ + fix: { + alias: 'f', + type: 'boolean', + describe: 'Automatically fix errors if possible.', + default: userConfig.lint.fix + }, + files: { + type: 'array', + describe: 'Files to lint.', + default: userConfig.lint.files + }, + silent: { + type: 'boolean', + describe: 'Disable eslint output.', + default: userConfig.lint.silent + } + }) }, /** * @param {(import("../types").GlobalOptions & import("../types").LintOptions) | undefined} argv diff --git a/src/cmds/release.js b/src/cmds/release.js index 982f2f8bc..53d97a739 100644 --- a/src/cmds/release.js +++ b/src/cmds/release.js @@ -1,97 +1,125 @@ 'use strict' const { userConfig } = require('../config/user') +/** + * @typedef {import("yargs").Argv} Argv + * @typedef {import("yargs").Arguments} Arguments + */ +const EPILOG = ` +Performing a release involves creating new commits and tags and then pushing them back to the repository you are releasing from. In order to do this you should create a [GitHub personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) and store it in the environmental variable "AEGIR_GHTOKEN". + +The only access scope it needs is "public_repo". + +Be aware that by storing it in "~/.profile" or similar you will make it available to any program that runs on your computer. +` module.exports = { command: 'release', desc: 'Release your code onto the world', - builder: { - build: { - describe: 'Run build tasks before release', - type: 'boolean', - default: userConfig.release.build - }, - test: { - describe: 'Run test tasks before release', - type: 'boolean', - default: userConfig.release.test - }, - lint: { - describe: 'Run lint task before release', - type: 'boolean', - default: userConfig.release.lint - }, - contributors: { - describe: 'Update contributors based on the git history', - type: 'boolean', - default: userConfig.release.contributors - }, - bump: { - describe: 'Bump the package version', - type: 'boolean', - default: userConfig.release.bump - }, - changelog: { - describe: 'Generate or update the CHANGELOG.md', - type: 'boolean', - default: userConfig.release.changelog - }, - publish: { - describe: 'Publish to npm', - type: 'boolean', - default: userConfig.release.publish - }, - commit: { - describe: 'Commit changes to git', - type: 'boolean', - default: userConfig.release.commit - }, - tag: { - describe: 'Create release tag in git', - type: 'boolean', - default: userConfig.release.tag - }, - push: { - describe: 'Push changes to GitHub', - type: 'boolean', - default: userConfig.release.push - }, - ghrelease: { - describe: 'Generate GitHub release', - type: 'boolean', - default: userConfig.release.ghrelease - }, - docs: { - describe: 'Generate and publish documentation', - type: 'boolean', - default: userConfig.release.docs - }, - ghtoken: { - describe: 'Access token for generating GitHub releases', - type: 'string', - default: userConfig.release.ghtoken - }, - type: { - describe: 'The type of version bump for this release', - type: 'string', - choices: ['major', 'minor', 'patch', 'prepatch', 'preminor', 'premajor', 'prerelease'], - default: userConfig.release.type - }, - preid: { - describe: 'The prerelease identifier', - type: 'string', - default: userConfig.release.preid - }, - 'dist-tag': { - describe: 'The npm tag to publish to', - type: 'string', - default: userConfig.release.distTag - }, - remote: { - describe: 'Git remote', - type: 'string', - default: userConfig.release.remote - } + /** + * @param {Argv} yargs + */ + builder: (yargs) => { + yargs + .epilog(EPILOG) + .example('aegir release --type major', 'Major release') + .example('aegir release --type premajor --preid rc --dist-tag next', 'Major prerelease (1.0.0 -> 2.0.0-rc.0)') + .example('aegir release --type prerelease --preid rc --dist-tag next', 'Increment prerelease (2.0.0-rc.0 -> 2.0.0-rc.1)') + .options( + { + build: { + describe: 'Run build tasks before release', + type: 'boolean', + default: userConfig.release.build + }, + test: { + describe: 'Run test tasks before release', + type: 'boolean', + default: userConfig.release.test + }, + lint: { + describe: 'Run lint task before release', + type: 'boolean', + default: userConfig.release.lint + }, + types: { + describe: 'Run type check task before release', + type: 'boolean', + default: userConfig.release.types + }, + contributors: { + describe: 'Update contributors based on the git history', + type: 'boolean', + default: userConfig.release.contributors + }, + bump: { + describe: 'Bump the package version', + type: 'boolean', + default: userConfig.release.bump + }, + changelog: { + describe: 'Generate or update the CHANGELOG.md', + type: 'boolean', + default: userConfig.release.changelog + }, + publish: { + describe: 'Publish to npm', + type: 'boolean', + default: userConfig.release.publish + }, + commit: { + describe: 'Commit changes to git', + type: 'boolean', + default: userConfig.release.commit + }, + tag: { + describe: 'Create release tag in git', + type: 'boolean', + default: userConfig.release.tag + }, + push: { + describe: 'Push changes to GitHub', + type: 'boolean', + default: userConfig.release.push + }, + ghrelease: { + describe: 'Generate GitHub release', + type: 'boolean', + default: userConfig.release.ghrelease + }, + docs: { + describe: 'Generate and publish documentation', + type: 'boolean', + default: userConfig.release.docs + }, + ghtoken: { + describe: 'Access token for generating GitHub releases', + type: 'string', + default: userConfig.release.ghtoken + }, + type: { + describe: 'The type of version bump for this release', + type: 'string', + choices: ['major', 'minor', 'patch', 'prepatch', 'preminor', 'premajor', 'prerelease'], + default: userConfig.release.type + }, + preid: { + describe: 'The prerelease identifier', + type: 'string', + default: userConfig.release.preid + }, + 'dist-tag': { + describe: 'The npm tag to publish to', + type: 'string', + default: userConfig.release.distTag + }, + remote: { + describe: 'Git remote', + type: 'string', + default: userConfig.release.remote + } + } + ) }, /** * @param {import("../types").GlobalOptions & import("../types").ReleaseOptions} argv diff --git a/src/cmds/test.js b/src/cmds/test.js index a6048614a..533b94fa0 100644 --- a/src/cmds/test.js +++ b/src/cmds/test.js @@ -5,8 +5,8 @@ const { userConfig } = require('../config/user') */ const EPILOG = ` -By default browser tests run in Chrome headless. -Browser testing with playwright-test supports options forwarding with '--' for more info check https://github.com/hugomrdias/playwright-test#options +By default browser tests run in Chromium headless. +Testing supports options forwarding with '--' for more info check https://github.com/hugomrdias/playwright-test#options, https://mochajs.org/#command-line-usage or https://github.com/jprichardson/electron-mocha#run-tests. ` module.exports = { diff --git a/src/config/user.js b/src/config/user.js index 51615fb3d..11bae2d8d 100644 --- a/src/config/user.js +++ b/src/config/user.js @@ -70,6 +70,7 @@ const defaults = { // release cmd options release: { build: true, + types: true, test: true, lint: true, contributors: true, diff --git a/src/release/index.js b/src/release/index.js index 2525b087f..501b55d7e 100644 --- a/src/release/index.js +++ b/src/release/index.js @@ -56,7 +56,7 @@ async function release (opts) { preset: 'check' }) }, - enabled: () => opts.lint + enabled: () => opts.types }, { title: 'Test', diff --git a/src/types.d.ts b/src/types.d.ts index 78fb5907e..e4ecc1005 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -231,6 +231,7 @@ interface TestBeforeResult { interface ReleaseOptions { build: boolean + types: boolean test: boolean lint: boolean contributors: boolean diff --git a/utils/chai.js b/utils/chai.js index f2e403885..9605651ec 100644 --- a/utils/chai.js +++ b/utils/chai.js @@ -7,8 +7,11 @@ chai.use(require('chai-as-promised')) chai.use(require('dirty-chai')) chai.use(require('chai-subset')) +const expect = chai.expect +const assert = chai.assert + module.exports = { - expect: chai.expect, - assert: chai.assert, + expect, + assert, chai } diff --git a/utils/echo-server.js b/utils/echo-server.js index d6c0d7b90..a770a7d1f 100644 --- a/utils/echo-server.js +++ b/utils/echo-server.js @@ -8,6 +8,37 @@ const http = require('http') const { Buffer } = require('buffer') const getPort = require('./get-port') +/** + * HTTP echo server for testing purposes. + * + * @example + * ```js + * const EchoServer = require('aegir/utils/echo-server') + * const server = new EchoServer() + * await server.start() + * + * // search params echo endpoint + * const req = await fetch('http://127.0.0.1:3000/echo/query?test=one') + * console.log(await req.text()) + * + * // body echo endpoint + * const req = await fetch('http://127.0.0.1:3000/echo', { + * method: 'POST', + * body: '{"key": "value"}' + * }) + * console.log(await req.text()) + * + * // redirect endpoint + * const req = await fetch('http://127.0.0.1:3000/redirect?to=http://127.0.0.1:3000/echo') + * console.log(await req.text()) + * + * // download endpoint + * const req = await fetch('http://127.0.0.1:3000/download?data=helloWorld') + * console.log(await req.text()) + * + * await server.stop() + * ``` + */ class EchoServer { /** * diff --git a/utils/fixtures.browser.js b/utils/fixtures.browser.js index f62d66927..1c46d7de5 100644 --- a/utils/fixtures.browser.js +++ b/utils/fixtures.browser.js @@ -3,7 +3,40 @@ const { Buffer } = require('buffer') /** - * note: filePath needs to be relative to the module root + * Loading fixture files in node and the browser can be painful, that's why aegir provides a method to do this. + * + * @example + * ```js + * // test/awesome.spec.js + * const loadFixture = require('aegir/fixtures') + * + * const myFixture = loadFixture('test/fixtures/largefixture') + * ``` + * The path to the fixture is relative to the module root. + * + * If you write a module like [interface-ipfs-core](https://github.com/ipfs/interface-ipfs-core) + * which is to be consumed by other modules tests you need to pass in a third parameter such that + * the server is able to serve the correct files. + * @example + * ```js + * // awesome-tests module + * const loadFixture = require('aegir/fixtures') + * + * const myFixture = loadFixture('test/fixtures/coolfixture', 'awesome-tests') + * ``` + * + * The folder to be served to the browser by default is `process.cwd()` but can be change in the configuration. + * ```js + * module.exports = { + * test: { + * browser: { + * config: { + * assets: '..', + * } + * } + * } + * } + * ``` * * @param {string} filePath * @param {string} module diff --git a/utils/fixtures.js b/utils/fixtures.js index 84c455d93..32a70efac 100644 --- a/utils/fixtures.js +++ b/utils/fixtures.js @@ -4,7 +4,27 @@ const path = require('path') const fs = require('fs') /** - * note: filePath needs to be relative to the module root + * Loading fixture files in node and the browser can be painful, that's why aegir provides a method to do this. + * + * @example + * ```js + * // test/awesome.spec.js + * const loadFixture = require('aegir/fixtures') + * + * const myFixture = loadFixture('test/fixtures/largefixture') + * ``` + * The path to the fixture is relative to the module root. + * + * If you write a module like [interface-ipfs-core](https://github.com/ipfs/interface-ipfs-core) + * which is to be consumed by other modules tests you need to pass in a third parameter such that + * the server is able to serve the correct files. + * @example + * ```js + * // awesome-tests module + * const loadFixture = require('aegir/fixtures') + * + * const myFixture = loadFixture('test/fixtures/coolfixture', 'awesome-tests') + * ``` * * @param {string} filePath * @param {string} [module] diff --git a/utils/get-port.js b/utils/get-port.js index 2513544a8..880aa6aa5 100644 --- a/utils/get-port.js +++ b/utils/get-port.js @@ -3,7 +3,15 @@ const { createServer } = require('net') /** - * Get a free port + * Helper to find an available port to put a server listening on. + * + * @example + * ```js + * const getPort = require('aegir/utils/get-port') + * const port = await getPort(3000, '127.0.0.1') + * // if 3000 is available returns 3000 if not returns a free port. + * + * ``` * * @param {number} port * @param {string} host From 18533d1e6d250b452ab1f5a42a0b89898a511159 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 23 Feb 2021 13:00:57 +0000 Subject: [PATCH 36/43] chore: update contributors --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cd081b671..1c2aa985d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aegir", - "version": "31.0.0-next0", + "version": "31.0.0-next.0", "description": "JavaScript project management", "keywords": [ "webpack", @@ -34,7 +34,7 @@ "dist/utils/*" ], "src/*": [ - "dist/src/*", + "dist/src/*", "dist/src/*/index" ], "src/": [ From 9d407c109d71b301123c840745fc650699c5f341 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 23 Feb 2021 13:00:57 +0000 Subject: [PATCH 37/43] chore: release version v31.0.0-next.0 --- CHANGELOG.md | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae70f0c33..43742d3ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,83 @@ +# [31.0.0-next.0](https://github.com/ipfs/aegir/compare/v30.3.0...v31.0.0-next.0) (2021-02-23) + + +### Bug Fixes + +* action types ([3237ad6](https://github.com/ipfs/aegir/commit/3237ad6b40e5136a47eefd6bd50706653b5adaae)) +* add migration and fix dep-check ([6dedc09](https://github.com/ipfs/aegir/commit/6dedc098e91d86b5a4a39a32d25d8cfa9ffec55f)) +* add src to dep-check prod input ([ce16e7c](https://github.com/ipfs/aegir/commit/ce16e7c24a3d7d8fdc8072cb827cb6af332aba3c)) +* bundle size options ([e83ac97](https://github.com/ipfs/aegir/commit/e83ac97477e64b1df479bf07ee039a443a64c566)) +* check more types ([1001e00](https://github.com/ipfs/aegir/commit/1001e00070b4f6f0dc012347175a6056605c399a)) +* concat dep-check ignore defaults to input ([169edb1](https://github.com/ipfs/aegir/commit/169edb15f8d450c19f824c2281ab323e8d827edc)) +* dep check cmd ([4ef344f](https://github.com/ipfs/aegir/commit/4ef344f2512af2adc57a7cb742b9c840c41af7af)) +* dep-check ignore ([181abe5](https://github.com/ipfs/aegir/commit/181abe54d7fe6c407a13f377ebe7bf32460be08c)) +* dep-check prod input ([9bbb44e](https://github.com/ipfs/aegir/commit/9bbb44e8666e915f40dc619daaaabef598b2cde3)) +* dependency check ([5bc8f64](https://github.com/ipfs/aegir/commit/5bc8f64fbc32f93ea148256f36c84af75300f25e)) +* documentation ([838c165](https://github.com/ipfs/aegir/commit/838c165e1c444640976745b711d8926f3f84633b)) +* electron lock, esbuild-register, node cov with c8, check cmd ([19b7301](https://github.com/ipfs/aegir/commit/19b73019cc68d4bbe731b6cc856b0f536f06a1dc)) +* fix docs paths and update deps ([#726](https://github.com/ipfs/aegir/issues/726)) ([9b7136a](https://github.com/ipfs/aegir/commit/9b7136aacd7637b406208558a4d47e19282fd4e6)) +* fix hooks ([98bf44d](https://github.com/ipfs/aegir/commit/98bf44d2f0e84fd4b6e927d5e59d532de09bd529)) +* fix hooks ([21d5639](https://github.com/ipfs/aegir/commit/21d5639ec425d5b4a654d3e1609075e5eda25d9c)) +* foward options for mocha ([26c2647](https://github.com/ipfs/aegir/commit/26c26472fb7696ef6658fb75dc294f668d461fdd)) +* future node builtin check ([6917d5c](https://github.com/ipfs/aegir/commit/6917d5c67d63f5c4355c2c5f5b66d15375d9e5d3)) +* move cmds to src and remove commit-lint ([ce2bc87](https://github.com/ipfs/aegir/commit/ce2bc87bbc8e31cd9cb60a59e29a663a36056bcc)) +* move fixtures and export types ([b7b7ee4](https://github.com/ipfs/aegir/commit/b7b7ee4b57d0be796fb4df0ffeca2bf83818d8b6)) +* remove ? from utils ([fd5695c](https://github.com/ipfs/aegir/commit/fd5695c9534358c14e9ed522512ab9d9d364c76d)) +* remove another ? ([62cb87d](https://github.com/ipfs/aegir/commit/62cb87d051c358754a98b5cd44f7d6ec649f4947)) +* remove c8 tmp from nyc_output ([e8b4e9f](https://github.com/ipfs/aegir/commit/e8b4e9ff6d85b0ec4efa47729141138bbea75d8b)) +* remove userConfig usage ([ee4bca3](https://github.com/ipfs/aegir/commit/ee4bca3038cfbd837093970b899a9078466cfb4d)) +* scripts ([9000aba](https://github.com/ipfs/aegir/commit/9000abae849ff5a51ce7addf0e0b483dd4923a10)) +* types ([c842d82](https://github.com/ipfs/aegir/commit/c842d821dd6ad84f166a92331164d8403a8a3688)) +* types ([c91c715](https://github.com/ipfs/aegir/commit/c91c715f7586e9f2555d3e1457b36480f2548d02)) +* types and release cmd ([853ea86](https://github.com/ipfs/aegir/commit/853ea8691d46bb355293f7a7671c749e4f85a282)) +* umd and global ([add8ef4](https://github.com/ipfs/aegir/commit/add8ef4abe980f7f0d39ed1e9c67a463bf5bcd44)) +* umd bundle ([8f7f4ae](https://github.com/ipfs/aegir/commit/8f7f4ae2a74031ff990970ebc3e66434acdee29d)) +* update action ([453c80f](https://github.com/ipfs/aegir/commit/453c80f0d455b8c1a2603a227309c24e5fb14459)) +* update action ([3467aed](https://github.com/ipfs/aegir/commit/3467aed0f38b1b800b54b95f6ea82c2a39f08830)) +* update deps ([5260ccb](https://github.com/ipfs/aegir/commit/5260ccb236cdfee0e79238dd13b3a8535859d955)) +* upgrade karma ([#733](https://github.com/ipfs/aegir/issues/733)) ([1212314](https://github.com/ipfs/aegir/commit/12123143b5d75934d54cbf3736db25f97767acf7)) + + +### Features + +* copy .d.ts. to dist ([#738](https://github.com/ipfs/aegir/issues/738)) ([4002b50](https://github.com/ipfs/aegir/commit/4002b5072c6f9e5dfe67e0e5e4f22930bc81d4a6)) +* hooks ([3e09f88](https://github.com/ipfs/aegir/commit/3e09f88157e8eb5e4086904f726d1cc16e46d9f3)) +* rename --ts flag to --ts-repo and fix ts repo support ([#730](https://github.com/ipfs/aegir/issues/730)) ([3d54004](https://github.com/ipfs/aegir/commit/3d5400406db2c912292ddc10b98586b04a41bf5b)) +* ts, build, docs and lint improvements ([#732](https://github.com/ipfs/aegir/issues/732)) ([846bb25](https://github.com/ipfs/aegir/commit/846bb25818f753bea6572194362d7bbdd90d8433)) +* update typedoc and improvemnts to docs cmd ([#727](https://github.com/ipfs/aegir/issues/727)) ([1149281](https://github.com/ipfs/aegir/commit/11492815864cf352ed0bba22eaec5996361439c1)) +* upgrade linter to v2.0.0 ([9f67cb9](https://github.com/ipfs/aegir/commit/9f67cb99531eda4bc0aa4f0fee0b45ebd15264c1)) +* use esbuild and playwright-test ([9a03b99](https://github.com/ipfs/aegir/commit/9a03b991178f4281f26ac7b5d7953e3c3aa40e9c)) + + +### BREAKING CHANGES + +* Major linter upgrade may cause errors. +* Config property `bundlesize.maxSize` is deprecated, use `build.bundlesizeMax` + +* fix: improve docs cmd + +- add more types +- clean code and improve Listr setup + +* feat: big utils clean up + +- remove unnecessary methods +- add some types +- improve `paths` export, with full paths to dist, test, src and package.json folder/file + +* feat: clean lint cmd + +- remove old npm deps semver version checks +- update to the new eslint api +- use a new output formatter that actually gives us links we can click and go to the errors +* old npm deps semver was removed + +* fix: add types for cmd options +* `--ts` flag renamed to `--ts-repo` +* aegir ts -p docs removed use aegir docs directly + + + # [30.3.0](https://github.com/ipfs/aegir/compare/v30.2.0...v30.3.0) (2021-01-05) From 5e31aa32b8a4a18244807c72e4f15a445c4f5866 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 23 Feb 2021 13:03:32 +0000 Subject: [PATCH 38/43] chore: update contributors --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c2aa985d..46fe4be66 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aegir", - "version": "31.0.0-next.0", + "version": "31.0.0-next.1", "description": "JavaScript project management", "keywords": [ "webpack", From d7fd908e5eb4c3dabab97bca02ae279fb9d3d8f0 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 23 Feb 2021 13:03:33 +0000 Subject: [PATCH 39/43] chore: release version v31.0.0-next.1 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43742d3ec..ca69afe44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# [31.0.0-next.1](https://github.com/ipfs/aegir/compare/v31.0.0-next.0...v31.0.0-next.1) (2021-02-23) + + + # [31.0.0-next.0](https://github.com/ipfs/aegir/compare/v30.3.0...v31.0.0-next.0) (2021-02-23) From a1f265e3d8755450f574a3de8152b59e52c32ac1 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 23 Feb 2021 14:39:46 +0000 Subject: [PATCH 40/43] fix: release --- .aegir.js | 3 --- src/release/index.js | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.aegir.js b/.aegir.js index 79be32206..a8380e4d5 100644 --- a/.aegir.js +++ b/.aegir.js @@ -2,8 +2,5 @@ module.exports = { docs: { entryPoint: 'utils' - }, - release: { - build: false } } \ No newline at end of file diff --git a/src/release/index.js b/src/release/index.js index 501b55d7e..282117280 100644 --- a/src/release/index.js +++ b/src/release/index.js @@ -125,7 +125,8 @@ async function release (opts) { docs.setRenderer('silent') return docs.run({ ...globalOptions, - ...opts.fileConfig.docs + ...opts.fileConfig.docs, + publish: true }) }, enabled: () => opts.docs From 1dc4c4bc0ceb4ca735211466d54396b0007d72b8 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 23 Feb 2021 14:41:06 +0000 Subject: [PATCH 41/43] chore: update contributors --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 46fe4be66..3d3bc54fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aegir", - "version": "31.0.0-next.1", + "version": "31.0.0-next.2", "description": "JavaScript project management", "keywords": [ "webpack", From 2d27afe90c7c28966ce7f21b165f0823b06307d7 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 23 Feb 2021 14:41:06 +0000 Subject: [PATCH 42/43] chore: release version v31.0.0-next.2 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca69afe44..5961b87c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [31.0.0-next.2](https://github.com/ipfs/aegir/compare/v31.0.0-next.1...v31.0.0-next.2) (2021-02-23) + + +### Bug Fixes + +* release ([a1f265e](https://github.com/ipfs/aegir/commit/a1f265e3d8755450f574a3de8152b59e52c32ac1)) + + + # [31.0.0-next.1](https://github.com/ipfs/aegir/compare/v31.0.0-next.0...v31.0.0-next.1) (2021-02-23) From 456a975f74347dcc18ad6bc1c65aa831ae2a27c3 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 23 Feb 2021 14:55:21 +0000 Subject: [PATCH 43/43] fix: readme --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++-- md/migration-to-v31.md | 2 +- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dbb575e13..b57b86b81 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,13 @@ ## ToC - [Project Structure](#project-structure) - [CLI](#cli) +- [Configuration](#configuration) - [Continuous Integration](#continuous-integration) - [Testing helpers](#testing-helpers) - [Typescript](#typescript) - [JSDoc Typescript support](#jsdoc-typescript-support) - [Native Typescript support](#native-typescript-support) - - [Release steps](#release-steps) +- [Release steps](#release-steps) - [License](#license) ## Project Structure @@ -84,6 +85,43 @@ Examples: Use `aegir --help` to learn more about each command. ``` +## Configuration +Aegir can be fully configured using a config file named `.aegir.js` or the package.json using the property `aegir`. + +```js +// file: .aegir.js + +'use strict' + +/** @type {import('aegir').PartialOptions} */ +module.exports = { + tsRepo: true, + release: { + build: false + } +} +``` + +```json +// file: package.json +"main": "src/index.js", +"files": [ + "src", + "dist" +], +"scripts": { + "lint": "aegir lint", + "release": "aegir release", + "build": "aegir build", + "test": "aegir test", + "test:node": "aegir test --target node", + "test:browser": "aegir test --target browser" +}, +"aegir" : { + "tsRepo": false +} +``` +You can find the complete default config [here](https://github.com/ipfs/aegir/blob/master/src/config/user.js#L12) and the types [here](https://github.com/ipfs/aegir/blob/master/src/types.d.ts). ## Continuous Integration Check this template for Github Actions https://github.com/ipfs/aegir/blob/master/md/github-actions.md @@ -110,7 +148,7 @@ aegir build --ts-repo aegir test --ts-repo ``` -### Release steps +## Release steps 1. Run linting 2. Run type check diff --git a/md/migration-to-v31.md b/md/migration-to-v31.md index 7b8c0f676..9be44d5ef 100644 --- a/md/migration-to-v31.md +++ b/md/migration-to-v31.md @@ -1,4 +1,4 @@ -# Migration Guide +# Migration Guide v31 ## `typeVersions` should not be used unless strictly necessary